From 3fa21d5a9235309e4090564599f38b68a94830d1 Mon Sep 17 00:00:00 2001 From: seymourimadeit Date: Fri, 16 Aug 2024 13:41:09 -0700 Subject: [PATCH] fix #28 --- build.gradle | 2 +- gradle.properties | 4 ++-- .../piglinproliferation/PiglinProliferation.java | 13 +++---------- .../piglinproliferation/client/PPClientEvents.java | 1 - .../client/models/PiglinAlchemistModel.java | 9 +++++++++ .../piglinproliferation/common/loot/PPLoot.java | 4 +++- .../bastion_loot.json | 0 7 files changed, 18 insertions(+), 15 deletions(-) rename src/main/resources/data/piglinproliferation/{loot_modifier => loot_modifiers}/bastion_loot.json (100%) diff --git a/build.gradle b/build.gradle index 5c69a28..394b9a8 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ plugins { id 'eclipse' id 'idea' id 'maven-publish' - id 'net.neoforged.gradle.userdev' version '7.0.145' + id 'net.neoforged.gradle.userdev' version '7.0.151' } version = minecraft_version + "-" + mod_version diff --git a/gradle.properties b/gradle.properties index 03f25cd..f438ec7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,7 +15,7 @@ minecraft_version=1.21 # as they do not follow standard versioning conventions. minecraft_version_range=[1.21, 1.22) # The Neo version must agree with the Minecraft version to get a valid artifact -neo_version=21.0.112-beta +neo_version=21.0.167 # The Neo version range can use any version of Neo as bounds or match the loader version range neo_version_range=[20.5.14,) # The loader version range can only use the major version of Neo/FML as bounds @@ -31,7 +31,7 @@ mod_name=Piglin Proliferation # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=MIT for code, CC BY-NC-SA 4.0 for assets # The mod version. See https://semver.org/ -mod_version=2.0.6 +mod_version=2.0.7 # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. # See https://maven.apache.org/guides/mini/guide-naming-conventions.html diff --git a/src/main/java/tallestred/piglinproliferation/PiglinProliferation.java b/src/main/java/tallestred/piglinproliferation/PiglinProliferation.java index ae11004..b631766 100644 --- a/src/main/java/tallestred/piglinproliferation/PiglinProliferation.java +++ b/src/main/java/tallestred/piglinproliferation/PiglinProliferation.java @@ -1,7 +1,5 @@ package tallestred.piglinproliferation; -import net.minecraft.client.renderer.item.CompassItemPropertyFunction; -import net.minecraft.client.renderer.item.ItemProperties; import net.minecraft.core.BlockPos; import net.minecraft.core.Registry; import net.minecraft.core.dispenser.BlockSource; @@ -23,17 +21,14 @@ import net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool; import net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessorList; import net.neoforged.api.distmarker.Dist; -import net.neoforged.api.distmarker.OnlyIn; import net.neoforged.bus.api.IEventBus; import net.neoforged.fml.ModContainer; import net.neoforged.fml.common.Mod; import net.neoforged.fml.config.ModConfig; -import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent; import net.neoforged.fml.event.lifecycle.InterModEnqueueEvent; import net.neoforged.fml.event.lifecycle.InterModProcessEvent; import net.neoforged.neoforge.common.NeoForge; -import net.neoforged.neoforge.common.util.InsertableLinkedOpenCustomHashSet; import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent; import net.neoforged.neoforge.event.entity.EntityAttributeCreationEvent; import net.neoforged.neoforge.event.entity.EntityAttributeModificationEvent; @@ -54,10 +49,8 @@ import tallestred.piglinproliferation.common.entities.PiglinAlchemist; import tallestred.piglinproliferation.common.entities.PiglinTraveler; import tallestred.piglinproliferation.common.entities.ZombifiedPiglinVariant; -import tallestred.piglinproliferation.common.items.BucklerItem; import tallestred.piglinproliferation.common.items.PPItems; import tallestred.piglinproliferation.common.items.component.PPComponents; -import tallestred.piglinproliferation.common.items.component.TravelersCompassTracker; import tallestred.piglinproliferation.common.loot.PPLoot; import tallestred.piglinproliferation.common.recipes.PPRecipeSerializers; import tallestred.piglinproliferation.common.worldgen.PPWorldgen; @@ -111,13 +104,13 @@ private void addAttributes(final EntityAttributeCreationEvent event) { event.put(PPEntityTypes.PIGLIN_ALCHEMIST.get(), PiglinAlchemist.createAttributes().build()); } - private void addCustomAttributes(EntityAttributeModificationEvent event) { + private void addCustomAttributes(final EntityAttributeModificationEvent event) { for (EntityType type : event.getTypes()) event.add(type, PPAttributes.TURNING_SPEED); } - private void addDataMaps(RegisterDataMapTypesEvent event) { - event.register(ZOMBIFIED_PIGLIN_VARIANT_DATA_MAP); + private void addDataMaps(final RegisterDataMapTypesEvent event) { + event.register(ZOMBIFIED_PIGLIN_VARIANT_DATA_MAP); } private void addCreativeTabs(final BuildCreativeModeTabContentsEvent event) { diff --git a/src/main/java/tallestred/piglinproliferation/client/PPClientEvents.java b/src/main/java/tallestred/piglinproliferation/client/PPClientEvents.java index 92eded2..9655431 100644 --- a/src/main/java/tallestred/piglinproliferation/client/PPClientEvents.java +++ b/src/main/java/tallestred/piglinproliferation/client/PPClientEvents.java @@ -31,7 +31,6 @@ public static void onMovementKeyPressed(MovementInputUpdateEvent event) { LocalPlayer player = mc.player; if (player != null && BucklerItem.getChargeTicks(PPItems.checkEachHandForBuckler(player)) > 0) event.getInput().leftImpulse = 0; - } @SubscribeEvent diff --git a/src/main/java/tallestred/piglinproliferation/client/models/PiglinAlchemistModel.java b/src/main/java/tallestred/piglinproliferation/client/models/PiglinAlchemistModel.java index 6017f51..804e32b 100644 --- a/src/main/java/tallestred/piglinproliferation/client/models/PiglinAlchemistModel.java +++ b/src/main/java/tallestred/piglinproliferation/client/models/PiglinAlchemistModel.java @@ -7,7 +7,9 @@ import net.minecraft.client.model.geom.builders.CubeListBuilder; import net.minecraft.client.model.geom.builders.MeshDefinition; import net.minecraft.client.model.geom.builders.PartDefinition; +import net.minecraft.util.Mth; import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.monster.piglin.PiglinArmPose; import net.minecraft.world.item.ArmorItem; import tallestred.piglinproliferation.common.entities.PiglinAlchemist; @@ -17,6 +19,7 @@ public class PiglinAlchemistModel extends PiglinModel public final ModelPart bodyForLeggings; public final ModelPart bodyForChest; public final ModelPart belt; + public final ModelPart leftEar = this.head.getChild("left_ear"); public PiglinAlchemistModel(ModelPart root) { super(root); @@ -56,6 +59,11 @@ public void setupAnim(T pEntity, float pLimbSwing, float pLimbSwingAmount, float this.bodyForLeggings.visible = pEntity.getItemBySlot(EquipmentSlot.LEGS).getItem() instanceof ArmorItem && !(pEntity.getItemBySlot(EquipmentSlot.CHEST).getItem() instanceof ArmorItem); this.bodyForChest.visible = pEntity.getItemBySlot(EquipmentSlot.CHEST).getItem() instanceof ArmorItem; this.belt.visible = !isWearingChestplateOrLeggings; + //PiglinArmPose piglinarmpose = pEntity.getArmPose(); + // if (piglinarmpose == PiglinArmPose.ADMIRING_ITEM) { + // this.rightEar.zRot = 0.95F * (Mth.cos(pAgeInTicks) * 0.2F) + 0.6F; + // this.leftEar.zRot = 0.95F * -(Mth.cos(pAgeInTicks) * 0.2F) - 0.6F; + // } if (pEntity.isGonnaThrowPotion()) { if (pEntity.isLeftHanded()) { this.rightArm.xRot = -1.8F; @@ -63,6 +71,7 @@ public void setupAnim(T pEntity, float pLimbSwing, float pLimbSwingAmount, float this.leftArm.xRot = -1.8F; } } + this.leftPants.copyFrom(this.leftLeg); this.rightPants.copyFrom(this.rightLeg); this.leftSleeve.copyFrom(this.leftArm); diff --git a/src/main/java/tallestred/piglinproliferation/common/loot/PPLoot.java b/src/main/java/tallestred/piglinproliferation/common/loot/PPLoot.java index abfc5ad..6a1a743 100644 --- a/src/main/java/tallestred/piglinproliferation/common/loot/PPLoot.java +++ b/src/main/java/tallestred/piglinproliferation/common/loot/PPLoot.java @@ -13,11 +13,13 @@ import net.neoforged.neoforge.registries.NeoForgeRegistries; import tallestred.piglinproliferation.PiglinProliferation; +import java.util.function.Supplier; + import static tallestred.piglinproliferation.PiglinProliferation.MODID; public class PPLoot { public static final DeferredRegister> GLM = DeferredRegister.create(NeoForgeRegistries.Keys.GLOBAL_LOOT_MODIFIER_SERIALIZERS, MODID); - public static final DeferredHolder, MapCodec> DUNGEON_LOOT = GLM.register("bastion_loot", BastionLootModifier.CODEC); + public static final Supplier> BASTION_LOOT = GLM.register("bastion_loot", BastionLootModifier.CODEC); public static final ResourceKey ALCHEMIST_BARTER = lootTable("gameplay/alchemist_bartering"); public static final ResourceKey ALCHEMIST_BARTER_CHEAP = lootTable("gameplay/compat/alchemist_bartering_cheap"); diff --git a/src/main/resources/data/piglinproliferation/loot_modifier/bastion_loot.json b/src/main/resources/data/piglinproliferation/loot_modifiers/bastion_loot.json similarity index 100% rename from src/main/resources/data/piglinproliferation/loot_modifier/bastion_loot.json rename to src/main/resources/data/piglinproliferation/loot_modifiers/bastion_loot.json