Obsidian platform fix
This commit is contained in:
parent
5f20079a30
commit
1717b30d41
2 changed files with 8 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue