Fixed some boot-crashes
This commit is contained in:
parent
54bbb75d77
commit
277dcc04b7
9 changed files with 51 additions and 45 deletions
|
@ -25,7 +25,8 @@ public class EndLotusFlowerBlock extends EndPlantBlock {
|
|||
private static final VoxelShape SHAPE_COLLISION = Block.box(0, 0, 0, 16, 2, 16);
|
||||
|
||||
public EndLotusFlowerBlock() {
|
||||
super(FabricBlockSettings.of(Material.PLANT).luminance(15).noOcclusion().offsetType(BlockBehaviour.OffsetType.NONE));
|
||||
//TODO: 1.19 Test if we can remove dynamic shape and offsetType
|
||||
super(FabricBlockSettings.of(Material.PLANT).luminance(15).noOcclusion().dynamicShape().offsetType(BlockBehaviour.OffsetType.NONE));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -29,8 +29,10 @@ public class FlamaeaBlock extends EndPlantBlock implements CustomItemProvider, A
|
|||
private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 1, 16);
|
||||
|
||||
public FlamaeaBlock() {
|
||||
//TODO: 1.19 Test if we can remove dynamic shape and offsetType
|
||||
super(FabricBlockSettings.of(Material.PLANT)
|
||||
.sound(SoundType.WET_GRASS)
|
||||
.dynamicShape()
|
||||
.offsetType( BlockBehaviour.OffsetType.NONE));
|
||||
}
|
||||
|
||||
|
|
|
@ -29,10 +29,12 @@ public class LargeAmaranitaBlock extends EndPlantBlock implements AddMineableShe
|
|||
private static final VoxelShape SHAPE_TOP = Shapes.or(Block.box(1, 3, 1, 15, 16, 15), SHAPE_BOTTOM);
|
||||
|
||||
public LargeAmaranitaBlock() {
|
||||
//TODO: 1.19 Test if we can remove dynamic shape and offsetType
|
||||
super(FabricBlockSettings.of(Material.PLANT)
|
||||
|
||||
.sound(SoundType.GRASS)
|
||||
.lightLevel((state) -> (state.getValue(SHAPE) == TripleShape.TOP) ? 15 : 0)
|
||||
.dynamicShape()
|
||||
.offsetType(OffsetType.NONE));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
package ru.betterend.mixin.common;
|
||||
|
||||
import net.minecraft.world.level.dimension.DimensionType;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import ru.betterend.world.generator.GeneratorOptions;
|
||||
|
||||
@Mixin(value = DimensionType.class, priority = 100)
|
||||
public class DimensionTypeMixin {
|
||||
@Inject(method = "createDragonFight", at = @At("HEAD"), cancellable = true)
|
||||
private void be_hasEnderDragonFight(CallbackInfoReturnable<Boolean> info) {
|
||||
if (!GeneratorOptions.hasDragonFights()) {
|
||||
info.setReturnValue(false);
|
||||
}
|
||||
}
|
||||
}
|
25
src/main/java/ru/betterend/mixin/common/LevelMixin.java
Normal file
25
src/main/java/ru/betterend/mixin/common/LevelMixin.java
Normal file
|
@ -0,0 +1,25 @@
|
|||
package ru.betterend.mixin.common;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import ru.betterend.world.generator.GeneratorOptions;
|
||||
|
||||
@Mixin(Level.class)
|
||||
public class LevelMixin {
|
||||
|
||||
@Inject(method = "getSharedSpawnPos", at = @At("HEAD"), cancellable = true)
|
||||
private void be_getSharedSpawnPos(CallbackInfoReturnable<BlockPos> info) {
|
||||
if (GeneratorOptions.changeSpawn()) {
|
||||
if (ServerLevel.class.cast(this).dimension() == Level.END) {
|
||||
BlockPos pos = GeneratorOptions.getSpawn();
|
||||
info.setReturnValue(pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,6 +2,8 @@ package ru.betterend.mixin.common;
|
|||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.data.BuiltinRegistries;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
|
@ -12,6 +14,7 @@ import net.minecraft.world.level.Level;
|
|||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.dimension.BuiltinDimensionTypes;
|
||||
import net.minecraft.world.level.dimension.DimensionType;
|
||||
import net.minecraft.world.level.dimension.LevelStem;
|
||||
import net.minecraft.world.level.levelgen.NoiseBasedChunkGenerator;
|
||||
|
@ -26,6 +29,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import ru.bclib.BCLib;
|
||||
import ru.bclib.api.biomes.BiomeAPI;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.interfaces.BETargetChecker;
|
||||
|
@ -49,19 +53,16 @@ public abstract class ServerLevelMixin extends Level {
|
|||
int i) {
|
||||
super(writableLevelData, resourceKey, holder, supplier, bl, bl2, l, i);
|
||||
}
|
||||
//private static String be_lastWorld = null;
|
||||
|
||||
|
||||
// @Inject(method = "<init>*", at = @At("TAIL"))
|
||||
// private void be_onServerWorldInit(MinecraftServer server, Executor workerExecutor, LevelStorageSource.LevelStorageAccess session, ServerLevelData properties, ResourceKey<Level> registryKey, DimensionType dimensionType, ChunkProgressListener worldGenerationProgressListener, ChunkGenerator chunkGenerator, boolean debugWorld, long l, List<CustomSpawner> list, boolean bl, CallbackInfo info) {
|
||||
// if (be_lastWorld != null && be_lastWorld.equals(session.getLevelId())) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// be_lastWorld = session.getLevelId();
|
||||
// //ServerLevel world = ServerLevel.class.cast(this);
|
||||
// //EndBiomes.onWorldLoad(world.getSeed(), world.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY));
|
||||
// }
|
||||
private final static List<ResourceKey<DimensionType>> BE_TEST_DIMENSIONS = List.of(BuiltinDimensionTypes.OVERWORLD, BuiltinDimensionTypes.OVERWORLD_CAVES, BuiltinDimensionTypes.NETHER);
|
||||
@ModifyArg(method = "<init>", at = @At(value = "INVOKE", target="Lnet/minecraft/core/Holder;is(Lnet/minecraft/resources/ResourceKey;)Z"))
|
||||
ResourceKey<DimensionType> be_dragonFight(ResourceKey<DimensionType> resourceKey){
|
||||
if (!GeneratorOptions.hasDragonFights()) {
|
||||
//this object would pass the test for the End-Dimension, so make sure we compare against something else to disabled the Dragon-Fight
|
||||
if (this.dimensionTypeRegistration().is(BuiltinDimensionTypes.END)) return BuiltinDimensionTypes.OVERWORLD;
|
||||
}
|
||||
return resourceKey;
|
||||
}
|
||||
|
||||
@Inject(method = "<init>*", at = @At("TAIL"))
|
||||
private void be_onServerWorldInit(MinecraftServer minecraftServer,
|
||||
|
@ -87,16 +88,7 @@ public abstract class ServerLevelMixin extends Level {
|
|||
TerrainGenerator.initNoise(seed, chunkGenerator.getBiomeSource(), level.getChunkSource().randomState().sampler());
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "getSharedSpawnPos", at = @At("HEAD"), cancellable = true)
|
||||
private void be_getSharedSpawnPos(CallbackInfoReturnable<BlockPos> info) {
|
||||
if (GeneratorOptions.changeSpawn()) {
|
||||
if (ServerLevel.class.cast(this).dimension() == Level.END) {
|
||||
BlockPos pos = GeneratorOptions.getSpawn();
|
||||
info.setReturnValue(pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Inject(method = "makeObsidianPlatform", at = @At("HEAD"), cancellable = true)
|
||||
private static void be_createObsidianPlatform(ServerLevel serverLevel, CallbackInfo info) {
|
||||
|
|
|
@ -41,6 +41,8 @@ import ru.betterend.world.generator.BiomeType;
|
|||
import ru.betterend.world.generator.GeneratorOptions;
|
||||
|
||||
public class EndBiomes {
|
||||
public static final BiomeAPI.Dimension END_CAVE = new BiomeAPI.Dimension(BiomeAPI.Dimension.END);
|
||||
|
||||
public static BiomePicker CAVE_BIOMES = null;
|
||||
private static HexBiomeMap caveBiomeMap;
|
||||
private static long lastSeed;
|
||||
|
@ -165,7 +167,7 @@ public class EndBiomes {
|
|||
}
|
||||
}
|
||||
}
|
||||
public static final BiomeAPI.Dimension END_CAVE = new BiomeAPI.Dimension(BiomeAPI.Dimension.END);
|
||||
|
||||
public static EndCaveBiome registerCaveBiome(EndCaveBiome.Config biomeConfig) {
|
||||
final EndCaveBiome biome = EndCaveBiome.create(biomeConfig);
|
||||
if (Configs.BIOME_CONFIG.getBoolean(biome.getID(), "enabled", true)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue