Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
seymourimadeit committed Aug 16, 2024
1 parent 5878ecc commit 3fa21d5
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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<? extends LivingEntity> 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -17,6 +19,7 @@ public class PiglinAlchemistModel<T extends PiglinAlchemist> 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);
Expand Down Expand Up @@ -56,13 +59,19 @@ 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;
} else {
this.leftArm.xRot = -1.8F;
}
}

this.leftPants.copyFrom(this.leftLeg);
this.rightPants.copyFrom(this.rightLeg);
this.leftSleeve.copyFrom(this.leftArm);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<MapCodec<? extends IGlobalLootModifier>> GLM = DeferredRegister.create(NeoForgeRegistries.Keys.GLOBAL_LOOT_MODIFIER_SERIALIZERS, MODID);
public static final DeferredHolder<MapCodec<? extends IGlobalLootModifier>, MapCodec<BastionLootModifier>> DUNGEON_LOOT = GLM.register("bastion_loot", BastionLootModifier.CODEC);
public static final Supplier<MapCodec<BastionLootModifier>> BASTION_LOOT = GLM.register("bastion_loot", BastionLootModifier.CODEC);

public static final ResourceKey<LootTable> ALCHEMIST_BARTER = lootTable("gameplay/alchemist_bartering");
public static final ResourceKey<LootTable> ALCHEMIST_BARTER_CHEAP = lootTable("gameplay/compat/alchemist_bartering_cheap");
Expand Down

0 comments on commit 3fa21d5

Please sign in to comment.