From daaeb97d1fc0a2b1af109105281bac5217d86af9 Mon Sep 17 00:00:00 2001 From: itsmeow Date: Sun, 4 Apr 2021 07:12:08 -0400 Subject: [PATCH] Fix spawn config issues & moddied biome spawning, abstract spawning registration to IMDLib, fix not using proper Biome dictionary, remove manual spinning fix (most have updated Forge w/ fix), fix serializable crash with newer JDKs, update mappings & Forge, fix attribute log spam on newer Forge --- gradle.properties | 14 +++---- .../itsmeow/whisperwoods/WhisperwoodsMod.java | 15 ++----- .../whisperwoods/block/BlockHandOfFate.java | 6 +-- .../client/init/ClientLifecycleHandler.java | 2 +- .../config/WhisperwoodsConfig.java | 12 ++---- .../entity/EntityAnimalWithTypes.java | 2 +- ...tityAnimalWithTypesAndSizeContainable.java | 4 +- .../whisperwoods/entity/EntityHidebehind.java | 24 ++++------- .../entity/EntityHirschgeist.java | 9 ++-- .../whisperwoods/entity/EntityMoth.java | 2 +- .../whisperwoods/entity/EntityWisp.java | 2 +- .../whisperwoods/entity/EntityZotzpyre.java | 4 +- .../itsmeow/whisperwoods/init/ModDataGen.java | 1 - .../whisperwoods/init/ModEntities.java | 15 ++++--- .../init/WhisperwoodsRegistrar.java | 41 ------------------- .../StopSpinningClimberPathNavigator.java | 34 --------------- .../util/StopSpinningGroundPathNavigator.java | 34 --------------- .../resources/META-INF/accesstransformer.cfg | 5 ++- 18 files changed, 52 insertions(+), 174 deletions(-) delete mode 100644 src/main/java/dev/itsmeow/whisperwoods/init/WhisperwoodsRegistrar.java delete mode 100644 src/main/java/dev/itsmeow/whisperwoods/util/StopSpinningClimberPathNavigator.java delete mode 100644 src/main/java/dev/itsmeow/whisperwoods/util/StopSpinningGroundPathNavigator.java diff --git a/gradle.properties b/gradle.properties index 40aaaea..983328c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,11 +4,11 @@ maven_group = dev.itsmeow.whisperwoods # Forge - mc_version = 1.16.4 - forge_version = 35.1.4 - mappings_version = 20201028 + mc_version = 1.16.5 + forge_version = 36.1.4 + mappings_version = 20210309 mappings_channel = snapshot - mappings_mc_version = 1.16.3 + mappings_mc_version = 1.16.5 # Publishing github = itsmeow/whisperwoods @@ -16,11 +16,11 @@ url = https://github.com/itsmeow/whisperwoods curse_project_id = 349597 curse_title = Whisperwoods 1.16.4-2.0.0 - curse_versions = Java 8,Forge,Minecraft 1.16:1.16.4,Minecraft 1.16:1.16.3 + curse_versions = Java 8,Forge,Minecraft 1.16:1.16.5,Minecraft 1.16:1.16.4,Minecraft 1.16:1.16.3 # Misc org.gradle.jvmargs=-Xmx6G org.gradle.daemon=true - jei_version=7.6.0.58 - imdlib_version=1.16.3-fe62adbeaca3eb6320f109a154209ffa8f415b62 + jei_version=7.6.1.75 + imdlib_version=1.16.5-cfc53986656fc4ab86b5570655e7af0b8723fb2b at_file = accesstransformer \ No newline at end of file diff --git a/src/main/java/dev/itsmeow/whisperwoods/WhisperwoodsMod.java b/src/main/java/dev/itsmeow/whisperwoods/WhisperwoodsMod.java index 9df5666..07e123d 100644 --- a/src/main/java/dev/itsmeow/whisperwoods/WhisperwoodsMod.java +++ b/src/main/java/dev/itsmeow/whisperwoods/WhisperwoodsMod.java @@ -1,21 +1,12 @@ package dev.itsmeow.whisperwoods; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - import dev.itsmeow.imdlib.entity.util.EntityTypeContainer; import dev.itsmeow.whisperwoods.config.WhisperwoodsConfig; -import dev.itsmeow.whisperwoods.init.ModBlocks; -import dev.itsmeow.whisperwoods.init.ModEntities; -import dev.itsmeow.whisperwoods.init.ModItems; -import dev.itsmeow.whisperwoods.init.ModParticles; -import dev.itsmeow.whisperwoods.init.ModSounds; -import dev.itsmeow.whisperwoods.init.ModTileEntities; +import dev.itsmeow.whisperwoods.init.*; import dev.itsmeow.whisperwoods.network.WWNetwork; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; -import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.common.Mod; @@ -23,6 +14,8 @@ import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; @Mod(value = WhisperwoodsMod.MODID) public class WhisperwoodsMod { @@ -34,13 +27,13 @@ public WhisperwoodsMod() { IEventBus modBus = FMLJavaModLoadingContext.get().getModEventBus(); modBus.addListener(this::setup); modBus.addListener(this::loadComplete); + ModEntities.subscribe(modBus); ModBlocks.subscribe(modBus); ModItems.subscribe(modBus); ModSounds.subscribe(modBus); ModTileEntities.subscribe(modBus); ModParticles.subscribe(modBus); WWNetwork.subscribe(modBus); - MinecraftForge.EVENT_BUS.addListener(WhisperwoodsConfig::onBiomeLoad); ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, WhisperwoodsConfig.getClientSpec()); LOGGER.info("Spooking you..."); } diff --git a/src/main/java/dev/itsmeow/whisperwoods/block/BlockHandOfFate.java b/src/main/java/dev/itsmeow/whisperwoods/block/BlockHandOfFate.java index 159177c..b1a12b0 100644 --- a/src/main/java/dev/itsmeow/whisperwoods/block/BlockHandOfFate.java +++ b/src/main/java/dev/itsmeow/whisperwoods/block/BlockHandOfFate.java @@ -71,7 +71,7 @@ public boolean isLit(World world, BlockPos pos) { @SuppressWarnings("deprecation") @Override public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving) { - if(!state.isIn(newState.getBlock())) { + if(!state.matchesBlock(newState.getBlock())) { TileEntity te = worldIn.getTileEntity(pos); if(te instanceof TileEntityHandOfFate) { ((TileEntityHandOfFate)te).dropItems(worldIn, pos); @@ -157,9 +157,9 @@ public void addInformation(ItemStack stack, IBlockReader worldIn, List child = getBaseChild(); diff --git a/src/main/java/dev/itsmeow/whisperwoods/entity/EntityAnimalWithTypesAndSizeContainable.java b/src/main/java/dev/itsmeow/whisperwoods/entity/EntityAnimalWithTypesAndSizeContainable.java index 800fddf..f5bead2 100644 --- a/src/main/java/dev/itsmeow/whisperwoods/entity/EntityAnimalWithTypesAndSizeContainable.java +++ b/src/main/java/dev/itsmeow/whisperwoods/entity/EntityAnimalWithTypesAndSizeContainable.java @@ -56,11 +56,11 @@ public void setContainerData(ItemStack bucket) { } @Override - public ActionResultType func_230254_b_(PlayerEntity player, Hand hand) { + public ActionResultType getEntityInteractionResult(PlayerEntity player, Hand hand) { if(this.processContainerInteract(player, hand)) { return ActionResultType.SUCCESS; } - return super.func_230254_b_(player, hand); + return super.getEntityInteractionResult(player, hand); } @Override diff --git a/src/main/java/dev/itsmeow/whisperwoods/entity/EntityHidebehind.java b/src/main/java/dev/itsmeow/whisperwoods/entity/EntityHidebehind.java index 73c0c41..43373b9 100644 --- a/src/main/java/dev/itsmeow/whisperwoods/entity/EntityHidebehind.java +++ b/src/main/java/dev/itsmeow/whisperwoods/entity/EntityHidebehind.java @@ -2,12 +2,10 @@ import dev.itsmeow.imdlib.entity.util.EntityTypeContainer; import dev.itsmeow.imdlib.entity.util.EntityVariant; -import dev.itsmeow.imdlib.util.BiomeDictionary.Type; import dev.itsmeow.whisperwoods.WhisperwoodsMod; import dev.itsmeow.whisperwoods.init.ModEntities; import dev.itsmeow.whisperwoods.init.ModSounds; import dev.itsmeow.whisperwoods.util.IOverrideCollisions; -import dev.itsmeow.whisperwoods.util.StopSpinningGroundPathNavigator; import net.minecraft.block.TorchBlock; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.*; @@ -22,10 +20,7 @@ import net.minecraft.network.datasync.DataParameter; import net.minecraft.network.datasync.DataSerializers; import net.minecraft.network.datasync.EntityDataManager; -import net.minecraft.pathfinding.PathFinder; -import net.minecraft.pathfinding.PathNavigator; -import net.minecraft.pathfinding.PathNodeType; -import net.minecraft.pathfinding.WalkNodeProcessor; +import net.minecraft.pathfinding.*; import net.minecraft.tags.BlockTags; import net.minecraft.util.*; import net.minecraft.util.math.AxisAlignedBB; @@ -38,6 +33,7 @@ import net.minecraft.world.World; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biomes; +import net.minecraftforge.common.BiomeDictionary; import javax.annotation.Nullable; import java.util.EnumSet; @@ -303,9 +299,7 @@ public Vector3d transformMove(@Nullable Entity entity, Vector3d vec, AxisAligned boolean flag1 = vec.y == 0.0D; boolean flag2 = vec.z == 0.0D; if((!flag || !flag1) && (!flag || !flag2) && (!flag1 || !flag2)) { // if moving somehow - ReuseableStream reusableStream = new ReuseableStream<>(Stream.concat(stream.createStream(), world.getCollisionShapes(entity, bb.expand(vec))).filter(shape -> { - return !world.getBlockState(new BlockPos(shape.getBoundingBox().minX, shape.getBoundingBox().minY, shape.getBoundingBox().minZ)).getBlock().isIn(BlockTags.LEAVES); - })); + ReuseableStream reusableStream = new ReuseableStream<>(Stream.concat(stream.createStream(), world.getBlockCollisionShapes(entity, bb.expand(vec))).filter(shape -> !world.getBlockState(new BlockPos(shape.getBoundingBox().minX, shape.getBoundingBox().minY, shape.getBoundingBox().minZ)).getBlock().isIn(BlockTags.LEAVES))); return collideBoundingBox(vec, bb, reusableStream); } else { return getAllowedMovement(vec, bb, world, context, stream); @@ -403,7 +397,7 @@ protected PathNavigator createNavigator(World world) { return new HidebehindGroundNavigator(this, world); } - public static class HidebehindGroundNavigator extends StopSpinningGroundPathNavigator { + public static class HidebehindGroundNavigator extends GroundPathNavigator { public HidebehindGroundNavigator(MobEntity entityliving, World world) { super(entityliving, world); @@ -418,8 +412,8 @@ protected PathFinder getPathFinder(int i1) { public static class HidebehindNodeProcessor extends WalkNodeProcessor { @Override - protected PathNodeType func_215744_a(IBlockReader reader, boolean b1, boolean b2, BlockPos pos, PathNodeType typeIn) { - return typeIn == PathNodeType.LEAVES ? PathNodeType.OPEN : super.func_215744_a(reader, b1, b2, pos, typeIn); + protected PathNodeType refineNodeType(IBlockReader reader, boolean b1, boolean b2, BlockPos pos, PathNodeType typeIn) { + return typeIn == PathNodeType.LEAVES ? PathNodeType.OPEN : super.refineNodeType(reader, b1, b2, pos, typeIn); } } @@ -473,14 +467,14 @@ public EntityTypeContainer getContainer() { } @Override - public String[] getTypesFor(RegistryKey biomeKey, Biome biome, Set types, SpawnReason reason) { + public String[] getTypesFor(RegistryKey biomeKey, Biome biome, Set types, SpawnReason reason) { if(biomeKey == Biomes.GIANT_SPRUCE_TAIGA || biomeKey == Biomes.GIANT_SPRUCE_TAIGA_HILLS || biomeKey == Biomes.GIANT_TREE_TAIGA || biomeKey == Biomes.GIANT_TREE_TAIGA_HILLS) { return new String[] { "mega_taiga", "mega_taiga", "mega_taiga", "darkforest" }; } - if(types.contains(Type.CONIFEROUS)) { + if(types.contains(BiomeDictionary.Type.CONIFEROUS)) { return new String[] { "coniferous", "coniferous", "coniferous", "coniferous", "black", "darkforest" }; } - if(types.contains(Type.FOREST)) { + if(types.contains(BiomeDictionary.Type.FOREST)) { return new String[] { "forest", "black", "darkforest" }; } return new String[] { "black", "coniferous", "darkforest", "forest", "mega_taiga" }; diff --git a/src/main/java/dev/itsmeow/whisperwoods/entity/EntityHirschgeist.java b/src/main/java/dev/itsmeow/whisperwoods/entity/EntityHirschgeist.java index 64fadea..7fc9a2e 100644 --- a/src/main/java/dev/itsmeow/whisperwoods/entity/EntityHirschgeist.java +++ b/src/main/java/dev/itsmeow/whisperwoods/entity/EntityHirschgeist.java @@ -3,7 +3,6 @@ import dev.itsmeow.imdlib.entity.util.EntityTypeContainer; import dev.itsmeow.whisperwoods.init.ModEntities; import dev.itsmeow.whisperwoods.util.IOverrideCollisions; -import dev.itsmeow.whisperwoods.util.StopSpinningGroundPathNavigator; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.entity.*; @@ -86,13 +85,13 @@ public ILivingEntityData onInitialSpawn(IServerWorld worldIn, DifficultyInstance @Override protected PathNavigator createNavigator(World worldIn) { - return new StopSpinningGroundPathNavigator(this, worldIn) { + return new GroundPathNavigator(this, worldIn) { @Override protected PathFinder getPathFinder(int i1) { this.nodeProcessor = new WalkNodeProcessor() { @Override - protected PathNodeType func_215744_a(IBlockReader reader, boolean b1, boolean b2, BlockPos pos, PathNodeType typeIn) { - return typeIn == PathNodeType.LEAVES || reader.getBlockState(pos).getBlock().isIn(BlockTags.LOGS) || reader.getBlockState(pos).getBlock().isIn(BlockTags.LEAVES) ? PathNodeType.OPEN : super.func_215744_a(reader, b1, b2, pos, typeIn); + protected PathNodeType refineNodeType(IBlockReader reader, boolean b1, boolean b2, BlockPos pos, PathNodeType typeIn) { + return typeIn == PathNodeType.LEAVES || reader.getBlockState(pos).getBlock().isIn(BlockTags.LOGS) || reader.getBlockState(pos).getBlock().isIn(BlockTags.LEAVES) ? PathNodeType.OPEN : super.refineNodeType(reader, b1, b2, pos, typeIn); } }; this.nodeProcessor.setCanEnterDoors(true); @@ -276,7 +275,7 @@ public Vector3d transformMove(@Nullable Entity entity, Vector3d vec, AxisAligned boolean flag1 = vec.y == 0.0D; boolean flag2 = vec.z == 0.0D; if ((!flag || !flag1) && (!flag || !flag2) && (!flag1 || !flag2)) { // if moving somehow - ReuseableStream reusableStream = new ReuseableStream<>(Stream.concat(stream.createStream(), world.getCollisionShapes(entity, bb.expand(vec))).filter(shape -> { + ReuseableStream reusableStream = new ReuseableStream<>(Stream.concat(stream.createStream(), world.getBlockCollisionShapes(entity, bb.expand(vec))).filter(shape -> { Block block = world.getBlockState(new BlockPos(shape.getBoundingBox().minX, shape.getBoundingBox().minY, shape.getBoundingBox().minZ)).getBlock(); return !block.isIn(BlockTags.LEAVES) && !block.isIn(BlockTags.LOGS); })); diff --git a/src/main/java/dev/itsmeow/whisperwoods/entity/EntityMoth.java b/src/main/java/dev/itsmeow/whisperwoods/entity/EntityMoth.java index f186eac..c484396 100644 --- a/src/main/java/dev/itsmeow/whisperwoods/entity/EntityMoth.java +++ b/src/main/java/dev/itsmeow/whisperwoods/entity/EntityMoth.java @@ -288,7 +288,7 @@ public static void bottleTooltip(EntityTypeContainer contai CompoundNBT tag = stack.getTag(); if(tag != null) { if(tag.contains("SizeTag", Constants.NBT.TAG_FLOAT)) { - tooltip.add(new StringTextComponent("Size: " + tag.getFloat("SizeTag")).setStyle(Style.EMPTY.createStyleFromFormattings(new TextFormatting[] { TextFormatting.ITALIC, TextFormatting.GRAY }))); + tooltip.add(new StringTextComponent("Size: " + tag.getFloat("SizeTag")).setStyle(Style.EMPTY.mergeWithFormatting(TextFormatting.ITALIC, TextFormatting.GRAY))); } } } diff --git a/src/main/java/dev/itsmeow/whisperwoods/entity/EntityWisp.java b/src/main/java/dev/itsmeow/whisperwoods/entity/EntityWisp.java index 16ee148..ac7659b 100644 --- a/src/main/java/dev/itsmeow/whisperwoods/entity/EntityWisp.java +++ b/src/main/java/dev/itsmeow/whisperwoods/entity/EntityWisp.java @@ -356,7 +356,7 @@ public WispData(boolean isHostile, int colorVariant) { } @Override - public AgeableEntity func_241840_a(ServerWorld world, AgeableEntity ageable) { + public AgeableEntity createChild(ServerWorld world, AgeableEntity ageable) { return null; } diff --git a/src/main/java/dev/itsmeow/whisperwoods/entity/EntityZotzpyre.java b/src/main/java/dev/itsmeow/whisperwoods/entity/EntityZotzpyre.java index 8993326..6b6fa33 100644 --- a/src/main/java/dev/itsmeow/whisperwoods/entity/EntityZotzpyre.java +++ b/src/main/java/dev/itsmeow/whisperwoods/entity/EntityZotzpyre.java @@ -2,7 +2,6 @@ import dev.itsmeow.imdlib.entity.util.EntityTypeContainer; import dev.itsmeow.whisperwoods.init.ModEntities; -import dev.itsmeow.whisperwoods.util.StopSpinningClimberPathNavigator; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.*; import net.minecraft.entity.ai.attributes.Attributes; @@ -18,6 +17,7 @@ import net.minecraft.network.datasync.DataSerializers; import net.minecraft.network.datasync.EntityDataManager; import net.minecraft.network.play.server.SSetPassengersPacket; +import net.minecraft.pathfinding.ClimberPathNavigator; import net.minecraft.pathfinding.PathNavigator; import net.minecraft.pathfinding.WalkAndSwimNodeProcessor; import net.minecraft.potion.EffectInstance; @@ -60,7 +60,7 @@ protected void registerGoals() { } protected PathNavigator createNavigator(World worldIn) { - return new StopSpinningClimberPathNavigator(this, worldIn); + return new ClimberPathNavigator(this, worldIn); } @Override diff --git a/src/main/java/dev/itsmeow/whisperwoods/init/ModDataGen.java b/src/main/java/dev/itsmeow/whisperwoods/init/ModDataGen.java index 9621549..a328e96 100644 --- a/src/main/java/dev/itsmeow/whisperwoods/init/ModDataGen.java +++ b/src/main/java/dev/itsmeow/whisperwoods/init/ModDataGen.java @@ -68,7 +68,6 @@ public static void gatherData(GatherDataEvent event) { event.getGenerator().addProvider(new WWItemModelProvider(event.getGenerator(), event.getExistingFileHelper())); event.getGenerator().addProvider(new WWLootTableProvider(event.getGenerator())); event.getGenerator().addProvider(new WWRecipeProvider(event.getGenerator())); - ModEntities.H.gatherData(event.getGenerator(), event.getExistingFileHelper()); } public static class WWBlockTagsProvider extends BlockTagsProvider { diff --git a/src/main/java/dev/itsmeow/whisperwoods/init/ModEntities.java b/src/main/java/dev/itsmeow/whisperwoods/init/ModEntities.java index 28e1d1b..53c5aae 100644 --- a/src/main/java/dev/itsmeow/whisperwoods/init/ModEntities.java +++ b/src/main/java/dev/itsmeow/whisperwoods/init/ModEntities.java @@ -1,9 +1,5 @@ package dev.itsmeow.whisperwoods.init; -import java.util.LinkedHashMap; -import java.util.function.Function; -import java.util.function.Supplier; - import dev.itsmeow.imdlib.IMDLib; import dev.itsmeow.imdlib.entity.EntityRegistrarHandler; import dev.itsmeow.imdlib.entity.util.EntityTypeContainer; @@ -13,7 +9,6 @@ import dev.itsmeow.imdlib.entity.util.IContainable; import dev.itsmeow.imdlib.item.IContainerItem; import dev.itsmeow.imdlib.item.ItemModEntityContainer; -import dev.itsmeow.imdlib.util.BiomeDictionary.Type; import dev.itsmeow.whisperwoods.WhisperwoodsMod; import dev.itsmeow.whisperwoods.entity.*; import dev.itsmeow.whisperwoods.entity.EntityHidebehind.HidebehindVariant; @@ -26,7 +21,13 @@ import net.minecraft.item.Items; import net.minecraft.world.Difficulty; import net.minecraft.world.World; +import net.minecraftforge.common.BiomeDictionary.Type; import net.minecraftforge.common.ForgeConfigSpec; +import net.minecraftforge.eventbus.api.IEventBus; + +import java.util.LinkedHashMap; +import java.util.function.Function; +import java.util.function.Supplier; public class ModEntities { @@ -126,4 +127,8 @@ private static Builder entity(Class entityClass, Fun private static > EntityTypeContainerContainable.Builder entityContainable(Class EntityClass, Function func, String entityNameIn, Supplier attributes) { return EntityTypeContainerContainable.Builder.create(EntityClass, func, entityNameIn, attributes, WhisperwoodsMod.MODID); } + + public static void subscribe(IEventBus modBus) { + H.subscribe(modBus); + } } diff --git a/src/main/java/dev/itsmeow/whisperwoods/init/WhisperwoodsRegistrar.java b/src/main/java/dev/itsmeow/whisperwoods/init/WhisperwoodsRegistrar.java deleted file mode 100644 index de1e8ef..0000000 --- a/src/main/java/dev/itsmeow/whisperwoods/init/WhisperwoodsRegistrar.java +++ /dev/null @@ -1,41 +0,0 @@ - -package dev.itsmeow.whisperwoods.init; - -import dev.itsmeow.imdlib.entity.util.EntityTypeContainer; -import dev.itsmeow.imdlib.entity.util.EntityTypeContainerContainable; -import dev.itsmeow.whisperwoods.WhisperwoodsMod; -import net.minecraft.entity.EntityType; -import net.minecraft.item.Item; -import net.minecraftforge.event.RegistryEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.registries.ForgeRegistries; - -@Mod.EventBusSubscriber(modid = WhisperwoodsMod.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) -public class WhisperwoodsRegistrar { - - @SubscribeEvent - public static void registerItems(RegistryEvent.Register event) { - for(EntityTypeContainer container : ModEntities.getEntities().values()) { - event.getRegistry().register(container.egg); - if(container instanceof EntityTypeContainerContainable) { - EntityTypeContainerContainable c = (EntityTypeContainerContainable) container; - if(!ForgeRegistries.ITEMS.containsValue(c.getContainerItem()) && c.getContainerItem().getRegistryName().getNamespace().equals(WhisperwoodsMod.MODID)) { - event.getRegistry().register(c.getContainerItem()); - } - if(!ForgeRegistries.ITEMS.containsValue(c.getEmptyContainerItem()) && c.getEmptyContainerItem().getRegistryName().getNamespace().equals(WhisperwoodsMod.MODID)) { - event.getRegistry().register(c.getEmptyContainerItem()); - } - } - } - } - - @SubscribeEvent - public static void registerEntities(RegistryEvent.Register> event) { - for(EntityTypeContainer container : ModEntities.getEntities().values()) { - event.getRegistry().register(container.entityType); - container.registerAttributes(); - } - } - -} diff --git a/src/main/java/dev/itsmeow/whisperwoods/util/StopSpinningClimberPathNavigator.java b/src/main/java/dev/itsmeow/whisperwoods/util/StopSpinningClimberPathNavigator.java deleted file mode 100644 index e64dba2..0000000 --- a/src/main/java/dev/itsmeow/whisperwoods/util/StopSpinningClimberPathNavigator.java +++ /dev/null @@ -1,34 +0,0 @@ -package dev.itsmeow.whisperwoods.util; - -import net.minecraft.entity.MobEntity; -import net.minecraft.pathfinding.ClimberPathNavigator; -import net.minecraft.util.math.vector.Vector3d; -import net.minecraft.util.math.vector.Vector3i; -import net.minecraft.world.World; - -public class StopSpinningClimberPathNavigator extends ClimberPathNavigator { - - public StopSpinningClimberPathNavigator(MobEntity entitylivingIn, World worldIn) { - super(entitylivingIn, worldIn); - } - - /** - * See Forge PRs #7520 and #6091 - * Necessary because some users may not have the latest Forge. - */ - @Override - protected void pathFollow() { - Vector3d vector3d = this.getEntityPosition(); - this.maxDistanceToWaypoint = this.entity.getWidth() > 0.75F ? this.entity.getWidth() / 2.0F : 0.75F - this.entity.getWidth() / 2.0F; - Vector3i vector3i = this.currentPath.func_242948_g(); - double d0 = Math.abs(this.entity.getPosX() - ((double)vector3i.getX() + (this.entity.getWidth() + 1) / 2D)); - double d1 = Math.abs(this.entity.getPosY() - (double)vector3i.getY()); - double d2 = Math.abs(this.entity.getPosZ() - ((double)vector3i.getZ() + (this.entity.getWidth() + 1) / 2D)); - boolean flag = d0 < (double)this.maxDistanceToWaypoint && d2 < (double)this.maxDistanceToWaypoint && d1 < 1.0D; - if (flag || this.entity.func_233660_b_(this.currentPath.func_237225_h_().nodeType) && this.func_234112_b_(vector3d)) { - this.currentPath.incrementPathIndex(); - } - - this.checkForStuck(vector3d); - } -} diff --git a/src/main/java/dev/itsmeow/whisperwoods/util/StopSpinningGroundPathNavigator.java b/src/main/java/dev/itsmeow/whisperwoods/util/StopSpinningGroundPathNavigator.java deleted file mode 100644 index a6ed9a7..0000000 --- a/src/main/java/dev/itsmeow/whisperwoods/util/StopSpinningGroundPathNavigator.java +++ /dev/null @@ -1,34 +0,0 @@ -package dev.itsmeow.whisperwoods.util; - -import net.minecraft.entity.MobEntity; -import net.minecraft.pathfinding.GroundPathNavigator; -import net.minecraft.util.math.vector.Vector3d; -import net.minecraft.util.math.vector.Vector3i; -import net.minecraft.world.World; - -public class StopSpinningGroundPathNavigator extends GroundPathNavigator { - - public StopSpinningGroundPathNavigator(MobEntity entitylivingIn, World worldIn) { - super(entitylivingIn, worldIn); - } - - /** - * See Forge PRs #7520 and #6091 - * Necessary because some users may not have the latest Forge. - */ - @Override - protected void pathFollow() { - Vector3d vector3d = this.getEntityPosition(); - this.maxDistanceToWaypoint = this.entity.getWidth() > 0.75F ? this.entity.getWidth() / 2.0F : 0.75F - this.entity.getWidth() / 2.0F; - Vector3i vector3i = this.currentPath.func_242948_g(); - double d0 = Math.abs(this.entity.getPosX() - ((double)vector3i.getX() + (this.entity.getWidth() + 1) / 2D)); - double d1 = Math.abs(this.entity.getPosY() - (double)vector3i.getY()); - double d2 = Math.abs(this.entity.getPosZ() - ((double)vector3i.getZ() + (this.entity.getWidth() + 1) / 2D)); - boolean flag = d0 < (double)this.maxDistanceToWaypoint && d2 < (double)this.maxDistanceToWaypoint && d1 < 1.0D; - if (flag || this.entity.func_233660_b_(this.currentPath.func_237225_h_().nodeType) && this.func_234112_b_(vector3d)) { - this.currentPath.incrementPathIndex(); - } - - this.checkForStuck(vector3d); - } -} diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index da4af79..e6ab5f2 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -13,4 +13,7 @@ public net.minecraft.entity.LivingEntity func_82166_i()I # getArmSwingAnimationE public net.minecraft.entity.Entity func_213306_e(Lnet/minecraft/util/math/vector/Vector3d;)Lnet/minecraft/util/math/vector/Vector3d; # getAllowedMovement public net.minecraft.pathfinding.GroundPathNavigator func_179692_b(IIIIIILnet/minecraft/util/math/vector/Vector3d;DD)Z # isPositionClear public net.minecraft.pathfinding.PathNavigator field_179695_a # nodeProcessor -public net.minecraft.pathfinding.PathNavigator func_234112_b_(Lnet/minecraft/util/math/vector/Vector3d;)Z #func_234112_b_ \ No newline at end of file +public net.minecraft.pathfinding.PathNavigator func_234112_b_(Lnet/minecraft/util/math/vector/Vector3d;)Z #func_234112_b_ +public-f net.minecraft.world.biome.MobSpawnInfo field_242554_e # spawners +public-f net.minecraft.world.biome.MobSpawnInfo field_242555_f # spawnCosts +public-f net.minecraft.entity.EntityType field_200733_aL # serializable \ No newline at end of file