From 9f8af3085ec03b4aee4dbc6acaadb9d43067abed Mon Sep 17 00:00:00 2001 From: Frank Date: Sat, 10 Dec 2022 11:03:44 +0100 Subject: [PATCH] Fixed some ToDos --- .../betterend/blocks/EndLotusFlowerBlock.java | 1 - .../betterend/blocks/EndStoneSmelter.java | 1 - .../betterend/entity/CubozoaEntity.java | 1 - .../integration/byg/features/BYGFeatures.java | 24 +++++++++---------- .../mixin/client/ModelLoaderMixin.java | 5 ++-- .../mixin/client/MusicTrackerMixin.java | 1 - .../particle/InfusionParticleType.java | 1 - .../piece/PaintedMountainPiece.java | 8 ++----- 8 files changed, 16 insertions(+), 26 deletions(-) diff --git a/src/main/java/org/betterx/betterend/blocks/EndLotusFlowerBlock.java b/src/main/java/org/betterx/betterend/blocks/EndLotusFlowerBlock.java index 21cccdb6..adaf0fc5 100644 --- a/src/main/java/org/betterx/betterend/blocks/EndLotusFlowerBlock.java +++ b/src/main/java/org/betterx/betterend/blocks/EndLotusFlowerBlock.java @@ -26,7 +26,6 @@ public class EndLotusFlowerBlock extends EndPlantBlock { private static final VoxelShape SHAPE_COLLISION = Block.box(0, 0, 0, 16, 2, 16); public EndLotusFlowerBlock() { - //TODO: 1.19 Test if we can remove dynamic shape and offsetType super(basePlantSettings(15).offsetType(BlockBehaviour.OffsetType.NONE)); } diff --git a/src/main/java/org/betterx/betterend/blocks/EndStoneSmelter.java b/src/main/java/org/betterx/betterend/blocks/EndStoneSmelter.java index 5829e259..afde831c 100644 --- a/src/main/java/org/betterx/betterend/blocks/EndStoneSmelter.java +++ b/src/main/java/org/betterx/betterend/blocks/EndStoneSmelter.java @@ -116,7 +116,6 @@ public class EndStoneSmelter extends BaseBlockWithEntity implements AlloyingReci @Override @SuppressWarnings("deprecation") public int getAnalogOutputSignal(BlockState state, Level world, BlockPos pos) { - //TODO return AbstractContainerMenu.getRedstoneSignalFromBlockEntity(world.getBlockEntity(pos)); } diff --git a/src/main/java/org/betterx/betterend/entity/CubozoaEntity.java b/src/main/java/org/betterx/betterend/entity/CubozoaEntity.java index bba08ef6..c0abbff5 100644 --- a/src/main/java/org/betterx/betterend/entity/CubozoaEntity.java +++ b/src/main/java/org/betterx/betterend/entity/CubozoaEntity.java @@ -52,7 +52,6 @@ public class CubozoaEntity extends AbstractSchoolingFish { SpawnGroupData data = super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityTag); if (BiomeAPI.getBiome(world.getBiome(blockPosition())).is(EndBiomes.SULPHUR_SPRINGS)) { - //TODO: 1.19.3 test if this still works this.entityData.set(VARIANT, (byte) 1); } diff --git a/src/main/java/org/betterx/betterend/integration/byg/features/BYGFeatures.java b/src/main/java/org/betterx/betterend/integration/byg/features/BYGFeatures.java index afb2ca53..db99f9da 100644 --- a/src/main/java/org/betterx/betterend/integration/byg/features/BYGFeatures.java +++ b/src/main/java/org/betterx/betterend/integration/byg/features/BYGFeatures.java @@ -14,42 +14,42 @@ import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfigur import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; public class BYGFeatures { - public static final BCLFeature OLD_BULBIS_TREE = redisterVegetation( + public static final BCLFeature OLD_BULBIS_TREE = registerVegetation( "old_bulbis_tree", EndFeatures.inlineBuild("old_bulbis_tree_feature", new OldBulbisTreeFeature()), 1 ); - public static final BCLFeature IVIS_SPROUT = redisterVegetation( + public static final BCLFeature IVIS_SPROUT = registerVegetation( "ivis_sprout", EndFeatures.SINGLE_PLANT_FEATURE, new SinglePlantFeatureConfig(Integrations.BYG.getBlock("ivis_sprout"), 6, 2), 6 ); - public static final BCLFeature IVIS_VINE = redisterVegetation( + public static final BCLFeature IVIS_VINE = registerVegetation( "ivis_vine", EndFeatures.VINE_FEATURE, new VineFeatureConfig(BYGBlocks.IVIS_VINE, 24), 5 ); - public static final BCLFeature IVIS_MOSS = redisterVegetation( + public static final BCLFeature IVIS_MOSS = registerVegetation( "ivis_moss", EndFeatures.WALL_PLANT_FEATURE, new WallPlantFeatureConfig(BYGBlocks.IVIS_MOSS, 6), 1 ); - public static final BCLFeature IVIS_MOSS_WOOD = redisterVegetation( + public static final BCLFeature IVIS_MOSS_WOOD = registerVegetation( "ivis_moss_wood", EndFeatures.WALL_PLANT_ON_LOG_FEATURE, new WallPlantFeatureConfig(BYGBlocks.IVIS_MOSS, 6), 15 ); - public static final BCLFeature NIGHTSHADE_MOSS = redisterVegetation( + public static final BCLFeature NIGHTSHADE_MOSS = registerVegetation( "nightshade_moss", EndFeatures.WALL_PLANT_FEATURE, new WallPlantFeatureConfig(BYGBlocks.NIGHTSHADE_MOSS, 5), 2 ); - public static final BCLFeature NIGHTSHADE_MOSS_WOOD = redisterVegetation( + public static final BCLFeature NIGHTSHADE_MOSS_WOOD = registerVegetation( "nightshade_moss_wood", EndFeatures.WALL_PLANT_ON_LOG_FEATURE, new WallPlantFeatureConfig(BYGBlocks.NIGHTSHADE_MOSS, 5), @@ -62,7 +62,7 @@ public class BYGFeatures { new NightshadeRedwoodTreeFeature() ); - public static final BCLFeature NIGHTSHADE_REDWOOD_TREE = redisterVegetation( + public static final BCLFeature NIGHTSHADE_REDWOOD_TREE = registerVegetation( "nightshade_redwood_tree", NIGHTSHADE_REDWOOD_TREE_FEATURE, 1 @@ -73,7 +73,7 @@ public class BYGFeatures { new BigEtherTreeFeature() ); - public static final BCLFeature BIG_ETHER_TREE = redisterVegetation( + public static final BCLFeature BIG_ETHER_TREE = registerVegetation( "big_ether_tree", BIG_ETHER_TREE_FEATURE, 1 @@ -82,15 +82,15 @@ public class BYGFeatures { public static void register() { } - private static > BCLFeature redisterVegetation( + private static > BCLFeature registerVegetation( String name, F feature, int density ) { - return redisterVegetation(name, feature, NoneFeatureConfiguration.NONE, density); + return registerVegetation(name, feature, NoneFeatureConfiguration.NONE, density); } - private static , FC extends FeatureConfiguration> BCLFeature redisterVegetation( + private static , FC extends FeatureConfiguration> BCLFeature registerVegetation( String name, F feature, FC config, diff --git a/src/main/java/org/betterx/betterend/mixin/client/ModelLoaderMixin.java b/src/main/java/org/betterx/betterend/mixin/client/ModelLoaderMixin.java index e4246890..dc4684b8 100644 --- a/src/main/java/org/betterx/betterend/mixin/client/ModelLoaderMixin.java +++ b/src/main/java/org/betterx/betterend/mixin/client/ModelLoaderMixin.java @@ -12,9 +12,9 @@ import org.spongepowered.asm.mixin.injection.ModifyArg; @Mixin(ModelBakery.class) public abstract class ModelLoaderMixin { - //TODO: 1.19.3 validate that alternative chorus model is loaded @ModifyArg(method = "loadModel", at = @At(value = "INVOKE", target = "Lnet/minecraft/resources/FileToIdConverter;idToFile(Lnet/minecraft/resources/ResourceLocation;)Lnet/minecraft/resources/ResourceLocation;")) public ResourceLocation be_switchModelOnLoad(ResourceLocation loc) { + //this should allways be a block state, as it is supplied a BLOCKSTATE_LISTER if (GeneratorOptions.changeChorusPlant() && be_changeModel(loc)) { String path = loc.getPath().replace("chorus", "custom_chorus"); return BetterEnd.makeID(path); @@ -25,8 +25,7 @@ public abstract class ModelLoaderMixin { private boolean be_changeModel(ResourceLocation id) { if (id.getNamespace().equals("minecraft")) { if (id.getPath().contains("chorus") && !id.getPath().contains("custom_")) { - return true || id.getPath().startsWith("blockstates/"); - + return true; } return false; } diff --git a/src/main/java/org/betterx/betterend/mixin/client/MusicTrackerMixin.java b/src/main/java/org/betterx/betterend/mixin/client/MusicTrackerMixin.java index 3e68ce23..0d70b48a 100644 --- a/src/main/java/org/betterx/betterend/mixin/client/MusicTrackerMixin.java +++ b/src/main/java/org/betterx/betterend/mixin/client/MusicTrackerMixin.java @@ -91,7 +91,6 @@ public abstract class MusicTrackerMixin { } private boolean be_shouldChangeSound(Music musicSound) { - //TODO: 1.19.3 do we need this? return currentMusic != null && !musicSound .getEvent() .value() diff --git a/src/main/java/org/betterx/betterend/particle/InfusionParticleType.java b/src/main/java/org/betterx/betterend/particle/InfusionParticleType.java index 6323b50a..75f58e86 100644 --- a/src/main/java/org/betterx/betterend/particle/InfusionParticleType.java +++ b/src/main/java/org/betterx/betterend/particle/InfusionParticleType.java @@ -30,7 +30,6 @@ public class InfusionParticleType extends ParticleType imp StringReader stringReader ) throws CommandSyntaxException { stringReader.expect(' '); - //TODO: 1.19.3 check if this is the correct way to gte the HolderLookup, or if PaintedMountainPiece is correct ItemParser.ItemResult itemResult = ItemParser.parseForItem( BuiltInRegistries.ITEM.asLookup(), stringReader diff --git a/src/main/java/org/betterx/betterend/world/structures/piece/PaintedMountainPiece.java b/src/main/java/org/betterx/betterend/world/structures/piece/PaintedMountainPiece.java index 57595028..f867d741 100644 --- a/src/main/java/org/betterx/betterend/world/structures/piece/PaintedMountainPiece.java +++ b/src/main/java/org/betterx/betterend/world/structures/piece/PaintedMountainPiece.java @@ -3,13 +3,12 @@ package org.betterx.betterend.world.structures.piece; import org.betterx.bclib.util.MHelper; import org.betterx.betterend.registry.EndStructures; import org.betterx.betterend.util.GlobalState; -import org.betterx.worlds.together.world.event.WorldBootstrap; import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos.MutableBlockPos; import net.minecraft.core.Holder; import net.minecraft.core.HolderLookup; -import net.minecraft.core.registries.Registries; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; import net.minecraft.nbt.NbtUtils; @@ -59,10 +58,7 @@ public class PaintedMountainPiece extends MountainPiece { @Override protected void fromNbt(CompoundTag tag) { super.fromNbt(tag); - //TODO: 1.19.3 check if this is the correct way to gte the HolderLookup - final HolderLookup blockLookup = WorldBootstrap.getLastRegistryAccess() - .lookup(Registries.BLOCK) - .orElseThrow(); + final HolderLookup blockLookup = BuiltInRegistries.BLOCK.asLookup(); ListTag slise = tag.getList("slises", 10); slices = new BlockState[slise.size()]; for (int i = 0; i < slices.length; i++) {