From 1717b30d4106eacddccb6ee232f8fa8899614250 Mon Sep 17 00:00:00 2001 From: paulevsGitch Date: Fri, 22 Jan 2021 13:30:31 +0300 Subject: [PATCH] Obsidian platform fix --- .../ru/betterend/mixin/common/ServerPlayerEntityMixin.java | 3 ++- .../java/ru/betterend/world/generator/GeneratorOptions.java | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/ru/betterend/mixin/common/ServerPlayerEntityMixin.java b/src/main/java/ru/betterend/mixin/common/ServerPlayerEntityMixin.java index ae19c112..1342b15a 100644 --- a/src/main/java/ru/betterend/mixin/common/ServerPlayerEntityMixin.java +++ b/src/main/java/ru/betterend/mixin/common/ServerPlayerEntityMixin.java @@ -31,6 +31,7 @@ import net.minecraft.world.World; import net.minecraft.world.WorldProperties; import net.minecraft.world.biome.source.BiomeAccess; import ru.betterend.interfaces.TeleportingEntity; +import ru.betterend.world.generator.GeneratorOptions; @Mixin(ServerPlayerEntity.class) public abstract class ServerPlayerEntityMixin extends PlayerEntity implements TeleportingEntity { @@ -60,7 +61,7 @@ public abstract class ServerPlayerEntityMixin extends PlayerEntity implements Te @Inject(method = "createEndSpawnPlatform", at = @At("HEAD"), cancellable = true) private void be_createEndSpawnPlatform(ServerWorld world, BlockPos centerPos, CallbackInfo info) { - if (!centerPos.equals(world.getSpawnPos()) || beCanTeleport()) { + if (!GeneratorOptions.generateObsidianPlatform()) { info.cancel(); } } diff --git a/src/main/java/ru/betterend/world/generator/GeneratorOptions.java b/src/main/java/ru/betterend/world/generator/GeneratorOptions.java index 2a0b2a48..3a4ab11a 100644 --- a/src/main/java/ru/betterend/world/generator/GeneratorOptions.java +++ b/src/main/java/ru/betterend/world/generator/GeneratorOptions.java @@ -14,6 +14,7 @@ public class GeneratorOptions { private static boolean newGenerator; private static boolean noRingVoid; private static boolean generateCentralIsland; + private static boolean generateObsidianPlatform; private static int endCityFailChance; public static void init() { @@ -29,6 +30,7 @@ public class GeneratorOptions { noRingVoid = Configs.GENERATOR_CONFIG.getBoolean("customGenerator", "noRingVoid", false); generateCentralIsland = Configs.GENERATOR_CONFIG.getBoolean("customGenerator", "generateCentralIsland", false); endCityFailChance = Configs.GENERATOR_CONFIG.getInt("customGenerator", "endCityFailChance", 5); + generateObsidianPlatform = Configs.GENERATOR_CONFIG.getBooleanRoot("generateObsidianPlatform", true); } public static int getBiomeSizeLand() { @@ -75,6 +77,10 @@ public class GeneratorOptions { return generateCentralIsland; } + public static boolean generateObsidianPlatform() { + return generateObsidianPlatform; + } + public static int getEndCityFailChance() { return endCityFailChance; }