From b5f49c33c559bfe106b92f73e76058dbc51a5279 Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Mon, 8 Apr 2024 21:20:56 +0800 Subject: [PATCH 01/32] Animate Rebuilded --- build.gradle | 6 ++++-- settings.gradle | 3 ++- .../content/client/pose/MetalGolemPose.java | 5 ++++- .../entity/common/AbstractGolemEntity.java | 6 ++++-- .../entity/metalgolem/MetalGolemModel.java | 6 +++--- .../content/item/wand/SquadWandItem.java | 20 +++++++++++++++++-- 6 files changed, 35 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index 5eb0382d5..d2043cceb 100644 --- a/build.gradle +++ b/build.gradle @@ -13,6 +13,9 @@ buildscript { plugins { id 'net.minecraftforge.gradle' version '[6.0,6.2)' } +plugins { + id 'org.parchmentmc.librarian.forgegradle' version '1.+' +} apply plugin: 'maven-publish' apply plugin: 'org.spongepowered.mixin' @@ -27,8 +30,7 @@ if (lljij.toBoolean()) jarJar.enable() java.toolchain.languageVersion = JavaLanguageVersion.of(17) minecraft { - //mappings channel: 'parchment', version: '1.19.3-2023.03.12-1.19.4' - mappings channel: 'official', version: "${minecraft_version}" + mappings channel: 'parchment', version: '2023.06.26-1.20.1' accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') runs { client { diff --git a/settings.gradle b/settings.gradle index dfb0a696f..1007c3f2b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,9 +1,10 @@ pluginManagement { repositories { + maven { url = 'https://maven.parchmentmc.org' } gradlePluginPortal() maven { name="MinecraftForge" - url = 'https://maven.minecraftforge.net/' } + url = 'https://maven.minecraftforge.net/'} } } plugins { diff --git a/src/main/java/dev/xkmc/modulargolems/content/client/pose/MetalGolemPose.java b/src/main/java/dev/xkmc/modulargolems/content/client/pose/MetalGolemPose.java index 008581c21..40900d114 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/client/pose/MetalGolemPose.java +++ b/src/main/java/dev/xkmc/modulargolems/content/client/pose/MetalGolemPose.java @@ -2,6 +2,10 @@ import dev.xkmc.modulargolems.content.entity.metalgolem.MetalGolemEntity; import dev.xkmc.modulargolems.content.entity.metalgolem.MetalGolemModel; +import net.minecraft.client.animation.AnimationChannel; +import net.minecraft.client.animation.AnimationDefinition; +import net.minecraft.client.animation.Keyframe; +import net.minecraft.client.animation.KeyframeAnimations; import net.minecraft.util.Mth; public class MetalGolemPose { @@ -14,7 +18,6 @@ public void attackModel(MetalGolemEntity entity, MetalGolemModel model, float at model.rightForeArm.xRot = 0; model.leftForeArm.xRot = 0; } - public void aggressive(MetalGolemEntity entity, MetalGolemModel model, float walkTick, float speed, float pTick) { walking(entity, model, walkTick, speed, pTick); } diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/common/AbstractGolemEntity.java b/src/main/java/dev/xkmc/modulargolems/content/entity/common/AbstractGolemEntity.java index a7264b147..e3c09c711 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/common/AbstractGolemEntity.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/common/AbstractGolemEntity.java @@ -487,7 +487,7 @@ public void handleEntityEvent(byte event) { private static final EntityDataAccessor DATA_MODE = GOLEM_DATA.define(SyncedData.INT, 0, "follow_mode"); private static final EntityDataAccessor GUARD_POS = GOLEM_DATA.define(SyncedData.BLOCK_POS, BlockPos.ZERO, "guard_pos"); - + private static final EntityDataAccessor SQUAD_POS = GOLEM_DATA.define(SyncedData.BLOCK_POS, BlockPos.ZERO, "cap_pos"); public GolemMode getMode() { return GolemModes.get(this.entityData.get(DATA_MODE)); } @@ -500,7 +500,9 @@ public void setMode(int mode, BlockPos pos) { this.entityData.set(DATA_MODE, mode); this.entityData.set(GUARD_POS, pos); } - + public void setCapDistance(BlockPos pos){ + this.entityData.set(SQUAD_POS,pos); + } public boolean initMode(@Nullable Player player) { var config = getConfigEntry(null); int mode = config == null ? 0 : config.defaultMode; diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index cff397b49..ccd041785 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -1,5 +1,4 @@ package dev.xkmc.modulargolems.content.entity.metalgolem; - import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.math.Axis; @@ -16,7 +15,8 @@ import net.minecraft.world.entity.EquipmentSlot; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; - +import dev.xkmc.modulargolems.content.client.pose.CustomModelAnimation; +import net.minecraft.client.animation.KeyframeAnimations; @OnlyIn(Dist.CLIENT) public class MetalGolemModel extends HierarchicalModel implements IGolemModel, IHeadedModel { @@ -80,7 +80,7 @@ public void prepareMobModel(MetalGolemEntity entity, float bob, float speed, flo if (atkTick > 0) { pose.attackModel(entity, this, atkTick - pTick); } else if (entity.isAggressive()) { - pose.aggressive(entity, this, bob, speed, pTick); + pose.aggressive(entity,this,bob,speed,pTick); } else { pose.walking(entity, this, bob, speed, pTick); } diff --git a/src/main/java/dev/xkmc/modulargolems/content/item/wand/SquadWandItem.java b/src/main/java/dev/xkmc/modulargolems/content/item/wand/SquadWandItem.java index d78210bbe..4ae5c5252 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/item/wand/SquadWandItem.java +++ b/src/main/java/dev/xkmc/modulargolems/content/item/wand/SquadWandItem.java @@ -23,7 +23,7 @@ public class SquadWandItem extends BaseWandItem implements GolemInteractItem, IGlowingTarget { - + private static final String KEY_OWNER = "config_captain"; private static final int RANGE = 64; public SquadWandItem(Properties properties, @Nullable ItemEntry base) { @@ -77,9 +77,25 @@ private static boolean choose(Level level, Player user, AbstractGolemEntity Date: Tue, 16 Apr 2024 22:15:26 +0800 Subject: [PATCH 02/32] Animate Rebuilded --- .../entity/metalgolem/MetalGolemEntity.java | 14 +++++----- .../entity/metalgolem/MetalGolemModel.java | 26 ++++--------------- 2 files changed, 11 insertions(+), 29 deletions(-) diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java index e1a7835e4..ae0a0f53b 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java @@ -16,6 +16,7 @@ import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.damagesource.DamageSource; +import net.minecraft.world.entity.AnimationState; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; @@ -34,6 +35,8 @@ @SerialClass public class MetalGolemEntity extends SweepGolemEntity { + public final AnimationState attackAnimationState = new AnimationState(); + public MetalGolemEntity(EntityType type, Level level) { super(type, level); this.setMaxUpStep(1); @@ -63,7 +66,6 @@ protected void registerGoals() { this.goalSelector.addGoal(2, new GolemMeleeGoal(this)); super.registerGoals(); } - public void aiStep() { super.aiStep(); if (this.attackAnimationTick > 0) { @@ -109,14 +111,10 @@ public IronGolem.Crackiness getCrackiness() { return IronGolem.Crackiness.byFraction(this.getHealth() / this.getMaxHealth()); } - public void handleEntityEvent(byte event) { - if (event == 4) { - this.attackAnimationTick = 10; - this.playSound(SoundEvents.IRON_GOLEM_ATTACK, 1.0F, 1.0F); - } else { - super.handleEntityEvent(event); + public void handleEntityEvent(byte pId) { + if (pId == 4) { + this.attackAnimationState.start(this.tickCount); } - } public int getAttackAnimationTick() { diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index ccd041785..6b0f74722 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -7,6 +7,7 @@ import dev.xkmc.modulargolems.content.client.pose.WeaponPose; import dev.xkmc.modulargolems.content.entity.common.IGolemModel; import dev.xkmc.modulargolems.content.entity.common.IHeadedModel; +import net.minecraft.client.animation.definitions.FrogAnimation; import net.minecraft.client.model.HierarchicalModel; import net.minecraft.client.model.geom.EntityModelSet; import net.minecraft.client.model.geom.ModelPart; @@ -62,28 +63,11 @@ public void copyFrom(MetalGolemModel other) { rightForeArm.copyFrom(other.rightForeArm); } - public void setupAnim(MetalGolemEntity entity, float f1, float f2, float f3, float f4, float f5) { - this.head.yRot = f4 * ((float) Math.PI / 180F); - this.head.xRot = f5 * ((float) Math.PI / 180F); - this.rightLeg.xRot = -1.5F * Mth.triangleWave(f1, 13.0F) * f2; - this.leftLeg.xRot = 1.5F * Mth.triangleWave(f1, 13.0F) * f2; - this.rightLeg.yRot = 0.0F; - this.leftLeg.yRot = 0.0F; - } + public void setupAnim(MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwingAmount, float pAgeInTicks, float pNetHeadYaw, float pHeadPitch) { + this.root().getAllParts().forEach(ModelPart::resetPose); + + this.animate(pEntity.attackAnimationState, CustomModelAnimation.offensive, pAgeInTicks); - public void prepareMobModel(MetalGolemEntity entity, float bob, float speed, float pTick) { - MetalGolemPose pose = MetalGolemPose.DEFAULT; - if (!entity.getMainHandItem().isEmpty()) { - pose = WeaponPose.WEAPON; - } - int atkTick = entity.getAttackAnimationTick(); - if (atkTick > 0) { - pose.attackModel(entity, this, atkTick - pTick); - } else if (entity.isAggressive()) { - pose.aggressive(entity,this,bob,speed,pTick); - } else { - pose.walking(entity, this, bob, speed, pTick); - } } public void renderToBufferInternal(MetalGolemPartType type, PoseStack stack, VertexConsumer consumer, int i, int j, float f1, float f2, float f3, float f4) { From 3cd42e2eaacdf306bf91f79b8923898a202fe83b Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Tue, 16 Apr 2024 22:24:37 +0800 Subject: [PATCH 03/32] Animate Rebuilded --- .../content/entity/metalgolem/MetalGolemEntity.java | 9 ++++++--- .../content/entity/metalgolem/MetalGolemModel.java | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java index ae0a0f53b..ebadb7ccc 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java @@ -35,7 +35,8 @@ @SerialClass public class MetalGolemEntity extends SweepGolemEntity { - public final AnimationState attackAnimationState = new AnimationState(); + public final AnimationState armedAttackAnimationState = new AnimationState(); + public final AnimationState armedStandardAnimationState = new AnimationState(); public MetalGolemEntity(EntityType type, Level level) { super(type, level); @@ -111,9 +112,11 @@ public IronGolem.Crackiness getCrackiness() { return IronGolem.Crackiness.byFraction(this.getHealth() / this.getMaxHealth()); } - public void handleEntityEvent(byte pId) { + public void handleEntityEvent(MetalGolemEntity pEntity,byte pId) { if (pId == 4) { - this.attackAnimationState.start(this.tickCount); + if (!pEntity.getMainHandItem().isEmpty()) { + this.armedStandardAnimationState.start(this.tickCount); + } } } diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index 6b0f74722..016e27c1f 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -65,9 +65,9 @@ public void copyFrom(MetalGolemModel other) { public void setupAnim(MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwingAmount, float pAgeInTicks, float pNetHeadYaw, float pHeadPitch) { this.root().getAllParts().forEach(ModelPart::resetPose); - - this.animate(pEntity.attackAnimationState, CustomModelAnimation.offensive, pAgeInTicks); - + if (!pEntity.getMainHandItem().isEmpty()) { + this.animate(pEntity.armedStandardAnimationState, CustomModelAnimation.standard, pAgeInTicks); + } } public void renderToBufferInternal(MetalGolemPartType type, PoseStack stack, VertexConsumer consumer, int i, int j, float f1, float f2, float f3, float f4) { From ab0a1bfa90f5c9cfcd45160803c53438d80419d3 Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Fri, 19 Apr 2024 14:52:59 +0800 Subject: [PATCH 04/32] Animate Rebuilded --- .../content/entity/metalgolem/MetalGolemEntity.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java index ebadb7ccc..7ad463d07 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java @@ -114,6 +114,7 @@ public IronGolem.Crackiness getCrackiness() { public void handleEntityEvent(MetalGolemEntity pEntity,byte pId) { if (pId == 4) { + this.attackAnimationTick=4; if (!pEntity.getMainHandItem().isEmpty()) { this.armedStandardAnimationState.start(this.tickCount); } From 080c2cfefb920b67acc70cf3dc0eff8a4a0d7b0c Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Fri, 19 Apr 2024 14:58:36 +0800 Subject: [PATCH 05/32] Animate Rebuilded --- .../content/entity/metalgolem/MetalGolemEntity.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java index 7ad463d07..c674f295f 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java @@ -121,10 +121,6 @@ public void handleEntityEvent(MetalGolemEntity pEntity,byte pId) { } } - public int getAttackAnimationTick() { - return this.attackAnimationTick; - } - protected SoundEvent getHurtSound(DamageSource p_28872_) { return SoundEvents.IRON_GOLEM_HURT; } From b1d8c5f15e9e7e7bddd58897cead2247b60fd6f9 Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Mon, 22 Apr 2024 22:15:31 +0800 Subject: [PATCH 06/32] Animate Rebuilded --- .../client/pose/CustomModelAnimation.java | 37 +++++++++++++++++++ .../entity/metalgolem/MetalGolemEntity.java | 9 +++-- .../entity/metalgolem/MetalGolemModel.java | 1 + 3 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java diff --git a/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java b/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java new file mode 100644 index 000000000..d616a6300 --- /dev/null +++ b/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java @@ -0,0 +1,37 @@ +package dev.xkmc.modulargolems.content.client.pose;// Save this class in your mod and generate all required imports + +import net.minecraft.client.animation.AnimationChannel; +import net.minecraft.client.animation.AnimationDefinition; +import net.minecraft.client.animation.Keyframe; +import net.minecraft.client.animation.KeyframeAnimations; + +/** + * Made with Blockbench 4.9.4 + * Exported for Minecraft version 1.19 or later with Mojang mappings + * @author Author + */ +public class CustomModelAnimation { + public static final AnimationDefinition standard = AnimationDefinition.Builder.withLength(1.0F) + .addAnimation("rightArm", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.0833F, KeyframeAnimations.degreeVec(-110.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + )) + .addAnimation("rightForeArm", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(-2160.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.5F, KeyframeAnimations.degreeVec(-75.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + )) + .build(); + + public static final AnimationDefinition offensive = AnimationDefinition.Builder.withLength(1.25F) + .addAnimation("rightArm", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(-110.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.25F, KeyframeAnimations.degreeVec(-32.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.5F, KeyframeAnimations.degreeVec(-110.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + )) + .addAnimation("rightForeArm", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(-75.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.25F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.5F, KeyframeAnimations.degreeVec(-75.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + )) + .build(); +} \ No newline at end of file diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java index c674f295f..d84bbfc02 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java @@ -112,12 +112,13 @@ public IronGolem.Crackiness getCrackiness() { return IronGolem.Crackiness.byFraction(this.getHealth() / this.getMaxHealth()); } - public void handleEntityEvent(MetalGolemEntity pEntity,byte pId) { + public void handleEntityEvent(byte pId) { if (pId == 4) { this.attackAnimationTick=4; - if (!pEntity.getMainHandItem().isEmpty()) { - this.armedStandardAnimationState.start(this.tickCount); - } + this.armedAttackAnimationState.start(this.tickCount); + this.playSound(SoundEvents.IRON_GOLEM_ATTACK, 1.0F, 1.0F); + }else{ + super.handleEntityEvent(pId); } } diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index 016e27c1f..266074803 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -67,6 +67,7 @@ public void setupAnim(MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwi this.root().getAllParts().forEach(ModelPart::resetPose); if (!pEntity.getMainHandItem().isEmpty()) { this.animate(pEntity.armedStandardAnimationState, CustomModelAnimation.standard, pAgeInTicks); + this.animate(pEntity.armedAttackAnimationState, CustomModelAnimation.offensive, pAgeInTicks); } } From a80237cf58d5fc81dd5e2e7eb7141a918f6b6d54 Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Thu, 9 May 2024 23:31:25 +0800 Subject: [PATCH 07/32] Animate Rebuilded --- .../content/entity/metalgolem/MetalGolemModel.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index 266074803..4a7eeded0 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -69,6 +69,12 @@ public void setupAnim(MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwi this.animate(pEntity.armedStandardAnimationState, CustomModelAnimation.standard, pAgeInTicks); this.animate(pEntity.armedAttackAnimationState, CustomModelAnimation.offensive, pAgeInTicks); } + this.head.yRot = pNetHeadYaw * ((float) Math.PI / 180F); + this.head.xRot = pHeadPitch * ((float) Math.PI / 180F); + this.rightLeg.xRot = -1.5F * Mth.triangleWave(pLimbSwing, 13.0F) * pLimbSwingAmount; + this.leftLeg.xRot = 1.5F * Mth.triangleWave(pLimbSwing, 13.0F) * pLimbSwingAmount; + this.rightLeg.yRot = 0.0F; + this.leftLeg.yRot = 0.0F; } public void renderToBufferInternal(MetalGolemPartType type, PoseStack stack, VertexConsumer consumer, int i, int j, float f1, float f2, float f3, float f4) { From 0a8ef45a199f23f4ef2b77de0962175055bf0137 Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Fri, 10 May 2024 17:44:14 +0800 Subject: [PATCH 08/32] Animate Rebuilded --- .../content/entity/metalgolem/MetalGolemModel.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index 4a7eeded0..d0d4b8c64 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -3,11 +3,8 @@ import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.math.Axis; import dev.xkmc.modulargolems.content.client.armor.GolemEquipmentModels; -import dev.xkmc.modulargolems.content.client.pose.MetalGolemPose; -import dev.xkmc.modulargolems.content.client.pose.WeaponPose; import dev.xkmc.modulargolems.content.entity.common.IGolemModel; import dev.xkmc.modulargolems.content.entity.common.IHeadedModel; -import net.minecraft.client.animation.definitions.FrogAnimation; import net.minecraft.client.model.HierarchicalModel; import net.minecraft.client.model.geom.EntityModelSet; import net.minecraft.client.model.geom.ModelPart; @@ -17,7 +14,6 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import dev.xkmc.modulargolems.content.client.pose.CustomModelAnimation; -import net.minecraft.client.animation.KeyframeAnimations; @OnlyIn(Dist.CLIENT) public class MetalGolemModel extends HierarchicalModel implements IGolemModel, IHeadedModel { From 3186bbc69abd21cba7947cb68dc8e4ed5dd2ef40 Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Fri, 10 May 2024 19:31:05 +0800 Subject: [PATCH 09/32] Animate Rebuilded --- .../entity/metalgolem/MetalGolemModel.java | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index d0d4b8c64..80c44d1f1 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -65,14 +65,27 @@ public void setupAnim(MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwi this.animate(pEntity.armedStandardAnimationState, CustomModelAnimation.standard, pAgeInTicks); this.animate(pEntity.armedAttackAnimationState, CustomModelAnimation.offensive, pAgeInTicks); } - this.head.yRot = pNetHeadYaw * ((float) Math.PI / 180F); - this.head.xRot = pHeadPitch * ((float) Math.PI / 180F); - this.rightLeg.xRot = -1.5F * Mth.triangleWave(pLimbSwing, 13.0F) * pLimbSwingAmount; - this.leftLeg.xRot = 1.5F * Mth.triangleWave(pLimbSwing, 13.0F) * pLimbSwingAmount; - this.rightLeg.yRot = 0.0F; - this.leftLeg.yRot = 0.0F; - } + } + private void animateWalk(float pNetHeadYaw, float pHeadPitch,float pLimbSwing,float pLimbSwingAmount) { + this.head.yRot = pNetHeadYaw * ((float) Math.PI / 180F); + this.head.xRot = pHeadPitch * ((float) Math.PI / 180F); + this.rightLeg.xRot = -1.5F * Mth.triangleWave(pLimbSwing, 13.0F) * pLimbSwingAmount; + this.leftLeg.xRot = 1.5F * Mth.triangleWave(pLimbSwing, 13.0F) * pLimbSwingAmount; + this.rightLeg.yRot = 0.0F; + this.leftLeg.yRot = 0.0F; + this.resetArmPoses(); + } + private void resetArmPoses() { + this.leftArm.yRot = 0.0F; + this.leftArm.z = 1.0F; + this.leftArm.x = 13.0F; + this.leftArm.y = -13.0F; + this.rightArm.yRot = 0.0F; + this.rightArm.z = 1.0F; + this.rightArm.x = -13.0F; + this.rightArm.y = -13.0F; + } public void renderToBufferInternal(MetalGolemPartType type, PoseStack stack, VertexConsumer consumer, int i, int j, float f1, float f2, float f3, float f4) { if (type == MetalGolemPartType.BODY) { this.body.render(stack, consumer, i, j, f1, f2, f3, f4); From d9ff501d39b467f3bb4e0c630122c5de907646be Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Fri, 10 May 2024 19:33:28 +0800 Subject: [PATCH 10/32] Animate Rebuilded --- .../content/entity/metalgolem/MetalGolemModel.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index 80c44d1f1..a3c598952 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -74,6 +74,10 @@ private void animateWalk(float pNetHeadYaw, float pHeadPitch,float pLimbSwing,fl this.leftLeg.xRot = 1.5F * Mth.triangleWave(pLimbSwing, 13.0F) * pLimbSwingAmount; this.rightLeg.yRot = 0.0F; this.leftLeg.yRot = 0.0F; + this.rightArm.xRot = (-0.2F + 1.5F * Mth.triangleWave(walkTick, 13.0F)) * speed; + this.leftArm.xRot = (-0.2F - 1.5F * Mth.triangleWave(walkTick, 13.0F)) * speed; + this.rightForeArm.xRot = 0; + this.leftForeArm.xRot = 0; this.resetArmPoses(); } private void resetArmPoses() { From 2ffd6d1969b6c656b2e166429e7d8a375407d6af Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Fri, 10 May 2024 19:46:28 +0800 Subject: [PATCH 11/32] Animate Rebuilded --- .../entity/metalgolem/MetalGolemModel.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index a3c598952..bdb1dcc64 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -65,7 +65,7 @@ public void setupAnim(MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwi this.animate(pEntity.armedStandardAnimationState, CustomModelAnimation.standard, pAgeInTicks); this.animate(pEntity.armedAttackAnimationState, CustomModelAnimation.offensive, pAgeInTicks); } - + this.animateWalk(pNetHeadYaw,pHeadPitch,pLimbSwing,pLimbSwingAmount); } private void animateWalk(float pNetHeadYaw, float pHeadPitch,float pLimbSwing,float pLimbSwingAmount) { this.head.yRot = pNetHeadYaw * ((float) Math.PI / 180F); @@ -74,21 +74,21 @@ private void animateWalk(float pNetHeadYaw, float pHeadPitch,float pLimbSwing,fl this.leftLeg.xRot = 1.5F * Mth.triangleWave(pLimbSwing, 13.0F) * pLimbSwingAmount; this.rightLeg.yRot = 0.0F; this.leftLeg.yRot = 0.0F; - this.rightArm.xRot = (-0.2F + 1.5F * Mth.triangleWave(walkTick, 13.0F)) * speed; - this.leftArm.xRot = (-0.2F - 1.5F * Mth.triangleWave(walkTick, 13.0F)) * speed; + this.rightArm.xRot = (-0.2F + 1.5F * Mth.triangleWave(pLimbSwing, 13.0F)) * pLimbSwingAmount; + this.leftArm.xRot = (-0.2F - 1.5F * Mth.triangleWave(pLimbSwing, 13.0F)) * pLimbSwingAmount; this.rightForeArm.xRot = 0; this.leftForeArm.xRot = 0; this.resetArmPoses(); } private void resetArmPoses() { this.leftArm.yRot = 0.0F; - this.leftArm.z = 1.0F; - this.leftArm.x = 13.0F; - this.leftArm.y = -13.0F; + this.leftArm.z = 0.0F; + this.leftArm.x = 0.0F; + this.leftArm.y = -0.0F; this.rightArm.yRot = 0.0F; - this.rightArm.z = 1.0F; - this.rightArm.x = -13.0F; - this.rightArm.y = -13.0F; + this.rightArm.z = 0.0F; + this.rightArm.x = -0.0F; + this.rightArm.y = -0.0F; } public void renderToBufferInternal(MetalGolemPartType type, PoseStack stack, VertexConsumer consumer, int i, int j, float f1, float f2, float f3, float f4) { if (type == MetalGolemPartType.BODY) { From bdea4c36a4d7e2d7978f66df7e435f6a31fe6fa6 Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Fri, 10 May 2024 21:47:08 +0800 Subject: [PATCH 12/32] Animate Rebuilded --- .../content/entity/metalgolem/MetalGolemModel.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index bdb1dcc64..07c7854ce 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -61,11 +61,10 @@ public void copyFrom(MetalGolemModel other) { public void setupAnim(MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwingAmount, float pAgeInTicks, float pNetHeadYaw, float pHeadPitch) { this.root().getAllParts().forEach(ModelPart::resetPose); + this.animateWalk(pNetHeadYaw,pHeadPitch,pLimbSwing,pLimbSwingAmount); if (!pEntity.getMainHandItem().isEmpty()) { - this.animate(pEntity.armedStandardAnimationState, CustomModelAnimation.standard, pAgeInTicks); this.animate(pEntity.armedAttackAnimationState, CustomModelAnimation.offensive, pAgeInTicks); } - this.animateWalk(pNetHeadYaw,pHeadPitch,pLimbSwing,pLimbSwingAmount); } private void animateWalk(float pNetHeadYaw, float pHeadPitch,float pLimbSwing,float pLimbSwingAmount) { this.head.yRot = pNetHeadYaw * ((float) Math.PI / 180F); @@ -84,11 +83,11 @@ private void resetArmPoses() { this.leftArm.yRot = 0.0F; this.leftArm.z = 0.0F; this.leftArm.x = 0.0F; - this.leftArm.y = -0.0F; + this.leftArm.y = -7.0F; this.rightArm.yRot = 0.0F; this.rightArm.z = 0.0F; this.rightArm.x = -0.0F; - this.rightArm.y = -0.0F; + this.rightArm.y = -7.0F; } public void renderToBufferInternal(MetalGolemPartType type, PoseStack stack, VertexConsumer consumer, int i, int j, float f1, float f2, float f3, float f4) { if (type == MetalGolemPartType.BODY) { From 54f55b35dae6db9dafcba10a6a1c480cb90a9df3 Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Fri, 10 May 2024 21:57:38 +0800 Subject: [PATCH 13/32] Animate Rebuilded --- .../content/client/pose/MetalGolemPose.java | 31 ------------------- .../content/client/pose/WeaponPose.java | 31 ------------------- .../entity/metalgolem/MetalGolemModel.java | 8 +++-- 3 files changed, 6 insertions(+), 64 deletions(-) delete mode 100644 src/main/java/dev/xkmc/modulargolems/content/client/pose/MetalGolemPose.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/content/client/pose/WeaponPose.java diff --git a/src/main/java/dev/xkmc/modulargolems/content/client/pose/MetalGolemPose.java b/src/main/java/dev/xkmc/modulargolems/content/client/pose/MetalGolemPose.java deleted file mode 100644 index 40900d114..000000000 --- a/src/main/java/dev/xkmc/modulargolems/content/client/pose/MetalGolemPose.java +++ /dev/null @@ -1,31 +0,0 @@ -package dev.xkmc.modulargolems.content.client.pose; - -import dev.xkmc.modulargolems.content.entity.metalgolem.MetalGolemEntity; -import dev.xkmc.modulargolems.content.entity.metalgolem.MetalGolemModel; -import net.minecraft.client.animation.AnimationChannel; -import net.minecraft.client.animation.AnimationDefinition; -import net.minecraft.client.animation.Keyframe; -import net.minecraft.client.animation.KeyframeAnimations; -import net.minecraft.util.Mth; - -public class MetalGolemPose { - - public static final MetalGolemPose DEFAULT = new MetalGolemPose(); - - public void attackModel(MetalGolemEntity entity, MetalGolemModel model, float atkTick) { - model.rightArm.xRot = -2.0F + 1.5F * Mth.triangleWave(atkTick, 10.0F); - model.leftArm.xRot = -2.0F + 1.5F * Mth.triangleWave(atkTick, 10.0F); - model.rightForeArm.xRot = 0; - model.leftForeArm.xRot = 0; - } - public void aggressive(MetalGolemEntity entity, MetalGolemModel model, float walkTick, float speed, float pTick) { - walking(entity, model, walkTick, speed, pTick); - } - - public void walking(MetalGolemEntity entity, MetalGolemModel model, float walkTick, float speed, float pTick) { - model.rightArm.xRot = (-0.2F + 1.5F * Mth.triangleWave(walkTick, 13.0F)) * speed; - model.leftArm.xRot = (-0.2F - 1.5F * Mth.triangleWave(walkTick, 13.0F)) * speed; - model.rightForeArm.xRot = 0; - model.leftForeArm.xRot = 0; - } -} diff --git a/src/main/java/dev/xkmc/modulargolems/content/client/pose/WeaponPose.java b/src/main/java/dev/xkmc/modulargolems/content/client/pose/WeaponPose.java deleted file mode 100644 index d9013dbf2..000000000 --- a/src/main/java/dev/xkmc/modulargolems/content/client/pose/WeaponPose.java +++ /dev/null @@ -1,31 +0,0 @@ -package dev.xkmc.modulargolems.content.client.pose; - -import dev.xkmc.modulargolems.content.entity.metalgolem.MetalGolemEntity; -import dev.xkmc.modulargolems.content.entity.metalgolem.MetalGolemModel; -import net.minecraft.client.model.AnimationUtils; - -public class WeaponPose extends MetalGolemPose { - - public static final MetalGolemPose WEAPON = new WeaponPose(); - - @Override - public void attackModel(MetalGolemEntity entity, MetalGolemModel model, float atkTick) { - AnimationUtils.swingWeaponDown(model.rightArm, model.leftArm, entity, model.attackTime, atkTick); - model.leftArm.xRot = 0; - model.rightForeArm.xRot = 0; - model.leftForeArm.xRot = 0; - } - - @Override - public void aggressive(MetalGolemEntity entity, MetalGolemModel model, float walkTick, float speed, float pTick) { - model.rightArm.xRot = -1.8f; - model.leftArm.xRot = 0; - model.rightForeArm.xRot = 0; - model.leftForeArm.xRot = 0; - } - - public void walking(MetalGolemEntity entity, MetalGolemModel model, float walkTick, float speed, float pTick) { - super.walking(entity, model, walkTick, speed, pTick); - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index 07c7854ce..de4368b69 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -61,9 +61,13 @@ public void copyFrom(MetalGolemModel other) { public void setupAnim(MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwingAmount, float pAgeInTicks, float pNetHeadYaw, float pHeadPitch) { this.root().getAllParts().forEach(ModelPart::resetPose); - this.animateWalk(pNetHeadYaw,pHeadPitch,pLimbSwing,pLimbSwingAmount); if (!pEntity.getMainHandItem().isEmpty()) { - this.animate(pEntity.armedAttackAnimationState, CustomModelAnimation.offensive, pAgeInTicks); + int atkTick = pEntity.getAttackAnimationTick(); + if (atkTick > 0) { + this.animate(pEntity.armedAttackAnimationState, CustomModelAnimation.offensive, pAgeInTicks); + } else { + this.animateWalk(pNetHeadYaw,pHeadPitch,pLimbSwing,pLimbSwingAmount); + } } } private void animateWalk(float pNetHeadYaw, float pHeadPitch,float pLimbSwing,float pLimbSwingAmount) { From 5dd1945714f299eca35185727c5ce83d52919bee Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Fri, 10 May 2024 22:35:18 +0800 Subject: [PATCH 14/32] Animate Rebuilded --- .../content/client/pose/CustomModelAnimation.java | 8 ++++---- .../content/entity/metalgolem/MetalGolemEntity.java | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java b/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java index d616a6300..d6533bd7a 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java +++ b/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java @@ -12,23 +12,23 @@ */ public class CustomModelAnimation { public static final AnimationDefinition standard = AnimationDefinition.Builder.withLength(1.0F) - .addAnimation("rightArm", new AnimationChannel(AnimationChannel.Targets.ROTATION, + .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), new Keyframe(0.0833F, KeyframeAnimations.degreeVec(-110.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) )) - .addAnimation("rightForeArm", new AnimationChannel(AnimationChannel.Targets.ROTATION, + .addAnimation("right_forearm", new AnimationChannel(AnimationChannel.Targets.ROTATION, new Keyframe(0.0F, KeyframeAnimations.degreeVec(-2160.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), new Keyframe(0.5F, KeyframeAnimations.degreeVec(-75.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) )) .build(); public static final AnimationDefinition offensive = AnimationDefinition.Builder.withLength(1.25F) - .addAnimation("rightArm", new AnimationChannel(AnimationChannel.Targets.ROTATION, + .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, new Keyframe(0.0F, KeyframeAnimations.degreeVec(-110.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), new Keyframe(0.25F, KeyframeAnimations.degreeVec(-32.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), new Keyframe(0.5F, KeyframeAnimations.degreeVec(-110.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) )) - .addAnimation("rightForeArm", new AnimationChannel(AnimationChannel.Targets.ROTATION, + .addAnimation("right_forearm", new AnimationChannel(AnimationChannel.Targets.ROTATION, new Keyframe(0.0F, KeyframeAnimations.degreeVec(-75.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), new Keyframe(0.25F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), new Keyframe(0.5F, KeyframeAnimations.degreeVec(-75.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java index d84bbfc02..83cf1599d 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java @@ -107,7 +107,9 @@ public boolean hurt(DamageSource source, float amount) { } return flag; } - + public int getAttackAnimationTick() { + return this.attackAnimationTick; + } public IronGolem.Crackiness getCrackiness() { return IronGolem.Crackiness.byFraction(this.getHealth() / this.getMaxHealth()); } From 601d87d1ce658b4ef6c4a780ffe8edf8b9033c26 Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Sat, 11 May 2024 23:13:07 +0800 Subject: [PATCH 15/32] Animate Rebuilded --- .../client/pose/CustomModelAnimation.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java b/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java index d6533bd7a..6c8d739fd 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java +++ b/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java @@ -34,4 +34,28 @@ public class CustomModelAnimation { new Keyframe(0.5F, KeyframeAnimations.degreeVec(-75.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) )) .build(); + public static final AnimationDefinition attackInSpear = AnimationDefinition.Builder.withLength(0.9583F) + .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(85.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.25F, KeyframeAnimations.degreeVec(-57.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.5F, KeyframeAnimations.degreeVec(85.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + )) + .addAnimation("right_forearm", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.25F, KeyframeAnimations.degreeVec(87.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.5F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + )) + .addAnimation("weapon", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.25F, KeyframeAnimations.degreeVec(47.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.5F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + )) + .build(); + + public static final AnimationDefinition WarningInSpear = AnimationDefinition.Builder.withLength(0.7083F) + .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.2083F, KeyframeAnimations.degreeVec(85.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + )) + .build(); } \ No newline at end of file From c2c00500edb9062cb3c0e2db60417b22a2ad103c Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Sat, 11 May 2024 23:28:49 +0800 Subject: [PATCH 16/32] Animate Rebuilded --- .../content/client/pose/CustomModelAnimation.java | 5 +++-- .../content/entity/metalgolem/MetalGolemModel.java | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java b/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java index 6c8d739fd..b5043e207 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java +++ b/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java @@ -11,7 +11,7 @@ * @author Author */ public class CustomModelAnimation { - public static final AnimationDefinition standard = AnimationDefinition.Builder.withLength(1.0F) + public static final AnimationDefinition warningInSpear = AnimationDefinition.Builder.withLength(1.0F) .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), new Keyframe(0.0833F, KeyframeAnimations.degreeVec(-110.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) @@ -22,7 +22,8 @@ public class CustomModelAnimation { )) .build(); - public static final AnimationDefinition offensive = AnimationDefinition.Builder.withLength(1.25F) + + public static final AnimationDefinition attackInAxe = AnimationDefinition.Builder.withLength(1.25F) .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, new Keyframe(0.0F, KeyframeAnimations.degreeVec(-110.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), new Keyframe(0.25F, KeyframeAnimations.degreeVec(-32.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index de4368b69..b00fb3812 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -61,10 +61,11 @@ public void copyFrom(MetalGolemModel other) { public void setupAnim(MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwingAmount, float pAgeInTicks, float pNetHeadYaw, float pHeadPitch) { this.root().getAllParts().forEach(ModelPart::resetPose); + int atkTick = pEntity.getAttackAnimationTick(); if (!pEntity.getMainHandItem().isEmpty()) { - int atkTick = pEntity.getAttackAnimationTick(); + if (atkTick > 0) { - this.animate(pEntity.armedAttackAnimationState, CustomModelAnimation.offensive, pAgeInTicks); + this.animate(pEntity.armedAttackAnimationState, CustomModelAnimation.attackInAxe, pAgeInTicks); } else { this.animateWalk(pNetHeadYaw,pHeadPitch,pLimbSwing,pLimbSwingAmount); } From 60445cfa0c3898f8a7d99526c1c78db96d82a01b Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Sun, 12 May 2024 19:04:07 +0800 Subject: [PATCH 17/32] Animate Rebuilded --- .../entity/metalgolem/MetalGolemModel.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index b00fb3812..7f623b63e 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -5,12 +5,14 @@ import dev.xkmc.modulargolems.content.client.armor.GolemEquipmentModels; import dev.xkmc.modulargolems.content.entity.common.IGolemModel; import dev.xkmc.modulargolems.content.entity.common.IHeadedModel; +import dev.xkmc.modulargolems.init.material.GolemWeaponType; import net.minecraft.client.model.HierarchicalModel; import net.minecraft.client.model.geom.EntityModelSet; import net.minecraft.client.model.geom.ModelPart; import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.item.Item; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import dev.xkmc.modulargolems.content.client.pose.CustomModelAnimation; @@ -58,16 +60,20 @@ public void copyFrom(MetalGolemModel other) { leftForeArm.copyFrom(other.leftForeArm); rightForeArm.copyFrom(other.rightForeArm); } - - public void setupAnim(MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwingAmount, float pAgeInTicks, float pNetHeadYaw, float pHeadPitch) { + public void setupAnim(GolemWeaponType gwt,MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwingAmount, float pAgeInTicks, + float pNetHeadYaw, float pHeadPitch) { this.root().getAllParts().forEach(ModelPart::resetPose); int atkTick = pEntity.getAttackAnimationTick(); if (!pEntity.getMainHandItem().isEmpty()) { + switch (gwt) { + case AXE: + if (atkTick > 0) { + this.animate(pEntity.armedAttackAnimationState, CustomModelAnimation.attackInAxe, pAgeInTicks); + } else if () { - if (atkTick > 0) { - this.animate(pEntity.armedAttackAnimationState, CustomModelAnimation.attackInAxe, pAgeInTicks); } else { - this.animateWalk(pNetHeadYaw,pHeadPitch,pLimbSwing,pLimbSwingAmount); + this.animateWalk(pNetHeadYaw, pHeadPitch, pLimbSwing, pLimbSwingAmount); + } } } } From 971ce50ca7e9f183d7956508debe454ea86fca77 Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Tue, 14 May 2024 23:43:29 +0800 Subject: [PATCH 18/32] Animate Rebuilded --- .../entity/metalgolem/MetalGolemModel.java | 14 ++++++++------ .../item/equipments/MetalGolemWeaponItem.java | 8 ++++---- .../init/material/GolemWeaponType.java | 18 +++++++++--------- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index 7f623b63e..1235fdd3a 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -5,6 +5,7 @@ import dev.xkmc.modulargolems.content.client.armor.GolemEquipmentModels; import dev.xkmc.modulargolems.content.entity.common.IGolemModel; import dev.xkmc.modulargolems.content.entity.common.IHeadedModel; +import dev.xkmc.modulargolems.content.item.equipments.MetalGolemWeaponItem; import dev.xkmc.modulargolems.init.material.GolemWeaponType; import net.minecraft.client.model.HierarchicalModel; import net.minecraft.client.model.geom.EntityModelSet; @@ -13,6 +14,7 @@ import net.minecraft.util.Mth; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import dev.xkmc.modulargolems.content.client.pose.CustomModelAnimation; @@ -60,22 +62,22 @@ public void copyFrom(MetalGolemModel other) { leftForeArm.copyFrom(other.leftForeArm); rightForeArm.copyFrom(other.rightForeArm); } - public void setupAnim(GolemWeaponType gwt,MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwingAmount, float pAgeInTicks, - float pNetHeadYaw, float pHeadPitch) { + public void setupAnim(MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwingAmount, float pAgeInTicks, float pNetHeadYaw, float pHeadPitch) { this.root().getAllParts().forEach(ModelPart::resetPose); int atkTick = pEntity.getAttackAnimationTick(); - if (!pEntity.getMainHandItem().isEmpty()) { - switch (gwt) { + ItemStack it =pEntity.getMainHandItem(); + if(it.getItem() instanceof MetalGolemWeaponItem wi){ + switch () { case AXE: if (atkTick > 0) { this.animate(pEntity.armedAttackAnimationState, CustomModelAnimation.attackInAxe, pAgeInTicks); - } else if () { + } else if (pEntity.isAggressive()) { } else { this.animateWalk(pNetHeadYaw, pHeadPitch, pLimbSwing, pLimbSwingAmount); } } - } + } } private void animateWalk(float pNetHeadYaw, float pHeadPitch,float pLimbSwing,float pLimbSwingAmount) { this.head.yRot = pNetHeadYaw * ((float) Math.PI / 180F); diff --git a/src/main/java/dev/xkmc/modulargolems/content/item/equipments/MetalGolemWeaponItem.java b/src/main/java/dev/xkmc/modulargolems/content/item/equipments/MetalGolemWeaponItem.java index fac7f024c..39b293ea9 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/item/equipments/MetalGolemWeaponItem.java +++ b/src/main/java/dev/xkmc/modulargolems/content/item/equipments/MetalGolemWeaponItem.java @@ -1,5 +1,6 @@ package dev.xkmc.modulargolems.content.item.equipments; +import dev.xkmc.modulargolems.init.material.GolemWeaponType; import dev.xkmc.modulargolems.init.registrate.GolemTypes; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.ai.attributes.AttributeModifier; @@ -11,7 +12,7 @@ public class MetalGolemWeaponItem extends GolemEquipmentItem { - public MetalGolemWeaponItem(Properties properties, int attackDamage, double percentAttack, float range, float sweep) { + public MetalGolemWeaponItem(Properties properties, int attackDamage, double percentAttack, float range, float sweep,GolemWeaponType gwt) { super(properties, EquipmentSlot.MAINHAND, GolemTypes.ENTITY_GOLEM::get, builder -> { var uuid = UUID.get(EquipmentSlot.MAINHAND); if (attackDamage > 0) { @@ -28,17 +29,14 @@ public MetalGolemWeaponItem(Properties properties, int attackDamage, double perc } }); } - @Override public boolean isEnchantable(ItemStack stack) { return true; } - @Override public int getEnchantmentValue() { return 15; } - @Override public boolean canApplyAtEnchantingTable(ItemStack stack, Enchantment enchantment) { if (enchantment.category == EnchantmentCategory.WEAPON) { @@ -46,5 +44,7 @@ public boolean canApplyAtEnchantingTable(ItemStack stack, Enchantment enchantmen } return super.canApplyAtEnchantingTable(stack, enchantment); } + public GolemWeaponType getGolemWeaponType(MetalGolemWeaponItem i) { + } } diff --git a/src/main/java/dev/xkmc/modulargolems/init/material/GolemWeaponType.java b/src/main/java/dev/xkmc/modulargolems/init/material/GolemWeaponType.java index c6fadd60f..54bf08bed 100644 --- a/src/main/java/dev/xkmc/modulargolems/init/material/GolemWeaponType.java +++ b/src/main/java/dev/xkmc/modulargolems/init/material/GolemWeaponType.java @@ -10,20 +10,21 @@ import java.util.function.BiFunction; import static dev.xkmc.modulargolems.init.ModularGolems.REGISTRATE; - +interface MGFunction{ + MetalGolemWeaponItem create(Item.Properties properties, int rank, GolemWeaponType type); +} public enum GolemWeaponType { - SPEAR("item/long_weapon", (p, i) -> new MetalGolemWeaponItem(p, i, 0, 2, 0), "TII", " SI", "S T"), + SPEAR("item/long_weapon", (p, i) -> new MetalGolemWeaponItem(p, i, 0, 2, 0,), "TII", " SI", "S T"), AXE("item/battle_axe", (p, i) -> new MetalGolemWeaponItem(p, 0, i * 0.05, 0, 2), "III", "IS ", "TST"), - SWORD("item/sword", (p, i) -> new MetalGolemWeaponItem(p, i, 0, 1, 2), "TII", "ISI", "SIT"), - ; + SWORD("item/sword", (p, i) -> new MetalGolemWeaponItem(p, i, 0, 1, 2), "TII", "ISI", "SIT"),; - private final BiFunction factory; + private final MGFunction function; private final String[] pattern; private final String model; - GolemWeaponType(String model, BiFunction factory, String... pattern) { + GolemWeaponType(String model, MGFunction function, String... pattern) { this.model = model; - this.factory = factory; + this.function = function; this.pattern = pattern; } @@ -32,7 +33,7 @@ public String getName() { } public ItemEntry buildItem(IGolemWeaponMaterial material) { - return REGISTRATE.item(material.getName() + "_" + getName(), p -> factory.apply(material.modify(p.stacksTo(1)), material.getDamage())) + return REGISTRATE.item(material.getName() + "_" + getName(), p -> function.create(material.modify(p.stacksTo(1)), material.getDamage(),this)) .model((ctx, pvd) -> pvd.getBuilder(ctx.getName()).parent(new ModelFile.UncheckedModelFile(pvd.modLoc(model))) .texture("layer0", pvd.modLoc("item/equipments/" + ctx.getName()))) .defaultLang().register(); @@ -56,5 +57,4 @@ public ShapedRecipeBuilder pattern(ShapedRecipeBuilder unlock) { } return unlock; } - } From 4c5eafd163d26c037bcba64b0a153f4b82853a72 Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Wed, 15 May 2024 18:28:50 +0800 Subject: [PATCH 19/32] Animate Rebuilded --- .../content/entity/metalgolem/MetalGolemModel.java | 6 +++--- .../content/item/equipments/MetalGolemWeaponItem.java | 8 +++++--- .../xkmc/modulargolems/init/material/GolemWeaponType.java | 7 +++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index 1235fdd3a..d7aa7e561 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -65,9 +65,9 @@ public void copyFrom(MetalGolemModel other) { public void setupAnim(MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwingAmount, float pAgeInTicks, float pNetHeadYaw, float pHeadPitch) { this.root().getAllParts().forEach(ModelPart::resetPose); int atkTick = pEntity.getAttackAnimationTick(); - ItemStack it =pEntity.getMainHandItem(); - if(it.getItem() instanceof MetalGolemWeaponItem wi){ - switch () { + Item its =pEntity.getMainHandItem().getItem(); + if(its instanceof MetalGolemWeaponItem wi){ + switch (wi.getGolemWeaponType(wi)) { case AXE: if (atkTick > 0) { this.animate(pEntity.armedAttackAnimationState, CustomModelAnimation.attackInAxe, pAgeInTicks); diff --git a/src/main/java/dev/xkmc/modulargolems/content/item/equipments/MetalGolemWeaponItem.java b/src/main/java/dev/xkmc/modulargolems/content/item/equipments/MetalGolemWeaponItem.java index 39b293ea9..9e671a733 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/item/equipments/MetalGolemWeaponItem.java +++ b/src/main/java/dev/xkmc/modulargolems/content/item/equipments/MetalGolemWeaponItem.java @@ -11,8 +11,8 @@ import net.minecraftforge.common.ForgeMod; public class MetalGolemWeaponItem extends GolemEquipmentItem { - - public MetalGolemWeaponItem(Properties properties, int attackDamage, double percentAttack, float range, float sweep,GolemWeaponType gwt) { + protected final GolemWeaponType gwt; + public MetalGolemWeaponItem(Properties properties, int attackDamage, double percentAttack, float range, float sweep, GolemWeaponType gwt) { super(properties, EquipmentSlot.MAINHAND, GolemTypes.ENTITY_GOLEM::get, builder -> { var uuid = UUID.get(EquipmentSlot.MAINHAND); if (attackDamage > 0) { @@ -28,6 +28,7 @@ public MetalGolemWeaponItem(Properties properties, int attackDamage, double perc builder.put(GolemTypes.GOLEM_SWEEP.get(), new AttributeModifier(uuid, "spear_sweep", sweep, AttributeModifier.Operation.ADDITION)); } }); + this.gwt = gwt; } @Override public boolean isEnchantable(ItemStack stack) { @@ -37,6 +38,7 @@ public boolean isEnchantable(ItemStack stack) { public int getEnchantmentValue() { return 15; } + @Override public boolean canApplyAtEnchantingTable(ItemStack stack, Enchantment enchantment) { if (enchantment.category == EnchantmentCategory.WEAPON) { @@ -45,6 +47,6 @@ public boolean canApplyAtEnchantingTable(ItemStack stack, Enchantment enchantmen return super.canApplyAtEnchantingTable(stack, enchantment); } public GolemWeaponType getGolemWeaponType(MetalGolemWeaponItem i) { - + return i.gwt; } } diff --git a/src/main/java/dev/xkmc/modulargolems/init/material/GolemWeaponType.java b/src/main/java/dev/xkmc/modulargolems/init/material/GolemWeaponType.java index 54bf08bed..bb8c6c405 100644 --- a/src/main/java/dev/xkmc/modulargolems/init/material/GolemWeaponType.java +++ b/src/main/java/dev/xkmc/modulargolems/init/material/GolemWeaponType.java @@ -7,16 +7,15 @@ import net.minecraftforge.client.model.generators.ModelFile; import java.util.Locale; -import java.util.function.BiFunction; import static dev.xkmc.modulargolems.init.ModularGolems.REGISTRATE; interface MGFunction{ MetalGolemWeaponItem create(Item.Properties properties, int rank, GolemWeaponType type); } public enum GolemWeaponType { - SPEAR("item/long_weapon", (p, i) -> new MetalGolemWeaponItem(p, i, 0, 2, 0,), "TII", " SI", "S T"), - AXE("item/battle_axe", (p, i) -> new MetalGolemWeaponItem(p, 0, i * 0.05, 0, 2), "III", "IS ", "TST"), - SWORD("item/sword", (p, i) -> new MetalGolemWeaponItem(p, i, 0, 1, 2), "TII", "ISI", "SIT"),; + SPEAR("item/long_weapon", (p, i,t) -> new MetalGolemWeaponItem(p, i, 0, 2, 0,t),"TII", " SI", "S T"), + AXE("item/battle_axe", (p, i,t) -> new MetalGolemWeaponItem(p, 0, i * 0.05, 0, 2,t), "III", "IS ", "TST"), + SWORD("item/sword", (p, i,t) -> new MetalGolemWeaponItem(p, i, 0, 1, 2,t), "TII", "ISI", "SIT"),; private final MGFunction function; private final String[] pattern; From 6bb9a9180c7a554ff5a2231af5f000019d3de6ed Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Wed, 15 May 2024 19:50:36 +0800 Subject: [PATCH 20/32] Animate Rebuilded --- .../content/client/pose/CustomModelAnimation.java | 4 ++-- .../content/entity/metalgolem/MetalGolemEntity.java | 2 +- .../content/entity/metalgolem/MetalGolemModel.java | 4 +--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java b/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java index b5043e207..b9fff96a2 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java +++ b/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java @@ -11,7 +11,7 @@ * @author Author */ public class CustomModelAnimation { - public static final AnimationDefinition warningInSpear = AnimationDefinition.Builder.withLength(1.0F) + public static final AnimationDefinition warningInAxe = AnimationDefinition.Builder.withLength(1.0F) .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), new Keyframe(0.0833F, KeyframeAnimations.degreeVec(-110.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) @@ -53,7 +53,7 @@ public class CustomModelAnimation { )) .build(); - public static final AnimationDefinition WarningInSpear = AnimationDefinition.Builder.withLength(0.7083F) + public static final AnimationDefinition warningInSpear = AnimationDefinition.Builder.withLength(0.7083F) .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), new Keyframe(0.2083F, KeyframeAnimations.degreeVec(85.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java index 83cf1599d..f7044692d 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java @@ -36,7 +36,7 @@ @SerialClass public class MetalGolemEntity extends SweepGolemEntity { public final AnimationState armedAttackAnimationState = new AnimationState(); - public final AnimationState armedStandardAnimationState = new AnimationState(); + public final AnimationState axeWarningAnimationState = new AnimationState(); public MetalGolemEntity(EntityType type, Level level) { super(type, level); diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index d7aa7e561..6c1b18169 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -6,7 +6,6 @@ import dev.xkmc.modulargolems.content.entity.common.IGolemModel; import dev.xkmc.modulargolems.content.entity.common.IHeadedModel; import dev.xkmc.modulargolems.content.item.equipments.MetalGolemWeaponItem; -import dev.xkmc.modulargolems.init.material.GolemWeaponType; import net.minecraft.client.model.HierarchicalModel; import net.minecraft.client.model.geom.EntityModelSet; import net.minecraft.client.model.geom.ModelPart; @@ -14,7 +13,6 @@ import net.minecraft.util.Mth; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import dev.xkmc.modulargolems.content.client.pose.CustomModelAnimation; @@ -72,7 +70,7 @@ public void setupAnim(MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwi if (atkTick > 0) { this.animate(pEntity.armedAttackAnimationState, CustomModelAnimation.attackInAxe, pAgeInTicks); } else if (pEntity.isAggressive()) { - + this.animate(pEntity.axeWarningAnimationState, CustomModelAnimation.warningInAxe, pAgeInTicks); } else { this.animateWalk(pNetHeadYaw, pHeadPitch, pLimbSwing, pLimbSwingAmount); } From 38de6d5db02eacbbcc20b76d3cdc7610a7542ba5 Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Wed, 15 May 2024 21:14:57 +0800 Subject: [PATCH 21/32] Animate Rebuilded --- .../content/entity/metalgolem/MetalGolemModel.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index 6c1b18169..fd7baea9c 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -66,15 +66,23 @@ public void setupAnim(MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwi Item its =pEntity.getMainHandItem().getItem(); if(its instanceof MetalGolemWeaponItem wi){ switch (wi.getGolemWeaponType(wi)) { + case SWORD: case AXE: if (atkTick > 0) { this.animate(pEntity.armedAttackAnimationState, CustomModelAnimation.attackInAxe, pAgeInTicks); } else if (pEntity.isAggressive()) { this.animate(pEntity.axeWarningAnimationState, CustomModelAnimation.warningInAxe, pAgeInTicks); - } else { - this.animateWalk(pNetHeadYaw, pHeadPitch, pLimbSwing, pLimbSwingAmount); - } } + break; + case SPEAR: + if (atkTick > 0) { + this.animate(pEntity.armedAttackAnimationState, CustomModelAnimation.attackInSpear, pAgeInTicks); + } else if (pEntity.isAggressive()) { + this.animate(pEntity.axeWarningAnimationState, CustomModelAnimation.warningInSpear, pAgeInTicks); + } + return; + } + this.animateWalk(pNetHeadYaw, pHeadPitch, pLimbSwing, pLimbSwingAmount); } } private void animateWalk(float pNetHeadYaw, float pHeadPitch,float pLimbSwing,float pLimbSwingAmount) { From 22e916b1daa32ff30019640d203b9b83d771d04c Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Wed, 15 May 2024 21:41:51 +0800 Subject: [PATCH 22/32] Animate Rebuilded --- .../entity/metalgolem/MetalGolemModel.java | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index fd7baea9c..390597411 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -64,25 +64,24 @@ public void setupAnim(MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwi this.root().getAllParts().forEach(ModelPart::resetPose); int atkTick = pEntity.getAttackAnimationTick(); Item its =pEntity.getMainHandItem().getItem(); + this.animateWalk(pNetHeadYaw, pHeadPitch, pLimbSwing, pLimbSwingAmount); if(its instanceof MetalGolemWeaponItem wi){ - switch (wi.getGolemWeaponType(wi)) { - case SWORD: - case AXE: - if (atkTick > 0) { - this.animate(pEntity.armedAttackAnimationState, CustomModelAnimation.attackInAxe, pAgeInTicks); - } else if (pEntity.isAggressive()) { - this.animate(pEntity.axeWarningAnimationState, CustomModelAnimation.warningInAxe, pAgeInTicks); - } - break; - case SPEAR: - if (atkTick > 0) { - this.animate(pEntity.armedAttackAnimationState, CustomModelAnimation.attackInSpear, pAgeInTicks); - } else if (pEntity.isAggressive()) { - this.animate(pEntity.axeWarningAnimationState, CustomModelAnimation.warningInSpear, pAgeInTicks); + switch (wi.getGolemWeaponType(wi)) { + case SWORD, AXE -> { + if (atkTick > 0) { + this.animate(pEntity.armedAttackAnimationState, CustomModelAnimation.attackInAxe, pAgeInTicks); + }if (pEntity.isAggressive()) { + this.animate(pEntity.axeWarningAnimationState, CustomModelAnimation.warningInAxe, pAgeInTicks); + } } - return; - } - this.animateWalk(pNetHeadYaw, pHeadPitch, pLimbSwing, pLimbSwingAmount); + case SPEAR -> { + if (atkTick > 0) { + this.animate(pEntity.armedAttackAnimationState, CustomModelAnimation.attackInSpear, pAgeInTicks); + } else if (pEntity.isAggressive()) { + this.animate(pEntity.axeWarningAnimationState, CustomModelAnimation.warningInSpear, pAgeInTicks); + } + } + } } } private void animateWalk(float pNetHeadYaw, float pHeadPitch,float pLimbSwing,float pLimbSwingAmount) { From 7c86e615fa3b328ac2bf83e173f52f233f6b8622 Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Thu, 16 May 2024 12:54:31 +0800 Subject: [PATCH 23/32] Animate Rebuilded --- .../content/entity/metalgolem/MetalGolemModel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index 390597411..24af503a8 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -70,7 +70,7 @@ public void setupAnim(MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwi case SWORD, AXE -> { if (atkTick > 0) { this.animate(pEntity.armedAttackAnimationState, CustomModelAnimation.attackInAxe, pAgeInTicks); - }if (pEntity.isAggressive()) { + }else if (pEntity.isAggressive()) { this.animate(pEntity.axeWarningAnimationState, CustomModelAnimation.warningInAxe, pAgeInTicks); } } From 3a848c8d9270b67793e69d20705ab8ce1d7c696e Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Thu, 16 May 2024 13:09:42 +0800 Subject: [PATCH 24/32] Animate Rebuilded --- .../content/entity/metalgolem/MetalGolemEntity.java | 7 ++++--- .../content/entity/metalgolem/MetalGolemModel.java | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java index f7044692d..ee645a4ae 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java @@ -35,9 +35,10 @@ @SerialClass public class MetalGolemEntity extends SweepGolemEntity { - public final AnimationState armedAttackAnimationState = new AnimationState(); + public final AnimationState axeAttackAnimationState = new AnimationState(); public final AnimationState axeWarningAnimationState = new AnimationState(); - + public final AnimationState spearAttackAnimationState = new AnimationState(); + public final AnimationState spearWarningAnimationState = new AnimationState(); public MetalGolemEntity(EntityType type, Level level) { super(type, level); this.setMaxUpStep(1); @@ -117,7 +118,7 @@ public IronGolem.Crackiness getCrackiness() { public void handleEntityEvent(byte pId) { if (pId == 4) { this.attackAnimationTick=4; - this.armedAttackAnimationState.start(this.tickCount); + this.axeAttackAnimationState.start(this.tickCount); this.playSound(SoundEvents.IRON_GOLEM_ATTACK, 1.0F, 1.0F); }else{ super.handleEntityEvent(pId); diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index 24af503a8..515e6be2e 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -69,16 +69,16 @@ public void setupAnim(MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwi switch (wi.getGolemWeaponType(wi)) { case SWORD, AXE -> { if (atkTick > 0) { - this.animate(pEntity.armedAttackAnimationState, CustomModelAnimation.attackInAxe, pAgeInTicks); + this.animate(pEntity.axeAttackAnimationState, CustomModelAnimation.attackInAxe, pAgeInTicks); }else if (pEntity.isAggressive()) { this.animate(pEntity.axeWarningAnimationState, CustomModelAnimation.warningInAxe, pAgeInTicks); } } case SPEAR -> { if (atkTick > 0) { - this.animate(pEntity.armedAttackAnimationState, CustomModelAnimation.attackInSpear, pAgeInTicks); + this.animate(pEntity.spearAttackAnimationState, CustomModelAnimation.attackInSpear, pAgeInTicks); } else if (pEntity.isAggressive()) { - this.animate(pEntity.axeWarningAnimationState, CustomModelAnimation.warningInSpear, pAgeInTicks); + this.animate(pEntity.spearAttackAnimationState, CustomModelAnimation.warningInSpear, pAgeInTicks); } } } From 92aedf8b6bcc1086262403f1de8451d0ae56deda Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Thu, 16 May 2024 13:11:49 +0800 Subject: [PATCH 25/32] Animate Rebuilded --- .../content/entity/metalgolem/MetalGolemModel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index 515e6be2e..dc5b244f5 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -70,7 +70,7 @@ public void setupAnim(MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwi case SWORD, AXE -> { if (atkTick > 0) { this.animate(pEntity.axeAttackAnimationState, CustomModelAnimation.attackInAxe, pAgeInTicks); - }else if (pEntity.isAggressive()) { + }else if(pEntity.isAggressive()) { this.animate(pEntity.axeWarningAnimationState, CustomModelAnimation.warningInAxe, pAgeInTicks); } } From 72cc5816ef507e1d63a57f6cb6326e7999c95480 Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Thu, 16 May 2024 16:42:43 +0800 Subject: [PATCH 26/32] Animate Rebuilded --- .../content/entity/metalgolem/MetalGolemModel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index dc5b244f5..7f88522f7 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -78,7 +78,7 @@ public void setupAnim(MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwi if (atkTick > 0) { this.animate(pEntity.spearAttackAnimationState, CustomModelAnimation.attackInSpear, pAgeInTicks); } else if (pEntity.isAggressive()) { - this.animate(pEntity.spearAttackAnimationState, CustomModelAnimation.warningInSpear, pAgeInTicks); + this.animate(pEntity.spearWarningAnimationState, CustomModelAnimation.warningInSpear, pAgeInTicks); } } } From ac0a1af22461d78788ee54066ddb9366b4c676a6 Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Thu, 16 May 2024 16:57:08 +0800 Subject: [PATCH 27/32] Animate Rebuilded --- .../client/pose/CustomModelAnimation.java | 19 ------------------- .../entity/metalgolem/MetalGolemEntity.java | 2 -- .../entity/metalgolem/MetalGolemModel.java | 4 ++-- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java b/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java index b9fff96a2..f4e2f46cb 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java +++ b/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java @@ -11,18 +11,6 @@ * @author Author */ public class CustomModelAnimation { - public static final AnimationDefinition warningInAxe = AnimationDefinition.Builder.withLength(1.0F) - .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, - new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.0833F, KeyframeAnimations.degreeVec(-110.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) - )) - .addAnimation("right_forearm", new AnimationChannel(AnimationChannel.Targets.ROTATION, - new Keyframe(0.0F, KeyframeAnimations.degreeVec(-2160.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.5F, KeyframeAnimations.degreeVec(-75.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) - )) - .build(); - - public static final AnimationDefinition attackInAxe = AnimationDefinition.Builder.withLength(1.25F) .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, new Keyframe(0.0F, KeyframeAnimations.degreeVec(-110.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), @@ -52,11 +40,4 @@ public class CustomModelAnimation { new Keyframe(0.5F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) )) .build(); - - public static final AnimationDefinition warningInSpear = AnimationDefinition.Builder.withLength(0.7083F) - .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, - new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.2083F, KeyframeAnimations.degreeVec(85.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) - )) - .build(); } \ No newline at end of file diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java index ee645a4ae..0b747d5cf 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java @@ -36,9 +36,7 @@ @SerialClass public class MetalGolemEntity extends SweepGolemEntity { public final AnimationState axeAttackAnimationState = new AnimationState(); - public final AnimationState axeWarningAnimationState = new AnimationState(); public final AnimationState spearAttackAnimationState = new AnimationState(); - public final AnimationState spearWarningAnimationState = new AnimationState(); public MetalGolemEntity(EntityType type, Level level) { super(type, level); this.setMaxUpStep(1); diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index 7f88522f7..14d35534d 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -71,14 +71,14 @@ public void setupAnim(MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwi if (atkTick > 0) { this.animate(pEntity.axeAttackAnimationState, CustomModelAnimation.attackInAxe, pAgeInTicks); }else if(pEntity.isAggressive()) { - this.animate(pEntity.axeWarningAnimationState, CustomModelAnimation.warningInAxe, pAgeInTicks); + } } case SPEAR -> { if (atkTick > 0) { this.animate(pEntity.spearAttackAnimationState, CustomModelAnimation.attackInSpear, pAgeInTicks); } else if (pEntity.isAggressive()) { - this.animate(pEntity.spearWarningAnimationState, CustomModelAnimation.warningInSpear, pAgeInTicks); + } } } From 2dd5e8275685c2e4f6fc42c23d1e3a4bd68702f5 Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Thu, 16 May 2024 17:24:15 +0800 Subject: [PATCH 28/32] Animate Rebuilded --- .../content/client/pose/CustomModelAnimation.java | 15 +++++---------- .../entity/metalgolem/MetalGolemModel.java | 6 +----- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java b/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java index f4e2f46cb..27b2e59e6 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java +++ b/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java @@ -23,21 +23,16 @@ public class CustomModelAnimation { new Keyframe(0.5F, KeyframeAnimations.degreeVec(-75.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) )) .build(); - public static final AnimationDefinition attackInSpear = AnimationDefinition.Builder.withLength(0.9583F) + public static final AnimationDefinition attackInSpear = AnimationDefinition.Builder.withLength(1.75F) .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, new Keyframe(0.0F, KeyframeAnimations.degreeVec(85.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.25F, KeyframeAnimations.degreeVec(-57.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.5F, KeyframeAnimations.degreeVec(85.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + new Keyframe(0.5F, KeyframeAnimations.degreeVec(-55.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(1.0F, KeyframeAnimations.degreeVec(82.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) )) .addAnimation("right_forearm", new AnimationChannel(AnimationChannel.Targets.ROTATION, new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.25F, KeyframeAnimations.degreeVec(87.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.5F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) - )) - .addAnimation("weapon", new AnimationChannel(AnimationChannel.Targets.ROTATION, - new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.25F, KeyframeAnimations.degreeVec(47.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.5F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + new Keyframe(0.5F, KeyframeAnimations.degreeVec(87.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(1.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) )) .build(); } \ No newline at end of file diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index 14d35534d..a43933f50 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -70,15 +70,11 @@ public void setupAnim(MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwi case SWORD, AXE -> { if (atkTick > 0) { this.animate(pEntity.axeAttackAnimationState, CustomModelAnimation.attackInAxe, pAgeInTicks); - }else if(pEntity.isAggressive()) { - } } case SPEAR -> { if (atkTick > 0) { - this.animate(pEntity.spearAttackAnimationState, CustomModelAnimation.attackInSpear, pAgeInTicks); - } else if (pEntity.isAggressive()) { - + this.animate(pEntity.spearAttackAnimationState, CustomModelAnimation.attackInSpear, atkTick); } } } From 22e1f10d0f6e49d58af89567189b98fbb7876628 Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Thu, 16 May 2024 17:32:43 +0800 Subject: [PATCH 29/32] Animate Rebuilded --- .../client/pose/CustomModelAnimation.java | 34 ++++++++++++++++--- .../entity/metalgolem/MetalGolemEntity.java | 2 ++ .../entity/metalgolem/MetalGolemModel.java | 6 +++- 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java b/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java index 27b2e59e6..b9fff96a2 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java +++ b/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java @@ -11,6 +11,18 @@ * @author Author */ public class CustomModelAnimation { + public static final AnimationDefinition warningInAxe = AnimationDefinition.Builder.withLength(1.0F) + .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.0833F, KeyframeAnimations.degreeVec(-110.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + )) + .addAnimation("right_forearm", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(-2160.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.5F, KeyframeAnimations.degreeVec(-75.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + )) + .build(); + + public static final AnimationDefinition attackInAxe = AnimationDefinition.Builder.withLength(1.25F) .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, new Keyframe(0.0F, KeyframeAnimations.degreeVec(-110.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), @@ -23,16 +35,28 @@ public class CustomModelAnimation { new Keyframe(0.5F, KeyframeAnimations.degreeVec(-75.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) )) .build(); - public static final AnimationDefinition attackInSpear = AnimationDefinition.Builder.withLength(1.75F) + public static final AnimationDefinition attackInSpear = AnimationDefinition.Builder.withLength(0.9583F) .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, new Keyframe(0.0F, KeyframeAnimations.degreeVec(85.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.5F, KeyframeAnimations.degreeVec(-55.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(1.0F, KeyframeAnimations.degreeVec(82.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + new Keyframe(0.25F, KeyframeAnimations.degreeVec(-57.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.5F, KeyframeAnimations.degreeVec(85.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) )) .addAnimation("right_forearm", new AnimationChannel(AnimationChannel.Targets.ROTATION, new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.5F, KeyframeAnimations.degreeVec(87.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(1.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + new Keyframe(0.25F, KeyframeAnimations.degreeVec(87.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.5F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + )) + .addAnimation("weapon", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.25F, KeyframeAnimations.degreeVec(47.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.5F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + )) + .build(); + + public static final AnimationDefinition warningInSpear = AnimationDefinition.Builder.withLength(0.7083F) + .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.2083F, KeyframeAnimations.degreeVec(85.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) )) .build(); } \ No newline at end of file diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java index 0b747d5cf..ee645a4ae 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java @@ -36,7 +36,9 @@ @SerialClass public class MetalGolemEntity extends SweepGolemEntity { public final AnimationState axeAttackAnimationState = new AnimationState(); + public final AnimationState axeWarningAnimationState = new AnimationState(); public final AnimationState spearAttackAnimationState = new AnimationState(); + public final AnimationState spearWarningAnimationState = new AnimationState(); public MetalGolemEntity(EntityType type, Level level) { super(type, level); this.setMaxUpStep(1); diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index a43933f50..7f88522f7 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -70,11 +70,15 @@ public void setupAnim(MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwi case SWORD, AXE -> { if (atkTick > 0) { this.animate(pEntity.axeAttackAnimationState, CustomModelAnimation.attackInAxe, pAgeInTicks); + }else if(pEntity.isAggressive()) { + this.animate(pEntity.axeWarningAnimationState, CustomModelAnimation.warningInAxe, pAgeInTicks); } } case SPEAR -> { if (atkTick > 0) { - this.animate(pEntity.spearAttackAnimationState, CustomModelAnimation.attackInSpear, atkTick); + this.animate(pEntity.spearAttackAnimationState, CustomModelAnimation.attackInSpear, pAgeInTicks); + } else if (pEntity.isAggressive()) { + this.animate(pEntity.spearWarningAnimationState, CustomModelAnimation.warningInSpear, pAgeInTicks); } } } From ec57aa5d2a3650ee8a3d59d1d826a4de17dacee3 Mon Sep 17 00:00:00 2001 From: D12epic <1545919889@qq.com> Date: Thu, 16 May 2024 19:42:52 +0800 Subject: [PATCH 30/32] Animate Rebuilded --- .../client/pose/CustomModelAnimation.java | 34 ++++++++----------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java b/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java index b9fff96a2..f2afccaa1 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java +++ b/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java @@ -24,33 +24,29 @@ public class CustomModelAnimation { public static final AnimationDefinition attackInAxe = AnimationDefinition.Builder.withLength(1.25F) - .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, - new Keyframe(0.0F, KeyframeAnimations.degreeVec(-110.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.25F, KeyframeAnimations.degreeVec(-32.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.5F, KeyframeAnimations.degreeVec(-110.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) - )) - .addAnimation("right_forearm", new AnimationChannel(AnimationChannel.Targets.ROTATION, - new Keyframe(0.0F, KeyframeAnimations.degreeVec(-75.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.25F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.5F, KeyframeAnimations.degreeVec(-75.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) - )) - .build(); - public static final AnimationDefinition attackInSpear = AnimationDefinition.Builder.withLength(0.9583F) .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, - new Keyframe(0.0F, KeyframeAnimations.degreeVec(85.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.25F, KeyframeAnimations.degreeVec(-57.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.5F, KeyframeAnimations.degreeVec(85.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + new Keyframe(0.0F, KeyframeAnimations.degreeVec(-110.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.25F, KeyframeAnimations.degreeVec(-32.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.5F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) )) .addAnimation("right_forearm", new AnimationChannel(AnimationChannel.Targets.ROTATION, new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.25F, KeyframeAnimations.degreeVec(87.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.25F, KeyframeAnimations.degreeVec(80.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), new Keyframe(0.5F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) )) - .addAnimation("weapon", new AnimationChannel(AnimationChannel.Targets.ROTATION, - new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.25F, KeyframeAnimations.degreeVec(47.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + .build(); + + public static final AnimationDefinition attackInSpear = AnimationDefinition.Builder.withLength(1.75F) + .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(85.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.25F, KeyframeAnimations.degreeVec(-57.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), new Keyframe(0.5F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) )) + .addAnimation("right_forearm", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.25F, KeyframeAnimations.degreeVec(87.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.5F, KeyframeAnimations.degreeVec(-2.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + )) .build(); public static final AnimationDefinition warningInSpear = AnimationDefinition.Builder.withLength(0.7083F) From 3688abdba4426b97655ce756e129a475fdde5e0f Mon Sep 17 00:00:00 2001 From: D12epic <1619640542@qq.com> Date: Sat, 27 Jul 2024 21:28:17 +0800 Subject: [PATCH 31/32] Merge branch 'Minecraft-LightLand:1.20' into D12's_1.20.1(AnimateRebuild) --- .../compat/curio/CurioCompatRegistry.java | 8 +- .../compat/jei/GolemJEIPlugin.java | 9 -- .../materials/botania/BotCompatRegistry.java | 27 ---- .../materials/botania/BotConfigGen.java | 48 ------- .../compat/materials/botania/BotDispatch.java | 38 ------ .../compat/materials/botania/BotUtils.java | 102 --------------- .../botania/GolemManaBurstEntity.java | 37 ------ .../materials/botania/ManaBoostModifier.java | 37 ------ .../botania/ManaBurstAttackGoal.java | 59 --------- .../materials/botania/ManaBurstModifier.java | 31 ----- .../botania/ManaMendingModifier.java | 35 ----- .../materials/botania/ManaModifier.java | 20 --- .../botania/ManaProductionModifier.java | 29 ----- .../botania/PixieAttackModifier.java | 43 ------ .../botania/PixieCounterattackModifier.java | 45 ------- .../materials/botania/package-info.java | 8 -- .../LeviathanBlastPortalModifier.java | 2 +- .../materials/common/CompatManager.java | 8 -- .../compat/materials/common/ModDispatch.java | 3 - .../create/CreateCompatRegistry.java | 50 +------ .../materials/create/CreateConfigGen.java | 26 ++-- .../materials/create/CreateDispatch.java | 23 +--- .../ConditionalSARecipeBuilder.java | 18 --- .../automation/CreateGolemRecipeGen.java | 102 --------------- .../create/automation/CreateJEIEvents.java | 12 -- .../create/automation/CreateRecipeEvents.java | 95 -------------- .../automation/DeployerUpgradeRecipe.java | 48 ------- .../create/automation/DummyFurnace.java | 30 ----- .../automation/GolemIncompleteItem.java | 31 ----- .../create/automation/package-info.java | 8 -- .../create/modifier/CoatingModifier.java | 30 ----- .../create/modifier/MechBodyModifier.java | 99 -------------- .../create/modifier/MechForceEffect.java | 23 ---- .../create/modifier/MechForceModifier.java | 24 ---- .../create/modifier/MechMobileEffect.java | 23 ---- .../create/modifier/MechMobileModifier.java | 25 ---- .../create/modifier/package-info.java | 8 -- .../twilightforest/TFCompatRegistry.java | 4 +- .../materials/twilightforest/TFConfigGen.java | 2 +- .../twilightforest/TFDamageModifier.java | 11 +- .../twilightforest/TFHealingModifier.java | 2 +- .../modulargolems/compat/misc/MaidCompat.java | 67 ---------- .../client/armor/GolemEquipmentModels.java | 122 ------------------ .../content/client/armor/GolemModelPath.java | 6 +- .../client/overlay/GolemStatusOverlay.java | 5 - .../client/pose/CustomModelAnimation.java | 70 +++++++--- .../modulargolems/content/core/GolemType.java | 4 - .../entity/common/AbstractGolemEntity.java | 30 ++--- .../entity/common/AbstractGolemRenderer.java | 1 + .../content/entity/common/GolemFlags.java | 2 +- .../content/entity/dog/DogGolemEntity.java | 20 +-- .../content/entity/goals/FollowOwnerGoal.java | 3 +- .../entity/humanoid/HumanoidGolemEntity.java | 33 +++-- .../humanoid/HumanoidGolemRenderer.java | 13 +- .../humanoid/skin/ClientProfileManager.java | 43 ------ .../humanoid/skin/ClientSkinDispatch.java | 23 ---- .../humanoid/skin/PlayerSkinRenderer.java | 45 ------- .../humanoid/skin/SpecialRenderProfile.java | 22 ---- .../humanoid/skin/SpecialRenderSkin.java | 11 -- .../entity/humanoid/skin/package-info.java | 8 -- .../metalgolem/GolemEquipmentRenderer.java | 90 +------------ .../entity/metalgolem/MetalGolemEntity.java | 46 +++---- .../entity/metalgolem/MetalGolemModel.java | 77 ++++++----- .../entity/metalgolem/MetalGolemRenderer.java | 4 +- .../content/entity/mode/PatrolMode.java | 1 - .../item/equipments/MetalGolemBeaconItem.java | 46 ------- .../item/equipments/MetalGolemWeaponItem.java | 4 +- .../item/equipments/TickEquipmentItem.java | 9 -- .../content/item/golem/GolemBEWLR.java | 6 +- .../content/item/golem/GolemHolder.java | 19 --- .../content/item/golem/GolemPart.java | 7 +- .../content/item/golem/IGolemPartItem.java | 7 - .../content/item/wand/CommandWandItem.java | 9 +- .../menu/equipment/EquipmentsMenu.java | 3 - .../menu/equipment/EquipmentsScreen.java | 12 +- .../content/modifier/base/GolemModifier.java | 11 +- .../modifier/immunes/DamageCapModifier.java | 6 +- .../events/GolemAttackListener.java | 13 -- .../events/GolemClientEventListeners.java | 35 ----- .../events/event/HumanoidSkinEvent.java | 38 ------ .../xkmc/modulargolems/init/GolemClient.java | 18 +-- .../modulargolems/init/ModularGolems.java | 6 - .../modulargolems/init/data/MGConfig.java | 45 ------- .../modulargolems/init/data/MGLangData.java | 3 - .../modulargolems/init/data/MGTagGen.java | 24 +--- .../init/registrate/GolemItems.java | 44 ++----- src/main/resources/META-INF/mods.toml | 5 - .../textures/entity/dog_golem/elementium.png | Bin 707 -> 0 bytes .../textures/entity/dog_golem/manasteel.png | Bin 699 -> 0 bytes .../textures/entity/dog_golem/terrasteel.png | Bin 708 -> 0 bytes .../entity/humanoid_golem/elementium.png | Bin 1811 -> 0 bytes .../entity/humanoid_golem/manasteel.png | Bin 1786 -> 0 bytes .../entity/humanoid_golem/terrasteel.png | Bin 1741 -> 0 bytes .../entity/metal_golem/elementium.png | Bin 5065 -> 0 bytes .../textures/entity/metal_golem/manasteel.png | Bin 5030 -> 0 bytes .../entity/metal_golem/terrasteel.png | Bin 4893 -> 0 bytes .../upgrades/ancient_remnant_sandstorm.png | Bin 659 -> 245 bytes .../upgrades/ender_guardian_void_rune.png | Bin 586 -> 245 bytes .../item/upgrades/leviathan_blast_portal.png | Bin 635 -> 245 bytes .../netherite_monstrosity_earthquake.png | Bin 620 -> 245 bytes .../assets/modulargolems/lang/zh_cn.json | 53 ++------ .../entries/golems/b2_humanoid_golem.json | 14 +- .../en_us/entries/golems/c2_command_wand.json | 5 +- .../en_us/entries/golems/d1_config_card.json | 10 +- .../entries/materials/bot_elementium.json | 29 ----- .../entries/materials/bot_manasteel.json | 29 ----- .../entries/materials/bot_terrasteel.json | 29 ----- .../entries/materials/cr_andesite_alloy.json | 2 +- .../en_us/entries/materials/cr_brass.json | 2 +- .../en_us/entries/materials/cr_railway.json | 2 +- .../entries/upgrades/ct_ancient_remnant.json | 4 +- .../entries/upgrades/ct_ender_guardian.json | 4 +- .../en_us/entries/upgrades/ct_leviathan.json | 4 +- .../upgrades/ct_netherite_monstrosity.json | 4 +- .../entries/golems/b2_humanoid_golem.json | 12 +- .../zh_cn/entries/golems/c2_command_wand.json | 5 +- .../zh_cn/entries/golems/d1_config_card.json | 11 +- .../entries/materials/bot_elementium.json | 29 ----- .../entries/materials/bot_manasteel.json | 29 ----- .../entries/materials/bot_terrasteel.json | 29 ----- .../entries/materials/cr_andesite_alloy.json | 2 +- .../zh_cn/entries/materials/cr_brass.json | 2 +- .../zh_cn/entries/materials/cr_railway.json | 2 +- .../entries/upgrades/ct_ancient_remnant.json | 4 +- .../entries/upgrades/ct_ender_guardian.json | 4 +- .../zh_cn/entries/upgrades/ct_leviathan.json | 4 +- .../upgrades/ct_netherite_monstrosity.json | 4 +- .../textures/equipments/beacon.png | Bin 3027 -> 0 bytes .../modulargolems/textures/item/card/path.png | Bin 425 -> 463 bytes .../item/equipments/golem_beacon_level_1.png | Bin 198 -> 0 bytes .../item/equipments/golem_beacon_level_2.png | Bin 198 -> 0 bytes .../item/equipments/golem_beacon_level_3.png | Bin 198 -> 0 bytes .../item/equipments/golem_beacon_level_4.png | Bin 198 -> 0 bytes .../item/equipments/golem_beacon_level_5.png | Bin 198 -> 0 bytes 134 files changed, 265 insertions(+), 2462 deletions(-) delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/botania/BotCompatRegistry.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/botania/BotConfigGen.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/botania/BotDispatch.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/botania/BotUtils.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/botania/GolemManaBurstEntity.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaBoostModifier.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaBurstAttackGoal.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaBurstModifier.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaMendingModifier.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaModifier.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaProductionModifier.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/botania/PixieAttackModifier.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/botania/PixieCounterattackModifier.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/botania/package-info.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/ConditionalSARecipeBuilder.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/CreateGolemRecipeGen.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/CreateJEIEvents.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/CreateRecipeEvents.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/DeployerUpgradeRecipe.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/DummyFurnace.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/GolemIncompleteItem.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/package-info.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/CoatingModifier.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/MechBodyModifier.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/MechForceEffect.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/MechForceModifier.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/MechMobileEffect.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/MechMobileModifier.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/package-info.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/content/client/armor/GolemEquipmentModels.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/ClientProfileManager.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/ClientSkinDispatch.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/PlayerSkinRenderer.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/SpecialRenderProfile.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/SpecialRenderSkin.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/package-info.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/content/item/equipments/MetalGolemBeaconItem.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/content/item/equipments/TickEquipmentItem.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/content/item/golem/IGolemPartItem.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/events/GolemClientEventListeners.java delete mode 100644 src/main/java/dev/xkmc/modulargolems/events/event/HumanoidSkinEvent.java delete mode 100644 src/main/resources/assets/botania/textures/entity/dog_golem/elementium.png delete mode 100644 src/main/resources/assets/botania/textures/entity/dog_golem/manasteel.png delete mode 100644 src/main/resources/assets/botania/textures/entity/dog_golem/terrasteel.png delete mode 100644 src/main/resources/assets/botania/textures/entity/humanoid_golem/elementium.png delete mode 100644 src/main/resources/assets/botania/textures/entity/humanoid_golem/manasteel.png delete mode 100644 src/main/resources/assets/botania/textures/entity/humanoid_golem/terrasteel.png delete mode 100644 src/main/resources/assets/botania/textures/entity/metal_golem/elementium.png delete mode 100644 src/main/resources/assets/botania/textures/entity/metal_golem/manasteel.png delete mode 100644 src/main/resources/assets/botania/textures/entity/metal_golem/terrasteel.png delete mode 100644 src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/bot_elementium.json delete mode 100644 src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/bot_manasteel.json delete mode 100644 src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/bot_terrasteel.json delete mode 100644 src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/bot_elementium.json delete mode 100644 src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/bot_manasteel.json delete mode 100644 src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/bot_terrasteel.json delete mode 100644 src/main/resources/assets/modulargolems/textures/equipments/beacon.png delete mode 100644 src/main/resources/assets/modulargolems/textures/item/equipments/golem_beacon_level_1.png delete mode 100644 src/main/resources/assets/modulargolems/textures/item/equipments/golem_beacon_level_2.png delete mode 100644 src/main/resources/assets/modulargolems/textures/item/equipments/golem_beacon_level_3.png delete mode 100644 src/main/resources/assets/modulargolems/textures/item/equipments/golem_beacon_level_4.png delete mode 100644 src/main/resources/assets/modulargolems/textures/item/equipments/golem_beacon_level_5.png diff --git a/src/main/java/dev/xkmc/modulargolems/compat/curio/CurioCompatRegistry.java b/src/main/java/dev/xkmc/modulargolems/compat/curio/CurioCompatRegistry.java index 7b756c3f4..13bc0539f 100644 --- a/src/main/java/dev/xkmc/modulargolems/compat/curio/CurioCompatRegistry.java +++ b/src/main/java/dev/xkmc/modulargolems/compat/curio/CurioCompatRegistry.java @@ -1,6 +1,5 @@ package dev.xkmc.modulargolems.compat.curio; -import com.mojang.datafixers.util.Pair; import com.tterrag.registrate.util.entry.MenuEntry; import dev.xkmc.l2tabs.compat.CuriosEventHandler; import dev.xkmc.l2tabs.init.data.L2TabsLangData; @@ -14,7 +13,6 @@ import dev.xkmc.modulargolems.init.ModularGolems; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraftforge.fml.ModList; import net.minecraftforge.network.NetworkHooks; @@ -87,9 +85,11 @@ private void onJEIRegistryImpl(Consumer> consumer) { consumer.accept(GolemCuriosListScreen.class); } - public ItemStack getSkin(HumanoidGolemEntity le) { + @Nullable + public String getSkin(HumanoidGolemEntity le) { return CuriosApi.getCuriosInventory(le).resolve().flatMap(e -> e.getStacksHandler("golem_skin")) - .map(ICurioStacksHandler::getStacks).map(e -> e.getSlots() == 0 ? null : e.getStackInSlot(0)).orElse(ItemStack.EMPTY); + .map(ICurioStacksHandler::getStacks).map(e -> e.getSlots() == 0 ? null : e.getStackInSlot(0)) + .filter(e->!e.isEmpty()).map(e -> e.getHoverName().getString()).orElse(null); } } diff --git a/src/main/java/dev/xkmc/modulargolems/compat/jei/GolemJEIPlugin.java b/src/main/java/dev/xkmc/modulargolems/compat/jei/GolemJEIPlugin.java index 9055082db..d256d39bd 100644 --- a/src/main/java/dev/xkmc/modulargolems/compat/jei/GolemJEIPlugin.java +++ b/src/main/java/dev/xkmc/modulargolems/compat/jei/GolemJEIPlugin.java @@ -16,7 +16,6 @@ import dev.xkmc.modulargolems.content.menu.target.TargetConfigScreen; import dev.xkmc.modulargolems.content.recipe.GolemAssembleRecipe; import dev.xkmc.modulargolems.init.ModularGolems; -import dev.xkmc.modulargolems.init.data.MGTagGen; import mezz.jei.api.IModPlugin; import mezz.jei.api.JeiPlugin; import mezz.jei.api.constants.RecipeTypes; @@ -108,14 +107,6 @@ private static String partSubtype(ItemStack stack, UidContext ctx) { private static void addPartCraftRecipes(List recipes, GolemMaterialConfig config, IVanillaRecipeFactory factory) { for (var mat : config.getAllMaterials()) { var arr = config.ingredients.get(mat).getItems(); - boolean special = false; - for (ItemStack stack : arr) { - if (stack.is(MGTagGen.SPECIAL_CRAFT)) { - special = true; - break; - } - } - if (special) continue; for (var item : GolemPart.LIST) { List list = new ArrayList<>(); for (ItemStack stack : arr) { diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/BotCompatRegistry.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/BotCompatRegistry.java deleted file mode 100644 index 6996332bf..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/BotCompatRegistry.java +++ /dev/null @@ -1,27 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.botania; - -import com.tterrag.registrate.util.entry.RegistryEntry; - -import static dev.xkmc.modulargolems.init.registrate.GolemModifiers.reg; - -public class BotCompatRegistry { - public static final RegistryEntry MANA_MENDING; - public static final RegistryEntry MANA_BOOSTING; - public static final RegistryEntry MANA_PRODUCTION; - public static final RegistryEntry MANA_BURST; - public static final RegistryEntry PIXIE_ATTACK; - public static final RegistryEntry PIXIE_COUNTERATTACK; - - static { - MANA_MENDING = reg("mana_mending", ManaMendingModifier::new, "Get %s regeneration at a %s mana/hp efficiency"); - MANA_BOOSTING = reg("mana_boosting", ManaBoostModifier::new, "Deal %s%% extra damage costing %s mana"); - MANA_PRODUCTION = reg("mana_production", ManaProductionModifier::new, "Generate %s mana per second"); - MANA_BURST = reg("mana_burst", ManaBurstModifier::new, "Shoot mana burst toward faraway targets dealing %s%% attack damage, costing %s mana"); - PIXIE_ATTACK = reg("pixie_attack", PixieAttackModifier::new, "Summon a pixie with a %s%% chance when attacking. Pixie damage +%s."); - PIXIE_COUNTERATTACK = reg("pixie_counterattack", PixieCounterattackModifier::new, "Summon a pixie with a %s%% chance when attacked."); - } - - public static void register() { - } - - } diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/BotConfigGen.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/BotConfigGen.java deleted file mode 100644 index 3dc85e335..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/BotConfigGen.java +++ /dev/null @@ -1,48 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.botania; - -import dev.xkmc.l2library.serial.config.ConfigDataProvider; -import dev.xkmc.modulargolems.content.config.GolemMaterialConfig; -import dev.xkmc.modulargolems.init.ModularGolems; -import dev.xkmc.modulargolems.init.registrate.GolemModifiers; -import dev.xkmc.modulargolems.init.registrate.GolemTypes; -import net.minecraft.data.DataGenerator; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.item.crafting.Ingredient; -import vazkii.botania.common.item.BotaniaItems; - -public class BotConfigGen extends ConfigDataProvider { - - public BotConfigGen(DataGenerator generator) { - super(generator, "Golem Config for Botania"); - } - - public void add(Collector map) { - map.add(ModularGolems.MATERIALS, new ResourceLocation(BotDispatch.MODID, BotDispatch.MODID), new GolemMaterialConfig() - .addMaterial(new ResourceLocation(BotDispatch.MODID, "manasteel"), Ingredient.of(BotaniaItems.manaSteel)) - .addStat(GolemTypes.STAT_HEALTH.get(), 150) - .addStat(GolemTypes.STAT_ATTACK.get(), 15) - .addModifier(BotCompatRegistry.MANA_MENDING.get(), 1) - .addModifier(BotCompatRegistry.MANA_BOOSTING.get(), 1) - .end() - - .addMaterial(new ResourceLocation(BotDispatch.MODID, "terrasteel"), Ingredient.of(BotaniaItems.terrasteel)) - .addStat(GolemTypes.STAT_HEALTH.get(), 300) - .addStat(GolemTypes.STAT_ATTACK.get(), 30) - .addModifier(BotCompatRegistry.MANA_MENDING.get(), 2) - .addModifier(BotCompatRegistry.MANA_BOOSTING.get(), 2) - .addModifier(BotCompatRegistry.MANA_PRODUCTION.get(), 1) - .addModifier(BotCompatRegistry.MANA_BURST.get(), 1) - .end() - - .addMaterial(new ResourceLocation(BotDispatch.MODID, "elementium"), Ingredient.of(BotaniaItems.elementium)) - .addStat(GolemTypes.STAT_HEALTH.get(), 200) - .addStat(GolemTypes.STAT_ATTACK.get(), 15) - .addModifier(BotCompatRegistry.MANA_MENDING.get(), 1) - .addModifier(BotCompatRegistry.MANA_BOOSTING.get(), 1) - .addModifier(BotCompatRegistry.PIXIE_ATTACK.get(), 1) - .addModifier(BotCompatRegistry.PIXIE_COUNTERATTACK.get(), 1) - .end() - ); - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/BotDispatch.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/BotDispatch.java deleted file mode 100644 index 04446a860..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/BotDispatch.java +++ /dev/null @@ -1,38 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.botania; - -import com.tterrag.registrate.providers.RegistrateLangProvider; -import com.tterrag.registrate.providers.RegistrateRecipeProvider; -import dev.xkmc.l2library.serial.config.ConfigDataProvider; -import dev.xkmc.l2library.serial.recipe.ConditionalRecipeWrapper; -import dev.xkmc.modulargolems.compat.materials.common.ModDispatch; -import dev.xkmc.modulargolems.init.registrate.GolemItems; -import net.minecraft.data.DataGenerator; -import net.minecraft.data.recipes.RecipeCategory; -import net.minecraft.data.recipes.ShapedRecipeBuilder; -import net.minecraft.world.item.Items; - -public class BotDispatch extends ModDispatch { - - public static final String MODID = "botania"; - - public BotDispatch() { - BotCompatRegistry.register(); - } - - public void genLang(RegistrateLangProvider pvd) { - pvd.add("golem_material." + MODID + ".manasteel", "Manasteel"); - pvd.add("golem_material." + MODID + ".terrasteel", "Terrasteel"); - pvd.add("golem_material." + MODID + ".elementium", "Elementium"); - } - - @Override - public void genRecipe(RegistrateRecipeProvider pvd) { - - } - - @Override - public ConfigDataProvider getDataGen(DataGenerator gen) { - return new BotConfigGen(gen); - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/BotUtils.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/BotUtils.java deleted file mode 100644 index 36a4f5d4b..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/BotUtils.java +++ /dev/null @@ -1,102 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.botania; - -import dev.xkmc.modulargolems.init.data.MGLangData; -import net.minecraft.ChatFormatting; -import net.minecraft.network.chat.Component; -import net.minecraft.world.entity.LivingEntity; -import top.theillusivec4.curios.api.CuriosApi; -import vazkii.botania.api.BotaniaForgeCapabilities; -import vazkii.botania.api.mana.ManaItem; - -import java.util.ArrayList; -import java.util.List; - -public class BotUtils { - - private static List getManaItems(LivingEntity e) { - var opt = CuriosApi.getCuriosInventory(e).resolve(); - if (opt.isEmpty()) return List.of(); - var list = opt.get().findCurios(stack -> stack.getCapability(BotaniaForgeCapabilities.MANA_ITEM).resolve().isPresent()); - List ans = new ArrayList<>(); - for (var item : list) { - var optMana = item.stack().getCapability(BotaniaForgeCapabilities.MANA_ITEM).resolve(); - if (optMana.isEmpty()) continue; - ans.add(optMana.get()); - } - return ans; - } - - private final List list; - - public BotUtils(LivingEntity e) { - list = getManaItems(e); - } - - public int count() { - return list.size(); - } - - public int getMana() { - int total = 0; - for (var manaItem : list) { - total += manaItem.getMana(); - } - return total; - } - - public int getMaxMana() { - int total = 0; - for (var manaItem : list) { - total += manaItem.getMaxMana(); - } - return total; - } - - /** - * returns amount actually consumed - * s - */ - public int consumeMana(int target) { - int consumed = 0; - for (var manaItem : list) { - int remainMana = manaItem.getMana(); - if (remainMana <= 0) continue; - int cost = Math.min(remainMana, target); - consumed += cost; - target -= cost; - manaItem.addMana(-cost); - if (target == 0) break; - } - return consumed; - } - - /** - * return amount remains - */ - public int generateMana(int available) { - for (var manaItem : list) { - int space = manaItem.getMaxMana() - manaItem.getMana(); - if (space <= 0) continue; - int toGen = Math.min(available, space); - available -= toGen; - manaItem.addMana(toGen); - if (available == 0) break; - } - return available; - } - - private static String parse(int mana) { - if (mana < 10000) return mana + ""; - mana /= 1000; - if (mana < 10000) return mana + "k"; - return mana / 1000 + "M"; - } - - public static Component getDesc(LivingEntity golem) { - var bot = new BotUtils(golem); - if (bot.count() == 0) return MGLangData.BOT_NO_RING.get().withStyle(ChatFormatting.RED); - return MGLangData.BOT_MANA.get(parse(bot.getMana()), parse(bot.getMaxMana())) - .withStyle(ChatFormatting.LIGHT_PURPLE); - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/GolemManaBurstEntity.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/GolemManaBurstEntity.java deleted file mode 100644 index 97ad3d556..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/GolemManaBurstEntity.java +++ /dev/null @@ -1,37 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.botania; - -import dev.xkmc.modulargolems.init.data.MGConfig; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.ai.attributes.Attributes; -import net.minecraft.world.phys.EntityHitResult; -import org.jetbrains.annotations.NotNull; -import vazkii.botania.common.entity.BotaniaEntities; -import vazkii.botania.common.entity.ManaBurstEntity; - -public class GolemManaBurstEntity extends ManaBurstEntity { - - private final int lv; - - public GolemManaBurstEntity(LivingEntity user, int lv) { - super(BotaniaEntities.MANA_BURST, user.level()); - setOwner(user); - this.setBurstSourceCoords(NO_SOURCE); - this.lv = lv; - } - - @Override - protected void onHitEntity(@NotNull EntityHitResult hit) { - if (this.isAlive()) { - if (!this.level().isClientSide) { - var owner = getOwner(); - double dmg = 7; - if (owner instanceof LivingEntity le) { - dmg = le.getAttributeValue(Attributes.ATTACK_DAMAGE) * lv * MGConfig.COMMON.manaBurstDamage.get(); - } - hit.getEntity().hurt(damageSources().indirectMagic(this, getOwner()), (float) dmg); - this.level().broadcastEntityEvent(this, (byte) 3); - this.discard(); - } - } - } -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaBoostModifier.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaBoostModifier.java deleted file mode 100644 index 87b721a51..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaBoostModifier.java +++ /dev/null @@ -1,37 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.botania; - -import dev.xkmc.l2damagetracker.contents.attack.AttackCache; -import dev.xkmc.l2damagetracker.contents.attack.DamageModifier; -import dev.xkmc.modulargolems.content.core.StatFilterType; -import dev.xkmc.modulargolems.content.entity.common.AbstractGolemEntity; -import dev.xkmc.modulargolems.init.data.MGConfig; -import net.minecraft.ChatFormatting; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; - -import java.util.List; - -public class ManaBoostModifier extends ManaModifier { - - public ManaBoostModifier() { - super(StatFilterType.ATTACK, MAX_LEVEL); - } - - @Override - public void modifyDamage(AttackCache cache, AbstractGolemEntity entity, int level) { - int manaCost = MGConfig.COMMON.manaBoostingCost.get() * level; - double damageBoost = MGConfig.COMMON.manaBoostingDamage.get() * level; - int consumed = new BotUtils(entity).consumeMana(manaCost); - if (consumed <= 0) return; - if (consumed < manaCost) damageBoost = damageBoost * consumed / manaCost; - cache.addHurtModifier(DamageModifier.multTotal(1 + (float) damageBoost)); - - } - - public List getDetail(int v) { - int bonus = (int) Math.round((MGConfig.COMMON.manaBoostingDamage.get() * v) * 100); - int manaCost = MGConfig.COMMON.manaBoostingCost.get() * v; - return List.of(Component.translatable(getDescriptionId() + ".desc", bonus, manaCost).withStyle(ChatFormatting.GREEN)); - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaBurstAttackGoal.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaBurstAttackGoal.java deleted file mode 100644 index 74c92ec69..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaBurstAttackGoal.java +++ /dev/null @@ -1,59 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.botania; - -import dev.xkmc.modulargolems.content.entity.common.AbstractGolemEntity; -import dev.xkmc.modulargolems.content.modifier.special.BaseRangedAttackGoal; -import dev.xkmc.modulargolems.init.data.MGConfig; -import net.minecraft.util.Mth; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.Mob; -import net.minecraft.world.phys.Vec3; -import vazkii.botania.common.entity.ManaBurstEntity; - -public class ManaBurstAttackGoal extends BaseRangedAttackGoal { - - public ManaBurstAttackGoal(AbstractGolemEntity golem, int lv) { - super(40, 4, 48, golem, lv); - } - - @Override - protected void performAttack(LivingEntity target) { - var manaCost = MGConfig.COMMON.manaBurstCost.get() * lv; - var bot = new BotUtils(golem); - if (bot.getMana() < manaCost) return; - bot.consumeMana(manaCost); - var burst = getBurst(golem); - golem.level().addFreshEntity(burst); - } - - public ManaBurstEntity getBurst(LivingEntity golem) { - ManaBurstEntity burst = new GolemManaBurstEntity(golem, lv); - Vec3 pos = new Vec3(golem.getX(), golem.getEyeY() - (double) 0.1F, golem.getZ()); - burst.setPos(pos); - Vec3 forward = golem.getForward(); - if (golem instanceof Mob mob) { - var target = mob.getTarget(); - if (target != null) { - forward = new Vec3(target.getX(), target.getY(0.5), target.getZ()).subtract(pos).normalize(); - } - } - double d0 = forward.horizontalDistance(); - burst.setYRot((float) (180 - Mth.atan2(forward.x, forward.z) * Mth.RAD_TO_DEG)); - burst.setXRot((float) (Mth.atan2(forward.y, d0) * Mth.RAD_TO_DEG)); - burst.setDeltaMovement(ManaBurstEntity.calculateBurstVelocity(burst.getXRot(), burst.getYRot())); - - float motionModifier = 7F; - - int manaCost = MGConfig.COMMON.manaBurstCost.get() * lv; - burst.setColor(0x20FF20); - burst.setMana(manaCost); - burst.setStartingMana(manaCost); - burst.setMinManaLoss(40); - burst.setManaLossPerTick(manaCost / 40f); - burst.setGravity(0F); - burst.setDeltaMovement(burst.getDeltaMovement().scale(motionModifier)); - - return burst; - } - -} - diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaBurstModifier.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaBurstModifier.java deleted file mode 100644 index 0a172a588..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaBurstModifier.java +++ /dev/null @@ -1,31 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.botania; - -import dev.xkmc.modulargolems.content.core.StatFilterType; -import dev.xkmc.modulargolems.content.entity.common.AbstractGolemEntity; -import dev.xkmc.modulargolems.init.data.MGConfig; -import net.minecraft.ChatFormatting; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.entity.ai.goal.Goal; - -import java.util.List; -import java.util.function.BiConsumer; - -public class ManaBurstModifier extends ManaModifier { - - public ManaBurstModifier() { - super(StatFilterType.ATTACK, MAX_LEVEL); - } - - @Override - public void onRegisterGoals(AbstractGolemEntity entity, int lv, BiConsumer addGoal) { - addGoal.accept(5, new ManaBurstAttackGoal(entity, lv)); - } - - public List getDetail(int v) { - int prob = (int) Math.round((MGConfig.COMMON.manaBurstDamage.get() * v) * 100); - int manaCost = MGConfig.COMMON.manaBurstCost.get() * v; - return List.of(Component.translatable(getDescriptionId() + ".desc", prob, manaCost).withStyle(ChatFormatting.GREEN)); - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaMendingModifier.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaMendingModifier.java deleted file mode 100644 index 1fba474dd..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaMendingModifier.java +++ /dev/null @@ -1,35 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.botania; - -import dev.xkmc.modulargolems.content.core.StatFilterType; -import dev.xkmc.modulargolems.content.entity.common.AbstractGolemEntity; -import dev.xkmc.modulargolems.init.data.MGConfig; -import net.minecraft.ChatFormatting; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; - -import java.util.List; - -public class ManaMendingModifier extends ManaModifier { - - public ManaMendingModifier() { - super(StatFilterType.HEALTH, MAX_LEVEL); - } - - @Override - public double onHealTick(double heal, AbstractGolemEntity le, int level) { - var healthDiff = le.getMaxHealth() - le.getHealth() - heal; - var cost = MGConfig.COMMON.manaMendingCost.get(); - int maxHeal = (int) Math.floor(Math.min(healthDiff, MGConfig.COMMON.manaMendingVal.get() * level)); - if (maxHeal <= 0) return heal; - int maxCost = maxHeal * cost; - int consume = new BotUtils(le).consumeMana(maxCost); - double toHeal = 1d * consume / cost; - return heal + toHeal; - } - - public List getDetail(int v) { - int eff = MGConfig.COMMON.manaMendingCost.get(); - double val = MGConfig.COMMON.manaMendingVal.get() * v; - return List.of(Component.translatable(getDescriptionId() + ".desc", val, eff).withStyle(ChatFormatting.GREEN)); - } -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaModifier.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaModifier.java deleted file mode 100644 index 5d035a2d4..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaModifier.java +++ /dev/null @@ -1,20 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.botania; - -import dev.xkmc.modulargolems.content.core.StatFilterType; -import dev.xkmc.modulargolems.content.entity.common.GolemFlags; -import dev.xkmc.modulargolems.content.modifier.base.GolemModifier; - -import java.util.function.Consumer; - -public class ManaModifier extends GolemModifier { - - public ManaModifier(StatFilterType type, int maxLevel) { - super(type, maxLevel); - } - - @Override - public void onRegisterFlag(Consumer addFlag) { - addFlag.accept(GolemFlags.BOTANIA); - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaProductionModifier.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaProductionModifier.java deleted file mode 100644 index 3a0916f8c..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/ManaProductionModifier.java +++ /dev/null @@ -1,29 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.botania; - -import dev.xkmc.modulargolems.content.core.StatFilterType; -import dev.xkmc.modulargolems.content.entity.common.AbstractGolemEntity; -import dev.xkmc.modulargolems.init.data.MGConfig; -import net.minecraft.ChatFormatting; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; - -import java.util.List; - -public class ManaProductionModifier extends ManaModifier { - - public ManaProductionModifier() { - super(StatFilterType.HEALTH, MAX_LEVEL); - } - - @Override - public double onHealTick(double heal, AbstractGolemEntity entity, int level) { - int prod = MGConfig.COMMON.manaProductionVal.get() * level; - new BotUtils(entity).generateMana(prod); - return heal; - } - - public List getDetail(int v) { - var prod = MGConfig.COMMON.manaProductionVal.get() * v; - return List.of(Component.translatable(getDescriptionId() + ".desc", prod).withStyle(ChatFormatting.GREEN)); - } -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/PixieAttackModifier.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/PixieAttackModifier.java deleted file mode 100644 index 82dd17fc6..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/PixieAttackModifier.java +++ /dev/null @@ -1,43 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.botania; - -import dev.xkmc.modulargolems.content.core.StatFilterType; -import dev.xkmc.modulargolems.content.entity.common.AbstractGolemEntity; -import dev.xkmc.modulargolems.content.modifier.base.GolemModifier; -import dev.xkmc.modulargolems.init.data.MGConfig; -import net.minecraft.ChatFormatting; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.entity.MobSpawnType; -import net.minecraft.world.level.ServerLevelAccessor; -import net.minecraftforge.event.entity.living.LivingHurtEvent; -import vazkii.botania.common.entity.PixieEntity; - -import java.util.List; - -public class PixieAttackModifier extends GolemModifier { - - public PixieAttackModifier() { - super(StatFilterType.ATTACK, MAX_LEVEL); - } - - @Override - public void onHurtTarget(AbstractGolemEntity entity, LivingHurtEvent event, int level) { - double prob = MGConfig.COMMON.pixieCounterattackProb.get() * level; - if (entity.getRandom().nextDouble() < prob) { - PixieEntity pixie = new PixieEntity(entity.level()); - pixie.setPos(entity.getX(), entity.getY() + 2, entity.getZ()); - float dmg = 4 + 2 * level; - pixie.setProps(event.getEntity(), entity, 0, dmg); - pixie.finalizeSpawn((ServerLevelAccessor) entity.level(), entity.level().getCurrentDifficultyAt(pixie.blockPosition()), - MobSpawnType.EVENT, null, null); - entity.level().addFreshEntity(pixie); - } - } - - public List getDetail(int v) { - int prob = (int) Math.round((MGConfig.COMMON.pixieAttackProb.get() * v) * 100); - double extraDmg = 2*v; - return List.of(Component.translatable(getDescriptionId() + ".desc", prob, extraDmg).withStyle(ChatFormatting.GREEN)); - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/PixieCounterattackModifier.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/PixieCounterattackModifier.java deleted file mode 100644 index 3c0f5f42b..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/PixieCounterattackModifier.java +++ /dev/null @@ -1,45 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.botania; - -import dev.xkmc.modulargolems.content.core.StatFilterType; -import dev.xkmc.modulargolems.content.entity.common.AbstractGolemEntity; -import dev.xkmc.modulargolems.content.modifier.base.GolemModifier; -import dev.xkmc.modulargolems.init.data.MGConfig; -import net.minecraft.ChatFormatting; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.MobSpawnType; -import net.minecraft.world.level.ServerLevelAccessor; -import net.minecraftforge.event.entity.living.LivingHurtEvent; -import vazkii.botania.common.entity.PixieEntity; - -import java.util.List; - -public class PixieCounterattackModifier extends GolemModifier { - - public PixieCounterattackModifier() { - super(StatFilterType.HEALTH, MAX_LEVEL); - } - - @Override - public void onHurt(AbstractGolemEntity entity, LivingHurtEvent event, int level) { - if (event.getSource().getEntity() instanceof LivingEntity le) { - double prob = MGConfig.COMMON.pixieCounterattackProb.get() * level; - if (entity.getRandom().nextDouble() < prob) { - PixieEntity pixie = new PixieEntity(entity.level()); - pixie.setPos(entity.getX(), entity.getY() + 2, entity.getZ()); - float dmg = 4 + 2 * entity.getModifiers().getOrDefault(BotCompatRegistry.PIXIE_ATTACK.get(), 0); - pixie.setProps(le, entity, 0, dmg); - pixie.finalizeSpawn((ServerLevelAccessor) entity.level(), entity.level().getCurrentDifficultyAt(pixie.blockPosition()), - MobSpawnType.EVENT, null, null); - entity.level().addFreshEntity(pixie); - } - } - } - - public List getDetail(int v) { - int prob = (int) Math.round((MGConfig.COMMON.pixieCounterattackProb.get() * v) * 100); - return List.of(Component.translatable(getDescriptionId() + ".desc", prob).withStyle(ChatFormatting.GREEN)); - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/package-info.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/package-info.java deleted file mode 100644 index 529f5f344..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/botania/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -@ParametersAreNonnullByDefault -@MethodsReturnNonnullByDefault - -package dev.xkmc.modulargolems.compat.materials.botania; - -import net.minecraft.MethodsReturnNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/cataclysm/LeviathanBlastPortalModifier.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/cataclysm/LeviathanBlastPortalModifier.java index 65a3d7913..9e1e80c74 100644 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/cataclysm/LeviathanBlastPortalModifier.java +++ b/src/main/java/dev/xkmc/modulargolems/compat/materials/cataclysm/LeviathanBlastPortalModifier.java @@ -1,6 +1,6 @@ package dev.xkmc.modulargolems.compat.materials.cataclysm; -import com.github.L_Ender.cataclysm.entity.AnimationMonster.BossMonsters.The_Leviathan.Abyss_Blast_Portal_Entity; +import com.github.L_Ender.cataclysm.entity.BossMonsters.The_Leviathan.Abyss_Blast_Portal_Entity; import dev.xkmc.modulargolems.content.core.StatFilterType; import dev.xkmc.modulargolems.content.entity.common.AbstractGolemEntity; import dev.xkmc.modulargolems.content.modifier.base.GolemModifier; diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/common/CompatManager.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/common/CompatManager.java index ed3fc8952..58d068c46 100644 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/common/CompatManager.java +++ b/src/main/java/dev/xkmc/modulargolems/compat/materials/common/CompatManager.java @@ -3,7 +3,6 @@ import com.tterrag.registrate.providers.RegistrateLangProvider; import com.tterrag.registrate.providers.RegistrateRecipeProvider; import dev.xkmc.modulargolems.compat.materials.blazegear.BGDispatch; -import dev.xkmc.modulargolems.compat.materials.botania.BotDispatch; import dev.xkmc.modulargolems.compat.materials.cataclysm.CataDispatch; import dev.xkmc.modulargolems.compat.materials.create.CreateDispatch; import dev.xkmc.modulargolems.compat.materials.l2complements.LCDispatch; @@ -24,7 +23,6 @@ public abstract class CompatManager { public static final List LIST = new ArrayList<>(); public static void register() { - if (ModList.get().isLoaded(BotDispatch.MODID)) LIST.add(new BotDispatch()); if (ModList.get().isLoaded(TFDispatch.MODID)) LIST.add(new TFDispatch()); if (ModList.get().isLoaded(CreateDispatch.MODID)) LIST.add(new CreateDispatch()); if (ModList.get().isLoaded(LCDispatch.MODID)) LIST.add(new LCDispatch()); @@ -62,10 +60,4 @@ public static void dispatchClientSetup() { } } - public static void lateRegister() { - for (ModDispatch dispatch : LIST) { - dispatch.lateRegister(); - } - } - } diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/common/ModDispatch.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/common/ModDispatch.java index 840d3c534..7ea6c95a4 100644 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/common/ModDispatch.java +++ b/src/main/java/dev/xkmc/modulargolems/compat/materials/common/ModDispatch.java @@ -31,7 +31,4 @@ public static T safeUpgrade(RegistrateRecipeProvider pvd, BiFunction COATING; public static final RegistryEntry PUSH; - public static final RegistryEntry BODY; - public static final RegistryEntry MOBILE; - public static final RegistryEntry FORCE; - public static final RegistryEntry EFF_MOBILE; - public static final RegistryEntry EFF_FORCE; - - public static final ItemEntry UP_COATING, UP_PUSH; - public static final ItemEntry DUMMY; + public static final RegistryEntry UP_COATING, UP_PUSH; static { COATING = reg("coating", CoatingModifier::new, "Reduce damage taken by %s"); PUSH = reg("push", () -> new AttributeGolemModifier(1, new AttributeGolemModifier.AttrEntry(GolemTypes.STAT_ATKKB, () -> 1) )).register(); - BODY = reg("mechanical_engine", MechBodyModifier::new, "Consumes fuels to power the golem up."); - MOBILE = reg("mechanical_mobility", MechMobileModifier::new, "When burning fuels, increase speed by %s%%"); - FORCE = reg("mechanical_force", MechForceModifier::new, "When burning fuels, increase attack damage by %s%%"); UP_COATING = regModUpgrade("coating", () -> COATING, CreateDispatch.MODID).lang("Zinc Upgrade").register(); UP_PUSH = regModUpgrade("push", () -> PUSH, CreateDispatch.MODID).lang("Extendo Upgrade").register(); - - EFF_MOBILE = genEffect("mechanical_mobility", () -> new MechMobileEffect(MobEffectCategory.BENEFICIAL, 0xffffffff), - "Increase golem movement speed"); - EFF_FORCE = genEffect("mechanical_force", () -> new MechForceEffect(MobEffectCategory.BENEFICIAL, 0xffffffff), - "Increase golem attack damage"); - - DUMMY = ModularGolems.REGISTRATE.item("dummy_furnace", p -> new DummyFurnace()) - .model((ctx, pvd) -> pvd.withExistingParent("item/" + ctx.getName(), "block/air")) - .removeTab(GolemItems.TAB.getKey()) - .register(); - } - - private static RegistryEntry genEffect(String name, NonNullSupplier sup, String desc) { - return ModularGolems.REGISTRATE.effect(name, sup, desc).lang(MobEffect::getDescriptionId).register(); } public static void register() { - MGTagGen.OPTIONAL_ITEM.add(e -> e.addTag(MGTagGen.SPECIAL_CRAFT) - .addOptional(AllItems.ANDESITE_ALLOY.getId()) - .addOptionalTag(new ResourceLocation("forge", "ingots/brass")) - .addOptional(AllBlocks.RAILWAY_CASING.getId())); - if (ModList.get().isLoaded(L2Complements.MODID)) { - MGTagGen.OPTIONAL_EFF.add(e -> e.addTag(TagGen.SKILL_EFFECT) - .addOptional(EFF_MOBILE.getId()).addOptional(EFF_FORCE.getId())); - } + } } diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/CreateConfigGen.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/CreateConfigGen.java index 84866f596..d0e289a1a 100644 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/CreateConfigGen.java +++ b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/CreateConfigGen.java @@ -29,39 +29,33 @@ public void add(Collector map) { map.add(ModularGolems.MATERIALS, new ResourceLocation(CreateDispatch.MODID, CreateDispatch.MODID), new GolemMaterialConfig() .addMaterial(new ResourceLocation(CreateDispatch.MODID, "zinc"), Ingredient.of(AllTags.forgeItemTag("ingots/zinc"))) - .addStat(GolemTypes.STAT_HEALTH.get(), 50) - .addStat(GolemTypes.STAT_ATTACK.get(), 10) + .addStat(GolemTypes.STAT_HEALTH.get(), 20) + .addStat(GolemTypes.STAT_ATTACK.get(), 5) .addModifier(CreateCompatRegistry.COATING.get(), 1).end() .addMaterial(new ResourceLocation(CreateDispatch.MODID, "andesite_alloy"), Ingredient.of(AllItems.ANDESITE_ALLOY.get())) - .addStat(GolemTypes.STAT_HEALTH.get(), 30) + .addStat(GolemTypes.STAT_HEALTH.get(), 20) .addStat(GolemTypes.STAT_ATTACK.get(), 5) - .addModifier(CreateCompatRegistry.BODY.get(), 1) - .addModifier(CreateCompatRegistry.MOBILE.get(), 1) - .addModifier(CreateCompatRegistry.FORCE.get(), 1) + .addStat(GolemTypes.STAT_SPEED.get(), 0.1) .addModifier(GolemModifiers.MAGIC_RES.get(), 1).end() .addMaterial(new ResourceLocation(CreateDispatch.MODID, "brass"), Ingredient.of(AllTags.forgeItemTag("ingots/brass"))) - .addStat(GolemTypes.STAT_HEALTH.get(), 150) - .addStat(GolemTypes.STAT_ATTACK.get(), 15) + .addStat(GolemTypes.STAT_HEALTH.get(), 160) + .addStat(GolemTypes.STAT_ATTACK.get(), 16) .addStat(GolemTypes.STAT_KBRES.get(), 0.5) - .addModifier(CreateCompatRegistry.BODY.get(), 1) - .addModifier(CreateCompatRegistry.MOBILE.get(), 1) - .addModifier(CreateCompatRegistry.FORCE.get(), 1) + .addStat(GolemTypes.STAT_SPEED.get(), 0.2) .addModifier(GolemModifiers.MAGIC_RES.get(), 2).end() .addMaterial(new ResourceLocation(CreateDispatch.MODID, "railway"), Ingredient.of(AllBlocks.RAILWAY_CASING.get())) - .addStat(GolemTypes.STAT_HEALTH.get(), 300) - .addStat(GolemTypes.STAT_ATTACK.get(), 15) + .addStat(GolemTypes.STAT_HEALTH.get(), 320) + .addStat(GolemTypes.STAT_ATTACK.get(), 16) + .addStat(GolemTypes.STAT_SPEED.get(), 0.4) .addStat(GolemTypes.STAT_SWEEP.get(), 1) .addStat(GolemTypes.STAT_KBRES.get(), 1) .addStat(GolemTypes.STAT_ATKKB.get(), 1) - .addModifier(CreateCompatRegistry.BODY.get(), 1) - .addModifier(CreateCompatRegistry.MOBILE.get(), 2) - .addModifier(CreateCompatRegistry.FORCE.get(), 2) .addModifier(GolemModifiers.MAGIC_RES.get(), 2) .addModifier(GolemModifiers.FIRE_IMMUNE.get(), 1).end() diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/CreateDispatch.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/CreateDispatch.java index d12e47e9e..839218ac2 100644 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/CreateDispatch.java +++ b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/CreateDispatch.java @@ -4,22 +4,16 @@ import com.simibubi.create.AllTags; import com.tterrag.registrate.providers.RegistrateLangProvider; import com.tterrag.registrate.providers.RegistrateRecipeProvider; -import com.tterrag.registrate.util.entry.ItemEntry; import dev.xkmc.l2library.serial.config.ConfigDataProvider; import dev.xkmc.l2library.serial.recipe.ConditionalRecipeWrapper; import dev.xkmc.modulargolems.compat.materials.common.ModDispatch; -import dev.xkmc.modulargolems.compat.materials.create.automation.*; -import dev.xkmc.modulargolems.init.ModularGolems; import dev.xkmc.modulargolems.init.registrate.GolemItems; import net.minecraft.data.DataGenerator; import net.minecraft.data.recipes.RecipeCategory; import net.minecraft.data.recipes.ShapedRecipeBuilder; -import net.minecraftforge.client.model.generators.ModelFile; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.ModList; -import java.util.List; - public class CreateDispatch extends ModDispatch { public static final String MODID = "create"; @@ -33,21 +27,6 @@ public CreateDispatch() { } - @Override - public void lateRegister() { - List> str = List.of(GolemItems.GOLEM_BODY, GolemItems.GOLEM_ARM, GolemItems.GOLEM_LEGS, - GolemItems.HUMANOID_BODY, GolemItems.HUMANOID_ARMS, GolemItems.HUMANOID_LEGS, - GolemItems.DOG_BODY, GolemItems.DOG_LEGS); - for (var part : str) { - ModularGolems.REGISTRATE.item("incomplete_" + part.getId().getPath(), - p -> new GolemIncompleteItem(p, part)) - .removeTab(GolemItems.TAB.getKey()) - .model((ctx, pvd) -> pvd.getBuilder(ctx.getName()).parent(new ModelFile.UncheckedModelFile("builtin/entity")) - .texture("particle", "minecraft:block/clay")) - .defaultLang().register(); - } - } - public void genLang(RegistrateLangProvider pvd) { pvd.add("golem_material." + MODID + ".zinc", "Zinc"); pvd.add("golem_material." + MODID + ".andesite_alloy", "Andesite Alloy"); @@ -71,7 +50,7 @@ public void genRecipe(RegistrateRecipeProvider pvd) { .define('C', AllItems.PRECISION_MECHANISM.get()) .save(ConditionalRecipeWrapper.mod(pvd, MODID)); - CreateGolemRecipeGen.genAllUpgradeRecipes(pvd); + CreateMixingRecipeGen.genAllUpgradeRecipes(pvd); } diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/ConditionalSARecipeBuilder.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/ConditionalSARecipeBuilder.java deleted file mode 100644 index 84942a482..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/ConditionalSARecipeBuilder.java +++ /dev/null @@ -1,18 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.create.automation; - -import com.simibubi.create.content.processing.sequenced.SequencedAssemblyRecipeBuilder; -import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.common.crafting.conditions.ICondition; - -public class ConditionalSARecipeBuilder extends SequencedAssemblyRecipeBuilder { - - public ConditionalSARecipeBuilder(ResourceLocation id) { - super(id); - } - - public ConditionalSARecipeBuilder withCondition(ICondition condition) { - this.recipeConditions.add(condition); - return this; - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/CreateGolemRecipeGen.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/CreateGolemRecipeGen.java deleted file mode 100644 index bdd51ec73..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/CreateGolemRecipeGen.java +++ /dev/null @@ -1,102 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.create.automation; - -import com.simibubi.create.AllBlocks; -import com.simibubi.create.AllItems; -import com.simibubi.create.AllTags; -import com.simibubi.create.content.kinetics.deployer.DeployerApplicationRecipe; -import com.simibubi.create.content.kinetics.press.PressingRecipe; -import com.tterrag.registrate.providers.RegistrateRecipeProvider; -import dev.xkmc.l2library.serial.config.ConfigDataProvider; -import dev.xkmc.modulargolems.compat.materials.common.CompatManager; -import dev.xkmc.modulargolems.compat.materials.common.ModDispatch; -import dev.xkmc.modulargolems.compat.materials.create.CreateDispatch; -import dev.xkmc.modulargolems.compat.materials.create.automation.ConditionalSARecipeBuilder; -import dev.xkmc.modulargolems.content.config.GolemMaterialConfig; -import dev.xkmc.modulargolems.content.item.golem.GolemPart; -import dev.xkmc.modulargolems.init.ModularGolems; -import dev.xkmc.modulargolems.init.data.MGConfigGen; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.item.crafting.Ingredient; -import net.minecraft.world.level.ItemLike; -import net.minecraftforge.common.crafting.conditions.ModLoadedCondition; -import net.minecraftforge.registries.ForgeRegistries; - -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -public class CreateGolemRecipeGen { - - private static final Set SPECIAL = Set.of("andesite_alloy", "brass", "railway"); - - public static void genAllUpgradeRecipes(RegistrateRecipeProvider pvd) { - var ing = gatherConfig(); - for (var part : GolemPart.LIST) { - for (var ent : ing.entrySet()) { - if (SPECIAL.contains(ent.getKey().getPath())) continue; - genAssembly(pvd, part, ent.getKey(), ent.getValue()); - } - } - genSpecialRecipes(pvd); - } - - public static void genSpecialRecipes(RegistrateRecipeProvider pvd) { - for (var part : GolemPart.LIST) { - genAssembly(pvd, part, new ResourceLocation(CreateDispatch.MODID, "andesite_alloy"), AllItems.ANDESITE_ALLOY, AllBlocks.COGWHEEL); - genAssembly(pvd, part, new ResourceLocation(CreateDispatch.MODID, "brass"), Ingredient.of(AllTags.forgeItemTag("ingots/brass")), AllItems.PRECISION_MECHANISM); - genAssembly(pvd, part, new ResourceLocation(CreateDispatch.MODID, "railway"), Ingredient.of(AllTags.forgeItemTag("plates/brass")), AllItems.PRECISION_MECHANISM, AllItems.ELECTRON_TUBE, AllItems.STURDY_SHEET); - } - } - - private static void genAssembly(RegistrateRecipeProvider pvd, GolemPart part, ResourceLocation id, ItemLike ingredient, ItemLike... parts) { - genAssembly(pvd, part, id, Ingredient.of(ingredient), parts); - } - - private static void genAssembly(RegistrateRecipeProvider pvd, GolemPart part, ResourceLocation id, Ingredient ingredient, ItemLike... parts) { - var part_rl = ForgeRegistries.ITEMS.getKey(part); - assert part_rl != null; - String item_name = part_rl.getPath(); - var recipe = new ConditionalSARecipeBuilder(new ResourceLocation(ModularGolems.MODID, - id.getPath() + "_assemble_" + item_name)); - var incomplete = ForgeRegistries.ITEMS.getValue(part_rl.withPrefix("incomplete_")); - recipe.require(part).transitionTo(incomplete); - recipe.addStep(DeployerApplicationRecipe::new, e -> e.require(ingredient)); - if (parts.length == 0) { - for (int i = 0; i < 3; i++) { - recipe.addStep(PressingRecipe::new, e -> e); - } - } else { - recipe.addStep(PressingRecipe::new, e -> e); - for (var p : parts) { - recipe.addStep(DeployerApplicationRecipe::new, e -> e.require(p)); - } - recipe.addStep(DeployerApplicationRecipe::new, e -> e.require(AllItems.WRENCH).toolNotConsumed()); - } - recipe.loops(part.count); - String modid = id.getNamespace(); - recipe.withCondition(new ModLoadedCondition(CreateDispatch.MODID)); - if (!modid.equals(ModularGolems.MODID) && !modid.equals(CreateDispatch.MODID)) { - recipe.withCondition(new ModLoadedCondition(modid)); - } - recipe.addOutput(GolemPart.setMaterial(part.getDefaultInstance(), id), 1); - recipe.build(pvd); - } - - @SuppressWarnings("ConstantConditions") - private static Map gatherConfig() { - ConfigDataProvider.Collector map = new ConfigDataProvider.Collector(new HashMap<>()); - for (ModDispatch dispatch : CompatManager.LIST) { - var gen = dispatch.getDataGen(null); - gen.add(map); - } - new MGConfigGen(null).add(map); - Map ing = new HashMap<>(); - for (ConfigDataProvider.ConfigEntry config : map.map().values()) { - if (config.config() instanceof GolemMaterialConfig mat) { - ing.putAll(mat.ingredients); - } - } - return ing; - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/CreateJEIEvents.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/CreateJEIEvents.java deleted file mode 100644 index 5a1533175..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/CreateJEIEvents.java +++ /dev/null @@ -1,12 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.create.automation; - -import dev.xkmc.modulargolems.compat.jei.CustomRecipeEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; - -public class CreateJEIEvents { - - @SubscribeEvent - public static void onJEICustomRecipe(CustomRecipeEvent event) { - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/CreateRecipeEvents.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/CreateRecipeEvents.java deleted file mode 100644 index 23ca0c0b9..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/CreateRecipeEvents.java +++ /dev/null @@ -1,95 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.create.automation; - -import com.simibubi.create.content.kinetics.deployer.DeployerRecipeSearchEvent; -import dev.xkmc.modulargolems.content.core.IGolemPart; -import dev.xkmc.modulargolems.content.entity.common.AbstractGolemEntity; -import dev.xkmc.modulargolems.content.item.equipments.GolemEquipmentItem; -import dev.xkmc.modulargolems.content.item.golem.GolemHolder; -import dev.xkmc.modulargolems.content.item.upgrade.UpgradeItem; -import dev.xkmc.modulargolems.events.CraftEventListeners; -import dev.xkmc.modulargolems.init.registrate.GolemTypes; -import net.minecraft.server.level.ServerLevel; -import net.minecraft.world.entity.EquipmentSlot; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.ModList; -import net.minecraftforge.registries.ForgeRegistries; -import top.theillusivec4.curios.Curios; -import top.theillusivec4.curios.api.CuriosApi; - -import java.util.Optional; - -public class CreateRecipeEvents { - - @SubscribeEvent - public static void addRecipe(DeployerRecipeSearchEvent event) { - ItemStack first = event.getInventory().getItem(0); - ItemStack second = event.getInventory().getItem(1); - if (!(first.getItem() instanceof GolemHolder holder)) return; - ItemStack result; - Level level = event.getBlockEntity().getLevel(); - if (!(level instanceof ServerLevel sl)) return; - if (second.getItem() instanceof UpgradeItem upgrade) { - result = CraftEventListeners.appendUpgrade(first, holder, upgrade); - } else if (isGolemCurio(holder, second)) { - result = equipCurio(holder, first, second, sl); - } else if (holder.getEntityType() == GolemTypes.TYPE_GOLEM.get()) { - if (!(second.getItem() instanceof GolemEquipmentItem equipment)) return; - if (!equipment.isFor(GolemTypes.ENTITY_GOLEM.get())) return; - EquipmentSlot slot = equipment.getSlot(); - result = equip(holder, first, second, slot, sl); - } else if (holder.getEntityType() == GolemTypes.TYPE_HUMANOID.get()) { - EquipmentSlot slot = LivingEntity.getEquipmentSlotForItem(second); - result = equip(holder, first, second, slot, sl); - } else return; - if (result.isEmpty()) return; - event.addRecipe(() -> Optional.of(new DeployerUpgradeRecipe(result)), 1000); - } - - private static boolean isGolemCurio(GolemHolder holder, ItemStack stack) { - if (!ModList.get().isLoaded(Curios.MODID)) return false; - var set = CuriosApi.getEntitySlots(holder.getEntityType().type()).keySet(); - return ForgeRegistries.ITEMS.tags().getReverseTag(stack.getItem()) - .map(e -> e.getTagKeys().anyMatch(t -> - t.location().getNamespace().equals(Curios.MODID) && - set.contains(t.location().getPath()))) - .orElse(false); - } - - private static , P extends IGolemPart

> - ItemStack equipCurio(GolemHolder holder, ItemStack golem, ItemStack equip, Level level) { - if (!ModList.get().isLoaded(Curios.MODID)) return ItemStack.EMPTY; - T entity = holder.createDummy(golem, level); - if (entity == null) return ItemStack.EMPTY; - var opt = CuriosApi.getCuriosInventory(entity).resolve(); - if (opt.isEmpty()) return ItemStack.EMPTY; - equip = equip.copy(); - equip.setCount(1); - for (var slot : CuriosApi.getItemStackSlots(equip, entity).keySet()) { - var handler = opt.get().getStacksHandler(slot); - if (handler.isEmpty()) continue; - var stacks = handler.get().getStacks(); - for (int i = 0; i < stacks.getSlots(); i++) { - if (stacks.getStackInSlot(i).isEmpty()) { - stacks.setStackInSlot(i, equip); - return GolemHolder.setEntity(entity); - } - } - } - return ItemStack.EMPTY; - } - - private static , P extends IGolemPart

> - ItemStack equip(GolemHolder holder, ItemStack golem, ItemStack equip, EquipmentSlot slot, Level level) { - T entity = holder.createDummy(golem, level); - if (entity == null) return ItemStack.EMPTY; - if (!entity.getItemBySlot(slot).isEmpty()) return ItemStack.EMPTY; - equip = equip.copy(); - equip.setCount(1); - entity.setItemSlot(slot, equip); - return GolemHolder.setEntity(entity); - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/DeployerUpgradeRecipe.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/DeployerUpgradeRecipe.java deleted file mode 100644 index 63fea084d..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/DeployerUpgradeRecipe.java +++ /dev/null @@ -1,48 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.create.automation; - -import net.minecraft.core.RegistryAccess; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.Container; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.Recipe; -import net.minecraft.world.item.crafting.RecipeSerializer; -import net.minecraft.world.item.crafting.RecipeType; -import net.minecraft.world.level.Level; - -public record DeployerUpgradeRecipe(ItemStack result) implements Recipe { - @Override - public boolean matches(Container container, Level level) { - return false; - } - - @Override - public ItemStack assemble(Container container, RegistryAccess access) { - return ItemStack.EMPTY; - } - - @Override - public boolean canCraftInDimensions(int w, int h) { - return false; - } - - @Override - public ItemStack getResultItem(RegistryAccess access) { - return result.copy(); - } - - @Override - public ResourceLocation getId() { - return null; - } - - @Override - public RecipeSerializer getSerializer() { - return null; - } - - @Override - public RecipeType getType() { - return null; - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/DummyFurnace.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/DummyFurnace.java deleted file mode 100644 index c6f9603b6..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/DummyFurnace.java +++ /dev/null @@ -1,30 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.create.automation; - -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.ProjectileWeaponItem; -import net.minecraft.world.item.crafting.RecipeType; -import net.minecraftforge.common.ForgeHooks; - -import java.util.function.Predicate; - -public class DummyFurnace extends ProjectileWeaponItem { - - public DummyFurnace() { - super(new Properties()); - } - - private static boolean isValid(ItemStack stack) { - return ForgeHooks.getBurnTime(stack, RecipeType.SMELTING) > 0; - } - - @Override - public Predicate getAllSupportedProjectiles() { - return DummyFurnace::isValid; - } - - @Override - public int getDefaultProjectileRange() { - return 0; - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/GolemIncompleteItem.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/GolemIncompleteItem.java deleted file mode 100644 index d3d876140..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/GolemIncompleteItem.java +++ /dev/null @@ -1,31 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.create.automation; - -import com.simibubi.create.content.processing.sequenced.SequencedAssemblyItem; -import com.tterrag.registrate.util.entry.ItemEntry; -import dev.xkmc.modulargolems.content.item.golem.GolemBEWLR; -import dev.xkmc.modulargolems.content.item.golem.GolemPart; -import dev.xkmc.modulargolems.content.item.golem.IGolemPartItem; -import net.minecraftforge.client.extensions.common.IClientItemExtensions; - -import java.util.function.Consumer; - -public class GolemIncompleteItem extends SequencedAssemblyItem implements IGolemPartItem { - - private final ItemEntry item; - - public GolemIncompleteItem(Properties prop, ItemEntry item) { - super(prop); - this.item = item; - } - - @Override - public void initializeClient(Consumer consumer) { - consumer.accept(GolemBEWLR.EXTENSIONS); - } - - @Override - public GolemPart asPart() { - return (GolemPart) item.get(); - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/package-info.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/package-info.java deleted file mode 100644 index 4b08a74d5..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/automation/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -@ParametersAreNonnullByDefault -@MethodsReturnNonnullByDefault - -package dev.xkmc.modulargolems.compat.materials.create.automation; - -import net.minecraft.MethodsReturnNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/CoatingModifier.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/CoatingModifier.java deleted file mode 100644 index 817a45fcc..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/CoatingModifier.java +++ /dev/null @@ -1,30 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.create.modifier; - -import dev.xkmc.modulargolems.content.core.StatFilterType; -import dev.xkmc.modulargolems.content.entity.common.AbstractGolemEntity; -import dev.xkmc.modulargolems.content.modifier.base.GolemModifier; -import dev.xkmc.modulargolems.init.data.MGConfig; -import net.minecraft.ChatFormatting; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; -import net.minecraftforge.event.entity.living.LivingDamageEvent; - -import java.util.List; - -public class CoatingModifier extends GolemModifier { - - public CoatingModifier() { - super(StatFilterType.MASS, 5); - } - - public List getDetail(int v) { - double reduce = v * MGConfig.COMMON.coating.get(); - return List.of(Component.translatable(getDescriptionId() + ".desc", reduce).withStyle(ChatFormatting.GREEN)); - } - - @Override - public void onDamaged(AbstractGolemEntity entity, LivingDamageEvent event, int level) { - event.setAmount((float) Math.max(0, event.getAmount() - level * MGConfig.COMMON.coating.get())); - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/MechBodyModifier.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/MechBodyModifier.java deleted file mode 100644 index 8ebc6b5f2..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/MechBodyModifier.java +++ /dev/null @@ -1,99 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.create.modifier; - -import dev.xkmc.modulargolems.compat.materials.create.CreateCompatRegistry; -import dev.xkmc.modulargolems.content.core.StatFilterType; -import dev.xkmc.modulargolems.content.entity.common.AbstractGolemEntity; -import dev.xkmc.modulargolems.content.modifier.base.GolemModifier; -import dev.xkmc.modulargolems.init.data.MGConfig; -import net.minecraft.sounds.SoundEvents; -import net.minecraft.world.InteractionHand; -import net.minecraft.world.InteractionResult; -import net.minecraft.world.effect.MobEffectInstance; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.RecipeType; -import net.minecraftforge.common.ForgeHooks; - -public class MechBodyModifier extends GolemModifier { - - public MechBodyModifier() { - super(StatFilterType.HEAD, 1); - } - - @Override - public void onAiStep(AbstractGolemEntity golem, int level) { - if (golem.level().isClientSide()) return; - int threshold = 200; - if (golem.tickCount % 20 != 0) return; - int mobile = golem.getModifiers().getOrDefault(CreateCompatRegistry.MOBILE.get(), 0); - int force = golem.getModifiers().getOrDefault(CreateCompatRegistry.FORCE.get(), 0); - if (mobile == 0 && force == 0) return; - var mobileIns = golem.getEffect(CreateCompatRegistry.EFF_MOBILE.get()); - var forceIns = golem.getEffect(CreateCompatRegistry.EFF_FORCE.get()); - int mobileTime = 0; - int forceTime = 0; - if (mobileIns != null) mobileTime = mobileIns.getDuration(); - if (forceIns != null) forceTime = forceIns.getDuration(); - if (mobile > 0 && mobileTime < threshold || - force > 0 && forceTime < threshold) { - ItemStack fuel = golem.getProjectile(CreateCompatRegistry.DUMMY.asStack()); - LivingEntity self = golem; - if (fuel.isEmpty()) { - var captain = golem.getCaptain(); - if (captain != null) { - self = captain; - fuel = captain.getProjectile(CreateCompatRegistry.DUMMY.asStack()); - } - if (fuel.isEmpty()) return; - } - int time = ForgeHooks.getBurnTime(fuel, RecipeType.SMELTING); - if (time <= 0) return; - ItemStack remain = fuel.getCraftingRemainingItem(); - if (!remain.isEmpty()) { - self.spawnAtLocation(remain); - } - fuel.shrink(1); - if (mobile > 0) golem.addEffect(new MobEffectInstance(CreateCompatRegistry.EFF_MOBILE.get(), - mobileTime + time, mobile - 1)); - if (force > 0) golem.addEffect(new MobEffectInstance(CreateCompatRegistry.EFF_FORCE.get(), - forceTime + time, force - 1)); - } - } - - @Override - public InteractionResult interact(Player player, AbstractGolemEntity golem, InteractionHand hand) { - ItemStack stack = player.getItemInHand(hand); - int time = ForgeHooks.getBurnTime(stack, RecipeType.SMELTING); - if (time <= 0) return InteractionResult.PASS; - int mobile = golem.getModifiers().getOrDefault(CreateCompatRegistry.MOBILE.get(), 0); - int force = golem.getModifiers().getOrDefault(CreateCompatRegistry.FORCE.get(), 0); - if (mobile == 0 && force == 0) return InteractionResult.FAIL; - if (player.level().isClientSide()) return InteractionResult.SUCCESS; - var mobileIns = golem.getEffect(CreateCompatRegistry.EFF_MOBILE.get()); - var forceIns = golem.getEffect(CreateCompatRegistry.EFF_FORCE.get()); - int mobileTime = 0; - int forceTime = 0; - if (mobileIns != null) mobileTime = mobileIns.getDuration(); - if (forceIns != null) forceTime = forceIns.getDuration(); - int maxFactor = MGConfig.COMMON.mechMaxFuel.get(); - if (mobile > 0 && mobileTime >= time * maxFactor) - return InteractionResult.FAIL; - if (force > 0 && forceTime >= time * maxFactor) - return InteractionResult.FAIL; - if (mobile > 0) golem.addEffect(new MobEffectInstance(CreateCompatRegistry.EFF_MOBILE.get(), - mobileTime + time, mobile - 1)); - if (force > 0) golem.addEffect(new MobEffectInstance(CreateCompatRegistry.EFF_FORCE.get(), - forceTime + time, force - 1)); - if (!player.isCreative()) { - ItemStack remain = stack.getCraftingRemainingItem(); - stack.shrink(1); - if (!remain.isEmpty()) { - player.getInventory().placeItemBackInInventory(remain); - } - } - float f1 = 1 + (golem.getRandom().nextFloat() - golem.getRandom().nextFloat()) * 0.2F; - golem.playSound(SoundEvents.IRON_GOLEM_REPAIR, 1, f1); - return InteractionResult.SUCCESS; - } -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/MechForceEffect.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/MechForceEffect.java deleted file mode 100644 index 5e21c7e34..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/MechForceEffect.java +++ /dev/null @@ -1,23 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.create.modifier; - -import dev.xkmc.l2library.base.effects.api.InherentEffect; -import dev.xkmc.l2library.util.math.MathHelper; -import dev.xkmc.modulargolems.init.data.MGConfig; -import net.minecraft.world.effect.MobEffectCategory; -import net.minecraft.world.entity.ai.attributes.AttributeModifier; -import net.minecraft.world.entity.ai.attributes.Attributes; - -public class MechForceEffect extends InherentEffect { - - public MechForceEffect(MobEffectCategory category, int color) { - super(category, color); - var uuid = MathHelper.getUUIDFromString("modulargolems:mech_force"); - addAttributeModifier(Attributes.ATTACK_DAMAGE, uuid.toString(), 0.2, AttributeModifier.Operation.MULTIPLY_BASE); - } - - @Override - public double getAttributeModifierValue(int lv, AttributeModifier val) { - return MGConfig.COMMON.mechAttack.get() * (lv + 1); - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/MechForceModifier.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/MechForceModifier.java deleted file mode 100644 index c8c28268e..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/MechForceModifier.java +++ /dev/null @@ -1,24 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.create.modifier; - -import dev.xkmc.modulargolems.content.core.StatFilterType; -import dev.xkmc.modulargolems.content.modifier.base.GolemModifier; -import dev.xkmc.modulargolems.init.data.MGConfig; -import net.minecraft.ChatFormatting; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.entity.ai.attributes.AttributeModifier; - -import java.util.List; - -public class MechForceModifier extends GolemModifier { - - public MechForceModifier() { - super(StatFilterType.ATTACK, 5); - } - - public List getDetail(int v) { - int reduce = (int) Math.round(v * MGConfig.COMMON.mechAttack.get() * 100); - return List.of(Component.translatable(getDescriptionId() + ".desc", reduce).withStyle(ChatFormatting.GREEN)); - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/MechMobileEffect.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/MechMobileEffect.java deleted file mode 100644 index b1431de01..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/MechMobileEffect.java +++ /dev/null @@ -1,23 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.create.modifier; - -import dev.xkmc.l2library.base.effects.api.InherentEffect; -import dev.xkmc.l2library.util.math.MathHelper; -import dev.xkmc.modulargolems.init.data.MGConfig; -import net.minecraft.world.effect.MobEffectCategory; -import net.minecraft.world.entity.ai.attributes.AttributeModifier; -import net.minecraft.world.entity.ai.attributes.Attributes; - -public class MechMobileEffect extends InherentEffect { - - public MechMobileEffect(MobEffectCategory category, int color) { - super(category, color); - var uuid = MathHelper.getUUIDFromString("modulargolems:mech_mobility"); - addAttributeModifier(Attributes.MOVEMENT_SPEED, uuid.toString(), 0.2, AttributeModifier.Operation.MULTIPLY_BASE); - } - - @Override - public double getAttributeModifierValue(int lv, AttributeModifier val) { - return MGConfig.COMMON.mechSpeed.get() * (lv + 1); - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/MechMobileModifier.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/MechMobileModifier.java deleted file mode 100644 index 46bc34c20..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/MechMobileModifier.java +++ /dev/null @@ -1,25 +0,0 @@ -package dev.xkmc.modulargolems.compat.materials.create.modifier; - -import dev.xkmc.modulargolems.content.core.StatFilterType; -import dev.xkmc.modulargolems.content.entity.common.AbstractGolemEntity; -import dev.xkmc.modulargolems.content.modifier.base.GolemModifier; -import dev.xkmc.modulargolems.init.data.MGConfig; -import net.minecraft.ChatFormatting; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; -import net.minecraftforge.event.entity.living.LivingDamageEvent; - -import java.util.List; - -public class MechMobileModifier extends GolemModifier { - - public MechMobileModifier() { - super(StatFilterType.MOVEMENT, 5); - } - - public List getDetail(int v) { - int reduce = (int) Math.round(v * MGConfig.COMMON.mechSpeed.get() * 100); - return List.of(Component.translatable(getDescriptionId() + ".desc", reduce).withStyle(ChatFormatting.GREEN)); - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/package-info.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/package-info.java deleted file mode 100644 index 7069c7c79..000000000 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/modifier/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -@ParametersAreNonnullByDefault -@MethodsReturnNonnullByDefault - -package dev.xkmc.modulargolems.compat.materials.create.modifier; - -import net.minecraft.MethodsReturnNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/twilightforest/TFCompatRegistry.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/twilightforest/TFCompatRegistry.java index da3e4b629..58b996fe5 100644 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/twilightforest/TFCompatRegistry.java +++ b/src/main/java/dev/xkmc/modulargolems/compat/materials/twilightforest/TFCompatRegistry.java @@ -21,8 +21,8 @@ public class TFCompatRegistry { static { FIERY = reg("fiery", FieryModifier::new, "Deal %s%% fire damage to mobs not immune to fire"); - TF_DAMAGE = reg("tf_damage", TFDamageModifier::new, "TF Damage Bonus", "Deal %s%% extra damage in twilight forest"); - TF_HEALING = reg("tf_healing", TFHealingModifier::new, "TF Healing Bonus", "Healing becomes %s%% more in twilight forest"); + TF_DAMAGE = reg("tf_damage", TFDamageModifier::new, "TF Damage Bonus", "Deal %s%% damage in twilight forest"); + TF_HEALING = reg("tf_healing", TFHealingModifier::new, "TF Healing Bonus", "Healing becomes %s%% in twilight forest"); CARMINITE = reg("carminite", CarminiteModifier::new, "After being hurt, turn invisible and invinsible for %s seconds"); NAGA = reg("naga", () -> new AttributeGolemModifier(2, new AttributeGolemModifier.AttrEntry(GolemTypes.STAT_ARMOR, () -> 10), diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/twilightforest/TFConfigGen.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/twilightforest/TFConfigGen.java index 75248c0b6..36335885c 100644 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/twilightforest/TFConfigGen.java +++ b/src/main/java/dev/xkmc/modulargolems/compat/materials/twilightforest/TFConfigGen.java @@ -27,7 +27,7 @@ public void add(Collector map) { .addMaterial(new ResourceLocation(TFDispatch.MODID, "steeleaf"), Ingredient.of(ItemTagGenerator.STEELEAF_INGOTS)) .addStat(GolemTypes.STAT_HEALTH.get(), 20) - .addStat(GolemTypes.STAT_ATTACK.get(), 24) + .addStat(GolemTypes.STAT_ATTACK.get(), 30) .addModifier(TFCompatRegistry.TF_DAMAGE.get(), 1) .addModifier(TFCompatRegistry.TF_HEALING.get(), 1).end() diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/twilightforest/TFDamageModifier.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/twilightforest/TFDamageModifier.java index 1947de54e..8dfccec01 100644 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/twilightforest/TFDamageModifier.java +++ b/src/main/java/dev/xkmc/modulargolems/compat/materials/twilightforest/TFDamageModifier.java @@ -1,7 +1,5 @@ package dev.xkmc.modulargolems.compat.materials.twilightforest; -import dev.xkmc.l2damagetracker.contents.attack.AttackCache; -import dev.xkmc.l2damagetracker.contents.attack.DamageModifier; import dev.xkmc.modulargolems.content.core.StatFilterType; import dev.xkmc.modulargolems.content.entity.common.AbstractGolemEntity; import dev.xkmc.modulargolems.content.modifier.base.GolemModifier; @@ -20,16 +18,15 @@ public TFDamageModifier() { } @Override - public void modifyDamage(AttackCache cache, AbstractGolemEntity entity, int level) { + public float modifyDamage(float damage, AbstractGolemEntity entity, int level) { if (entity.level().dimensionTypeId().equals(TFDimensionSettings.TWILIGHT_DIM_TYPE)) { - double dmg = MGConfig.COMMON.compatTFDamage.get() * level; - cache.addHurtModifier(DamageModifier.multTotal(1 + (float) dmg)); + return (float) (damage * (1 + MGConfig.COMMON.compatTFDamage.get() * level)); } - + return damage; } public List getDetail(int v) { - int bonus = (int) Math.round((MGConfig.COMMON.compatTFDamage.get() * v) * 100); + int bonus = (int) Math.round((1 + MGConfig.COMMON.compatTFDamage.get() * v) * 100); return List.of(Component.translatable(getDescriptionId() + ".desc", bonus).withStyle(ChatFormatting.GREEN)); } diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/twilightforest/TFHealingModifier.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/twilightforest/TFHealingModifier.java index 7a961dff5..d0950f86b 100644 --- a/src/main/java/dev/xkmc/modulargolems/compat/materials/twilightforest/TFHealingModifier.java +++ b/src/main/java/dev/xkmc/modulargolems/compat/materials/twilightforest/TFHealingModifier.java @@ -25,7 +25,7 @@ public double onInventoryHealTick(double heal, HealingContext ctx, int level) { } public List getDetail(int v) { - int bonus = (int) Math.round((MGConfig.COMMON.compatTFHealing.get() * v) * 100); + int bonus = (int) Math.round((1 + MGConfig.COMMON.compatTFHealing.get() * v) * 100); return List.of(Component.translatable(getDescriptionId() + ".desc", bonus).withStyle(ChatFormatting.GREEN)); } diff --git a/src/main/java/dev/xkmc/modulargolems/compat/misc/MaidCompat.java b/src/main/java/dev/xkmc/modulargolems/compat/misc/MaidCompat.java index c688fbdeb..a42ea7a96 100644 --- a/src/main/java/dev/xkmc/modulargolems/compat/misc/MaidCompat.java +++ b/src/main/java/dev/xkmc/modulargolems/compat/misc/MaidCompat.java @@ -1,71 +1,4 @@ package dev.xkmc.modulargolems.compat.misc; -import com.github.tartaricacid.touhoulittlemaid.api.entity.IMaid; -import com.github.tartaricacid.touhoulittlemaid.api.event.ConvertMaidEvent; -import com.github.tartaricacid.touhoulittlemaid.client.renderer.entity.EntityMaidRenderer; -import com.github.tartaricacid.touhoulittlemaid.init.InitItems; -import com.github.tartaricacid.touhoulittlemaid.item.ItemGarageKit; -import com.mojang.blaze3d.vertex.PoseStack; -import dev.xkmc.modulargolems.content.entity.humanoid.HumanoidGolemEntity; -import dev.xkmc.modulargolems.content.entity.humanoid.skin.ClientSkinDispatch; -import dev.xkmc.modulargolems.content.entity.humanoid.skin.SpecialRenderSkin; -import dev.xkmc.modulargolems.events.event.HumanoidSkinEvent; -import dev.xkmc.modulargolems.init.ModularGolems; -import net.minecraft.client.renderer.MultiBufferSource; -import net.minecraft.world.entity.Mob; -import net.minecraft.world.item.ItemStack; -import net.minecraftforge.client.event.EntityRenderersEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; - public class MaidCompat { - - private static EntityMaidRenderer RENDERER; - - @SubscribeEvent - public static void onMaidConvert(ConvertMaidEvent event) { - if (!(event.getEntity() instanceof HumanoidGolemEntity golem)) return; - if (ClientSkinDispatch.get(golem) instanceof MaidSkin skin) - event.setMaid(new MaidWrapper(golem, skin.id)); - } - - @SubscribeEvent - public static void onHumanoidSkin(HumanoidSkinEvent event) { - ItemStack stack = event.getStack(); - if (stack.is(InitItems.GARAGE_KIT.get())) { - var id = ItemGarageKit.getMaidData(stack).getString("ModelId"); - event.setSkin(new MaidSkin(id)); - } - } - - public static void addLayers(EntityRenderersEvent.AddLayers event) { - RENDERER = new EntityMaidRenderer(event.getContext()); - } - - private record MaidSkin(String id) implements SpecialRenderSkin { - - @Override - public void render(HumanoidGolemEntity entity, float f1, float f2, PoseStack stack, MultiBufferSource source, int i) { - if (RENDERER == null) return; - try { - RENDERER.render(entity, f1, f2, stack, source, i); - } catch (Exception e) { - ModularGolems.LOGGER.debug("Error rendering golem with TLM skin", e); - } - } - } - - private record MaidWrapper(Mob mob, String id) implements IMaid { - - @Override - public String getModelId() { - return id; - } - - @Override - public Mob asEntity() { - return mob; - } - - } - } diff --git a/src/main/java/dev/xkmc/modulargolems/content/client/armor/GolemEquipmentModels.java b/src/main/java/dev/xkmc/modulargolems/content/client/armor/GolemEquipmentModels.java deleted file mode 100644 index b11533d9e..000000000 --- a/src/main/java/dev/xkmc/modulargolems/content/client/armor/GolemEquipmentModels.java +++ /dev/null @@ -1,122 +0,0 @@ -package dev.xkmc.modulargolems.content.client.armor; - -import dev.xkmc.modulargolems.init.ModularGolems; -import net.minecraft.client.model.geom.ModelLayerLocation; -import net.minecraft.client.model.geom.PartPose; -import net.minecraft.client.model.geom.builders.*; -import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.client.event.EntityRenderersEvent; - -import java.util.ArrayList; -import java.util.List; - -public class GolemEquipmentModels { - - public static final List LIST = new ArrayList<>(); - - public static final ModelLayerLocation HELMET_LAYER = new ModelLayerLocation(new ResourceLocation(ModularGolems.MODID, "golem_helmet"), "main"); - public static final ModelLayerLocation CHESTPLATE_LAYER = new ModelLayerLocation(new ResourceLocation(ModularGolems.MODID, "golem_chestplate"), "main"); - public static final ModelLayerLocation SHINGUARD_LAYER = new ModelLayerLocation(new ResourceLocation(ModularGolems.MODID, "golem_shinguard"), "main"); - public static final ModelLayerLocation METALGOLEM = new ModelLayerLocation(new ResourceLocation(ModularGolems.MODID, "metalgolem"), "model"); - - public static MeshDefinition buildGolemBaseLayers() { - MeshDefinition mesh = new MeshDefinition(); - PartDefinition partdefinition = mesh.getRoot(); - partdefinition.addOrReplaceChild("head", CubeListBuilder.create().texOffs(0, 0).addBox(-4.0F, -12.0F, -5.5F, 8.0F, 10.0F, 8.0F).texOffs(24, 0).addBox(-1.0F, -5.0F, -7.5F, 2.0F, 4.0F, 2.0F), PartPose.offset(0.0F, -7.0F, -2.0F)); - partdefinition.addOrReplaceChild("body", CubeListBuilder.create().texOffs(0, 40).addBox(-9.0F, -2.0F, -6.0F, 18.0F, 12.0F, 11.0F).texOffs(0, 70).addBox(-4.5F, 10.0F, -3.0F, 9.0F, 5.0F, 6.0F, new CubeDeformation(0.5F)), PartPose.offset(0.0F, -7.0F, 0.0F)); - partdefinition.addOrReplaceChild("right_arm", CubeListBuilder.create().texOffs(60, 21).addBox(-13.0F, -2.5F, -3.0F, 4.0F, 14.0F, 6.0F), PartPose.offset(0.0F, -7.0F, 0.0F)); - partdefinition.addOrReplaceChild("left_arm", CubeListBuilder.create().texOffs(60, 58).addBox(9.0F, -2.5F, -3.0F, 4.0F, 14.0F, 6.0F), PartPose.offset(0.0F, -7.0F, 0.0F)); - partdefinition.addOrReplaceChild("right_leg", CubeListBuilder.create().texOffs(37, 0).addBox(-3.5F, -3.0F, -3.0F, 6.0F, 16.0F, 5.0F), PartPose.offset(-4.0F, 11.0F, 0.0F)); - partdefinition.addOrReplaceChild("left_leg", CubeListBuilder.create().texOffs(60, 0).mirror().addBox(-3.5F, -3.0F, -3.0F, 6.0F, 16.0F, 5.0F), PartPose.offset(5.0F, 11.0F, 0.0F)); - PartDefinition root1 = mesh.getRoot().getChild("right_arm"); - root1.addOrReplaceChild("right_forearm", CubeListBuilder.create().texOffs(60, 35).addBox(-12.99F, 0F, -6.0F, 4.0F, 16.0F, 6.0F), PartPose.offsetAndRotation(0.0F, 11.5F, 3.0F, 0.0F, 0.0F, 0.0F)); - PartDefinition root2 = mesh.getRoot().getChild("left_arm"); - root2.addOrReplaceChild("left_forearm", CubeListBuilder.create().texOffs(60, 72).addBox(8.99F, 0F, -6.0F, 4.0F, 16.0F, 6.0F), PartPose.offsetAndRotation(0.0F, 11.5F, 3.0F, 0.0F, 0.0F, 0.0F)); - return mesh; - } - - public static LayerDefinition createHelmetLayer() { - MeshDefinition mesh = buildGolemBaseLayers(); - PartDefinition root = mesh.getRoot().getChild("head"); - root.addOrReplaceChild("helmet3", CubeListBuilder.create().texOffs(0, 48).addBox(-4.0F, -44.0F, -8.0F, 9.0F, 12.0F, 9.0F, new CubeDeformation(0.0F)) - .texOffs(76, 39).addBox(-4.5F, -37.0F, -6.25F, 10.0F, 5.0F, 8.0F, new CubeDeformation(0.0F)), PartPose.offset(-0.5F, 31.0F, 2.0F)); - - root.addOrReplaceChild("helmet17", CubeListBuilder.create().texOffs(48, 105).addBox(-5.5F, 28.0F, 0.0F, 9.0F, 12.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-5.5F, -43.0F, -1.5F, 0.0F, 0.8727F, 0.0F)); - - root.addOrReplaceChild("helmet16", CubeListBuilder.create().texOffs(108, 52).addBox(-3.5F, 28.0F, 0.0F, 9.0F, 12.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(5.5F, -43.0F, -1.5F, 0.0F, -0.8727F, 0.0F)); - - root.addOrReplaceChild("helmet15", CubeListBuilder.create(), PartPose.offsetAndRotation(0.5F, -36.0F, -5.25F, 0.4363F, 0.0F, 0.0F)); - - root.addOrReplaceChild("helmet8", CubeListBuilder.create(), PartPose.offsetAndRotation(1.0F, 0.0F, -2.0F, 0.0F, 0.3491F, 0.0F)); - - root.addOrReplaceChild("helmet9", CubeListBuilder.create().texOffs(50, 0).addBox(2.0F, 28.0F, -2.0F, 6.0F, 4.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-4.5F, -40.5F, -3.5F, 0.0F, 0.0F, 0.2182F)); - - root.addOrReplaceChild("helmet10", CubeListBuilder.create().texOffs(70, 39).addBox(13.0F, 24.5F, 0.5F, 4.0F, 4.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-7.8669F, -41.8411F, -3.5F, 0.0F, 0.1309F, 0.5672F)); - - root.addOrReplaceChild("helmet11", CubeListBuilder.create().texOffs(0, 0).addBox(-17.0F, -4.5F, -5.5F, 4.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-2.384F, -0.549F, 0.0F, 0.0F, 0.0873F, 0.7418F)); - - root.addOrReplaceChild("helmet4", CubeListBuilder.create(), PartPose.offsetAndRotation(0.0F, 0.0F, -2.0F, 0.0F, -0.3491F, 0.0F)); - - root.addOrReplaceChild("helmet6", CubeListBuilder.create().texOffs(105, 14).addBox(-8.0F, 28.0F, -2.0F, 6.0F, 4.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(4.5F, -40.5F, -3.5F, 0.0F, 0.0F, -0.2182F)); - - root.addOrReplaceChild("helmet5", CubeListBuilder.create().texOffs(73, 18).addBox(-16.0F, 24.5F, 0.5F, 4.0F, 4.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(7.8669F, -41.8411F, -3.5F, 0.0F, -0.1309F, -0.5672F)); - - root.addOrReplaceChild("helmet7", CubeListBuilder.create().texOffs(0, 5).addBox(14.0F, -4.5F, -5.5F, 4.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(2.384F, -0.549F, 0.0F, 0.0F, -0.0873F, -0.7418F)); - - root.addOrReplaceChild("helmet", CubeListBuilder.create().texOffs(58, 12).addBox(-1.0F, -49.0F, -6.0F, 1.0F, 14.0F, 13.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 31.0F, 2.0F)); - return LayerDefinition.create(mesh, 128, 128); - } - - public static LayerDefinition createChestplateLayer() { - MeshDefinition mesh = buildGolemBaseLayers(); - PartDefinition root = mesh.getRoot().getChild("body"); - root.addOrReplaceChild("main_body", CubeListBuilder.create().texOffs(0, 0).addBox(-9.5F, 4.5F, -6.6F, 19.0F, 13.0F, 12.0F, new CubeDeformation(0.0F)) - .texOffs(19, 110).addBox(5.5F, 3.5F, -7.75F, 2.0F, 8.0F, 7.0F, new CubeDeformation(0.0F)) - .texOffs(105, 28).addBox(-7.5F, 3.5F, -7.75F, 2.0F, 8.0F, 7.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -7.0F, 0.0F)); - PartDefinition root_ra1 = mesh.getRoot().getChild("right_arm"); - PartDefinition root_rfa = mesh.getRoot().getChild("right_arm").getChild("right_forearm"); - root_ra1.addOrReplaceChild("main_rightarm1", CubeListBuilder.create().texOffs(0, 83).addBox(-14.5F, -33.5F, -3.5F, 6.0F, 10.0F, 7.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 31.0F, 0.0F)); - root_rfa.addOrReplaceChild("main_rightforearm", CubeListBuilder.create().texOffs(89, 104).addBox(-13.0F, -29.5F, -6.5F, 4.01F, 7.0F, 7.0F, new CubeDeformation(0.0F)) - .texOffs(0, 111).addBox(-17.0F, -32.75F, -3.5F, 5.0F, 12.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 31.0F, 0.0F)); - root_ra1.addOrReplaceChild("main_rightarm2", CubeListBuilder.create().texOffs(90, 65).addBox(27.75F, 8.75F, -5.0F, 7.0F, 3.0F, 8.0F, new CubeDeformation(0.0F)) - .texOffs(76, 52).addBox(27F, 4.75F, -5.5F, 7.0F, 4.0F, 9.0F, new CubeDeformation(0.0F)) - .texOffs(65, 67).addBox(26.25F, 2.75F, -6.5F, 7.0F, 3.0F, 11.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-11.75F, -31.75F, 1.0F, 0.0F, 0.0F, 1.3526F)); - PartDefinition root_la1 = mesh.getRoot().getChild("left_arm"); - PartDefinition root_lfa = mesh.getRoot().getChild("left_arm").getChild("left_forearm"); - root_la1.addOrReplaceChild("main_leftarm1", CubeListBuilder.create().texOffs(86, 18).addBox(8.75F, -33.5F, -3.5F, 6.0F, 10.0F, 7.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 31.0F, 0.0F)); - root_la1.addOrReplaceChild("main_leftarm2", CubeListBuilder.create().texOffs(96, 82).addBox(-34.5F, 8.75F, -5.0F, 7.0F, 3.0F, 8.0F, new CubeDeformation(0.0F)) - .texOffs(47, 81).addBox(-33.75F, 4.75F, -5.5F, 7.0F, 4.0F, 9.0F, new CubeDeformation(0.0F)) - .texOffs(0, 69).addBox(-33.0F, 2.75F, -6.5F, 7.0F, 3.0F, 11.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(11.75F, -31.75F, 1.0F, 0.0F, 0.0F, -1.3526F)); - root_lfa.addOrReplaceChild("main_leftforearm", CubeListBuilder.create().texOffs(105, 0).addBox(8.98F, -29.5F, -6.5F, 4.01F, 7.0F, 7.0F, new CubeDeformation(0.0F)) - .texOffs(68, 111).addBox(11.75F, -32.75F, -3.5F, 5.0F, 12.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 31.0F, 0.0F)); - return LayerDefinition.create(mesh, 128, 128); - } - - public static LayerDefinition createShinGuard() { - MeshDefinition mesh = buildGolemBaseLayers(); - PartDefinition root1 = mesh.getRoot().getChild("body"); - root1.addOrReplaceChild("main_shinguard", CubeListBuilder.create().texOffs(70, 81).addBox(-5.0F, 19.0F, -3.5F, 10.0F, 2.0F, 7.0F, new CubeDeformation(0.5F)), PartPose.offset(0.0F, -7.0F, 0.0F)); - PartDefinition root2 = mesh.getRoot().getChild("right_leg"); - root2.addOrReplaceChild("shinguard1", CubeListBuilder.create().texOffs(48, 94).addBox(0.0F, -9.0F, -3.5F, 7.0F, 5.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offset(-4.0F, 11.0F, 0.0F)); - PartDefinition root3 = mesh.getRoot().getChild("left_leg"); - root3.addOrReplaceChild("shinguard2", CubeListBuilder.create().texOffs(0, 100).addBox(-9.0F, -9.0F, -3.5F, 7.0F, 5.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offset(5.0F, 11.0F, 0.0F)); - return LayerDefinition.create(mesh, 128, 128); - } - - public static LayerDefinition createGolemLayer() { - MeshDefinition mesh = buildGolemBaseLayers(); - return LayerDefinition.create(mesh, 128, 128); - } - - public static void registerArmorLayer(EntityRenderersEvent.RegisterLayerDefinitions event) { - LIST.add(HELMET_LAYER); - event.registerLayerDefinition(HELMET_LAYER, GolemEquipmentModels::createHelmetLayer); - LIST.add(CHESTPLATE_LAYER); - event.registerLayerDefinition(CHESTPLATE_LAYER, GolemEquipmentModels::createChestplateLayer); - LIST.add(SHINGUARD_LAYER); - event.registerLayerDefinition(SHINGUARD_LAYER, GolemEquipmentModels::createShinGuard); - event.registerLayerDefinition(METALGOLEM, GolemEquipmentModels::createGolemLayer); - } - -} - diff --git a/src/main/java/dev/xkmc/modulargolems/content/client/armor/GolemModelPath.java b/src/main/java/dev/xkmc/modulargolems/content/client/armor/GolemModelPath.java index 41239c7bc..bb3347a6d 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/client/armor/GolemModelPath.java +++ b/src/main/java/dev/xkmc/modulargolems/content/client/armor/GolemModelPath.java @@ -13,7 +13,7 @@ public record GolemModelPath(ModelLayerLocation models, List> paths static { register(GolemModelPaths.HELMETS, - new GolemModelPath(GolemEquipmentModels.HELMET_LAYER, List.of( + new GolemModelPath(MetalGolemBasicModels.HELMET_LAYER, List.of( List.of("head", "helmet3"), List.of("head", "helmet17"), List.of("head", "helmet16"), @@ -30,7 +30,7 @@ public record GolemModelPath(ModelLayerLocation models, List> paths ))); register(GolemModelPaths.CHESTPLATES, - new GolemModelPath(GolemEquipmentModels.CHESTPLATE_LAYER, List.of( + new GolemModelPath(MetalGolemBasicModels.CHESTPLATE_LAYER, List.of( List.of("body", "main_body"), List.of("right_arm", "main_rightarm2"), List.of("right_arm", "right_forearm", "main_rightforearm"), @@ -41,7 +41,7 @@ public record GolemModelPath(ModelLayerLocation models, List> paths ))); register(GolemModelPaths.LEGGINGS, - new GolemModelPath(GolemEquipmentModels.SHINGUARD_LAYER, List.of( + new GolemModelPath(MetalGolemBasicModels.SHINGUARD_LAYER, List.of( List.of("body", "main_shinguard"), List.of("right_leg", "shinguard1"), List.of("left_leg", "shinguard2") diff --git a/src/main/java/dev/xkmc/modulargolems/content/client/overlay/GolemStatusOverlay.java b/src/main/java/dev/xkmc/modulargolems/content/client/overlay/GolemStatusOverlay.java index 22e0bafca..f915d3199 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/client/overlay/GolemStatusOverlay.java +++ b/src/main/java/dev/xkmc/modulargolems/content/client/overlay/GolemStatusOverlay.java @@ -5,9 +5,7 @@ import dev.xkmc.l2library.util.Proxy; import dev.xkmc.l2library.util.raytrace.IGlowingTarget; import dev.xkmc.l2library.util.raytrace.RayTraceUtil; -import dev.xkmc.modulargolems.compat.materials.botania.BotUtils; import dev.xkmc.modulargolems.content.entity.common.AbstractGolemEntity; -import dev.xkmc.modulargolems.content.entity.common.GolemFlags; import dev.xkmc.modulargolems.content.entity.humanoid.HumanoidGolemEntity; import dev.xkmc.modulargolems.content.item.wand.GolemInteractItem; import dev.xkmc.modulargolems.init.data.MGLangData; @@ -53,9 +51,6 @@ public void render(ForgeGui gui, GuiGraphics g, float partialTick, int screenWid gui.setupOverlayRenderState(true, false); List text = new ArrayList<>(); text.add(golem.getName()); - if (golem.hasFlag(GolemFlags.BOTANIA)) { - text.add(BotUtils.getDesc(golem)); - } text.add(golem.getMode().getDesc(golem)); var config = golem.getConfigEntry(MGLangData.LOADING.get()); if (config != null) { diff --git a/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java b/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java index f2afccaa1..65e2b7d16 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java +++ b/src/main/java/dev/xkmc/modulargolems/content/client/pose/CustomModelAnimation.java @@ -11,48 +11,80 @@ * @author Author */ public class CustomModelAnimation { - public static final AnimationDefinition warningInAxe = AnimationDefinition.Builder.withLength(1.0F) - .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, - new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.0833F, KeyframeAnimations.degreeVec(-110.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) - )) - .addAnimation("right_forearm", new AnimationChannel(AnimationChannel.Targets.ROTATION, - new Keyframe(0.0F, KeyframeAnimations.degreeVec(-2160.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.5F, KeyframeAnimations.degreeVec(-75.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) - )) - .build(); - - public static final AnimationDefinition attackInAxe = AnimationDefinition.Builder.withLength(1.25F) .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, new Keyframe(0.0F, KeyframeAnimations.degreeVec(-110.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.25F, KeyframeAnimations.degreeVec(-32.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.25F, KeyframeAnimations.degreeVec(-12.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), new Keyframe(0.5F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) )) .addAnimation("right_forearm", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(-87.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.25F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.5F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + )) + .addAnimation("weapon", new AnimationChannel(AnimationChannel.Targets.ROTATION, new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.25F, KeyframeAnimations.degreeVec(80.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.25F, KeyframeAnimations.degreeVec(7.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), new Keyframe(0.5F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) )) .build(); - public static final AnimationDefinition attackInSpear = AnimationDefinition.Builder.withLength(1.75F) + public static final AnimationDefinition attackInSpear = AnimationDefinition.Builder.withLength(0.7917F) .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, new Keyframe(0.0F, KeyframeAnimations.degreeVec(85.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), new Keyframe(0.25F, KeyframeAnimations.degreeVec(-57.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), new Keyframe(0.5F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) )) + .addAnimation("right_forearm", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(-87.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.25F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.5F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + )) + .addAnimation("weapon", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.25F, KeyframeAnimations.degreeVec(57.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.5F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + )) + .build(); + + public static final AnimationDefinition warningInSpear = AnimationDefinition.Builder.withLength(0.625F) + .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.25F, KeyframeAnimations.degreeVec(85.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + )) .addAnimation("right_forearm", new AnimationChannel(AnimationChannel.Targets.ROTATION, new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.25F, KeyframeAnimations.degreeVec(87.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.5F, KeyframeAnimations.degreeVec(-2.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + new Keyframe(0.25F, KeyframeAnimations.degreeVec(-85.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) )) .build(); - public static final AnimationDefinition warningInSpear = AnimationDefinition.Builder.withLength(0.7083F) + public static final AnimationDefinition warningInAxe = AnimationDefinition.Builder.withLength(0.9583F) .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), - new Keyframe(0.2083F, KeyframeAnimations.degreeVec(85.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + new Keyframe(0.25F, KeyframeAnimations.degreeVec(-110.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + )) + .addAnimation("right_forearm", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.25F, KeyframeAnimations.degreeVec(-87.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + )) + .build(); + + public static final AnimationDefinition attackUnarmed = AnimationDefinition.Builder.withLength(1.5417F) + .addAnimation("right_arm", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(-145.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.25F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + )) + .addAnimation("right_forearm", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(-52.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.25F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + )) + .addAnimation("arm1", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(-145.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.25F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) + )) + .addAnimation("bone2", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(-52.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), + new Keyframe(0.25F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR) )) .build(); } \ No newline at end of file diff --git a/src/main/java/dev/xkmc/modulargolems/content/core/GolemType.java b/src/main/java/dev/xkmc/modulargolems/content/core/GolemType.java index 86e5d794b..ba4e0a70c 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/core/GolemType.java +++ b/src/main/java/dev/xkmc/modulargolems/content/core/GolemType.java @@ -82,10 +82,6 @@ public T createForDisplay(CompoundTag tag) { return golem; } - public EntityType type() { - return type.get(); - } - public P[] values() { return list.get(); } diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/common/AbstractGolemEntity.java b/src/main/java/dev/xkmc/modulargolems/content/entity/common/AbstractGolemEntity.java index 4c21af074..e3c09c711 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/common/AbstractGolemEntity.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/common/AbstractGolemEntity.java @@ -18,9 +18,9 @@ import dev.xkmc.modulargolems.content.item.card.DefaultFilterCard; import dev.xkmc.modulargolems.content.item.card.PathRecordCard; import dev.xkmc.modulargolems.content.item.equipments.GolemEquipmentItem; -import dev.xkmc.modulargolems.content.item.equipments.TickEquipmentItem; import dev.xkmc.modulargolems.content.item.golem.GolemHolder; import dev.xkmc.modulargolems.content.item.upgrade.UpgradeItem; +import dev.xkmc.modulargolems.content.item.wand.GolemInteractItem; import dev.xkmc.modulargolems.content.modifier.base.GolemModifier; import dev.xkmc.modulargolems.init.ModularGolems; import dev.xkmc.modulargolems.init.advancement.GolemTriggers; @@ -161,18 +161,8 @@ public boolean hasFlag(GolemFlags flag) { } @Override - protected final InteractionResult mobInteract(Player player, InteractionHand hand) { - if (player.getItemInHand(hand).is(MGTagGen.GOLEM_INTERACT)) return InteractionResult.PASS; - for (var ent : modifiers.entrySet()) { - var result = ent.getKey().interact(player, this, hand); - if (result != InteractionResult.PASS) { - return result; - } - } - return mobInteractImpl(player, hand); - } - - protected InteractionResult mobInteractImpl(Player player, InteractionHand hand) { + protected InteractionResult mobInteract(Player player, InteractionHand hand) { + if (player.getItemInHand(hand).getItem() instanceof GolemInteractItem) return InteractionResult.PASS; if (!MGConfig.COMMON.barehandRetrieve.get() || !this.canModify(player)) return InteractionResult.FAIL; if (player.getMainHandItem().isEmpty()) { if (!level().isClientSide()) { @@ -191,7 +181,7 @@ protected InteractionResult mobInteractImpl(Player player, InteractionHand hand) } } } - return InteractionResult.PASS; + return super.mobInteract(player, hand); } @ServerOnly @@ -427,7 +417,11 @@ public boolean canAttack(LivingEntity target) { } protected float getAttackDamage() { - return (float) this.getAttributeValue(Attributes.ATTACK_DAMAGE); + float ans = (float) this.getAttributeValue(Attributes.ATTACK_DAMAGE); + for (var entry : getModifiers().entrySet()) { + ans = entry.getKey().modifyDamage(ans, this, entry.getValue()); + } + return ans; } @Override @@ -441,12 +435,6 @@ public void tick() { entry.getKey().onClientTick(this, entry.getValue()); } } - for (var slot: EquipmentSlot.values()) { - var stack = this.getItemBySlot(slot); - if (stack.getItem() instanceof TickEquipmentItem tickItem) { - tickItem.tick(stack, this.level(), this); - } - } } @Override diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/common/AbstractGolemRenderer.java b/src/main/java/dev/xkmc/modulargolems/content/entity/common/AbstractGolemRenderer.java index e3f24bec5..a69c75565 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/common/AbstractGolemRenderer.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/common/AbstractGolemRenderer.java @@ -45,6 +45,7 @@ protected void scale(T entity, PoseStack pose, float f) { pose.scale(r, r, r); } + @Deprecated public ResourceLocation getTextureLocation(T entity) { return GOLEM_LOCATION; } diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/common/GolemFlags.java b/src/main/java/dev/xkmc/modulargolems/content/entity/common/GolemFlags.java index 401a37bd6..68a9cde02 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/common/GolemFlags.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/common/GolemFlags.java @@ -2,5 +2,5 @@ public enum GolemFlags { IMMUNITY, FIRE_IMMUNE, FREEZE_IMMUNE, THUNDER_IMMUNE, SEE_THROUGH, RECYCLE, - FLOAT, SWIM, PICKUP, MENDING, NO_DESTROY, PASSIVE, EARTH_QUAKE, BOTANIA + FLOAT, SWIM, PICKUP, MENDING, NO_DESTROY, PASSIVE, EARTH_QUAKE } diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/dog/DogGolemEntity.java b/src/main/java/dev/xkmc/modulargolems/content/entity/dog/DogGolemEntity.java index d51405d81..5f286f917 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/dog/DogGolemEntity.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/dog/DogGolemEntity.java @@ -3,6 +3,8 @@ import dev.xkmc.l2serial.serialization.SerialClass; import dev.xkmc.modulargolems.content.entity.common.AbstractGolemEntity; import dev.xkmc.modulargolems.content.entity.goals.GolemMeleeGoal; +import dev.xkmc.modulargolems.content.item.golem.GolemHolder; +import dev.xkmc.modulargolems.content.item.wand.GolemInteractItem; import dev.xkmc.modulargolems.init.data.MGConfig; import dev.xkmc.modulargolems.init.registrate.GolemModifiers; import dev.xkmc.modulargolems.init.registrate.GolemTypes; @@ -17,8 +19,6 @@ import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.damagesource.DamageSource; -import net.minecraft.world.effect.MobEffectInstance; -import net.minecraft.world.effect.MobEffects; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; @@ -36,13 +36,7 @@ public class DogGolemEntity extends AbstractGolemEntity { public float getJumpStrength() { - float ans = (float) getAttributeValue(GolemTypes.GOLEM_JUMP.get()); - MobEffectInstance ins = getEffect(MobEffects.JUMP); - if (ins != null) { - int lv = ins.getAmplifier() + 1; - ans *= (1 + lv * 0.625f); - } - return ans; + return (float) getAttributeValue(GolemTypes.GOLEM_JUMP.get()); } public DogGolemEntity(EntityType type, Level level) { @@ -243,12 +237,12 @@ public Vec3 getLeashOffset() { return new Vec3(0.0D, 0.6F * this.getEyeHeight(), this.getBbWidth() * 0.4F); } - protected InteractionResult mobInteractImpl(Player player, InteractionHand hand) { + protected InteractionResult mobInteract(Player player, InteractionHand hand) { + if (player.getItemInHand(hand).getItem() instanceof GolemInteractItem) return InteractionResult.PASS; + if (player.getItemInHand(hand).getItem() instanceof GolemHolder) return InteractionResult.PASS; ItemStack itemstack = player.getItemInHand(hand); - if (MGConfig.COMMON.strictInteract.get() && !itemstack.isEmpty()) - return InteractionResult.PASS; if (!player.isShiftKeyDown() && itemstack.isEmpty()) - return super.mobInteractImpl(player, hand); + return super.mobInteract(player, hand); else { if (!this.level().isClientSide() && canModify(player)) this.setInSittingPose(!this.isInSittingPose()); diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/goals/FollowOwnerGoal.java b/src/main/java/dev/xkmc/modulargolems/content/entity/goals/FollowOwnerGoal.java index 00c9f0378..7c3b72819 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/goals/FollowOwnerGoal.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/goals/FollowOwnerGoal.java @@ -73,7 +73,8 @@ public void stop() { * Keep ticking a continuous task that has already been started */ public void tick() { - Vec3 target = this.golem.getTargetPos(); + float offset = 0;//-(golem.getBbWidth() + 1) / 2; + Vec3 target = this.golem.getTargetPos().add(offset, 0, offset); LivingEntity owner = this.golem.getOwner(); if (owner != null) this.golem.getLookControl().setLookAt(owner, 10.0F, (float) this.golem.getMaxHeadXRot()); diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/HumanoidGolemEntity.java b/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/HumanoidGolemEntity.java index e72c1ec09..6fdf602d3 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/HumanoidGolemEntity.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/HumanoidGolemEntity.java @@ -9,9 +9,9 @@ import dev.xkmc.modulargolems.content.entity.ranged.GolemShooterHelper; import dev.xkmc.modulargolems.content.entity.ranged.GolemTridentAttackGoal; import dev.xkmc.modulargolems.content.item.golem.GolemHolder; +import dev.xkmc.modulargolems.content.item.wand.GolemInteractItem; import dev.xkmc.modulargolems.events.event.*; import dev.xkmc.modulargolems.init.advancement.GolemTriggers; -import dev.xkmc.modulargolems.init.data.MGConfig; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; @@ -271,10 +271,9 @@ protected boolean performDamageTarget(Entity target, float damage, double kb) { } @Override - protected InteractionResult mobInteractImpl(Player player, InteractionHand hand) { + protected InteractionResult mobInteract(Player player, InteractionHand hand) { + if (player.getItemInHand(hand).getItem() instanceof GolemInteractItem) return InteractionResult.PASS; ItemStack itemstack = player.getItemInHand(hand); - if (MGConfig.COMMON.strictInteract.get() && !itemstack.isEmpty()) - return InteractionResult.PASS; if (player.isShiftKeyDown()) { if (canModify(player)) { for (EquipmentSlot slot : EquipmentSlot.values()) { @@ -282,12 +281,12 @@ protected InteractionResult mobInteractImpl(Player player, InteractionHand hand) } } if (itemstack.isEmpty()) { - super.mobInteractImpl(player, hand); + super.mobInteract(player, hand); } return InteractionResult.SUCCESS; } if (itemstack.isEmpty()) { - return super.mobInteractImpl(player, hand); + return super.mobInteract(player, hand); } if ((itemstack.getItem() instanceof GolemHolder) || !itemstack.getItem().canFitInsideContainerItems() || @@ -422,18 +421,16 @@ private void switchWeapon(ItemWrapper mainhand, ItemWrapper offhand) { ItemStack main = mainhand.getItem(); ItemStack off = offhand.getItem(); if (main.getItem() instanceof ProjectileWeaponItem) { - if (!getProjectile(main).isEmpty()) { - if (off.canPerformAction(ToolActions.SHIELD_BLOCK)) { + if (getProjectile(main).isEmpty()) { + if (off.isEmpty() || + off.getItem() instanceof ProjectileWeaponItem || + off.getItem() instanceof ArrowItem) { + return; + } + } else { + if (target == null || !meleeGoal.canReachTarget(target)) { return; } - } - if (off.isEmpty() || - off.getItem() instanceof ProjectileWeaponItem || - off.getItem() instanceof ArrowItem) { - return; - } - if (target == null || !meleeGoal.canReachTarget(target)) { - return; } } else if (off.getItem() instanceof ProjectileWeaponItem) { boolean noArrow = getProjectile(off).isEmpty(); @@ -443,7 +440,9 @@ private void switchWeapon(ItemWrapper mainhand, ItemWrapper offhand) { if (target != null && meleeGoal.canReachTarget(target)) { return; } - } else if (!main.isEmpty() || off.isEmpty()) { + } else if (main.isEmpty() && !off.isEmpty()) { + + } else { return; } mainhand.setItem(off); diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/HumanoidGolemRenderer.java b/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/HumanoidGolemRenderer.java index 3efeaadc1..1e7a41452 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/HumanoidGolemRenderer.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/HumanoidGolemRenderer.java @@ -4,7 +4,6 @@ import com.mojang.math.Axis; import dev.xkmc.modulargolems.content.entity.common.AbstractGolemRenderer; import dev.xkmc.modulargolems.content.entity.common.GolemBannerLayer; -import dev.xkmc.modulargolems.content.entity.humanoid.skin.ClientSkinDispatch; import net.minecraft.client.CameraType; import net.minecraft.client.Minecraft; import net.minecraft.client.model.HumanoidModel; @@ -95,10 +94,16 @@ public void render(HumanoidGolemEntity entity, float f1, float f2, PoseStack sta camera != null && camera.getVehicle() != null && entity.getVehicle() == camera.getVehicle()) return; - var profile = ClientSkinDispatch.get(entity); + var profile = ClientProfileManager.get(entity); if (profile != null) { - profile.render(entity, f1, f2, stack, source, i); - return; + if (profile.slim() && PlayerSkinRenderer.SLIM != null) { + PlayerSkinRenderer.SLIM.render(entity, f1, f2, stack, source, i); + return; + } + if (!profile.slim() && PlayerSkinRenderer.REGULAR != null) { + PlayerSkinRenderer.REGULAR.render(entity, f1, f2, stack, source, i); + return; + } } renderImpl(entity, f1, f2, stack, source, i); } diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/ClientProfileManager.java b/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/ClientProfileManager.java deleted file mode 100644 index 7f8805e46..000000000 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/ClientProfileManager.java +++ /dev/null @@ -1,43 +0,0 @@ -package dev.xkmc.modulargolems.content.entity.humanoid.skin; - -import com.mojang.authlib.GameProfile; -import com.mojang.authlib.minecraft.MinecraftProfileTexture; -import dev.xkmc.modulargolems.compat.curio.CurioCompatRegistry; -import dev.xkmc.modulargolems.content.entity.humanoid.HumanoidGolemEntity; -import net.minecraft.client.Minecraft; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.level.block.entity.SkullBlockEntity; - -import javax.annotation.Nullable; -import java.util.Map; -import java.util.TreeMap; - -public class ClientProfileManager { - - private static final Map CACHE = new TreeMap<>(); - - @Nullable - public static SpecialRenderProfile get(String name) { - var profile = getProfile(name); - if (profile == null) return null; - var skins = Minecraft.getInstance().getSkinManager(); - var skin = skins.getInsecureSkinInformation(profile).get(MinecraftProfileTexture.Type.SKIN); - if (skin == null) return null; - var skinModel = skin.getMetadata("model"); - boolean slim = skinModel != null && skinModel.equals("slim"); - ResourceLocation texture = skins.getInsecureSkinLocation(profile); - if (texture.equals(new ResourceLocation("missingno"))) - return null; - return new SpecialRenderProfile(slim, texture); - } - - @Nullable - private static GameProfile getProfile(String name) { - if (!CACHE.containsKey(name)) { - CACHE.put(name, null); - SkullBlockEntity.updateGameprofile(new GameProfile(null, name), e -> CACHE.put(name, e)); - } - return CACHE.get(name); - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/ClientSkinDispatch.java b/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/ClientSkinDispatch.java deleted file mode 100644 index 5605fc07b..000000000 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/ClientSkinDispatch.java +++ /dev/null @@ -1,23 +0,0 @@ -package dev.xkmc.modulargolems.content.entity.humanoid.skin; - -import dev.xkmc.modulargolems.compat.curio.CurioCompatRegistry; -import dev.xkmc.modulargolems.content.entity.humanoid.HumanoidGolemEntity; -import dev.xkmc.modulargolems.events.event.HumanoidSkinEvent; -import net.minecraftforge.common.MinecraftForge; - -import javax.annotation.Nullable; - -public class ClientSkinDispatch { - - @Nullable - public static SpecialRenderSkin get(HumanoidGolemEntity entity) { - var curio = CurioCompatRegistry.get(); - if (curio == null) return null; - var name = curio.getSkin(entity); - if (name.isEmpty()) return null; - var event = new HumanoidSkinEvent(entity, name); - MinecraftForge.EVENT_BUS.post(event); - return event.getSkin(); - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/PlayerSkinRenderer.java b/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/PlayerSkinRenderer.java deleted file mode 100644 index 180cb3056..000000000 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/PlayerSkinRenderer.java +++ /dev/null @@ -1,45 +0,0 @@ -package dev.xkmc.modulargolems.content.entity.humanoid.skin; - -import com.mojang.blaze3d.vertex.PoseStack; -import dev.xkmc.l2library.util.Proxy; -import dev.xkmc.modulargolems.content.entity.humanoid.HumanoidGolemEntity; -import dev.xkmc.modulargolems.content.entity.humanoid.HumanoidGolemRenderer; -import net.minecraft.client.player.AbstractClientPlayer; -import net.minecraft.client.renderer.MultiBufferSource; -import net.minecraft.client.renderer.entity.EntityRendererProvider; -import net.minecraft.resources.ResourceLocation; - -public class PlayerSkinRenderer extends HumanoidGolemRenderer { - - public static PlayerSkinRenderer REGULAR; - public static PlayerSkinRenderer SLIM; - - public PlayerSkinRenderer(EntityRendererProvider.Context ctx, boolean slim) { - super(ctx, slim); - } - - @Override - protected boolean delegated(HumanoidGolemEntity entity) { - return true; - } - - @Override - public void render(HumanoidGolemEntity entity, float f1, float f2, PoseStack stack, MultiBufferSource source, int i) { - stack.pushPose(); - float r = entity.getScale(); - stack.scale(r, r, r); - renderImpl(entity, f1, f2, stack, source, i); - stack.popPose(); - } - - @Override - public ResourceLocation getTextureLocation(HumanoidGolemEntity entity) { - var skin = ClientSkinDispatch.get(entity); - if (skin instanceof SpecialRenderProfile profile && profile.texture() != null) - return profile.texture(); - AbstractClientPlayer player = Proxy.getClientPlayer(); - assert player != null; - return player.getSkinTextureLocation(); - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/SpecialRenderProfile.java b/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/SpecialRenderProfile.java deleted file mode 100644 index fab462c38..000000000 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/SpecialRenderProfile.java +++ /dev/null @@ -1,22 +0,0 @@ -package dev.xkmc.modulargolems.content.entity.humanoid.skin; - -import com.mojang.blaze3d.vertex.PoseStack; -import dev.xkmc.modulargolems.content.entity.humanoid.HumanoidGolemEntity; -import net.minecraft.client.renderer.MultiBufferSource; -import net.minecraft.resources.ResourceLocation; - -import javax.annotation.Nullable; - -public record SpecialRenderProfile(boolean slim, @Nullable ResourceLocation texture) implements SpecialRenderSkin { - - @Override - public void render(HumanoidGolemEntity entity, float f1, float f2, PoseStack stack, MultiBufferSource source, int i) { - if (slim() && PlayerSkinRenderer.SLIM != null) { - PlayerSkinRenderer.SLIM.render(entity, f1, f2, stack, source, i); - } - if (!slim() && PlayerSkinRenderer.REGULAR != null) { - PlayerSkinRenderer.REGULAR.render(entity, f1, f2, stack, source, i); - } - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/SpecialRenderSkin.java b/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/SpecialRenderSkin.java deleted file mode 100644 index a0f07a58c..000000000 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/SpecialRenderSkin.java +++ /dev/null @@ -1,11 +0,0 @@ -package dev.xkmc.modulargolems.content.entity.humanoid.skin; - -import com.mojang.blaze3d.vertex.PoseStack; -import dev.xkmc.modulargolems.content.entity.humanoid.HumanoidGolemEntity; -import net.minecraft.client.renderer.MultiBufferSource; - -public interface SpecialRenderSkin { - - void render(HumanoidGolemEntity entity, float f1, float f2, PoseStack stack, MultiBufferSource source, int i); - -} diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/package-info.java b/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/package-info.java deleted file mode 100644 index 71a6478f6..000000000 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/skin/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -@ParametersAreNonnullByDefault -@MethodsReturnNonnullByDefault - -package dev.xkmc.modulargolems.content.entity.humanoid.skin; - -import net.minecraft.MethodsReturnNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/GolemEquipmentRenderer.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/GolemEquipmentRenderer.java index 94195ff59..05f000afe 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/GolemEquipmentRenderer.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/GolemEquipmentRenderer.java @@ -1,12 +1,9 @@ package dev.xkmc.modulargolems.content.entity.metalgolem; import com.mojang.blaze3d.vertex.PoseStack; -import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.math.Axis; import dev.xkmc.modulargolems.content.client.armor.GolemModelPath; import dev.xkmc.modulargolems.content.item.equipments.GolemModelItem; -import dev.xkmc.modulargolems.content.item.equipments.MetalGolemBeaconItem; -import dev.xkmc.modulargolems.init.ModularGolems; import net.minecraft.client.Minecraft; import net.minecraft.client.model.geom.ModelLayerLocation; import net.minecraft.client.model.geom.ModelPart; @@ -16,20 +13,15 @@ import net.minecraft.client.renderer.entity.RenderLayerParent; import net.minecraft.client.renderer.entity.layers.RenderLayer; import net.minecraft.client.renderer.texture.OverlayTexture; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.util.Mth; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.item.ItemDisplayContext; import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.NotNull; -import org.joml.Matrix3f; -import org.joml.Matrix4f; -import org.joml.Quaternionf; import java.util.HashMap; import java.util.List; -import static dev.xkmc.modulargolems.content.client.armor.GolemEquipmentModels.LIST; +import static dev.xkmc.modulargolems.content.client.armor.MetalGolemBasicModels.LIST; public class GolemEquipmentRenderer extends RenderLayer { @@ -61,12 +53,6 @@ public void render(@NotNull PoseStack pose, MultiBufferSource source, int i, @No i, OverlayTexture.NO_OVERLAY, 1, 1, 1, 1); pose.popPose(); } - } else if (stack.getItem() instanceof MetalGolemBeaconItem beacon) { - if (!entity.isAddedToWorld()) - return; - var color = new float[]{1.0F, 1.0F, 1.0F}; - renderBeacon(pose, source, i, entity.level().getGameTime(), entity.getBbHeight()); - renderBeam(pose, source, i, 1F, entity.level().getGameTime(), entity.getBbHeight(), color); } else { renderArmWithItem(entity, stack, e, pose, source, i); } @@ -98,79 +84,5 @@ protected void renderArmWithItem(MetalGolemEntity entity, ItemStack stack, Equip } - final ResourceLocation BEACON_LOCATION = new ResourceLocation(ModularGolems.MODID, "textures/equipments/beacon.png"); - protected void renderBeacon(PoseStack pose, MultiBufferSource source, float pTick, long gameTick, float height) { - float width = 3F; - - pose.pushPose(); - pose.scale(1, -1, 1); - pose.translate(0D, - height / 2, 0D); - float accurateTick = (float)Math.floorMod(gameTick, 90) + pTick; - pose.mulPose(Axis.YP.rotationDegrees(accurateTick - 45.0F)); - - var buffer = source.getBuffer(RenderType.armorCutoutNoCull(BEACON_LOCATION)); - PoseStack.Pose posestack$pose = pose.last(); - Matrix4f matrix4f = posestack$pose.pose(); - Matrix3f matrix3f = posestack$pose.normal(); - addVertex(matrix4f, matrix3f, buffer, 1.0F, 1.0F, 1.0F, 1.0F, 0, 0, width, 0, 0); - addVertex(matrix4f, matrix3f, buffer, 1.0F, 1.0F, 1.0F, 1.0F, 0, width, 0, 0, 1); - addVertex(matrix4f, matrix3f, buffer, 1.0F, 1.0F, 1.0F, 1.0F, 0, 0, -width, 1, 1); - addVertex(matrix4f, matrix3f, buffer, 1.0F, 1.0F, 1.0F, 1.0F, 0, -width, 0, 1, 0); - pose.popPose(); - } - - final ResourceLocation BEAM_LOCATION = new ResourceLocation("textures/entity/beacon_beam.png"); - protected void renderBeam(PoseStack pose, MultiBufferSource source, float pTick, float scale, long gameTick, float height, float[] color) { - float width1 = 0.2F; - float width2 = 0.25F; - int length = 1024; - - pose.pushPose(); - pose.scale(1, -1, 1); - pose.translate(0D, height / 2, 0D); - float accurateTick = (float)Math.floorMod(gameTick, 40) + pTick; - float f2 = Mth.frac(accurateTick * 0.2F - (float)Mth.floor(accurateTick * 0.1F)); - float colorR = color[0]; - float colorG = color[1]; - float colorB = color[2]; - pose.pushPose(); - pose.mulPose(Axis.YP.rotationDegrees(accurateTick * 2.25F - 45.0F)); - float v1 = -1.0F + f2; - float v2 = (float)length * scale * (0.5F / width1) + v1; - renderPart(pose, source.getBuffer(RenderType.beaconBeam(BEAM_LOCATION, false)), - colorR, colorG, colorB, 1.0F, - 0, length, 0.0F, width1, width1, 0.0F, -width1, 0.0F, 0.0F, -width1, - 0.0F, 1.0F, v2, v1); - pose.popPose(); - v1 = -1.0F + f2; - v2 = (float)length * scale + v1; - renderPart(pose, source.getBuffer(RenderType.beaconBeam(BEAM_LOCATION, true)), - colorR, colorG, colorB, 0.125F, - 0, length, -width2, -width2, width2, -width2, -width2, width2, width2, width2, - 0.0F, 1.0F, v2, v1); - pose.popPose(); - } - - private static void renderPart(PoseStack pose, VertexConsumer buffer, float r, float g, float b, float a, int start, int end, float p_112164_, float p_112165_, float p_112166_, float p_112167_, float p_112168_, float p_112169_, float p_112170_, float p_112171_, float u1, float u2, float v1, float v2) { - PoseStack.Pose posestack$pose = pose.last(); - Matrix4f matrix4f = posestack$pose.pose(); - Matrix3f matrix3f = posestack$pose.normal(); - renderQuad(matrix4f, matrix3f, buffer, r, g, b, a, start, end, p_112164_, p_112165_, p_112166_, p_112167_, u1, u2, v1, v2); - renderQuad(matrix4f, matrix3f, buffer, r, g, b, a, start, end, p_112170_, p_112171_, p_112168_, p_112169_, u1, u2, v1, v2); - renderQuad(matrix4f, matrix3f, buffer, r, g, b, a, start, end, p_112166_, p_112167_, p_112170_, p_112171_, u1, u2, v1, v2); - renderQuad(matrix4f, matrix3f, buffer, r, g, b, a, start, end, p_112168_, p_112169_, p_112164_, p_112165_, u1, u2, v1, v2); - } - - private static void renderQuad(Matrix4f pose, Matrix3f normal, VertexConsumer buffer, float r, float g, float b, float a, int y1, int y2, float x1, float z1, float x2, float z2, float u1, float u2, float v1, float v2) { - addVertex(pose, normal, buffer, r, g, b, a, y2, x1, z1, u2, v1); - addVertex(pose, normal, buffer, r, g, b, a, y1, x1, z1, u2, v2); - addVertex(pose, normal, buffer, r, g, b, a, y1, x2, z2, u1, v2); - addVertex(pose, normal, buffer, r, g, b, a, y2, x2, z2, u1, v1); - } - - private static void addVertex(Matrix4f pose, Matrix3f normal, VertexConsumer buffer, float r, float g, float b, float a, int y, float x, float z, float u, float v) { - buffer.vertex(pose, x, (float)y, z).color(r, g, b, a).uv(u, v).overlayCoords(OverlayTexture.NO_OVERLAY).uv2(15728880).normal(normal, 0.0F, 1.0F, 0.0F).endVertex(); - } - } diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java index 30c2b25d8..16ed8dffb 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemEntity.java @@ -1,12 +1,11 @@ package dev.xkmc.modulargolems.content.entity.metalgolem; - import dev.xkmc.l2serial.serialization.SerialClass; +import dev.xkmc.modulargolems.content.client.pose.PoseStateMachine; import dev.xkmc.modulargolems.content.config.GolemMaterialConfig; import dev.xkmc.modulargolems.content.entity.common.SweepGolemEntity; import dev.xkmc.modulargolems.content.entity.goals.GolemMeleeGoal; import dev.xkmc.modulargolems.content.item.wand.GolemInteractItem; import dev.xkmc.modulargolems.init.advancement.GolemTriggers; -import dev.xkmc.modulargolems.init.data.MGConfig; import net.minecraft.core.BlockPos; import net.minecraft.core.particles.BlockParticleOption; import net.minecraft.core.particles.ParticleTypes; @@ -17,10 +16,7 @@ import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.damagesource.DamageSource; -import net.minecraft.world.entity.AnimationState; -import net.minecraft.world.entity.Entity; -import net.minecraft.world.entity.EntityType; -import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.*; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.animal.IronGolem; import net.minecraft.world.entity.player.Player; @@ -33,18 +29,15 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.Fluids; import net.minecraft.world.phys.Vec3; - @SerialClass public class MetalGolemEntity extends SweepGolemEntity { - public final AnimationState axeAttackAnimationState = new AnimationState(); - public final AnimationState axeWarningAnimationState = new AnimationState(); - public final AnimationState spearAttackAnimationState = new AnimationState(); - public final AnimationState spearWarningAnimationState = new AnimationState(); + public final AnimationState attackAnimationState = new AnimationState(); + public final AnimationState warningAnimationState = new AnimationState(); + private final PoseStateMachine psm = new PoseStateMachine(this); public MetalGolemEntity(EntityType type, Level level) { super(type, level); this.setMaxUpStep(1); } - protected boolean performDamageTarget(Entity target, float damage, double kb) { if (target instanceof LivingEntity le) { le.setLastHurtByPlayer(getOwner()); @@ -60,11 +53,8 @@ protected boolean performDamageTarget(Entity target, float damage, double kb) { } return succeed; } - // ------ vanilla golem behavior - private int attackAnimationTick; - protected void registerGoals() { this.goalSelector.addGoal(2, new GolemMeleeGoal(this)); super.registerGoals(); @@ -85,7 +75,6 @@ public void aiStep() { } } } - public boolean doHurtTarget(Entity target) { this.attackAnimationTick = 10; this.level().broadcastEntityEvent(this, (byte) 4); @@ -100,7 +89,6 @@ public boolean doHurtTarget(Entity target) { this.playSound(SoundEvents.IRON_GOLEM_ATTACK, 1.0F, 1.0F); return flag; } - public boolean hurt(DamageSource source, float amount) { IronGolem.Crackiness crack = this.getCrackiness(); boolean flag = super.hurt(source, amount); @@ -115,17 +103,13 @@ public int getAttackAnimationTick() { public IronGolem.Crackiness getCrackiness() { return IronGolem.Crackiness.byFraction(this.getHealth() / this.getMaxHealth()); } - public void handleEntityEvent(byte pId) { - if (pId == 4) { - this.attackAnimationTick=4; - this.axeAttackAnimationState.start(this.tickCount); - this.playSound(SoundEvents.IRON_GOLEM_ATTACK, 1.0F, 1.0F); - }else{ + if(pId == 4) { + this.attackAnimationTick = 10; + psm.signalAttacking(); super.handleEntityEvent(pId); } } - protected SoundEvent getHurtSound(DamageSource p_28872_) { return SoundEvents.IRON_GOLEM_HURT; } @@ -137,7 +121,10 @@ protected SoundEvent getDeathSound() { protected void playStepSound(BlockPos p_28864_, BlockState p_28865_) { this.playSound(SoundEvents.IRON_GOLEM_STEP, 1.0F, 1.0F); } - + public void tick() { + super.tick(); + psm.tick(); + } public boolean checkSpawnObstruction(LevelReader p_28853_) { BlockPos blockpos = this.blockPosition(); BlockPos blockpos1 = blockpos.below(); @@ -161,16 +148,15 @@ public Vec3 getLeashOffset() { return new Vec3(0.0D, 0.875F * this.getEyeHeight(), this.getBbWidth() * 0.4F); } - protected InteractionResult mobInteractImpl(Player player, InteractionHand hand) { + protected InteractionResult mobInteract(Player player, InteractionHand hand) { + if (player.getItemInHand(hand).getItem() instanceof GolemInteractItem) return InteractionResult.PASS; ItemStack itemstack = player.getItemInHand(hand); if (getMaterials().size() != MetalGolemPartType.values().length) - return super.mobInteractImpl(player, hand); + return super.mobInteract(player, hand); var mat = getMaterials().get(MetalGolemPartType.BODY.ordinal()); Ingredient ing = GolemMaterialConfig.get().ingredients.get(mat.id()); if (!ing.test(itemstack)) { - if (MGConfig.COMMON.strictInteract.get() && !itemstack.isEmpty()) - return InteractionResult.PASS; - return super.mobInteractImpl(player, hand); + return super.mobInteract(player, hand); } else { float f = this.getHealth(); this.heal(getMaxHealth() / 4f); diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java index 7f88522f7..9bf2cbbe8 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemModel.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.math.Axis; -import dev.xkmc.modulargolems.content.client.armor.GolemEquipmentModels; +import dev.xkmc.modulargolems.content.client.armor.MetalGolemBasicModels; import dev.xkmc.modulargolems.content.entity.common.IGolemModel; import dev.xkmc.modulargolems.content.entity.common.IHeadedModel; import dev.xkmc.modulargolems.content.item.equipments.MetalGolemWeaponItem; @@ -12,28 +12,25 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; import net.minecraft.world.entity.EquipmentSlot; -import net.minecraft.world.item.Item; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import dev.xkmc.modulargolems.content.client.pose.CustomModelAnimation; @OnlyIn(Dist.CLIENT) public class MetalGolemModel extends HierarchicalModel implements IGolemModel, IHeadedModel { - private final ModelPart root; private final ModelPart head; private final ModelPart rightLeg; private final ModelPart leftLeg; private final ModelPart body; - - public final ModelPart rightArm; - public final ModelPart leftArm; - public final ModelPart leftForeArm; - public final ModelPart rightForeArm; - + private final ModelPart weapon; + private final ModelPart rightArm; + private final ModelPart leftArm; + private final ModelPart leftForeArm; + private final ModelPart rightForeArm; + private final ModelPart shield; public MetalGolemModel(EntityModelSet set) { - this(set.bakeLayer(GolemEquipmentModels.METALGOLEM)); + this(set.bakeLayer(MetalGolemBasicModels.METALGOLEM)); } - public MetalGolemModel(ModelPart part) { this.root = part; this.body = part.getChild("body"); @@ -44,12 +41,10 @@ public MetalGolemModel(ModelPart part) { this.leftLeg = part.getChild("left_leg"); this.leftForeArm = leftArm.getChild("left_forearm"); this.rightForeArm = rightArm.getChild("right_forearm"); + this.weapon=rightForeArm.getChild("weapon"); + this.shield=leftForeArm.getChild("shield"); } - - public ModelPart root() { - return this.root; - } - + public ModelPart root() {return this.root;} public void copyFrom(MetalGolemModel other) { head.copyFrom(other.head); body.copyFrom(other.body); @@ -59,30 +54,25 @@ public void copyFrom(MetalGolemModel other) { leftLeg.copyFrom(other.leftLeg); leftForeArm.copyFrom(other.leftForeArm); rightForeArm.copyFrom(other.rightForeArm); + weapon.copyFrom(other.weapon); + shield.copyFrom(other.shield); } public void setupAnim(MetalGolemEntity pEntity, float pLimbSwing, float pLimbSwingAmount, float pAgeInTicks, float pNetHeadYaw, float pHeadPitch) { this.root().getAllParts().forEach(ModelPart::resetPose); - int atkTick = pEntity.getAttackAnimationTick(); - Item its =pEntity.getMainHandItem().getItem(); this.animateWalk(pNetHeadYaw, pHeadPitch, pLimbSwing, pLimbSwingAmount); - if(its instanceof MetalGolemWeaponItem wi){ - switch (wi.getGolemWeaponType(wi)) { - case SWORD, AXE -> { - if (atkTick > 0) { - this.animate(pEntity.axeAttackAnimationState, CustomModelAnimation.attackInAxe, pAgeInTicks); - }else if(pEntity.isAggressive()) { - this.animate(pEntity.axeWarningAnimationState, CustomModelAnimation.warningInAxe, pAgeInTicks); - } - } - case SPEAR -> { - if (atkTick > 0) { - this.animate(pEntity.spearAttackAnimationState, CustomModelAnimation.attackInSpear, pAgeInTicks); - } else if (pEntity.isAggressive()) { - this.animate(pEntity.spearWarningAnimationState, CustomModelAnimation.warningInSpear, pAgeInTicks); - } - } + if(pEntity.getMainHandItem().getItem() instanceof MetalGolemWeaponItem mwi) { + switch (mwi.getGolemWeaponType()) { + case AXE, SWORD -> + {this.animate(pEntity.warningAnimationState, CustomModelAnimation.warningInAxe, pAgeInTicks); + this.animate(pEntity.attackAnimationState, CustomModelAnimation.attackInAxe, pAgeInTicks);} + case SPEAR -> { + this.animate(pEntity.attackAnimationState, CustomModelAnimation.attackInSpear, pAgeInTicks); + this.animate(pEntity.warningAnimationState, CustomModelAnimation.warningInSpear, pAgeInTicks); } } + }else { + this.animate(pEntity.attackAnimationState, CustomModelAnimation.attackUnarmed, pAgeInTicks); + } } private void animateWalk(float pNetHeadYaw, float pHeadPitch,float pLimbSwing,float pLimbSwingAmount) { this.head.yRot = pNetHeadYaw * ((float) Math.PI / 180F); @@ -102,10 +92,22 @@ private void resetArmPoses() { this.leftArm.z = 0.0F; this.leftArm.x = 0.0F; this.leftArm.y = -7.0F; + this.leftForeArm.yRot = 0.0F; + this.leftForeArm.z = 3.0F; + this.leftForeArm.x = -0.001F; + this.leftForeArm.y = 11.5F; this.rightArm.yRot = 0.0F; this.rightArm.z = 0.0F; this.rightArm.x = -0.0F; this.rightArm.y = -7.0F; + this.rightForeArm.yRot = 0.0F; + this.rightForeArm.z = 3.0F; + this.rightForeArm.x = -0.001F; + this.rightForeArm.y = 11.5F; + this.weapon.yRot=0.0f; + this.weapon.z=0.0f; + this.weapon.x=0.0f; + this.weapon.y =2.0F; } public void renderToBufferInternal(MetalGolemPartType type, PoseStack stack, VertexConsumer consumer, int i, int j, float f1, float f2, float f3, float f4) { if (type == MetalGolemPartType.BODY) { @@ -120,33 +122,30 @@ public void renderToBufferInternal(MetalGolemPartType type, PoseStack stack, Ver this.rightLeg.render(stack, consumer, i, j, f1, f2, f3, f4); } } - public ResourceLocation getTextureLocationInternal(ResourceLocation rl) { String id = rl.getNamespace(); String mat = rl.getPath(); return new ResourceLocation(id, "textures/entity/metal_golem/" + mat + ".png"); } - public void transformToHand(EquipmentSlot slot, PoseStack pose) { if (slot == EquipmentSlot.MAINHAND) { rightArm.translateAndRotate(pose); rightForeArm.translateAndRotate(pose); + weapon.translateAndRotate(pose); } if (slot == EquipmentSlot.OFFHAND) { leftArm.translateAndRotate(pose); leftForeArm.translateAndRotate(pose); + shield.translateAndRotate(pose); } } - @Override public ModelPart getHead() { return head; } - public void translateToHead(PoseStack pose) { pose.translate(0.0F, -0.45F, -0.08F); pose.mulPose(Axis.YP.rotationDegrees(180.0F)); pose.scale(0.625F, -0.625F, -0.625F); } - } \ No newline at end of file diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemRenderer.java b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemRenderer.java index 7fad6ac67..d3d4002da 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemRenderer.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/metalgolem/MetalGolemRenderer.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Axis; -import dev.xkmc.modulargolems.content.client.armor.GolemEquipmentModels; +import dev.xkmc.modulargolems.content.client.armor.MetalGolemBasicModels; import dev.xkmc.modulargolems.content.entity.common.AbstractGolemRenderer; import dev.xkmc.modulargolems.content.entity.common.GolemBannerLayer; import net.minecraft.client.renderer.entity.EntityRendererProvider; @@ -65,7 +65,7 @@ protected static void transform(PoseStack stack, ItemDisplayContext transform, @ } public MetalGolemRenderer(EntityRendererProvider.Context ctx) { - super(ctx, new MetalGolemModel(ctx.bakeLayer(GolemEquipmentModels.METALGOLEM)), 0.7F, MetalGolemPartType::values); + super(ctx, new MetalGolemModel(ctx.bakeLayer(MetalGolemBasicModels.METALGOLEM)), 0.7F, MetalGolemPartType::values); this.addLayer(new MetalGolemCrackinessLayer(this)); this.addLayer(new GolemEquipmentRenderer(this, ctx)); this.addLayer(new GolemBannerLayer<>(this, ctx.getItemInHandRenderer())); diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/mode/PatrolMode.java b/src/main/java/dev/xkmc/modulargolems/content/entity/mode/PatrolMode.java index 7b6905f6a..b92b87c9c 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/entity/mode/PatrolMode.java +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/mode/PatrolMode.java @@ -16,7 +16,6 @@ public double getStartFollowDistance(AbstractGolemEntity golem) { @Override public void tick(AbstractGolemEntity golem) { - if (!golem.isInWater() && !golem.onGround()) return; if (golem.getNavigation().isDone()) { golem.advancePatrolStage(); } diff --git a/src/main/java/dev/xkmc/modulargolems/content/item/equipments/MetalGolemBeaconItem.java b/src/main/java/dev/xkmc/modulargolems/content/item/equipments/MetalGolemBeaconItem.java deleted file mode 100644 index 326cea83c..000000000 --- a/src/main/java/dev/xkmc/modulargolems/content/item/equipments/MetalGolemBeaconItem.java +++ /dev/null @@ -1,46 +0,0 @@ -package dev.xkmc.modulargolems.content.item.equipments; - -import dev.xkmc.modulargolems.content.entity.common.AbstractGolemEntity; -import dev.xkmc.modulargolems.init.registrate.GolemTypes; -import net.minecraft.world.effect.MobEffect; -import net.minecraft.world.effect.MobEffectInstance; -import net.minecraft.world.effect.MobEffects; -import net.minecraft.world.entity.Entity; -import net.minecraft.world.entity.EquipmentSlot; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.OwnableEntity; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraft.world.phys.AABB; - -public class MetalGolemBeaconItem extends GolemEquipmentItem implements TickEquipmentItem { - private final int beaconLevel; - - public MetalGolemBeaconItem(Properties properties, int beaconLevel) { - super(properties, EquipmentSlot.FEET, GolemTypes.ENTITY_GOLEM::get, builder -> {}); - this.beaconLevel = beaconLevel; - } - - public int getBeaconLevel() { - return this.beaconLevel; - } - - @Override - public void tick(ItemStack stack, Level level, Entity entity) { - if (level.getGameTime() % 80D != 0) - return; - if (stack.getItem() instanceof MetalGolemBeaconItem beacon && entity instanceof AbstractGolemEntity golem) { - double range = this.getBeaconLevel() * 10D + 10D; - int time = (9 + this.getBeaconLevel() * 2) * 20; - AABB aabb = golem.getBoundingBox().inflate(range).expandTowards(0D, level.getHeight(), 0D); - for(LivingEntity entity1 : level.getEntitiesOfClass(LivingEntity.class, aabb)) { - if (entity1 == golem.getOwner()) { - entity1.addEffect(new MobEffectInstance(MobEffects.REGENERATION, time, this.getBeaconLevel() - 1, true, true)); - } else if (entity1 instanceof OwnableEntity ownable) { - if (golem.getOwner() == ownable.getOwner()) - entity1.addEffect(new MobEffectInstance(MobEffects.REGENERATION, time, this.getBeaconLevel() - 1, true, true)); - } - } - } - } -} diff --git a/src/main/java/dev/xkmc/modulargolems/content/item/equipments/MetalGolemWeaponItem.java b/src/main/java/dev/xkmc/modulargolems/content/item/equipments/MetalGolemWeaponItem.java index 9e671a733..eca5019d0 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/item/equipments/MetalGolemWeaponItem.java +++ b/src/main/java/dev/xkmc/modulargolems/content/item/equipments/MetalGolemWeaponItem.java @@ -46,7 +46,5 @@ public boolean canApplyAtEnchantingTable(ItemStack stack, Enchantment enchantmen } return super.canApplyAtEnchantingTable(stack, enchantment); } - public GolemWeaponType getGolemWeaponType(MetalGolemWeaponItem i) { - return i.gwt; - } + public GolemWeaponType getGolemWeaponType() {return this.gwt;} } diff --git a/src/main/java/dev/xkmc/modulargolems/content/item/equipments/TickEquipmentItem.java b/src/main/java/dev/xkmc/modulargolems/content/item/equipments/TickEquipmentItem.java deleted file mode 100644 index 1366efd84..000000000 --- a/src/main/java/dev/xkmc/modulargolems/content/item/equipments/TickEquipmentItem.java +++ /dev/null @@ -1,9 +0,0 @@ -package dev.xkmc.modulargolems.content.item.equipments; - -import net.minecraft.world.entity.Entity; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; - -public interface TickEquipmentItem { - void tick(ItemStack stack, Level level, Entity entity); -} diff --git a/src/main/java/dev/xkmc/modulargolems/content/item/golem/GolemBEWLR.java b/src/main/java/dev/xkmc/modulargolems/content/item/golem/GolemBEWLR.java index 014dc3cb9..0347d0c23 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/item/golem/GolemBEWLR.java +++ b/src/main/java/dev/xkmc/modulargolems/content/item/golem/GolemBEWLR.java @@ -10,6 +10,7 @@ import dev.xkmc.modulargolems.content.core.IGolemPart; import dev.xkmc.modulargolems.content.entity.common.AbstractGolemEntity; import dev.xkmc.modulargolems.content.entity.common.IGolemModel; +import dev.xkmc.modulargolems.content.entity.humanoid.PlayerSkinRenderer; import net.minecraft.client.Minecraft; import net.minecraft.client.model.EntityModel; import net.minecraft.client.model.geom.EntityModelSet; @@ -17,6 +18,7 @@ import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.blockentity.BlockEntityRenderDispatcher; +import net.minecraft.client.renderer.entity.EntityRendererProvider; import net.minecraft.client.renderer.entity.ItemRenderer; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.packs.resources.ResourceManager; @@ -61,8 +63,8 @@ public void renderByItem(ItemStack stack, ItemDisplayContext type, PoseStack pos MultiBufferSource bufferSource, int light, int overlay) { BEWLRHandle handle = new BEWLRHandle(stack, type, poseStack, bufferSource, light, overlay); poseStack.pushPose(); - if (stack.getItem() instanceof IGolemPartItem part) { - render(handle, part.asPart()); + if (stack.getItem() instanceof GolemPart part) { + render(handle, part); } if (stack.getItem() instanceof GolemHolder holder) { if (!renderEntity(handle, holder)) diff --git a/src/main/java/dev/xkmc/modulargolems/content/item/golem/GolemHolder.java b/src/main/java/dev/xkmc/modulargolems/content/item/golem/GolemHolder.java index b2fa3bb42..32528c368 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/item/golem/GolemHolder.java +++ b/src/main/java/dev/xkmc/modulargolems/content/item/golem/GolemHolder.java @@ -389,25 +389,6 @@ public boolean summon(ItemStack stack, Level level, Vec3 pos, @Nullable Player p return false; } - @Nullable - public T createDummy(ItemStack stack, Level level) { - CompoundTag root = stack.getTag(); - if (root == null) return null; - T golem; - if (root.contains(KEY_ENTITY)) { - golem = type.get().create((ServerLevel) level, root.getCompound(KEY_ENTITY)); - golem.updateAttributes(getMaterial(stack), getUpgrades(stack), null); - } else if (root.contains(KEY_MATERIAL)) { - golem = type.get().create(level); - golem.onCreate(getMaterial(stack), getUpgrades(stack), null); - } else return null; - getGolemConfig(stack).ifPresent(e -> golem.setConfigCard(e.getFirst(), e.getSecond())); - if (stack.hasCustomHoverName()) { - golem.setCustomName(stack.getHoverName()); - } - return golem; - } - @Override public boolean isBarVisible(ItemStack stack) { if (stack.getTag() != null && stack.getTag().contains(KEY_DISPLAY)) diff --git a/src/main/java/dev/xkmc/modulargolems/content/item/golem/GolemPart.java b/src/main/java/dev/xkmc/modulargolems/content/item/golem/GolemPart.java index e759f1ac6..700314cae 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/item/golem/GolemPart.java +++ b/src/main/java/dev/xkmc/modulargolems/content/item/golem/GolemPart.java @@ -25,7 +25,7 @@ import java.util.function.Consumer; import java.util.function.Supplier; -public class GolemPart, P extends IGolemPart

> extends Item implements IGolemPartItem { +public class GolemPart, P extends IGolemPart

> extends Item { public static final List> LIST = new ArrayList<>(); @@ -90,11 +90,6 @@ public void initializeClient(Consumer consumer) { consumer.accept(GolemBEWLR.EXTENSIONS); } - @Override - public GolemPart asPart() { - return this; - } - public GolemType getEntityType() { return type.get(); } diff --git a/src/main/java/dev/xkmc/modulargolems/content/item/golem/IGolemPartItem.java b/src/main/java/dev/xkmc/modulargolems/content/item/golem/IGolemPartItem.java deleted file mode 100644 index 1098d02e4..000000000 --- a/src/main/java/dev/xkmc/modulargolems/content/item/golem/IGolemPartItem.java +++ /dev/null @@ -1,7 +0,0 @@ -package dev.xkmc.modulargolems.content.item.golem; - -public interface IGolemPartItem { - - GolemPart asPart(); - -} diff --git a/src/main/java/dev/xkmc/modulargolems/content/item/wand/CommandWandItem.java b/src/main/java/dev/xkmc/modulargolems/content/item/wand/CommandWandItem.java index 52facf37c..a15a8afaf 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/item/wand/CommandWandItem.java +++ b/src/main/java/dev/xkmc/modulargolems/content/item/wand/CommandWandItem.java @@ -8,6 +8,8 @@ import dev.xkmc.modulargolems.compat.curio.CurioCompatRegistry; import dev.xkmc.modulargolems.content.client.outline.BlockOutliner; import dev.xkmc.modulargolems.content.entity.common.AbstractGolemEntity; +import dev.xkmc.modulargolems.content.entity.humanoid.HumanoidGolemEntity; +import dev.xkmc.modulargolems.content.entity.metalgolem.MetalGolemEntity; import dev.xkmc.modulargolems.content.entity.mode.GolemMode; import dev.xkmc.modulargolems.content.entity.mode.GolemModes; import dev.xkmc.modulargolems.content.item.card.ConfigCard; @@ -87,8 +89,11 @@ private static boolean command(Level level, Player user, AbstractGolemEntity list = null; - if (hoveredSlot.getContainerSlot() == 0) { + if (this.hoveredSlot.getContainerSlot() == 0) { list = List.of(MGLangData.SLOT_MAIN.get(), MGLangData.SLOT_MAIN_DESC.get()); } - if (hoveredSlot.getContainerSlot() == 1) { + if (this.hoveredSlot.getContainerSlot() == 1) { list = List.of(MGLangData.SLOT_OFF.get()); } - if (hoveredSlot.getContainerSlot() == 6) { + if (this.hoveredSlot.getContainerSlot() == 6) { list = List.of(MGLangData.SLOT_BACKUP.get(), MGLangData.SLOT_BACKUP_DESC.get(), MGLangData.SLOT_BACKUP_INFO.get()); } - if (hoveredSlot.getContainerSlot() == 7) { + if (this.hoveredSlot.getContainerSlot() == 7) { list = List.of(MGLangData.SLOT_ARROW.get(), MGLangData.SLOT_ARROW_DESC.get()); diff --git a/src/main/java/dev/xkmc/modulargolems/content/modifier/base/GolemModifier.java b/src/main/java/dev/xkmc/modulargolems/content/modifier/base/GolemModifier.java index e7e5cc64c..018fac510 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/modifier/base/GolemModifier.java +++ b/src/main/java/dev/xkmc/modulargolems/content/modifier/base/GolemModifier.java @@ -1,6 +1,5 @@ package dev.xkmc.modulargolems.content.modifier.base; -import dev.xkmc.l2damagetracker.contents.attack.AttackCache; import dev.xkmc.l2damagetracker.contents.attack.CreateSourceEvent; import dev.xkmc.l2library.base.NamedEntry; import dev.xkmc.modulargolems.content.config.GolemPartConfig; @@ -15,12 +14,9 @@ import net.minecraft.ChatFormatting; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.InteractionHand; -import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.ai.goal.Goal; -import net.minecraft.world.entity.player.Player; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.event.entity.living.LivingAttackEvent; @@ -111,7 +107,8 @@ public double onInventoryHealTick(double heal, HealingContext ctx, int level) { /** * modify damage */ - public void modifyDamage(AttackCache cache, AbstractGolemEntity entity, int level) { + public float modifyDamage(float damage, AbstractGolemEntity entity, int level) { + return damage; } /** @@ -152,10 +149,6 @@ public void modifySource(AbstractGolemEntity golem, CreateSourceEvent even public void handleEvent(AbstractGolemEntity golem, int value, byte event) { } - public InteractionResult interact(Player player, AbstractGolemEntity golem, InteractionHand hand) { - return InteractionResult.PASS; - } - public record HealingContext(float health, float maxHealth, Entity owner) { } diff --git a/src/main/java/dev/xkmc/modulargolems/content/modifier/immunes/DamageCapModifier.java b/src/main/java/dev/xkmc/modulargolems/content/modifier/immunes/DamageCapModifier.java index c2fa507eb..51d17b655 100644 --- a/src/main/java/dev/xkmc/modulargolems/content/modifier/immunes/DamageCapModifier.java +++ b/src/main/java/dev/xkmc/modulargolems/content/modifier/immunes/DamageCapModifier.java @@ -9,7 +9,6 @@ import net.minecraft.network.chat.MutableComponent; import net.minecraft.tags.DamageTypeTags; import net.minecraft.world.entity.EntityEvent; -import net.minecraftforge.event.entity.living.LivingDamageEvent; import net.minecraftforge.event.entity.living.LivingHurtEvent; import java.util.List; @@ -21,10 +20,11 @@ public DamageCapModifier() { } @Override - public void onDamaged(AbstractGolemEntity entity, LivingDamageEvent event, int level) { - if (event.getSource().is(DamageTypeTags.BYPASSES_INVULNERABILITY)) { + public void onHurt(AbstractGolemEntity entity, LivingHurtEvent event, int level) { + if (event.getSource().is(DamageTypeTags.BYPASSES_INVULNERABILITY) || event.getSource().is(DamageTypeTags.BYPASSES_EFFECTS)) { return; } + float factor = (float) Math.max(0, (2 - level * 0.2) * MGConfig.COMMON.damageCap.get()); if (event.getAmount() > factor * entity.getMaxHealth()) { event.setAmount(factor * entity.getMaxHealth()); diff --git a/src/main/java/dev/xkmc/modulargolems/events/GolemAttackListener.java b/src/main/java/dev/xkmc/modulargolems/events/GolemAttackListener.java index 741c9f260..d0bfec60e 100644 --- a/src/main/java/dev/xkmc/modulargolems/events/GolemAttackListener.java +++ b/src/main/java/dev/xkmc/modulargolems/events/GolemAttackListener.java @@ -1,10 +1,8 @@ package dev.xkmc.modulargolems.events; -import dev.xkmc.l2damagetracker.contents.attack.AttackCache; import dev.xkmc.l2damagetracker.contents.attack.AttackListener; import dev.xkmc.l2damagetracker.contents.attack.CreateSourceEvent; import dev.xkmc.modulargolems.content.entity.common.AbstractGolemEntity; -import net.minecraft.world.item.ItemStack; public class GolemAttackListener implements AttackListener { @@ -16,15 +14,4 @@ public void onCreateSource(CreateSourceEvent event) { } } } - - @Override - public void onHurt(AttackCache cache, ItemStack weapon) { - if (cache.getAttacker() instanceof AbstractGolemEntity golem) { - for (var entry : golem.getModifiers().entrySet()) { - entry.getKey().modifyDamage(cache, golem, entry.getValue()); - } - } - } - - } diff --git a/src/main/java/dev/xkmc/modulargolems/events/GolemClientEventListeners.java b/src/main/java/dev/xkmc/modulargolems/events/GolemClientEventListeners.java deleted file mode 100644 index 37e66e1a0..000000000 --- a/src/main/java/dev/xkmc/modulargolems/events/GolemClientEventListeners.java +++ /dev/null @@ -1,35 +0,0 @@ -package dev.xkmc.modulargolems.events; - -import dev.xkmc.modulargolems.content.entity.humanoid.skin.ClientProfileManager; -import dev.xkmc.modulargolems.content.entity.humanoid.skin.SpecialRenderProfile; -import dev.xkmc.modulargolems.events.event.HumanoidSkinEvent; -import dev.xkmc.modulargolems.init.ModularGolems; -import dev.xkmc.modulargolems.init.data.MGTagGen; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.item.Items; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod; - - -@Mod.EventBusSubscriber(value = Dist.CLIENT, modid = ModularGolems.MODID, bus = Mod.EventBusSubscriber.Bus.FORGE) -public class GolemClientEventListeners { - - @SubscribeEvent - public static void onHumanoidSkin(HumanoidSkinEvent event) { - if (event.getStack().is(Items.PLAYER_HEAD)) { - String name = event.getStack().getHoverName().getString(); - if (ResourceLocation.isValidResourceLocation(name)) - event.setSkin(new SpecialRenderProfile(true, new ResourceLocation(name))); - } - if (event.getStack().is(Items.PIGLIN_HEAD)) { - String name = event.getStack().getHoverName().getString(); - if (ResourceLocation.isValidResourceLocation(name)) - event.setSkin(new SpecialRenderProfile(false, new ResourceLocation(name))); - } - if (event.getStack().is(MGTagGen.PLAYER_SKIN)) { - event.setSkin(ClientProfileManager.get(event.getStack().getHoverName().getString())); - } - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/events/event/HumanoidSkinEvent.java b/src/main/java/dev/xkmc/modulargolems/events/event/HumanoidSkinEvent.java deleted file mode 100644 index d222548f0..000000000 --- a/src/main/java/dev/xkmc/modulargolems/events/event/HumanoidSkinEvent.java +++ /dev/null @@ -1,38 +0,0 @@ -package dev.xkmc.modulargolems.events.event; - -import dev.xkmc.modulargolems.content.entity.humanoid.HumanoidGolemEntity; -import dev.xkmc.modulargolems.content.entity.humanoid.skin.SpecialRenderSkin; -import net.minecraft.world.item.ItemStack; -import net.minecraftforge.eventbus.api.Event; -import org.jetbrains.annotations.Nullable; - -public class HumanoidSkinEvent extends Event { - - private final HumanoidGolemEntity golem; - private final ItemStack stack; - - private SpecialRenderSkin skin; - - public HumanoidSkinEvent(HumanoidGolemEntity golem, ItemStack stack) { - this.golem = golem; - this.stack = stack; - } - - public HumanoidGolemEntity getGolem() { - return golem; - } - - public ItemStack getStack() { - return stack; - } - - public void setSkin(@Nullable SpecialRenderSkin skin) { - this.skin = skin; - } - - @Nullable - public SpecialRenderSkin getSkin() { - return skin; - } - -} diff --git a/src/main/java/dev/xkmc/modulargolems/init/GolemClient.java b/src/main/java/dev/xkmc/modulargolems/init/GolemClient.java index 51fd1eb46..95839c9e3 100644 --- a/src/main/java/dev/xkmc/modulargolems/init/GolemClient.java +++ b/src/main/java/dev/xkmc/modulargolems/init/GolemClient.java @@ -1,12 +1,10 @@ package dev.xkmc.modulargolems.init; -import com.github.tartaricacid.touhoulittlemaid.TouhouLittleMaid; import dev.xkmc.modulargolems.compat.curio.CurioCompatRegistry; import dev.xkmc.modulargolems.compat.materials.common.CompatManager; -import dev.xkmc.modulargolems.compat.misc.MaidCompat; -import dev.xkmc.modulargolems.content.client.armor.GolemEquipmentModels; +import dev.xkmc.modulargolems.content.client.armor.MetalGolemBasicModels; import dev.xkmc.modulargolems.content.client.overlay.GolemStatusOverlay; -import dev.xkmc.modulargolems.content.entity.humanoid.skin.PlayerSkinRenderer; +import dev.xkmc.modulargolems.content.entity.humanoid.PlayerSkinRenderer; import dev.xkmc.modulargolems.content.item.golem.GolemBEWLR; import dev.xkmc.modulargolems.content.item.upgrade.UpgradeItem; import dev.xkmc.modulargolems.content.menu.registry.GolemTabRegistry; @@ -20,22 +18,15 @@ import net.minecraftforge.client.event.RegisterClientReloadListenersEvent; import net.minecraftforge.client.event.RegisterGuiOverlaysEvent; import net.minecraftforge.client.gui.overlay.VanillaGuiOverlay; -import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.ModList; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; @Mod.EventBusSubscriber(value = Dist.CLIENT, modid = ModularGolems.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) public class GolemClient { - private static final boolean ENABLE_TLM = true; - @SubscribeEvent public static void clientSetup(FMLClientSetupEvent event) { - if (ENABLE_TLM && ModList.get().isLoaded(TouhouLittleMaid.MOD_ID)) { - MinecraftForge.EVENT_BUS.register(MaidCompat.class); - } event.enqueueWork(() -> { ClampedItemPropertyFunction func = (stack, level, entity, layer) -> entity != null && entity.isBlocking() && entity.getUseItem() == stack ? 1.0F : 0.0F; @@ -58,7 +49,7 @@ public static void registerOverlays(RegisterGuiOverlaysEvent event) { @SubscribeEvent public static void registerArmorLayer(EntityRenderersEvent.RegisterLayerDefinitions event) { - GolemEquipmentModels.registerArmorLayer(event); + MetalGolemBasicModels.registerArmorLayer(event); } @SubscribeEvent @@ -70,9 +61,6 @@ public static void onResourceReload(RegisterClientReloadListenersEvent event) { public static void onAddLayers(EntityRenderersEvent.AddLayers event) { PlayerSkinRenderer.SLIM = new PlayerSkinRenderer(event.getContext(), true); PlayerSkinRenderer.REGULAR = new PlayerSkinRenderer(event.getContext(), false); - if (ENABLE_TLM && ModList.get().isLoaded(TouhouLittleMaid.MOD_ID)) { - MaidCompat.addLayers(event); - } } } diff --git a/src/main/java/dev/xkmc/modulargolems/init/ModularGolems.java b/src/main/java/dev/xkmc/modulargolems/init/ModularGolems.java index b42b447d2..d2ece933e 100644 --- a/src/main/java/dev/xkmc/modulargolems/init/ModularGolems.java +++ b/src/main/java/dev/xkmc/modulargolems/init/ModularGolems.java @@ -1,8 +1,6 @@ package dev.xkmc.modulargolems.init; import com.tterrag.registrate.providers.ProviderType; -import dev.xkmc.l2complements.init.L2Complements; -import dev.xkmc.l2complements.init.data.TagGen; import dev.xkmc.l2damagetracker.contents.attack.AttackEventHandler; import dev.xkmc.l2library.base.L2Registrate; import dev.xkmc.l2library.serial.config.ConfigTypeEntry; @@ -32,7 +30,6 @@ import net.minecraftforge.event.entity.EntityAttributeModificationEvent; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.ModList; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent; @@ -105,9 +102,6 @@ public static void gatherData(GatherDataEvent event) { event.getGenerator().addProvider(event.includeServer(), new MGConfigGen(event.getGenerator())); CompatManager.gatherData(event); event.getGenerator().addProvider(event.includeServer(), new SlotGen(event.getGenerator())); - if (ModList.get().isLoaded(L2Complements.MODID)){ - REGISTRATE.addDataGenerator(TagGen.EFF_TAGS, MGTagGen::onEffTagGen); - } } @SubscribeEvent diff --git a/src/main/java/dev/xkmc/modulargolems/init/data/MGConfig.java b/src/main/java/dev/xkmc/modulargolems/init/data/MGConfig.java index b1294cd07..b9902b0d5 100644 --- a/src/main/java/dev/xkmc/modulargolems/init/data/MGConfig.java +++ b/src/main/java/dev/xkmc/modulargolems/init/data/MGConfig.java @@ -23,22 +23,9 @@ public static class Common { public final ForgeConfigSpec.DoubleValue explosionResistance; public final ForgeConfigSpec.DoubleValue compatTFHealing; public final ForgeConfigSpec.DoubleValue compatTFDamage; - public final ForgeConfigSpec.IntValue manaMendingCost; - public final ForgeConfigSpec.DoubleValue manaMendingVal; - public final ForgeConfigSpec.DoubleValue manaBoostingDamage; - public final ForgeConfigSpec.IntValue manaBoostingCost; - public final ForgeConfigSpec.IntValue manaProductionVal; - public final ForgeConfigSpec.DoubleValue manaBurstDamage; - public final ForgeConfigSpec.IntValue manaBurstCost; - public final ForgeConfigSpec.DoubleValue pixieAttackProb; - public final ForgeConfigSpec.DoubleValue pixieCounterattackProb; public final ForgeConfigSpec.IntValue carminiteTime; public final ForgeConfigSpec.DoubleValue coating; - public final ForgeConfigSpec.DoubleValue mechSpeed; - public final ForgeConfigSpec.DoubleValue mechAttack; - public final ForgeConfigSpec.IntValue mechMaxFuel; public final ForgeConfigSpec.BooleanValue barehandRetrieve; - public final ForgeConfigSpec.BooleanValue strictInteract; public final ForgeConfigSpec.DoubleValue damageCap; public final ForgeConfigSpec.IntValue conduitCooldown; public final ForgeConfigSpec.IntValue conduitDamage; @@ -84,9 +71,6 @@ public static class Common { .defineInRange("retrieveRange", 20, 1, 1000); ownerPickupOnly = builder.comment("Only owner can pickup") .define("ownerPickupOnly", true); - strictInteract = builder.comment("When enabled, the following features will be disabled when player holds item in hand:") - .comment("- give item to golem or take items from golem by right click").comment("- order dog golem to seat") - .define("strictInteract", false); startFollowRadius = builder.comment("Max golem activity radius before following player in follow mode") .defineInRange("startFollowRadius", 10d, 1, 100); stopWanderRadius = builder.comment("Max golem activity radius before willing to go back to origin in wander mode") @@ -137,38 +121,9 @@ public static class Common { } builder.pop(); - builder.push("botania compat"); - { - manaMendingCost = builder.comment("Mana mending cost per HP") - .defineInRange("mendingManaCost", 200, 1, 50000); - manaMendingVal = builder.comment("Mana mending value per level") - .defineInRange("manaMendingVal", 4D, 0.1D, 100D); - manaBoostingDamage = builder.comment("Percentage damage bonus per level of mana boost") - .defineInRange("manaBoostingDamage", 0.2, 0, 100); - manaBoostingCost = builder.comment("Mana boosting cost per level (of 1 hit)") - .defineInRange("manaBoostingCost", 500, 0, 100000); - manaProductionVal = builder.comment("Mana production value per level") - .defineInRange("manaProductionVal", 20, 0, 100000); - manaBurstDamage = builder.comment("Damage of magic burst as percentage of attack damage") - .defineInRange("manaBurstDamage", 0.25, 0, 1.0); - manaBurstCost = builder.comment("Mana burst cost per level") - .defineInRange("manaBurstCost", 2000, 0, 100000); - pixieAttackProb = builder.comment("Probability of summoning a pixie when attacking") - .defineInRange("pixieAttackProb", 0.05, 0, 1.0); - pixieCounterattackProb = builder.comment("Probability of summoning a pixie when attacked") - .defineInRange("pixiecounterattackProb", 0.25, 0, 1.0); - } - builder.pop(); - builder.push("create compat"); coating = builder.comment("Damage absorbed per level of coating") .defineInRange("coating", 1d, 0, 10000); - mechSpeed = builder.comment("Speed boost per level of Mechanical Mobility") - .defineInRange("mechSpeed", 0.2, 0, 1); - mechAttack = builder.comment("Attack boost per level of Mechanical Force") - .defineInRange("mechAttack", 0.2, 0, 1); - mechMaxFuel = builder.comment("Maximum number of fuel item that can be added at the same time") - .defineInRange("mechMaxFuel", 3, 1, 364); builder.pop(); builder.push("l2complements compat"); diff --git a/src/main/java/dev/xkmc/modulargolems/init/data/MGLangData.java b/src/main/java/dev/xkmc/modulargolems/init/data/MGLangData.java index 92eddc62c..4382530ff 100644 --- a/src/main/java/dev/xkmc/modulargolems/init/data/MGLangData.java +++ b/src/main/java/dev/xkmc/modulargolems/init/data/MGLangData.java @@ -109,9 +109,6 @@ public enum MGLangData { TAB_EQUIPMENT("tab.equipment", "Golem Equipments", 0, null), TAB_ATTRIBUTE("tab.attribute", "Golem Attributes", 0, null), - BOT_MANA("msg.botania_mana","Mana: %s/%s",2,null), - BOT_NO_RING("msg.botania_no_ring","No Band of Mana Equipped",0,null) - ; private final String key, def; diff --git a/src/main/java/dev/xkmc/modulargolems/init/data/MGTagGen.java b/src/main/java/dev/xkmc/modulargolems/init/data/MGTagGen.java index 0fe407274..18fa7de02 100644 --- a/src/main/java/dev/xkmc/modulargolems/init/data/MGTagGen.java +++ b/src/main/java/dev/xkmc/modulargolems/init/data/MGTagGen.java @@ -1,6 +1,5 @@ package dev.xkmc.modulargolems.init.data; -import com.github.tartaricacid.touhoulittlemaid.TouhouLittleMaid; import com.tterrag.registrate.providers.RegistrateItemTagsProvider; import com.tterrag.registrate.providers.RegistrateTagsProvider; import dev.xkmc.modulargolems.init.ModularGolems; @@ -12,13 +11,11 @@ import net.minecraft.tags.EntityTypeTags; import net.minecraft.tags.ItemTags; import net.minecraft.tags.TagKey; -import net.minecraft.world.effect.MobEffect; import net.minecraft.world.entity.EntityType; import net.minecraft.world.item.Item; import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Block; import net.minecraftforge.common.Tags; -import net.minecraftforge.fml.ModList; import java.util.ArrayList; import java.util.List; @@ -33,18 +30,13 @@ public class MGTagGen { public static final TagKey BLUE_UPGRADES = createItemTag("blue_upgrades"); public static final TagKey POTION_UPGRADES = createItemTag("potion_upgrades"); public static final TagKey CONFIG_CARD = createItemTag("config_card"); - public static final TagKey SPECIAL_CRAFT = createItemTag("special_crafting_material"); - public static final TagKey GOLEM_INTERACT = createItemTag("golem_interact"); - public static final TagKey CURIO_SKIN = ItemTags.create(new ResourceLocation("curios", "golem_skin")); - public static final TagKey PLAYER_SKIN = createItemTag("player_skin"); public static final TagKey> GOLEM_FRIENDLY = createEntityTag("friendly"); public static final TagKey POTENTIAL_DST = createBlockTag("potential_destination"); public static final List> OPTIONAL_ITEM = new ArrayList<>(); public static final List>> OPTIONAL_BLOCK = new ArrayList<>(); - public static final List>> OPTIONAL_EFF = new ArrayList<>(); - public static void onBlockTagGen(RegistrateTagsProvider.IntrinsicImpl pvd) { + public static void onBlockTagGen(RegistrateTagsProvider pvd) { pvd.addTag(POTENTIAL_DST) .addTag(BlockTags.SHULKER_BOXES) .addTag(Tags.Blocks.CHESTS) @@ -52,14 +44,8 @@ public static void onBlockTagGen(RegistrateTagsProvider.IntrinsicImpl pvd OPTIONAL_BLOCK.forEach(e -> e.accept(pvd)); } - public static void onEffTagGen(RegistrateTagsProvider.IntrinsicImpl pvd) { - OPTIONAL_EFF.forEach(e -> e.accept(pvd)); - } - public static void onItemTagGen(RegistrateItemTagsProvider pvd) { pvd.addTag(SCULK_MATS).add(Items.ECHO_SHARD); - pvd.addTag(SPECIAL_CRAFT); - pvd.addTag(GOLEM_INTERACT).addTag(CONFIG_CARD).addTag(GOLEM_HOLDERS); OPTIONAL_ITEM.forEach(e -> e.accept(pvd)); pvd.addTag(BLUE_UPGRADES).add( GolemItems.BELL.get(), @@ -81,12 +67,8 @@ public static void onItemTagGen(RegistrateItemTagsProvider pvd) { GolemItems.SLOW.get(), GolemItems.WITHER.get() ); - pvd.addTag(PLAYER_SKIN).add(Items.ZOMBIE_HEAD, Items.SKELETON_SKULL, Items.WITHER_SKELETON_SKULL); - var skin = pvd.addTag(CURIO_SKIN); - skin.addTag(PLAYER_SKIN).add(Items.PLAYER_HEAD, Items.PIGLIN_HEAD); - if (ModList.get().isLoaded(TouhouLittleMaid.MOD_ID)) { - skin.addOptional(new ResourceLocation(TouhouLittleMaid.MOD_ID, "garage_kit")); - } + pvd.addTag(ItemTags.create(new ResourceLocation("curios", "golem_skin"))) + .add(Items.PLAYER_HEAD, Items.ZOMBIE_HEAD, Items.SKELETON_SKULL, Items.WITHER_SKELETON_SKULL); } public static void onEntityTagGen(RegistrateTagsProvider.IntrinsicImpl> pvd) { diff --git a/src/main/java/dev/xkmc/modulargolems/init/registrate/GolemItems.java b/src/main/java/dev/xkmc/modulargolems/init/registrate/GolemItems.java index 34548e217..9a42e3ced 100644 --- a/src/main/java/dev/xkmc/modulargolems/init/registrate/GolemItems.java +++ b/src/main/java/dev/xkmc/modulargolems/init/registrate/GolemItems.java @@ -16,7 +16,6 @@ import dev.xkmc.modulargolems.content.entity.metalgolem.MetalGolemPartType; import dev.xkmc.modulargolems.content.item.card.*; import dev.xkmc.modulargolems.content.item.equipments.MetalGolemArmorItem; -import dev.xkmc.modulargolems.content.item.equipments.MetalGolemBeaconItem; import dev.xkmc.modulargolems.content.item.equipments.MetalGolemWeaponItem; import dev.xkmc.modulargolems.content.item.golem.GolemHolder; import dev.xkmc.modulargolems.content.item.golem.GolemPart; @@ -72,7 +71,6 @@ public class GolemItems { public static final ItemEntry GOLEMGUARD_CHESTPLATE, WINDSPIRIT_CHESTPLATE, BARBARICFLAMEVANGUARD_CHESTPLATE; public static final ItemEntry GOLEMGUARD_SHINGUARD, WINDSPIRIT_SHINGUARD, BARBARICFLAMEVANGUARD_SHINGUARD; public static final ItemEntry[][] METALGOLEM_WEAPON; - public static final ItemEntry[] METALGOLEM_BEACONS; public static final ItemEntry[] CARD; public static final ItemEntry CARD_PATH; public static final ItemEntry CARD_NAME; @@ -86,40 +84,39 @@ public class GolemItems { { RETRIEVAL_WAND = REGISTRATE.item("retrieval_wand", p -> new RetrievalWandItem(p.stacksTo(1), null)) - .model((ctx, pvd) -> pvd.handheld(ctx)).defaultLang().tag(MGTagGen.GOLEM_INTERACT).register(); + .model((ctx, pvd) -> pvd.handheld(ctx)).defaultLang().register(); COMMAND_WAND = REGISTRATE.item("command_wand", p -> new CommandWandItem(p.stacksTo(1), null)) - .model((ctx, pvd) -> pvd.handheld(ctx)).defaultLang().tag(MGTagGen.GOLEM_INTERACT).register(); + .model((ctx, pvd) -> pvd.handheld(ctx)).defaultLang().register(); DISPENSE_WAND = REGISTRATE.item("summon_wand", p -> new DispenseWand(p.stacksTo(1), null)) - .model((ctx, pvd) -> pvd.handheld(ctx)).defaultLang().tag(MGTagGen.GOLEM_INTERACT).register(); + .model((ctx, pvd) -> pvd.handheld(ctx)).defaultLang().register(); RIDER_WAND = REGISTRATE.item("rider_wand", p -> new RiderWandItem(p.stacksTo(1), null)) - .model((ctx, pvd) -> pvd.handheld(ctx)).defaultLang().tag(MGTagGen.GOLEM_INTERACT).register(); + .model((ctx, pvd) -> pvd.handheld(ctx)).defaultLang().register(); SQUAD_WAND = REGISTRATE.item("squad_wand", p -> new SquadWandItem(p.stacksTo(1), null)) - .model((ctx, pvd) -> pvd.handheld(ctx)).defaultLang().tag(MGTagGen.GOLEM_INTERACT).register(); + .model((ctx, pvd) -> pvd.handheld(ctx)).defaultLang().register(); OMNI_COMMAND = REGISTRATE.item("omnipotent_wand_command", p -> new CommandWandItem(p.stacksTo(1), COMMAND_WAND)) .model((ctx, pvd) -> pvd.handheld(ctx, pvd.modLoc("item/omnipotent_wand"))) - .lang("Omnipotent Wand: Command").tag(L2ISTagGen.SELECTABLE, MGTagGen.GOLEM_INTERACT) + .lang("Omnipotent Wand: Command").tag(L2ISTagGen.SELECTABLE) .register(); OMNI_RETRIVAL = REGISTRATE.item("omnipotent_wand_retrieval", p -> new RetrievalWandItem(p.stacksTo(1), RETRIEVAL_WAND)) .model((ctx, pvd) -> pvd.handheld(ctx, pvd.modLoc("item/omnipotent_wand"))) - .lang("Omnipotent Wand: Retrieval").tag(L2ISTagGen.SELECTABLE, MGTagGen.GOLEM_INTERACT) + .lang("Omnipotent Wand: Retrieval").tag(L2ISTagGen.SELECTABLE) .removeTab(TAB.getKey()).register(); OMNI_DISPENSE = REGISTRATE.item("omnipotent_wand_summon", p -> new DispenseWand(p.stacksTo(1), DISPENSE_WAND)) .model((ctx, pvd) -> pvd.handheld(ctx, pvd.modLoc("item/omnipotent_wand"))) - .lang("Omnipotent Wand: Summon").tag(L2ISTagGen.SELECTABLE, MGTagGen.GOLEM_INTERACT) + .lang("Omnipotent Wand: Summon").tag(L2ISTagGen.SELECTABLE) .removeTab(TAB.getKey()).register(); OMNI_RIDER = REGISTRATE.item("omnipotent_wand_rider", p -> new RiderWandItem(p.stacksTo(1), RIDER_WAND)) .model((ctx, pvd) -> pvd.handheld(ctx, pvd.modLoc("item/omnipotent_wand"))) - .lang("Omnipotent Wand: Rider").tag(L2ISTagGen.SELECTABLE, MGTagGen.GOLEM_INTERACT) + .lang("Omnipotent Wand: Rider").tag(L2ISTagGen.SELECTABLE) .removeTab(TAB.getKey()).register(); OMNI_SQUAD = REGISTRATE.item("omnipotent_wand_squad", p -> new SquadWandItem(p.stacksTo(1), SQUAD_WAND)) .model((ctx, pvd) -> pvd.handheld(ctx, pvd.modLoc("item/omnipotent_wand"))) - .lang("Omnipotent Wand: Squad").tag(L2ISTagGen.SELECTABLE, MGTagGen.GOLEM_INTERACT) + .lang("Omnipotent Wand: Squad").tag(L2ISTagGen.SELECTABLE) .removeTab(TAB.getKey()).register(); } - // golemguard armor { GOLEMGUARD_HELMET = REGISTRATE.item("roman_guard_helmet", p -> new MetalGolemArmorItem(p.stacksTo(1), @@ -167,19 +164,7 @@ public class GolemItems { METALGOLEM_WEAPON = GolemWeaponType.build(VanillaGolemWeaponMaterial.values()); } - //metalgolem beacon - { - METALGOLEM_BEACONS = new ItemEntry[5]; - for (int i = 0; i < 5; i++) { - int lv = i + 1; - METALGOLEM_BEACONS[i] = REGISTRATE.item("golem_beacon_level_" + lv, - p -> new MetalGolemBeaconItem(p.stacksTo(1), lv)) - .model((ctx, pvd) -> pvd.generated(ctx, pvd.modLoc("item/equipments/" + ctx.getName()))) - .removeTab(TAB.getKey()).register(); - } - } - - // cards + // card { CARD = new ItemEntry[16]; for (int i = 0; i < 16; i++) { @@ -192,23 +177,18 @@ public class GolemItems { CARD_NAME = REGISTRATE.item("target_filter_name", p -> new NameFilterCard(p.stacksTo(1))) .model((ctx, pvd) -> pvd.generated(ctx, pvd.modLoc("item/card/name"))) - .tag(MGTagGen.GOLEM_INTERACT) .lang("Target Filter: Datapack").register(); CARD_TYPE = REGISTRATE.item("target_filter_type", p -> new EntityTypeFilterCard(p.stacksTo(1))) .model((ctx, pvd) -> pvd.generated(ctx, pvd.modLoc("item/card/type"))) - .tag(MGTagGen.GOLEM_INTERACT) .lang("Target Filter: Entity Type").register(); CARD_UUID = REGISTRATE.item("target_filter_uuid", p -> new UuidFilterCard(p.stacksTo(1))) .model((ctx, pvd) -> pvd.generated(ctx, pvd.modLoc("item/card/uuid"))) - .tag(MGTagGen.GOLEM_INTERACT) .lang("Target Filter: Entity UUID").register(); CARD_DEF = REGISTRATE.item("target_filter_default", p -> new DefaultFilterCard(p.stacksTo(1))) .model((ctx, pvd) -> pvd.generated(ctx, pvd.modLoc("item/card/default"))) - .tag(MGTagGen.GOLEM_INTERACT) .lang("Target Filter: Default Target").register(); CARD_PATH = REGISTRATE.item("patrol_path_recorder", p -> new PathRecordCard(p.stacksTo(1))) .model((ctx, pvd) -> pvd.generated(ctx, pvd.modLoc("item/card/path"))) - .tag(MGTagGen.GOLEM_INTERACT) .lang("Patrol Path Recorder").register(); } @@ -330,8 +310,6 @@ public class GolemItems { .tag(MGTagGen.GOLEM_PARTS).defaultLang().register(); } - CompatManager.lateRegister(); - } public static ItemBuilder regModUpgrade(String id, Supplier> mod, int lv, boolean foil, String modid) { diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 2f37d2232..8ee902273 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -33,9 +33,4 @@ This mod adds golems that can be crafted with different materials in a Tinker-li modId="curios" mandatory=false versionRange="[5.4.5,)" - side="BOTH" -[[dependencies.modulargolems]] - modId="touhou_little_maid" - mandatory=false - versionRange="[1.1.9,)" side="BOTH" \ No newline at end of file diff --git a/src/main/resources/assets/botania/textures/entity/dog_golem/elementium.png b/src/main/resources/assets/botania/textures/entity/dog_golem/elementium.png deleted file mode 100644 index 0b5029fd513839c3adaa4dc843c1d92b6a481105..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 707 zcmV;!0zCbRP)a>00RAt~$Grc>v_hd@+-qgzcnDHNS}qiU5+INb5Lq8(y~c8N_c#mYnG>-wreMW;DBgd zl_e_xfZx@xPF>fJBkk=Fw>=xd&F$K^Kmp-9`AOMKz%jZ~t*KJ4%68bwy z!7jp2MIudN$fR6ia+(5ju{gEzlVpW?D!NBqU_INI^L2I6Yno$W71rg(hrsbcqRY`! zj`hy!12{S}r;3r1qnPOb07Z=Nv!7mld0hwJ|6>xS#?=oG(7+_(V%_z&>kL7d4S=Y0SG002ovPDHLkV1gA-Q3L=0 diff --git a/src/main/resources/assets/botania/textures/entity/dog_golem/manasteel.png b/src/main/resources/assets/botania/textures/entity/dog_golem/manasteel.png deleted file mode 100644 index 9bed0b687a1674b47c81307340f9feb91a4b8065..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 699 zcmV;s0!00ZP)RA_$v8}z;q zDthF84a^p%?9aEGUP_gutUf*&=a%vr5Dg$&9=9u;imFs-59+S z%R}p&ar)wySNY=0s~OWVF?!ko)446flk1LbOdwd6#v+f)WZrPvnLjG`-IEwmo1cH> zVGdv76_@T1rp5{vSVE0MofMA#-_EDl}i-^r}X{0@ALdn&)=Ntk&0nu}PEO`Nd z=Iw_maE#+fv7KYL7b3sA-FXOfNl<^NUi!X&4%Y}He{2qJ+uEgABJZU1wl^*uX>%it z3HADhQhzA2c$}ox?g0AT~(oeUgD=3^Wpx z>qqzu;UTIfkL~ze&_*4lE6iJ7oO+|%V(xMEMi5TtVPzwBe8^lMC|8f3Qg4sJ9AM#c zb7~l=IXcqJYtA9CUz=NBe(r$B|B!~MZ}xMdEX66Q`vDHd$o4MMt*w_@!B8eL2Z#;M h%>M~Kc<=xK@EPx%en~_@RA_nGnOiUG3 z)S-w4Is}vR`Rq8vju`l)N{P9|x%1umd>w$Zn4XL=7xS+{EBTL!`~A!0a#>_K%D>-k z^EHrqORh^`GSbI3`|D;UN@_eGwOd2^2#5v{Ee~9;a3G2-M;Z8?;!<$si!2X3?RCWP zh!l(I$-3fn;#nd8I4ks+_KDH$0T>U>F+4Or8kz(UEK6gN#bq#W*dFvhI_`QVFme+7 zIpPu>^csQO@Wrvxt~?VV2Mw^8p0Fn*bOfC%mt8me@tgjgGZuaMgFL%H2#Q7VO}m&2cO|$ETy{|9J5-fi;V$7|7D6f)#LNj?dD|Get*#HU2Xs|F;DJT* z!P4wa9X9?AED5 zfF~e&udXF808oB@>jM@!juhK5PJ2zncefi4fjSAQ4^>;=YG-~3SElEWje&nhh!SFp zypht|Jh*VA!;K`<)a&cY<0gu?rQR#S<#@7NCUs(?vbLn?Arrd@0)RxDd_074-+0000Px*%}GQ-RCt{2o3U#fNfgF^4!cM2;bvX9QsF|42?RoF7v|tFg4p1sFbBq2gW-q^ z7djW`6l!!uE)W;t0zR@A3?W5qhyo%U94`C^Buz-;0~M-LWE*iJoCLaJ^F}kXE3IU0 zV&~A;cr`OSGw+)>Z{F;Co*)Gs@83?p`bz6%-}jdrHz(4@I8Qi(Hf)D29M6qC3zpm) z#_u#@E(%gtM>HUffJ*Bnr;XPDa{0w%&$>UK z{{=)s>wE5;D^Ki1R)rlm_V5U8(x>=ue@s2vg>Z?Xaa* zUr=Z)c00C?$%~2!dxeAuAwh()1sb%S-ag5XIByMz5s-xYVF`euS4#Xn2reoCj!Y;G zv*c8}S#s24q8lD12dJAEFQXz@=c$*C^Qyv`SyHmz>BHF4y51aMy>CK^S&;}20!Fc2cSkBfOni4^?&fZ?}Tr2tFzA& z0K@13Y_iTA`MwkSiC_Bmf5@ZG5^Jiz>s&SJ?{If0LSvp_jk*$ACObzyMnoDmSvPEj zkOGkrO@fe~1|fDojQVW*5y3(5aHu)L5SO8}l{-&3!P$*z;$6TNcG%TVLydY&3kF?% zfTQp+09B4Du)q>)XC}cpzCC423PEvi9d&cDS0sHOSS#riiH(4i`e*$m2 zM$i^U-kl?_?1fBxlXal0i3NW(5;k~dXirjqc3B!O)u=1=nI+fl{L`Qi5tKwmjXFiI zM2)&pKSv(ky3uX&O5`u-+e+FOy%I&Q#2k4=gq##}1>o}EF71yzRFj(4Oh4y9n+CE^VSZ$8!y# z+F^_8n^)=@?RYLl%z7RAD(+EcJKT*4r_WDcFe#VCk@0F_x?y!H92lL;ii^xG9MYUqmu(eXxni5{#HbMV7`AAOz5Y8-pLYc2swkm zwh^|)w#)QWpuhqv^J{9mIP(z+Qdi}ezvAW`Ia1=gHJq0f5 zlaf7Jqdt&fu?5nNsBD!jf5#}(+W^sN0aV^}FHG_*b%FO3K-mbf3AP)27EIjcR_Cl< z-aAg!I3h@r_a|lc-N2rh<3-kf#oOTHa#I;c(W32e7bkGL#GJHn zJPd+FaJ%mc2g=dWgJGZ&^thqy|6W?pG{E~zmeE{B|#^uz(S(%1%K6u2J7ud zMJ5F3p>pVkuJtgO6SzhmfxW8sr*J(NK(@f=`23v-0bBk~ET5p@uXaP#fy*9cr3pfW zkYEQubOM_++2;XH;L@a_oZ8WAwl{W zHUT0HBcB2ySghku8X;|C3I&>m$Y*Fa$ZPQrDrsy#3H0MN}5$QmPSz%Yg= z$sw9#k{PCr)tq6PeI77L^uI_Fg14i>S)2-)YymrepjW;@8blyTZ_x#mT!E}HG68n} zfSpv4_Re*#CMG#Z0)&mMeSyqvz*+N(?bZHL_z#Y=N_q}&LMH$K002ovPDHLkV1frf BTR{K- diff --git a/src/main/resources/assets/botania/textures/entity/humanoid_golem/manasteel.png b/src/main/resources/assets/botania/textures/entity/humanoid_golem/manasteel.png deleted file mode 100644 index 2905306a52bba23f5a1acc3b86b569576817213b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1786 zcmVRq?g6@c zF987Qn>WPu(x@*uWsHUC-0rbI9kTEM(A|4^VKg8V0slt?CSd#Zf$NuIN`h^p=$sUK_rk+xkB>0{~dog6BMUfgGL*DZm`uc#zJ!{nB}$+w{F}kk*_hq#zAc z_uRVe4^nSaTp+__E~fp&Ss+pTrQg>FVj{vcn_&glF?($i&R1va0}^R_zmEXBxl!8( z;jFjI-k0Bd!&ZfElb!GHsO^8-!v}oJ?iW{90jORd0G#zlK&CK!M8AGM{Q39Z^oxsG z_jy_0A?QisSZwl;V`>R=aqpv>yNNmUd8rXc5W1g?#&d0zYqf_|G_n} zu{OoV_fXRw)ARIeJ{Uu{>8ejUFCI=W1rcN-quXTRakr_qXA0PU%XX8qS9lyCn-%YG zSqtp`OhFJKR*Fo4wY_fx;C9ZB#eWW`QVS)tj8tP|9y1SW02ajH8XNQMgFxk5K%Eo&WPLiE0bt8V!{C6D(_iX-UQHD*~^hL)i5soTo2ysR~c{31tyf!*~wX5;G^iFHU15 zh)Fo*ctA8rLRMQ$?HX%Su(t+=Fb62F8blDd1D(A#>G@!yuS^6XybPI$ z0i>8PJTDM%4`B2c`#Wy%v%e$O_@Vc6VVymH|D$L{2!Uh7h!G=3j2JOu#E20iMvNFS zqAyPP@^>|NsOJnr)E78g9q-4EkokWISR^!M{A zK8VHy1_(wF86p#8qNbOP!Z+5Ylytq)e?&w>08gnC#9*Z~m|ah*bp+b1dOod7wE)8Y zPvP@-Bm^k+1U$RkSep{U+Vv!yO3l>-B7*V&S^`8N@aPcE(--XdM~9+M(Db(-Mkj!T zl+)>R>hBClK)aq4#TG(i4CbSFd?JBJ>NX=Su^oLC;DYIpD@?>p3oovvwls6F=Z;~| z-F7QL^unqL5s3*nTODPIvg=88$-zu%j0U+tth_}Pu-!YINN{ul^!fprgdq1^z3Z*?AQFBu%y7i9K=hlTlhze$ cv;Cp)AAz)FoL`54RsaA107*qoM6N<$g2iJ~r2qf` diff --git a/src/main/resources/assets/botania/textures/entity/humanoid_golem/terrasteel.png b/src/main/resources/assets/botania/textures/entity/humanoid_golem/terrasteel.png deleted file mode 100644 index da735625015d810cd5c959d7b180299afc3a9a4d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1741 zcmV;;1~U1HP)Px*heAW zFc=Dj5a>m3bt}*t2!%rKRk|c*si{aYRLD()SZu9&G5@op{gKvxWj`>U)y&S$`R2@- zGjq-glHj?sxN4^p#=bso{<)I)jXQ*$y5%qgs#dg2G2T_5lZd%5NKe2VFu|Qpi1GQ9 zl%K5%LYm8d;bvhaH<2(5$)5&UcmNomPalj1WFz2zh|~l)Z_H(YECc7+s;HNjz&%GM z8=wm=W4vp@>4@?}K_UU}(--hRyqjBh@rwt52rUcFY`{2=QQjczxP9Jz`XaG|&%fC) z62!^ajrSw4;oqsBAT&U-?o8D$KxP+PhBt>HE;^*%p+Ak~cGZWm3|1lL)B*%bx>dG;r2ednL}8QXm_!^=mcEL(j5IQ|52q*2jbU=RqQ*Iz=)-Nx|1INDfVO=?;z18!wztnZD|eUXvL-tUcwDp#qKbx1waVMvzI_PTi2G|t`#*kLxOq}rga z4SaVNYZGh$aE}^fY(M<24o?1H+`6rm)qx(5fOZXd{}FSAVeh&XVK3Og*)!Ed_n=P3 z_xeoL9^T)z=x=*nJg0z#K_JwpR_2|vj{=k+6B&bmxW|J)t#>QH`;X)_`TQ~2?&M{~ z+8>t4pIZ?`u${uKkh&ppyZye$%ltn>Yl=l-xknA4H5DWb0=Nft@=OWw`ySU4?gkG6 z@f#C_3ARsehkWO6;O!-8v%eY@oZ+xU>Y3pCtD=4qlCiXBz$7$I5Nc&X!XU`xVcJ~K zRsht5O>{Rm;CIh>nRi|*izOo)o~oq^H4NeWbg9)_O1%Pk7F$zbUluM9WeW0bTU`=t za@hA$7*-oyTkV|9I1^eHl(yl|U0Zx)9|BYuTmlxs#rVAgk&IyI+bNoYG_INk5R zBIBSFq>Mi!i1Y)E;jRrI9_Q;}jR17&M;5Tr9Kx?z-zC|fG-Q9~V^+y)@K1)wY!UZ!<8 zT_gXgjo>yxcY_ze3U;5&7WVS|i5T4T$3%5O43z)joml5pi(Ib0rYhTX#1={6bV7do zcHYc6S+=Fit18_gsW z59kHz+e`9}L=Y1^(s$PeKm5qT?}fmxh?2n2PPY??#XQg5m47$2kuCNxgg=yoXYE^L zYg2ZOVW9BfF9wI+b7wS1mv>><_Si@BSa?1L~XAdg?A6?YBX4Gza;V@Kn|5d3SCQK zFu(7qc?9~b>R0PhE&yKwH*o!(3jyv?BbrZeQ0Kz>eGh0&g(ff}cpPA=YK%Sgb1eUiB&lwA1b@HvPJoQPu;Tg93rhfZ&ND+y^$caHzI#50u2Zf z+Ey-v+>9U4ngTGy3+EX?84ZW5d3dTnak@qlA9BX>1Y|KpCWokEk?^)mO0@*EuSgvr zLhyQ2IEP&!9}Up+2j=A)B!LOE7Xs~)7V-{n#1mY;M?HT)PpU|Ir{S2B99RN`j+}jg j{0~Em<`wI+eM|TcUg!#MjnkUk00000NkvXXu0mjf8M`e3 diff --git a/src/main/resources/assets/botania/textures/entity/metal_golem/elementium.png b/src/main/resources/assets/botania/textures/entity/metal_golem/elementium.png deleted file mode 100644 index 2bb3205329a16480f7bc89a9505a9776568c4a38..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5065 zcmbtY^-~*MuuY&yixrm-2vXdk6e#Xe+$ANrOMzg;f`3ShTXA>S;!-SFOK>kzG`OYM z<9qY|gLh|kckcP^?CiOF=0<6%E8@MPdIbOg@RXJ0w4W>NzreJ8dxe^r-9`Bvn z-c zjNRtvRld}@um)lp6DvY9uWxSthu8qdj`qFd!yyICLhX0jHKZaChNtO}s0x~d9=IA0F-U3eSJJ6``bjuuibdZ6oLkk1|!I0m< zn7@|S6^$V*fB=B$$Y_QraQ2_lH(Lx8xY;f#PGGwZnCs9I%7(M0;o@&&e@U*|V$@fr z0y(oop*_5YB2_?Ev$e3}7$9C$F?4$};waPh#o(yK4y(}{g&i$p1qs_;Azu1<;(&Xr z8)A#39$s+2bGNk0ikp2h*`Dae;`SM8(Jnk9p^M+ z-;KacHni8s^%&pYOEw-kYM-G2>lH3Fo5dupV=LkZ3Mp2|B>+v7q?DB3VoIk_p&>e9 z&(>+2+@P4d)1jQ|@p^*|P~vyNR*|mk?H$K$Iu;u)FhJfZ1YHEAR=TsYj+9z!cz~^0 z7=KYpaTy|Xion!nJ?52HueyM4g ztdXW@-^BnnOa{5_F^Nu7j2=^aW z$y||V1P3m#_{{C^ZmTA`c%eS%OKdK;Mx41Lf$fWYyIPn0PA?kdEZ4YYOMXaL*0oRf zn7Xc$G#A*T+wa0Fi)5>0mA6reqqb}&jUKzr+HM%_jJ;=6XR5%#?tCUP#rb?j$F$?? zYD$lVmZ#w_WggLldgNNCcoi(uOaE<^kgDH&GbL=*v)O#C%^$@s$oV;hTZ5oywN=0Z zBkq%ov+rQ0N?wC$DNOU<)T#+@?lE;TrybIi*jW-P=64;}nj^3ZJ9F$!e<1lU`F9so zHGJc))%)6C7&RA-3wdQKsrhc%vGhcijtw|C{^R1K^KvIS3(=5-w`{0J?=lbkSd`+G zMLMQC_@2U`U5X+UUH;c`dmLqjD)?9Hw1+WC}z(r(}j?J9z{1!eg*7f0~_T553MUnY^peHhLPlSGaRnyX-E>EPLrs+tanDZhGBW zMhkq5<(jrir8&!0lX9A<5eIOlcgcN$*7O+TJwcGeBwnP`-|s!LxZp6CSPS(j$H8-F z?jG-D0z4dvg9lu2?wRQFSvrTFIb^^O9pp~aGZo)Ts!7rm!qgcvZL(?ysb;V3?~ZtX zQh87xTioRLt-P*QEAHef0Q-D9H9K~JdrM)^T}Uy01?%VzapuAIk(LcY&4UryS#5R& z(RV0THHAx*lUj`=CNGcs1%R}NwAX$U1K@`6|1Rc`!V<`^)3tIn=S@NPHPv}b#qTI? zQOc-J+6^%V<1#vggs4(UY;n7Xb58F)d#W<0=%|v?a&>$lg=geJVyFSFpwcj|_2G70 z(I}_rk~?u!QPri@>$cmg(RLQ-zK%V8S!!4}MwVkyyOEM-b4!7)P7Ok%|M}j%C;dn{WyBc_cO9#YkF%w78_Sd5ohR(+ zJCI?2cZwVRhs5CyIB6J?)Pn zrkEp)e$$mAi$yDz8_z?mDBPFisc~wxN=*GbZ0P{xx**4sAOxGV#g7wmQaK2x3rRi# z#v0#l;bj7LtmB$XI4azqm4`Jy#nR-m`z=`jrdgQ*$gwr}vCH77Mt)~+(^L7)&rqbV zS@fnT3n)V{qkPWhy^%f6;ZAP+mn7gy7H)kik`NW>sl8`p z|6#fYgQRFh2Nso+d;* zZu5g3i?0v8fqa^1ORF_?B`6gpIw>aYyx5v#Z-GTQuUUXL3JO4c$ZU)wZ@tJAlV5cb zcBQ%vMDrARyC%g~Di{2HE`8pYxPb0LTd4Uf=TC0!+;OSiw_&PxN9m70j2{~5XReQ# zHN;ED@D-CATVl%;5{|NF={_A@(Vj-Qy_gk@c1;svUGnqX6Wg^w2AnZl>)0lhnwG9S zKhN#ezw@_CLLdNXa4W2S-mh-eH0)%LvY7m|^{>=S(=_g&;r$3rA0}OkMM}MHsSlE@ zI!bOnL~yxd%yGWH$6eO&`=%O`&JgzG0UO;^jz-VZ!tm<{4lZ!rygEp>y(yTQ!#IV2 z0GBeAyp34#hnie#t$d}}FF5)ZVrTWsz^2SXe zI>&A&v|yZBBS3SWdy{eWB@2;GaN|3`ow@w4)I)b@&{C7s8}!|+-|e?iM~|6WE<7^9 z!Ca!6^}+6_?J{dsjLmM0TdKeH!tOxbaK|(wqnfe48&gTLNIZyaF1PEAE$u*YnnH99 zoe$#AVu2@SeOWtGk&GC2|&26VpYm=xow4*=bi8tdg>yO(EFQ=p~gU~8jyw=9HD6Fr!8xo)LYqi|ne z^15s!{Rwi(c}c;fMVc=j8RqRm`c+hawKAeoWgab>A5`H(0?QSlEy&OZR|cvIR67vV z-`5E0ijbfj?$F&Jk_mMIKT6WqZKLKuj)J{&{dHBkb1|z0$ z+JG=TF~a&|i@zd2N!9fBjnk9xSt7nCiPk6E{1kNd7g-SZb~Y>XpkuAtQ9rhll_Q{x z`hu6&hu&oyt$KXb0)VpN56#=BDeGyFjq-)KC4uY0kb4`%Dg5elr) zE9Ei$clN|)sQLDDgh{vAHbM7?N%|P`+r1X=Sw~FnRsGs>`e{L61-0WDk~(Y}SHZb( z0TwICX0u<a}nnG2J|3V8b_)&wBq=@1_C{I-u^2D7Y;TK|14W!lTQ=B89xn0$iB! zhd!2?m?%)JEd<*-R#v>8n$veDC)d6_1rMoQ%0B*X?sHj_J$r}s$+^?iTP=V5)BFqQ zykPsEJ*F-1o<7$uD{#V?*;C%+p>H47J`^HeHMZ-h!`#(gOFKk_8noyqzM`v3uoPR> z9fPzFDJnOz=^HP22v9<4UbGezNvp>{t=v$W`bB>o3T<)_`y#(R9%}``-F)PaV$-VN>2<>q&O)@30Jjr|1W4}nK0xoV7 zl#IR>nmi`7x9MtMvFW*1@@yd<+w_;*ZV`d>k`%i7c*}rKS)6%OB1P=Y8|c6ODDLxw zg1wnL*+YAHUhiXoiV$9UpzjMKjk|~m-tP}*0R;33|DyO#BQD20cO_{atu>br1I_e1 zqLa|!&&pQsXHT{7UctMzxRL(A6MFa#6K6foHt|V^L)H)PnNyv$AWe|s%cFisj3yy6 zWRvaZgDf@Xr_l@?=*h76%&~43Gx>v3Hdn`>q=Cz&L|5nnt`zIVc?5gl;Sy%AMKX6+ zf+hHO5QE(|MVjL@KyZraPDV~hNH5^w$A@uDI-98qGs`a5#q+E&FhTYHjFFhW@ucjmL{vv95+d^fO2z{W3PZtucjv)l(cMy$<8d_M~>M# zuDaBp9o3QMuP9xPLKH&!BLxM5_#1xXWT@Ubtsc;nwhAjLh(4_^ER2A;L!8CoHxX>O zuXYzNX8SVr6UYUQ!|y2|73SuzA*Y_>l5!RNOjz&E;wwUX*-#qcjLAu?030&^AJ@$Y zD{rC{chOLrxN&Uv`E z4JpNF#*8lA4(`VDw){DFLNl#?d@UL@{TJ(#>uP0<>_XR-{MCg|dz@3oBd`R&A4SZn zPKSTNq<+JnJ>D}TuI8G(NynZjP;S+`LR*uc2Anm}WVO}S8I>jp+XpHfDek1!^NiHn zBPXmI*kcNrSLYSg?D_f&mcSRS_0iA3`FlisLv{2yuzfh*iER6Ir6W-WjnHG- z``*Sm=-IQ?0gt^h77otb;uB3$!7QM95eUa|xaB|2X@Y0rgvEilghne1+#jvBRoNF` z+5<#7{OQ=>xg9XkbhAMhjb2& zmy*&E44*@uo19%(W_9zL=={HhIwfdifENFF3SB*0TTwYbLTxWzxV7dKbj+el+19vE z-30JUO#)-yYra(mJLR5-{9d`$sy(|2{WAUcKIpQKZADdsL(h7WQ=%j_sLBllKp<4y zVmU>5G_Xzzt4MLZ02uQXA5>Fb7HVQk$`n*t4YlN5|A~+4;0Ov&+L&*5Sz>gFlQ2X9 z)uTn`+Ty;)q*cPb5tAWEp~LHq><|4SK}6A>qaFir;CTN#ru(o(e1mR6el5;}tV4*s zKxe(IUSOO5QfEIltn5Pl-I9DoK~A37RxY>bc%X)dp$I)kmNJvTJ6Oh^xXVid(@2hW z3WM~XK}>dDZBt}iDmI*)LIn2yqnGf=MPvfl7y16Dlh6knCzq!hn*0$RYUv+Q$LrOL zi;cZOGehBUj#w$W}DOoxsjk)JxsA1gP}c; zBySL!W@mYryGqC=`mkXB_EM$EJtm*Mo|tXX(Xvz_8MQMwsWeA^H0TaX`_egYZz)sk z>ODw0csG9=?cpV}0GmBPCPM)~KNdXjQUp0!Vq;ty7L%Ubi4o=wtdu{La?tXud+Noa z%FznIU=mP1s|jR4L2?p4K5zDc$yVsuoxQ#Zl;FWZ_-BGH-9HOiGdORL{pmp{oJldf&I1~1}wjXnCa=g@lqC?gP_5xgn) z=+dv&(BA9Q@cW~zvvY!*f?lKGoJ9|zv8EP%*WWe7|9;KUS{-;EpZ%+AGdC;Eg%;lO zpn+s0@WmFl1|{nWO^=z^t|yh)BoS+4cZd{YK?o`LQV$x{5Jv0xo_a#99T002O)sqtFxVGa2&hzTF&Zh5QU z006bK=4&Mb-|W2{sGEUdW=Alxh5DK1rY-KMB2bl+RY-Z28vG`{CZsXE`Vqd9B|pN; zh{?;#+s>ve^@nMX(kMdLM4!)SJC*Re7grs=+n2=0Y#kcUc*rz8ACusda4cvxCo3kQ z7Zmo34))p>awtgFN)M`dy+DiD91qv4YxH$?6+t1m(U7L7--ffHeEGAvW^-e$Z5S1Q zAjEfTfvyH=Y;$nu9Wlu~&CJfmmYACiVdR#oZ5SSI{U=%dW@iL)c<%Y!+h=TUAwJNP zRF1p7X$2K6lh8)IUdpgo<@&X<#j)k+=TF5jJhqzXwa2(WVxJ>zqBW-}2jBs!_D6w$ z7)46U`xa|J1Y?hN9VcrXFy43O^Zo9*@VcCEcTXbavp)-1dKacI52%4600PzJPQp

DoXb6Q53RK1! z^4kpcn)R;2ok9(22qM6;$JZ@HC#qR3$xWB!l#7P<1U21w3u)Dy_9NQtcTrg5>~@bK zpNoXxmwXog%6Dl}(i1)8*V57s(RE%rB0jlz)xl$)Jw2%rC09Rw7Q5c7Tn4YbmlKF~ z34P7__@=dENIwqS=;!`{w%#_AO88*ZV;m|6kh~XaKxu2_kt^!9>EZE6g+{CiOSzJ! zT-dccSNPq{3unQzNeiy61dM$HALj|;n^s$1 zp1eph17|7?&qZwYxGu~1tCh3~ijeNp!L1zNAMmYA%>6@?ya*};S^?Y1Z)>?042R}8q)1r=E%%sKkDC8ZFnrK7rbPh5jx*wZeAy^ChHx{M zLZBU$4C>XjKh>;a)TBev#!C5X4&@L;#o*4^qmO1{gmko2U6vcpB1}%37w)$L-(jxx z`cew&Mbo<>W45?Il^cq;%*lm}Ts6K9uRjn|yfnpwnOxbH*bFy)#@dGFBFlgv@_io8 z+15=J*x84bFdBItzbvYPNSYTV>7+m^Vwn}J0eye0n`-yoD*Py)lj(R%OfQ zA4ZNP*eIsT#Q|$Nd1aUYJ3qxl&fu#jAZwXA*{ttQsR!^=(WasdwdnYDIB+-(%IN6c zN}BK}`155+w#TFG@0T=O3Nhy=oR^h=CQ7B-Jll-Ovg3!FqkTdBs&m!2u?8yjzp75h@? zastHjlwIVL#RJ54PVr`sQOL*mckG%--U18gxlp z*?b4P1Wk)|Zqt4YPe;xGlY02(O{O;)3gW;)Yfd;K>qkJe0+%)&?4fQAG9WXKWmkcoH`FmRN)< zv_;2fsLhrEppco`b75d2YHx{_x8Pf;Br(B4$X~UJMIRmaq=_QHD1P6g@&%q3fK8Bw z`!DXU-|4Z9q9I+E(lqU@S>J-6Bi89%okkGWyij(#p@oEtj$u!S$kr;|nszZ(Xot>B zFrIh`&)3v`Fz`QB=GzVfY_2LhtZk}ZoJ}%G`rSj?S_~~)8B&{^_ zw>>pwU%DXmYG4ea35!>|qS2iEmr;pkrIt{Lclm2cJFZ`i{T@z>5^s0_jHOGwk}^ys z{ehKRO9tTk43n2h{aFYz1LdlzCy+})y2I7yG*%XmCtDDCzWS+ndBGU^BH(Co&2Gs! zkoOkH&n*K*{b5J=V|(L22rNZo5rp3jRh|91Uy zH<0|O!QOKB!-rh}8puV@a*=@s4mQ(++4j|N==@hI38@lX-~!{mCe69dLTw4Z6P-w~ z)X6voxqFYz1@ktyOQZw8P?Y$-$NSpeZ-@Bhu#}59o31G$nj6 zW~h&E)Bcg3MTUTsq1{XSCs*cp0Y+0#l5bF&4vy1vvxMK!r{|-3&m_+j5TEe1q&E=R zc!TNU;c_4gZt|n&eTH-jG@tYaDo)BNN48QEZgkL3+_;pTlj~DV=f=w)eS?Q(jh#Ap zjvsVBC{`0YnCg>K#696B}yNrF<&X+RtCKhcS_vgY)jn;Tl7~V_5fJ3#ceGntP zRv5qM3EdAE%gD|mJF}A^4bZGMoR;xR~HF##EJoS_6@~pEFCFaBGAN?dP z+weB_i{M2hpy0DW6f9S$+F3yf&1#f}CN3XwV{RXC9!_ePPPhj6W$1~+Lyx~!PZHn6 zzF4zu(1jYo4uIm%r0B<%^+%b0Q*>@w#5JC$Xx#U%7>?iF$t?sTHYuGw+=hJ_W!H7` zowncWvAQn>Q7)UhJ5S=CwX!rgPd)o1@v1idBkMKh;Cz+-)lnk@`aS9mDMzW^#V!_L zBN#;SO8lkCT9PACQ5CyANJBouaZ;x_0G+|~IH(LWX=$LIeDW~ZoOG|RQ>EGTj) z4}g^U4H{Yv$Qmzb6|9TQ zL2N*@51`zK*0d9UA)TlFf_Udi9vObFbPt(V{hLIqC$2tnAKZBGg7&rwca~HSC(1P= zc8o2}aHw_yyJO0HAXbz9t;PvY74CUfM9ZfHNBf=R0&S)Pify^dsr5}&wvM88-c#EU z&%BVBAg!4NUkX#ESSS6lX9CxyTbx1)Rvr`@rIGa_C9sXBl;*$(DQlrz3n--?~j&u zU0$c+y-w{zq`2e8WliLrt36Ca z?;(bU1R2O{d#Ah-Z#7f1O?fm+!jyV% zz|kcWi@PoPMRj$i!!3P5(_lV_Y)5B+T>3D!C82)%5srzseS?c@_+xw1Wq5D#^5!MN zcojhe|F0w0XD89YVITq{<|5f-5e0Yq|9Wb1(c&yr9jRY)&w}H5hXX^3f4`=JEn*ON zuX4}S8wU4TSog_TpOj&_XGrk(SH*l!i!y4Fcj2{DoJ6{#*_s(RSiujJ9OlktRr%HE z;;6)Mp63$)^yxz3y)yIJzZ@uK(tbJZldG0(pnEG#9qcJ7zaF_j(}Y0jEAmkmWxU)EhbJ|-&^8&kAlv79n?||c zQLOm`=_FHy!SMZ?A8NDb)n_4>l+h95A(u^i0Voey>vvoGQ{jL=siF$V94_I=(OBHJ zh?f9UfzWP&kyXh&Y)WL+M`KxEC(7xPvfwMcF}I_SDud|aLB&Ox(BE)^uJ@(nm^m{7 z0~Uo@C{ke{0rG}DoY^YqC8?ix_3r7R0+X#;7ehzo6^BEn+oiA_CYVofA-OL~#oWN1 zEa2K81ErN%wD|We)E=pEOsp?<%WF!c+qEbW$pAB>CRRuOWl}w=Y?6zJU?z~#*9Ut2 zeFbocHT2NV#eyF8Zl$H*#Sz88A~C+y2Wg(lj*Yxk^+=l4tp_$snFI}1*PJ~=h&MBH zp@}XIaoiFjvT6-7GJd5^+?1bb^7)WR+K#pgT+bRjhCweSbBG_z=Fu)uL~Y7ljAWO(Vz=zGsns#m`cTWk$} z{ppTFHs*<_dE&aFH;wJx4=eRiS9o;1frOWf6wMYM&j36{C(B3}H-FfHh;gCRXkBhy zIOuM}ZeEsBJw@M!)?Uv}Z3iFY8-7>0+gZMa>@|#})x2#36R5o{zZ{DSJEo0eQe1a+ zp*Xs+;xMkQ3~9EDBA`H#yS*vu)8FjiGj@J+dN5(+rGI+;HwEX>yEsN6f8c;2vkZISK!`i;$!`qQf<{CLxsavq+!{ex$r=F5}zKVn!*?baa zL)E?HsWD$k$nbTk4dY>KP?z~M{LIBTxzUW=pv>Dx^(R^#e7NcMsq+qhNXv{Nq)>}J z8mv~iY#_bY&jlK)c6&^nrmZMNUo9g>QJfMkID7JSE|>g*R77|qvzmpN?oQLJy6+cy zET15!r#tk?!bDkAIJ0IX_%7^6dv~J~u2E$+KY`6A2*&<>_t!9vMna+3fbob-svgtp z7ZgQxVg`S+gy*AsMB9FEan%%ct zhfA#wm73WBSN+s(ErSB>9Z4UGX&WmzrhUuY<4m5P-yDl$Hns4Bf#)yTWaYRCt5V;^i^qg`yT?8l5A{?T3Cx|YHUQazOI;Zyf zQI!RM+w@qEs137x$(%KFE%N5Csatj-MGaboU3${C2$W%AZ&S*?lMKbp~9sNJ}hhtet~mwuL@p2^?QsP<$p z!g&`6UJPQFW9StEf1iy7MmJB!se3DhW}MKqa>0&&nsjLnuehz+uqts8i*&FdIX*nK zZXS1KcC=V2WpoYFgy~6GtK7?S2ai_WOogd8N;kbw#PoZjn+Xp5M1u7*Qd{-;S`QoM zJ+8ic$1m6Hr%d!^bq2eFy{*LV6ERC2y5tZR$AL&m>%(5*GBCi3V}y;!@s8uQwfW2J zPuB@QWO7PrCO&LW6aCN01wm*>HqECL3kH?B%(61nzX&#L0jbNQnAV|~7z!V8hh6cU zR+Aam=SZ%(a_}Q!w(;9zz2K z$gWeL?UwJTgaXX7tkk1ob{<{aw0^e#dm7mn^jO4$V^zVsFiiiZ#v}a(89S0p}3u?l>d0z-0WieZ+wD1(gkD$)`uIwYf zvgo#_{|i>mP{k=ashbQ}rw6fJ&e#CX*mp$bP%qRaZr(uoek@~-+0k;~N99d@GL9j2 z&dGEC2B++;?`OcMC2m}I|&_o#(w#q-c7gXtUi zRUMTBZF+YU2rbgbT_3#|4x4=T?b9b)V)E?+swT<>v5tIACXFlGYt}eJ_X5@SvVX9= zUmkJBKFdnXzfizI3<7Xoc)lX+kFA9t?PDW&RKXJB>4 z=Q7dx$UrWTr*T2riDXhad_jRib`Y`2w^&5?hDVAo!-@b_t-<4eo!W^@+V5oXPOov{*&zTkuf}U5)4k}k_pgiELPoLJDF_>KOE>O%s$lGZ?Gh%Hi;P<9 zow|0wrk;WU@nb(;pWf!vE>0@mm}Z$gzgRYNS?S5RB{o-~e&1MPj}61%NWNbvc3oY! z2cD^J92-e{t}16uL+%p={tRI9x2m=v`;geF7!@)J8><(nxSB3{-q*eu5Bd& zEH5=LTI`aO@9sS`+c!v=2A8#WHrrevu>Ke@079Oj|l zO*7uO2RC7x54H_$-D2{Qsv;;z+PH{sX8+>=*s80zf&EAR+Bc={S_PnX0G`6%mDS%O zwW-vuLbP6-4hKBF1ah18y>@+;3HftEX!Nt%n2aNx5BOdf?xAxoKY&H|Ho&xLT8o9nQ3riivV{gI%wRtum%uK> z`zl0Ao!Fvutu03%LxuP9vS;N(brnFXdLq)+KXd;0;{b@Qb_CPMiXKptN?5!XbE?cA zLbUDC)aj|q15Xe4g^UnvhGXHXucoOY*+QyeSX-r5sXiP9^UUKZK zxT}O$jJ}E7s{>*uqu6Z|f*On)Prgc;yUow6IUOsA7qMe8)#Pqz zZvzHj=ps7Bp|oe#%hoI(^U%obY{YJ0YX7~X`U0&TI*;$e!46w=eGFq-F<>u3IL=s7)0Gx5_@^ zfr*K+O}iPd{G?_?8y}gpD2MJFf6#jD>y$uHTC!1sqa(J^%Q-kYPvf0$386R2(pZ zQU9TBO8H?2kK`om+zZQ`a!*WgY4k|N>?YVw)ZsC{mpAzNOqAQMKBd^sHxOw+xa1TW zlhd*EG?&V~n!pgLc{Ou|rdpZ5t>TbT3pg9XQw}p-+ zDjn-L3gptEk}l3`i?QnbgbhNOErAS!A{$TLxa#PAUh!`;X}bEEG=n!cxS(<8X0b;_9%mEmO! z_NGc=6FhgLcNPQRTt1OxdcD=s36-oh_ma9qIjm$T^3M|9JZZ|&gho5SVw1Kq05LJt zRpW_UVXiCuee}E|N0GRvuyx*ZsPitK`xSN2f1|p)w|^-c4zIyK_LB}}ijn_%L)1fSy42~h>lU(t@zqm>2C|ACsKn#=@hhW_nuF3LA~SVkPcxR;6E-4Sir{|d$w88V~+sjbU7&KAfuwR2ZfkMU% z7>(M?Jli7gw<|_0wF#sthzQhJ>qq|l@_})UEVUXb_<&-bOfJwRPw?@i^3CJGj%#zJ z*kn6NDQWWRMVWM=%EcYg44{`y|_fose%OkatErJ{=AStC?cJ1QKFi+4y@87I-G z8?{LWfo>Lsn5Df_hGfg6-lHSq{|w~|VO3{u2=F_ZXS@;YXHe6!g2~~`+48jh_GaG| zqgHN5G^1im70~BAw3Er9RAkW2a&i=G8?C^~3003TO5?V{z65^uAl230)A_zUXwg(yN%L<=_r6=5dbS?yu=%CY@2#T^T_Ftst|naE=eWcm3>CKQ$@eng zR)+d!AmH|9wqbukh%6Z>+sPqiyjJ&?^>yfvHz1~une|HP|3YcNwruluYZ2!u+zUTx z=vUs>8OdBc9av2!!z|R$-KZI*N`k*0YZ9*gB?XKrhR(i-85FjzW$)7}4?RG*h#~SG z#p3gp68tQ7jA9G5Jo_3OD3iG3?E9^;d)TQj+BPO0kF11_)b!6!qM^0QzkPpVtdLPs z^w#3ipS63x8z)Jd%8fc^J*w zwKiysD0`Ax`Ei`qc9wK5PP&L)BwgXF6|LCT-?=UI?AcO(0r*DY?EWv+jJ`Lf#crpe zeipU?51j<)yrIVeTGDA{{EefZC4dEQi*g@?rlv_xx^dTt&vn|Py`F`v^*U2=HqcCq#}*yXs^x2q1Huj-wc8r!{!MvHs7Hjy@h}GNSh~`Sk5t8n+h@q1E7#B_66{gFxU=)V z(DIVj3kqK(Jc35C1!i--XdzxxXkEJEmF5n+X=E5RPQzRMO^yS;Gv?a2h-E$bG(4H$ z1Zao?IZeZ<#yU;MI~?FOJ_huFdvsmylv_r6AlX0FQvT?~iFhd?s-*>r&f%S|R;F-a zRUu>l`}8;Ogy&QESE}tQE6b=XkN^u4loiEX3F$p8mTk8?@4np=QZvU_B9t=U`_J4$ z3a576cB|Q%k&~fp@i93s_&2oaKPg;tL{rDUgeE2`b<=suk6NreIy#KD<<*mIj8h>Uy|kwfGRMBua$24Ns~sNK z&=N2{lOjnEle|*h#b!o#(oLvMld)=#IOk&!~5OO!V+9W;R2x`fd8GO6o5#UBe-+8{9h?0eI&!chXZ?pzEcs z0J`lmGC!mQqm| z7wT?(M>O(rTvRtK>$}|Kiu;F2qU~gFWv8>fDXYwQ2W8{dpZEW&PA9NZFxjkqgGb>Q z!}PBK9t}^zIT75qG9y8{GPm~{ck=gh*el0B`vX5Z?A-sMW_e=vsO4v4@Li*HyK8zQ z&HG1hKmJJour!1-Gc5QAN}8u{h+WbUIwNIM$~bt&F(ev=?h?Pl@L{fWyn&%a5uOX) zdpfhFteeB`=h=@FkjW2aKHCL0ghaop%^a}#o+}rajHktMbruw7SG{6a#F{+IYJTNd mGM(EPWNh^RO`?RiRGS6{hH)uL*LVLefbv^)g;Kc>{{IJms+{rw diff --git a/src/main/resources/assets/cataclysm/textures/item/upgrades/ancient_remnant_sandstorm.png b/src/main/resources/assets/cataclysm/textures/item/upgrades/ancient_remnant_sandstorm.png index 1ae142a0795f093b8553306c323fa64f3ac489f2..73f88830aaec74f3e2c7e562c68ed35cdbad9203 100644 GIT binary patch delta 228 zcmV=K~y-6-IBiwf>0EPzvNC%-ix3&X(?!I zcIg3no!+J=X^s{fT7njb8bUM@uTu^|G&ogo&9!g-{W*to2CL;JFEXI=6Tle5J5owO zl`){hNaRI!sjjnyBbi`fayzV_fB?qx`*1kbTH6c&d$U7Seq9m}0Cinkw4Ud+V>?}` zpE%!JS}?}+Z} zgD=L!qD1c0q!xyXbF<~$9nG;6Zx8EUo%5kD95{T>`F+p#e1FgR6%5~-Rkx#C0PL20 z06>;yPJ`KO2EY=(0zj#)3}HLE#pZ5|nkEBgDgb!==mh|EMg@SNVgw-Yuq~@p@srT> zApin^)3=A+?qaON&*H%a+-@%bZ7pE{eoa;a@O0n}9$}paBX5BP##LY4F-; z_hqO`&XPzdgny+JVJSr-p-`2arQMgI!E2-c)^+{L!tpy+UKVlI)X)f2znW)eJ_^8H zFErk~2EbY<#LWCrjUdZ1R;!huVx&PzF){iMfcG0Qebcw8B+Eq_7qWVJj-6cXXWI(Q%%gE7ywwR^tgG{2@IzfkFG88lu0` zgryYC-F|~Qx6;|kqEiGwI@kxG&i@2^^X*&*8nh=n$w>$M`ssQGT4Mmb^xwf&R7icG zhjcofGwK69dBx^=K~y-6-IBiwf>0EPzvNC%-ix3&X(?!I zcIg3no!+J=X^s{fT7njb8bUM@uTu^|G&ogo&9!g-{W*to2CL;JFEXI=6Tle5J5owO zl`){hNaRI!sjjnyBbi`fayzV_fB?qx`*1kbTH6c&d$U7Seq9m}0Cinkw4Ud+V>?}` zpE%!JS}?}+Z}l0F0m=lB8Gi-<001BJ|6u?C00DDSM?wIu&K&6g00IO_L_t(Ijg^xR0jtaK^I2{B{&p{kP5LVCD=*oB%-276$A-_ zilWe1I53K2G3{_|J~Z5Gu}!oI#^IX7fMBUP#!7-o&3Nk1|%&p?-A-}spO4S)nNFxH^2?=YICxqPpUT67J$ zXxoh73(j9Ug?JB=8P21kGLu>WU~7BRnL%-0qdTMa*$n3`g07Alw;3L{o}s@gQAKxD z-fGocgpv>fRex1&!<7$1%pEK6OgRZa@7{prDD}94g%D1HDmnm7;R9gGe8TW}jD2zk zfXqsg?9FLHp%A)m`TD!Tnd}9=24CCw-GtYR2{J25yGVR?){qup*XKYx;@ELjs842Sq~BW?A@i(n5y z&K--1m!@pFR8F8in0000< KMNUMnLSTa6pb1g{ diff --git a/src/main/resources/assets/cataclysm/textures/item/upgrades/leviathan_blast_portal.png b/src/main/resources/assets/cataclysm/textures/item/upgrades/leviathan_blast_portal.png index 65215b08553953a8c52419c1cfcedbe77ed9b960..73f88830aaec74f3e2c7e562c68ed35cdbad9203 100644 GIT binary patch delta 228 zcmV=K~y-6-IBiwf>0EPzvNC%-ix3&X(?!I zcIg3no!+J=X^s{fT7njb8bUM@uTu^|G&ogo&9!g-{W*to2CL;JFEXI=6Tle5J5owO zl`){hNaRI!sjjnyBbi`fayzV_fB?qx`*1kbTH6c&d$U7Seq9m}0Cinkw4Ud+V>?}` zpE%!JS}?}+Z}Bij_}!$7B%}q2WPdhHG8;x(kVqFvyg6LVx;D+2 ztzF@0_X@;B1aIFsH0JDEuqbzz)c`F2$^vla=0mF6 zuc}7?@Miek0Jt1><*dhP$K!Xie9xu4UYpNApRmHAuK>uhtdJgg`&GiSEGy(Z^a*Ru z!IyW%z~{fs6u@w;2g7c?GPQ$Q4_c!kH(NIJf9q`4=hpcTuHfGFXOlzi00000NkvXX Hu0mjfOSCG- diff --git a/src/main/resources/assets/cataclysm/textures/item/upgrades/netherite_monstrosity_earthquake.png b/src/main/resources/assets/cataclysm/textures/item/upgrades/netherite_monstrosity_earthquake.png index 109285e0fc49a2cd90f4e7bf1a76b150b5d14377..73f88830aaec74f3e2c7e562c68ed35cdbad9203 100644 GIT binary patch delta 228 zcmV=K~y-6-IBiwf>0EPzvNC%-ix3&X(?!I zcIg3no!+J=X^s{fT7njb8bUM@uTu^|G&ogo&9!g-{W*to2CL;JFEXI=6Tle5J5owO zl`){hNaRI!sjjnyBbi`fayzV_fB?qx`*1kbTH6c&d$U7Seq9m}0Cinkw4Ud+V>?}` zpE%!JS}?}+Z}yyj zkIUt%A~ikgBGEfpI?O{T6xz(ZLwgIRwfb2cH~`RfT@YJeTw*cxlSP0#Cu#4^!zp;L z>)32I@nlmiseg*1@KWv}vFn?_ehp7!9E?@f8h09|C<=#y2TJmNjbe@M?W7PrTT!cN z8piEFbZD4;vJ8ME)d^gZ>Ik*9aNBUSTER|W=FJ>FZ!Z*0rTz&)7u(QbTzFj*PU6CfmsX3uzsd9L&TpmcQqZ zz9$44>X@=jGG&=W)iWeh8p)K#1%rj()-U3AfD`@q@O1Z8n^=y~ks(w)!$j}{H;QrA zuTBW*Dp$EJ6Yc3RIKBc9?|2B=tVrI!d!0By2awHHk?rYl$%Dk}-N5I6i4ozvd=2O3 ser~#eYzLFe=>cHl)BlaLY%h)TU!$1DMsK9Zp#T5?07*qoM6N<$f(2U`ga7~l diff --git a/src/main/resources/assets/modulargolems/lang/zh_cn.json b/src/main/resources/assets/modulargolems/lang/zh_cn.json index f2f544e47..c6b49e294 100644 --- a/src/main/resources/assets/modulargolems/lang/zh_cn.json +++ b/src/main/resources/assets/modulargolems/lang/zh_cn.json @@ -1,8 +1,16 @@ { - "item.modulargolems.metal_golem_template": "傀儡胚料", + "item.modulargolems.metal_golem_arm": "大型金属傀儡-手臂", + "item.modulargolems.metal_golem_body": "大型金属傀儡-身体", "item.modulargolems.metal_golem_holder": "大型金属傀儡", + "item.modulargolems.metal_golem_legs": "大型金属傀儡-双腿", + "item.modulargolems.metal_golem_template": "傀儡胚料", + "item.modulargolems.humanoid_golem_arms": "人形金属傀儡-双臂", + "item.modulargolems.humanoid_golem_body": "人形金属傀儡-躯干", "item.modulargolems.humanoid_golem_holder": "人形金属傀儡", + "item.modulargolems.humanoid_golem_legs": "人形金属傀儡-双腿", + "item.modulargolems.dog_golem_body": "犬形金属傀儡-躯干", "item.modulargolems.dog_golem_holder": "犬形金属傀儡", + "item.modulargolems.dog_golem_legs": "犬形金属傀儡-四肢", "item.modulargolems.diamond": "钻石升级", "item.modulargolems.fire_immune": "防火升级", "item.modulargolems.thunder_immune": "导电升级", @@ -57,22 +65,6 @@ "item.modulargolems.target_filter_uuid": "生物过滤器: 实体ID", "item.modulargolems.target_filter_default": "生物过滤器: 默认攻击目标", "item.modulargolems.patrol_path_recorder": "巡逻手册", - "item.modulargolems.metal_golem_arm": "大型金属傀儡-手臂", - "item.modulargolems.metal_golem_body": "大型金属傀儡-身体", - "item.modulargolems.metal_golem_legs": "大型金属傀儡-双腿", - "item.modulargolems.humanoid_golem_arms": "人形金属傀儡-双臂", - "item.modulargolems.humanoid_golem_body": "人形金属傀儡-躯干", - "item.modulargolems.humanoid_golem_legs": "人形金属傀儡-双腿", - "item.modulargolems.dog_golem_body": "犬形金属傀儡-躯干", - "item.modulargolems.dog_golem_legs": "犬形金属傀儡-四肢", - "item.modulargolems.incomplete_metal_golem_arm": "大型金属傀儡-手臂(半成品)", - "item.modulargolems.incomplete_metal_golem_body": "大型金属傀儡-身体(半成品)", - "item.modulargolems.incomplete_metal_golem_legs": "大型金属傀儡-双腿(半成品)", - "item.modulargolems.incomplete_humanoid_golem_arms": "人形金属傀儡-双臂(半成品)", - "item.modulargolems.incomplete_humanoid_golem_body": "人形金属傀儡-躯干(半成品)", - "item.modulargolems.incomplete_humanoid_golem_legs": "人形金属傀儡-双腿(半成品)", - "item.modulargolems.incomplete_dog_golem_body": "犬形金属傀儡-躯干(半成品)", - "item.modulargolems.incomplete_dog_golem_legs": "犬形金属傀儡-四肢(半成品)", "item.modulargolems.black_config_card": "配置卡片黑色", "item.modulargolems.blue_config_card": "配置卡片蓝色", "item.modulargolems.brown_config_card": "配置卡片棕色", @@ -289,18 +281,8 @@ "modifier.modulargolems.coating": "镀层升级", "modifier.modulargolems.coating.desc": "受到的伤害减少%s", "modifier.modulargolems.push": "击退提升", - "modifier.modulargolems.mechanical_engine": "蒸汽动力", - "modifier.modulargolems.mechanical_engine.desc": "消耗燃料强化傀儡", - "modifier.modulargolems.mechanical_force": "工业长路", - "modifier.modulargolems.mechanical_force.desc": "消耗燃料时+%s%%攻击伤害", - "modifier.modulargolems.mechanical_mobility": "汽鸣铁道", - "modifier.modulargolems.mechanical_mobility.desc": "消耗燃料时+%s%%速度", "item.modulargolems.coating": "镀层升级", "item.modulargolems.push": "机械手升级", - "effect.modulargolems.mechanical_force": "工业长路", - "effect.modulargolems.mechanical_force.description": "提升傀儡攻击伤害", - "effect.modulargolems.mechanical_mobility": "汽鸣铁道", - "effect.modulargolems.mechanical_mobility.description": "提升傀儡移动速度", "golem_material.twilightforest.fiery": "炽铁", "golem_material.twilightforest.ironwood": "铁木", "golem_material.twilightforest.knightmetal": "骑士", @@ -398,23 +380,6 @@ "golem_material.blazegear.brimsteel": "烈焰钢", "modifier.modulargolems.blazing": "烈焰", "modifier.modulargolems.blazing.desc": "对远处的敌人发射火球", - "golem_material.botania.manasteel": "魔钢", - "golem_material.botania.terrasteel": "泰拉钢", - "golem_material.botania.elementium": "源质钢", - "modifier.modulargolems.mana_mending": "魔力修复", - "modifier.modulargolems.mana_mending.desc": "消耗魔力修复自身血量,每秒最多恢复%s点HP,效率为%s魔力/HP", - "modifier.modulargolems.mana_boosting": "魔力增幅", - "modifier.modulargolems.mana_boosting.desc": "消耗魔力增幅自身攻击%s%%,消耗为%s魔力", - "modifier.modulargolems.mana_production": "魔力制造", - "modifier.modulargolems.mana_production.desc": "泰拉钢的力量让傀儡能够被动地每秒制造%s魔力", - "modifier.modulargolems.mana_burst": "魔力脉冲", - "modifier.modulargolems.mana_burst.desc": "向远处的目标发射魔力脉冲,造成%s%%攻击伤害,消耗为%s魔力", - "modifier.modulargolems.pixie_attack": "精灵袭击", - "modifier.modulargolems.pixie_attack.desc": "攻击时有%s%%几率召唤一个精灵袭击目标,并且精灵伤害+%s", - "modifier.modulargolems.pixie_counterattack": "精灵反击", - "modifier.modulargolems.pixie_counterattack.desc": "被攻击时有%s%%几率召唤一个精灵反击目标", - "modulargolems.msg.botania_mana": "魔力: %s/%s", - "modulargolems.msg.botania_no_ring": "未装备魔力之戒", "golem_material.cataclysm.ignitium": "腾炎", "golem_material.cataclysm.witherite": "凋零合金", "item.modulargolems.ender_guardian_void_rune": "末影守卫升级", diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/golems/b2_humanoid_golem.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/golems/b2_humanoid_golem.json index 53af4652d..b61b05b8a 100644 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/golems/b2_humanoid_golem.json +++ b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/golems/b2_humanoid_golem.json @@ -11,18 +11,8 @@ { "type": "patchouli:crafting", "recipe": "modulargolems:humanoid_golem_holder", - "text": "Humanoid golem can perform area attack if and only if it holds a sword-like item.$(br2)Humanoid golem can use shield, trident, bow, and crossbow." + "text": "Humanoid golem can perform area attack if and only if it holds a sword-like item.$(br2)Humanoid golem can use shield, but can be bypassed if the enemy attacks from behind or holds an axe. $(br2)It can also use bow and crossbows, but would consume arrows. Infinity bow is recommended." }, - { - "type": "patchouli:spotlight", - "item": "minecraft:zombie_head,minecraft:skeleton_skull,minecraft:wither_skeleton_skull", - "text": "Equip a zombie head / skeleton skull / wither skeleton skull named as a player in Golem Skin slot to use player skin.$(br2)Requires the player to have a valid Minecraft account, and requires internet connection to download skins from Minecraft Server." - }, - { - "type": "patchouli:spotlight", - "item": "minecraft:player_head,minecraft:piglin_head", - "text": "Equip a player head / piglin skull in Golem Skin slot, named as the texture location of a humanoid texture, to use a custom texture for the golem.$(br2)Use player head for slim player model, and piglin head for normal player model." - }, - "If Touhou Little Maid is installed, Garage Kit can be plced in Golem Skin slot to use the Maid model as well." + "Equip a head/skull named as a player in Golem Skin slot to use player skin.$(br2)Requires the player to have a valid Minecraft account, and requires internet connection to download skins from Minecraft Server." ] } \ No newline at end of file diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/golems/c2_command_wand.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/golems/c2_command_wand.json index 8111eb6b4..71ec91243 100644 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/golems/c2_command_wand.json +++ b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/golems/c2_command_wand.json @@ -7,9 +7,8 @@ { "type": "patchouli:spotlight", "item": "modulargolems:command_wand", - "text": "Shift right click golem to configure equipments, view golem attributes, and configure curios.$(br2)Attack entity with this wand, or right click faraway entity with this wand to call all your surrounding golems to attack that entity." + "text": "Shift right click golem to configure equipments.$(br2)Attack entity with this wand to call all your surrounding golems to attack that entity.$(br2)Golems in guarding/standing mode cannot change dimensions." }, - "Right click to switch between 6 modes for the golems.$(li)Following Mode: the default mode. Golem follows player.$(li)Guarding mode: Golems will wander around the point when it's set to this mode. Golems in this mode cannot change dimension.$(li)Standing Mode: Golems will not move. Golems in this mode cannot change dimension.$(li)Wandering Mode: Golems will wander around freely.", - "$(li)Squad Mode: Golems will follow its captain (with the same config), and when itself is the captain or when no captain is present, it will wander freely.$(li)Patrol Mode: Golems will follow the path specified in its config card. They will deviate from their path if they find attack target." + "Right click to switch between modes for the golems.$(li)Following Mode: the default mode. Golem follows player.$(li)Guarding mode: Golem will wander around the point when it's set to this mode.$(li)Golems in standing mode will not move.$(li)Golems in wandering mode will wander around freely.$(li)Golems in squad mode will follow its captain (with the same config), and when no captain is present, it will wander freely." ] } \ No newline at end of file diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/golems/d1_config_card.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/golems/d1_config_card.json index bf7d95eb4..49029477c 100644 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/golems/d1_config_card.json +++ b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/golems/d1_config_card.json @@ -18,14 +18,8 @@ "text": "You can also lock golem interaction, so that you would not accidentally pick them up, or change their weapons, even when you have the card in offhand. If you lost the card, you can make a new one of the same color to unlock golems. $(br2)You can also configure item filters for pickup upgrade. This is helpful to not accidentally pickup unwanted items or destroy valuables." }, { - "type": "patchouli:spotlight", - "item": "modulargolems:target_filter_type,modulargolems:target_filter_uuid,modulargolems:target_filter_name,modulargolems:target_filter_default", - "text": "You can configure golem attack targets. The hostile target list contains targets golems will actively attack. The friendly target list containers targets golems will never attack.$(br2)There are default cards but you can remove them and insert your own, so that you can use golems to fight other golems or other players." - }, - { - "type": "patchouli:spotlight", - "item": "modulargolems:patrol_path_recorder", - "text": "You can configure golem patrol path in config. Craft Patrol Path Recorder and record a circular path by clicking with it. When Create is installed, it will render the path and direction of movement a well. The path is fur guidance only. Golem will not always step on the exact block." + "type": "patchouli:text", + "text":"You can configure golem attack targets. The hostile target list contains targets golems will actively attack. The friendly target list containers targets golems will never attack.$(br2)There are default cards but you can remove them and insert your own, so that you can use golems to fight other golems or other players." } ] } \ No newline at end of file diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/bot_elementium.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/bot_elementium.json deleted file mode 100644 index f9d558fda..000000000 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/bot_elementium.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "flag": "mod:botania", - "name": "Elementium", - "icon": "botania:elementium_ingot", - "category": "modulargolems:materials", - "sortnum": 603, - "pages": [ - { - "type": "patchouli:spotlight", - "item": "botania:elementium_ingot", - "text": "Main material to craft elementium golem parts. elementium golem parts feature decent attack and health, as well as traits of manasteel. It has a chance to summon a pixie to attack the target when attacking or being attacked" - }, - { - "type": "patchouli:spotlight", - "item": "modulargolems:metal_golem_holder{golem_materials:[{part:\"modulargolems:metal_golem_arm\",material:\"botania:elementium\"},{part:\"modulargolems:metal_golem_body\",material:\"botania:elementium\"},{part:\"modulargolems:metal_golem_arm\",material:\"botania:elementium\"},{part:\"modulargolems:metal_golem_legs\",material:\"botania:elementium\"}]}", - "text": "Use JEI (press R) to check part stats of each part made of this material." - }, - { - "type": "patchouli:spotlight", - "item": "modulargolems:humanoid_golem_holder{golem_materials:[{part:\"modulargolems:humanoid_golem_body\",material:\"botania:elementium\"},{part:\"modulargolems:humanoid_golem_arms\",material:\"botania:elementium\"},{part:\"modulargolems:humanoid_golem_legs\",material:\"botania:elementium\"}]}", - "text": "Use JEI (press R) to check part stats of each part made of this material." - }, - { - "type": "patchouli:spotlight", - "item": "modulargolems:dog_golem_holder{golem_materials:[{part:\"modulargolems:dog_golem_body\",material:\"botania:elementium\"},{part:\"modulargolems:dog_golem_legs\",material:\"botania:elementium\"}]}", - "text": "Use JEI (press R) to check part stats of each part made of this material." - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/bot_manasteel.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/bot_manasteel.json deleted file mode 100644 index d9a96c360..000000000 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/bot_manasteel.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "flag": "mod:botania", - "name": "Manasteel", - "icon": "botania:manasteel_ingot", - "category": "modulargolems:materials", - "sortnum": 601, - "pages": [ - { - "type": "patchouli:spotlight", - "item": "botania:manasteel_ingot", - "text": "Main material to craft manasteel golem parts. manasteel golem parts feature balanced attack and health. It's is capable of boosting damage and repairing itself at a faster speed when there is mana available in curios slots." - }, - { - "type": "patchouli:spotlight", - "item": "modulargolems:metal_golem_holder{golem_materials:[{part:\"modulargolems:metal_golem_arm\",material:\"botania:manasteel\"},{part:\"modulargolems:metal_golem_body\",material:\"botania:manasteel\"},{part:\"modulargolems:metal_golem_arm\",material:\"botania:manasteel\"},{part:\"modulargolems:metal_golem_legs\",material:\"botania:manasteel\"}]}", - "text": "Use JEI (press R) to check part stats of each part made of this material." - }, - { - "type": "patchouli:spotlight", - "item": "modulargolems:humanoid_golem_holder{golem_materials:[{part:\"modulargolems:humanoid_golem_body\",material:\"botania:manasteel\"},{part:\"modulargolems:humanoid_golem_arms\",material:\"botania:manasteel\"},{part:\"modulargolems:humanoid_golem_legs\",material:\"botania:manasteel\"}]}", - "text": "Use JEI (press R) to check part stats of each part made of this material." - }, - { - "type": "patchouli:spotlight", - "item": "modulargolems:dog_golem_holder{golem_materials:[{part:\"modulargolems:dog_golem_body\",material:\"botania:manasteel\"},{part:\"modulargolems:dog_golem_legs\",material:\"botania:manasteel\"}]}", - "text": "Use JEI (press R) to check part stats of each part made of this material." - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/bot_terrasteel.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/bot_terrasteel.json deleted file mode 100644 index ac91802ed..000000000 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/bot_terrasteel.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "flag": "mod:botania", - "name": "Terrasteel", - "icon": "botania:terrasteel_ingot", - "category": "modulargolems:materials", - "sortnum": 602, - "pages": [ - { - "type": "patchouli:spotlight", - "item": "botania:terrasteel_ingot", - "text": "Main material to craft terrasteel golem parts. terrasteel golem parts feature high attack and health, as well as higher level of manasteel traits. It is also capable of passively producting mana and shoot mana burst toward faraway targets." - }, - { - "type": "patchouli:spotlight", - "item": "modulargolems:metal_golem_holder{golem_materials:[{part:\"modulargolems:metal_golem_arm\",material:\"botania:terrasteel\"},{part:\"modulargolems:metal_golem_body\",material:\"botania:terrasteel\"},{part:\"modulargolems:metal_golem_arm\",material:\"botania:terrasteel\"},{part:\"modulargolems:metal_golem_legs\",material:\"botania:terrasteel\"}]}", - "text": "Use JEI (press R) to check part stats of each part made of this material." - }, - { - "type": "patchouli:spotlight", - "item": "modulargolems:humanoid_golem_holder{golem_materials:[{part:\"modulargolems:humanoid_golem_body\",material:\"botania:terrasteel\"},{part:\"modulargolems:humanoid_golem_arms\",material:\"botania:terrasteel\"},{part:\"modulargolems:humanoid_golem_legs\",material:\"botania:terrasteel\"}]}", - "text": "Use JEI (press R) to check part stats of each part made of this material." - }, - { - "type": "patchouli:spotlight", - "item": "modulargolems:dog_golem_holder{golem_materials:[{part:\"modulargolems:dog_golem_body\",material:\"botania:terrasteel\"},{part:\"modulargolems:dog_golem_legs\",material:\"botania:terrasteel\"}]}", - "text": "Use JEI (press R) to check part stats of each part made of this material." - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/cr_andesite_alloy.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/cr_andesite_alloy.json index 691089fd8..19dcc33a1 100644 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/cr_andesite_alloy.json +++ b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/cr_andesite_alloy.json @@ -8,7 +8,7 @@ { "type": "patchouli:spotlight", "item": "create:andesite_alloy", - "text": "Main material to craft Andesite Alloy golem parts. It is cheap to fix and provides magic damage resistance. Boosts speed and damage when consuming fuels.$(br2)Fuels can be automatically consumed from Dimensional Backpack (from L2Backpack) equipped on the golem or the captain of the team." + "text": "Main material to craft Andesite Alloy golem parts. It is cheap to fix and provides speed boost and magic damage resistance." }, { "type": "patchouli:spotlight", diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/cr_brass.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/cr_brass.json index d2f7948a7..4dbaffd2a 100644 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/cr_brass.json +++ b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/cr_brass.json @@ -8,7 +8,7 @@ { "type": "patchouli:spotlight", "item": "create:brass_ingot", - "text": "Main material to craft Brass golem parts. It provides high magic damage resistance. Boosts speed and damage when consuming fuels.$(br2)Fuels can be automatically consumed from Dimensional Backpack (from L2Backpack) equipped on the golem or the captain of the team." + "text": "Main material to craft Brass golem parts. It provides speed boost and high magic damage resistance." }, { "type": "patchouli:spotlight", diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/cr_railway.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/cr_railway.json index c8723f9a6..c7481d824 100644 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/cr_railway.json +++ b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/materials/cr_railway.json @@ -8,7 +8,7 @@ { "type": "patchouli:spotlight", "item": "create:railway_casing", - "text": "Main material to craft Railway golem parts. It provides high magic damage resistance, fire resistance, range attack, and high knock back. Boosts speed and damage significantly when consuming fuels. It attacks as if it is a train running into mobs.$(br2)Fuels can be automatically consumed from Dimensional Backpack (from L2Backpack) equipped on the golem or the captain of the team." + "text": "Main material to craft Railway golem parts. It provides high speed boost, high magic damage resistance, fire resistance, range attack, and high knock back. It attacks as if it is a train running into mobs" }, { "type": "patchouli:spotlight", diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/upgrades/ct_ancient_remnant.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/upgrades/ct_ancient_remnant.json index 4708b9ddd..8a1c7ef56 100644 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/upgrades/ct_ancient_remnant.json +++ b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/upgrades/ct_ancient_remnant.json @@ -1,12 +1,12 @@ { "flag": "mod:cataclysm", "name": "Ancient Remnant Upgrade", - "icon": "modulargolems:ancient_remnant_sandstorm", + "icon": "modulargolems:ancient_remnant", "category": "modulargolems:upgrades", "pages": [ { "type": "patchouli:spotlight", - "item": "modulargolems:ancient_remnant_sandstorm", + "item": "modulargolems:ancient_remnant", "text": "Summon sandstorm at target position. Max: 1" } ] diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/upgrades/ct_ender_guardian.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/upgrades/ct_ender_guardian.json index fa9d32ae7..fd87f7c7b 100644 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/upgrades/ct_ender_guardian.json +++ b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/upgrades/ct_ender_guardian.json @@ -1,12 +1,12 @@ { "flag": "mod:cataclysm", "name": "Ender Guardian Upgrade", - "icon": "modulargolems:ender_guardian_void_rune", + "icon": "modulargolems:ender_guardian", "category": "modulargolems:upgrades", "pages": [ { "type": "patchouli:spotlight", - "item": "modulargolems:ender_guardian_void_rune", + "item": "modulargolems:ender_guardian", "text": "Summon void rune toward target. Max: 1" } ] diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/upgrades/ct_leviathan.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/upgrades/ct_leviathan.json index 8cc06612e..94c8a7e1c 100644 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/upgrades/ct_leviathan.json +++ b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/upgrades/ct_leviathan.json @@ -1,12 +1,12 @@ { "flag": "mod:cataclysm", "name": "Leviathan Upgrade", - "icon": "modulargolems:leviathan_blast_portal", + "icon": "modulargolems:leviathan", "category": "modulargolems:upgrades", "pages": [ { "type": "patchouli:spotlight", - "item": "modulargolems:leviathan_blast_portal", + "item": "modulargolems:leviathan", "text": "Create blast portal at target position. Max: 1" } ] diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/upgrades/ct_netherite_monstrosity.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/upgrades/ct_netherite_monstrosity.json index bcdceaa14..3779cb097 100644 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/upgrades/ct_netherite_monstrosity.json +++ b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/en_us/entries/upgrades/ct_netherite_monstrosity.json @@ -1,12 +1,12 @@ { "flag": "mod:cataclysm", "name": "Netherite Monstrosity Upgrade", - "icon": "modulargolems:netherite_monstrosity_earthquake", + "icon": "modulargolems:netherite_monstrosity", "category": "modulargolems:upgrades", "pages": [ { "type": "patchouli:spotlight", - "item": "modulargolems:netherite_monstrosity_earthquake", + "item": "modulargolems:netherite_monstrosity", "text": "Jump and cause earthquake on land. Max: 1" } ] diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/golems/b2_humanoid_golem.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/golems/b2_humanoid_golem.json index 2161d4880..c988c4373 100644 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/golems/b2_humanoid_golem.json +++ b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/golems/b2_humanoid_golem.json @@ -12,16 +12,6 @@ "recipe": "modulargolems:humanoid_golem_holder", "text": "手持剑类装备的傀儡将对敌人造成范围伤害。$(br2)人形傀儡装备盾牌后可以格挡除了来自背后和斧类武器以外的所有伤害。$(br2)装备弓/弩时需要消耗箭,推荐使用无限弓。" }, - { - "type": "patchouli:spotlight", - "item": "minecraft:zombie_head,minecraft:skeleton_skull,minecraft:wither_skeleton_skull", - "text": "在傀儡皮肤槽中放入命名为玩家名字的僵尸/骷髅/凋零骷髅头颅来使用玩家皮肤。$(br2)要求该名字的玩家账号是正版账号,且游戏有网络连接才能从我的世界服务器下载皮肤。" - }, - { - "type": "patchouli:spotlight", - "item": "minecraft:player_head,minecraft:piglin_head", - "text": "在傀儡皮肤槽中放入命名为贴图路径的玩家/猪灵头颅来使用自定义人形模型贴图皮肤。$(br2)使用纤瘦模型时使用玩家头颅。使用正常模型时使用猪灵头颅。$(br2)猪灵头颅也可以用于显示其他材料的人形傀儡贴图皮肤来伪装" - }, - "如果安装了车万女仆,也可以在傀儡皮肤槽中放入手办来使用女仆模型" + "在傀儡皮肤槽中放入命名为玩家名字的人形生物头颅来使用玩家皮肤。$(br2)要求该名字的玩家账号是正版账号,且游戏有网络连接才能从我的世界服务器下载皮肤。" ] } \ No newline at end of file diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/golems/c2_command_wand.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/golems/c2_command_wand.json index 923f91759..b083c4259 100644 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/golems/c2_command_wand.json +++ b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/golems/c2_command_wand.json @@ -7,9 +7,8 @@ { "type": "patchouli:spotlight", "item": "modulargolems:command_wand", - "text": "攻击实体或者右键远处的实体使周围所有你的傀儡优先攻击改目标。$(br2)蹲下右键傀儡调整傀儡的装备和饰品,或查看傀儡数值" + "text": "攻击实体使周围所有你的傀儡优先攻击改目标。$(br2)蹲下右键人形傀儡调整傀儡的装备$(br2)巡逻/站立模式的傀儡不能改变纬度。回收傀儡时回到跟随模式。" }, - "右键傀儡切换傀儡行为模式,一共6种:$(li)跟随模式:默认模式。傀儡跟随玩家。$(li)巡逻模式:切换至巡逻模式时的地点为巡逻点。傀儡会在附近巡逻。傀儡不能改变纬度。$(li)站立模式:切换至站立模式时的傀儡会停留原地。傀儡不能改变纬度。$(li)自由行动:傀儡会随机自由移动", - "$(li)编队模式:傀儡会跟随相同配置卡的队长。如果自己就是队长或者找不到队长就自由行动。$(li)固定路线模式:傀儡会根据配置卡中的路径移动" + "右键傀儡改变傀儡行为模式。$(li)跟随模式:默认模式。傀儡跟随玩家。$(li)巡逻模式:切换至巡逻模式时的地点为巡逻点。傀儡会在附近巡逻。$(li)站立模式:切换至站立模式时的傀儡会停留原地。$(li)自由行动:傀儡会随机自由移动$(li)编队模式:傀儡会跟随相同配置卡的队长。如果找不到队长就自由行动。" ] } \ No newline at end of file diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/golems/d1_config_card.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/golems/d1_config_card.json index c9594b0ac..aacb36bdd 100644 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/golems/d1_config_card.json +++ b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/golems/d1_config_card.json @@ -13,18 +13,13 @@ "type": "patchouli:text", "text": "在配置界面中,放入傀儡可以让傀儡绑定此配置。你可以选择傀儡被召唤时的模式,也可以选择傀儡将会被召唤到指向地点还是上次收回的地点。$(br2)注意如果收回的地点在64格以外则不会生效,且如果默认模式是跟随,则还是会在指向地点召唤。" }, - { "type": "patchouli:text", + { + "type": "patchouli:text", "text": "你也可以锁定傀儡交互,以避免不小心把傀儡拾起或者换掉装备。这时副手拿卡片也没用。如果卡片不小心弄丢了,可以做个同色的来解锁傀儡。$(br2)你也可以配置拾取升级的物品过滤器,以避免傀儡拾取不想要的物品或者不小心销毁重要物品。" }, { - "type": "patchouli:spotlight", - "item": "modulargolems:target_filter_type,modulargolems:target_filter_uuid,modulargolems:target_filter_name,modulargolems:target_filter_default", + "type": "patchouli:text", "text": "你可以配置傀儡的主动攻击目标和友好列表。友好列表内的生物不会被攻击,主动攻击目标内的生物会主动被攻击,其他生物只有试图攻击傀儡和玩家的时候才会被攻击。$(br2)初始配置中存在默认攻击配置。你可以移除它们并放入你自己的配置,以允许傀儡攻击其他傀儡和其他玩家" - }, - { - "type": "patchouli:spotlight", - "item": "modulargolems:patrol_path_recorder", - "text": "你可以配置傀儡在固定移动路线模式下的移动路径。手持巡逻手册右键方块记录路径。安装了机械动力时,同时会在世界中渲染路径点。固定移动路径模式下的傀儡发现攻击目标的时候会偏移路径进行战斗。" } ] } \ No newline at end of file diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/bot_elementium.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/bot_elementium.json deleted file mode 100644 index 4c97a6043..000000000 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/bot_elementium.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "flag": "mod:botania", - "name": "源质钢", - "icon": "botania:elementium_ingot", - "category": "modulargolems:materials", - "sortnum": 603, - "pages": [ - { - "type": "patchouli:spotlight", - "item": "botania:elementium_ingot", - "text": "制作源质钢傀儡部件的主要材料,源质钢傀儡部件具有不错的攻击力和生命值和魔钢傀儡的特性,并且在攻击和被攻击时都有几率召唤精灵攻击目标。" - }, - { - "type": "patchouli:spotlight", - "item": "modulargolems:metal_golem_holder{golem_materials:[{part:\"modulargolems:metal_golem_arm\",material:\"botania:elementium\"},{part:\"modulargolems:metal_golem_body\",material:\"botania:elementium\"},{part:\"modulargolems:metal_golem_arm\",material:\"botania:elementium\"},{part:\"modulargolems:metal_golem_legs\",material:\"botania:elementium\"}]}", - "text": "使用JEI物品管理器 (R键默认)来查看以此为原料的傀儡部件的详细属性。" - }, - { - "type": "patchouli:spotlight", - "item": "modulargolems:humanoid_golem_holder{golem_materials:[{part:\"modulargolems:humanoid_golem_body\",material:\"botania:elementium\"},{part:\"modulargolems:humanoid_golem_arms\",material:\"botania:elementium\"},{part:\"modulargolems:humanoid_golem_legs\",material:\"botania:elementium\"}]}", - "text": "使用JEI物品管理器 (R键默认)来查看以此为原料的傀儡部件的详细属性。" - }, - { - "type": "patchouli:spotlight", - "item": "modulargolems:dog_golem_holder{golem_materials:[{part:\"modulargolems:dog_golem_body\",material:\"botania:elementium\"},{part:\"modulargolems:dog_golem_legs\",material:\"botania:elementium\"}]}", - "text": "使用JEI物品管理器 (R键默认)来查看以此为原料的傀儡部件的详细属性。" - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/bot_manasteel.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/bot_manasteel.json deleted file mode 100644 index 4a38ad6e6..000000000 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/bot_manasteel.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "flag": "mod:botania", - "name": "魔钢", - "icon": "botania:manasteel_ingot", - "category": "modulargolems:materials", - "sortnum": 601, - "pages": [ - { - "type": "patchouli:spotlight", - "item": "botania:manasteel_ingot", - "text": "制作魔钢傀儡部件的主要材料,魔钢傀儡部件具有平衡的攻击力和生命值,且在饰品栏中有魔力可用时提高伤害并以较快的速度修复自身。" - }, - { - "type": "patchouli:spotlight", - "item": "modulargolems:metal_golem_holder{golem_materials:[{part:\"modulargolems:metal_golem_arm\",material:\"botania:manasteel\"},{part:\"modulargolems:metal_golem_body\",material:\"botania:manasteel\"},{part:\"modulargolems:metal_golem_arm\",material:\"botania:manasteel\"},{part:\"modulargolems:metal_golem_legs\",material:\"botania:manasteel\"}]}", - "text": "使用JEI物品管理器 (R键默认)来查看以此为原料的傀儡部件的详细属性。" - }, - { - "type": "patchouli:spotlight", - "item": "modulargolems:humanoid_golem_holder{golem_materials:[{part:\"modulargolems:humanoid_golem_body\",material:\"botania:manasteel\"},{part:\"modulargolems:humanoid_golem_arms\",material:\"botania:manasteel\"},{part:\"modulargolems:humanoid_golem_legs\",material:\"botania:manasteel\"}]}", - "text": "使用JEI物品管理器 (R键默认)来查看以此为原料的傀儡部件的详细属性。" - }, - { - "type": "patchouli:spotlight", - "item": "modulargolems:dog_golem_holder{golem_materials:[{part:\"modulargolems:dog_golem_body\",material:\"botania:manasteel\"},{part:\"modulargolems:dog_golem_legs\",material:\"botania:manasteel\"}]}", - "text": "使用JEI物品管理器 (R键默认)来查看以此为原料的傀儡部件的详细属性。" - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/bot_terrasteel.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/bot_terrasteel.json deleted file mode 100644 index 5563d63e1..000000000 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/bot_terrasteel.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "flag": "mod:botania", - "name": "泰拉钢", - "icon": "botania:terrasteel_ingot", - "category": "modulargolems:materials", - "sortnum": 602, - "pages": [ - { - "type": "patchouli:spotlight", - "item": "botania:terrasteel_ingot", - "text": "制作泰拉钢傀儡部件的主要材料,泰拉钢傀儡部件具有高额的攻击力和生命值,还拥有更高等级的魔钢傀儡特性。此外,还能够被动地产出魔力,并且能向远方的目标发射魔力光线。" - }, - { - "type": "patchouli:spotlight", - "item": "modulargolems:metal_golem_holder{golem_materials:[{part:\"modulargolems:metal_golem_arm\",material:\"botania:terrasteel\"},{part:\"modulargolems:metal_golem_body\",material:\"botania:terrasteel\"},{part:\"modulargolems:metal_golem_arm\",material:\"botania:terrasteel\"},{part:\"modulargolems:metal_golem_legs\",material:\"botania:terrasteel\"}]}", - "text": "使用JEI物品管理器 (R键默认)来查看以此为原料的傀儡部件的详细属性。" - }, - { - "type": "patchouli:spotlight", - "item": "modulargolems:humanoid_golem_holder{golem_materials:[{part:\"modulargolems:humanoid_golem_body\",material:\"botania:terrasteel\"},{part:\"modulargolems:humanoid_golem_arms\",material:\"botania:terrasteel\"},{part:\"modulargolems:humanoid_golem_legs\",material:\"botania:terrasteel\"}]}", - "text": "使用JEI物品管理器 (R键默认)来查看以此为原料的傀儡部件的详细属性。" - }, - { - "type": "patchouli:spotlight", - "item": "modulargolems:dog_golem_holder{golem_materials:[{part:\"modulargolems:dog_golem_body\",material:\"botania:terrasteel\"},{part:\"modulargolems:dog_golem_legs\",material:\"botania:terrasteel\"}]}", - "text": "使用JEI物品管理器 (R键默认)来查看以此为原料的傀儡部件的详细属性。" - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/cr_andesite_alloy.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/cr_andesite_alloy.json index 171134ee0..85b69dde7 100644 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/cr_andesite_alloy.json +++ b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/cr_andesite_alloy.json @@ -8,7 +8,7 @@ { "type": "patchouli:spotlight", "item": "create:andesite_alloy", - "text": "制作安山合金傀儡部件的主要材料,修复成本低廉,可为傀儡提供额外魔法抗性。消耗燃料可以提升速度和攻击伤害。$(br2)可以自动从该傀儡或者同队的傀儡队长身上装备的空间背包(来自莱特兰背包)中消耗燃料。" + "text": "制作安山合金傀儡部件的主要材料,修复成本低廉,可为傀儡提供额外移动速度和魔法抗性" }, { "type": "patchouli:spotlight", diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/cr_brass.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/cr_brass.json index 8cc0ce35d..2d3283acb 100644 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/cr_brass.json +++ b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/cr_brass.json @@ -8,7 +8,7 @@ { "type": "patchouli:spotlight", "item": "create:brass_ingot", - "text": "制作黄铜傀儡部件的主要材料。可为傀儡提供更高的魔法抗性。消耗燃料可以提升速度和攻击伤害。$(br2)可以自动从该傀儡或者同队的傀儡队长身上装备的空间背包(来自莱特兰背包)中消耗燃料。" + "text": "制作黄铜傀儡部件的主要材料。可为傀儡提供更高的额外移动速度及高魔法抗性。" }, { "type": "patchouli:spotlight", diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/cr_railway.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/cr_railway.json index 7dddc11c0..ec793030b 100644 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/cr_railway.json +++ b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/materials/cr_railway.json @@ -8,7 +8,7 @@ { "type": "patchouli:spotlight", "item": "create:railway_casing", - "text": "制作列车傀儡部件的主要材料,可为傀儡提供高魔法抗性,火焰抗性,范围攻击以及强力击退。消耗燃料可以显著提升速度和攻击伤害。看呐!火车头创向了怪物!$(br2)可以自动从该傀儡或者同队的傀儡队长身上装备的空间背包(来自莱特兰背包)中消耗燃料。" + "text": "制作列车傀儡部件的主要材料,可为傀儡提供高移动速度,高魔法抗性,火焰抗性,范围攻击以及强力击退。看呐!火车头创向了怪物!" }, { "type": "patchouli:spotlight", diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/upgrades/ct_ancient_remnant.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/upgrades/ct_ancient_remnant.json index 78b723a6d..cf3a7992e 100644 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/upgrades/ct_ancient_remnant.json +++ b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/upgrades/ct_ancient_remnant.json @@ -1,12 +1,12 @@ { "flag": "mod:cataclysm", "name": "远古遗魂升级", - "icon": "modulargolems:ancient_remnant_sandstorm", + "icon": "modulargolems:ancient_remnant", "category": "modulargolems:upgrades", "pages": [ { "type": "patchouli:spotlight", - "item": "modulargolems:ancient_remnant_sandstorm", + "item": "modulargolems:ancient_remnant", "text": "攻击目标较远时,在目标位置召唤沙暴。最高等级: 1" } ] diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/upgrades/ct_ender_guardian.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/upgrades/ct_ender_guardian.json index db2c3f121..c528a3e2e 100644 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/upgrades/ct_ender_guardian.json +++ b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/upgrades/ct_ender_guardian.json @@ -1,12 +1,12 @@ { "flag": "mod:cataclysm", "name": "末影守卫升级", - "icon": "modulargolems:ender_guardian_void_rune", + "icon": "modulargolems:ender_guardian", "category": "modulargolems:upgrades", "pages": [ { "type": "patchouli:spotlight", - "item": "modulargolems:ender_guardian_void_rune", + "item": "modulargolems:ender_guardian", "text": "对目标放出虚空符文。最高等级: 1" } ] diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/upgrades/ct_leviathan.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/upgrades/ct_leviathan.json index 280232797..b1b092137 100644 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/upgrades/ct_leviathan.json +++ b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/upgrades/ct_leviathan.json @@ -1,12 +1,12 @@ { "flag": "mod:cataclysm", "name": "利维坦升级", - "icon": "modulargolems:leviathan_blast_portal", + "icon": "modulargolems:leviathan", "category": "modulargolems:upgrades", "pages": [ { "type": "patchouli:spotlight", - "item": "modulargolems:leviathan_blast_portal", + "item": "modulargolems:leviathan", "text": "攻击目标较远时,在目标位置放出深渊冲击波。最高等级: 1" } ] diff --git a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/upgrades/ct_netherite_monstrosity.json b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/upgrades/ct_netherite_monstrosity.json index 30ad33f4e..5bc067a97 100644 --- a/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/upgrades/ct_netherite_monstrosity.json +++ b/src/main/resources/assets/modulargolems/patchouli_books/golem_guide/zh_cn/entries/upgrades/ct_netherite_monstrosity.json @@ -1,12 +1,12 @@ { "flag": "mod:cataclysm", "name": "下界合金巨兽升级", - "icon": "modulargolems:netherite_monstrosity_earthquake", + "icon": "modulargolems:netherite_monstrosity", "category": "modulargolems:upgrades", "pages": [ { "type": "patchouli:spotlight", - "item": "modulargolems:netherite_monstrosity_earthquake", + "item": "modulargolems:netherite_monstrosity", "text": "傀儡会起跳砸地造成范围伤害。最高等级: 1" } ] diff --git a/src/main/resources/assets/modulargolems/textures/equipments/beacon.png b/src/main/resources/assets/modulargolems/textures/equipments/beacon.png deleted file mode 100644 index 923d9d922b15f5a488df561caa20a71a50b43492..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3027 zcmcImYitx%6kd!F^(KIekwe5$m8J*C_PzT^LQ@0e0x`lw%pj`P zW-hVNyd`sDaLHmQt7LHzF|}U74pPVgM13l$+e&?aO#4;vvpYx#JwE3lgluSOrlT1;;d%sdqs9r4 zIMWP-l$m#{+gX}0VRSt(Y1YfQkkW=K%-fkYRx%x2g)~Z{6w)0V+p>9Ev)XVByV~f+ zb^h}m0Wh_ZNIpiFxujD05VliVi(zC5>C)PcHJFGlN48O8K~!3c(;S~eV>{*OHlMwi zj?L4PO(kd{;22iSFp{}dj^^+Z!JxaUeq!PRO;?RN`)M~|b`A;w2L(uu;RK4|DNc^D zlETRf=byy*6^6-}MhsO;G<0RkONw}>DVCfH9MGe&3YCOmr2r;OOMxmxn|c*VE``5SsIvN|C!fdz0oLzW#N6PA%8@}eOeg8-(P z)F5!N)3v&qZ5jF1BD;-agW7wuBngZVm!M3kP?RX(7eoq3J|86|L?DSEF3Wx_&kX#o zSi%J&$hlhjk1S=~!)l;cA-o^Z_kjm6q9m%kL@}HnQ9e=dQ+`>+Rltfef}#(~g0BZW zw+sHk`d#S z@9s*O_fUq+GPg|Ao0`&9|LLs~@h+#}?wjw&|EhCl;~V$ef!zj@2HxrDk{iP3A@?zV z5W_F|qa4z4y;}I7*6-OPvpt?ZuZKg^V-??Atk}P3<+Pz4uUvWZX49=`(Sb47=eK;> zuVhHaJHf5%SH3swN}sj@-@08F_S7C5ba2O;uTH+a=BMTBiYEMZN?$u-M`bIq_3w$7 z`9I~o+or^xt1-dcd1qegTX<_Qd_yW;dh}}Hs^zQR@*F<3>|5^Z*53rE|zQ5l1 zZr7)$D;J(_ENR|y=W3HE&D%ikekYM>sH~qj7cP#`eKKN8cX)Ve=}z zarL9ye%VsEeJT2k=$PsZ7oscAXmP6G$KYmSXj{?P;--O*O^z10w#T_oK1!}#R5Ja1 z!{Gr3F19UN(cJIIqLTKhM|WRY|M{S?h4YUe6Hj_aADwjV@usTx%`r`vqZiJ$to~x; z?#b&HoEZ7Rb$!z^cGlT(&rH1b8!-iYoKUp=Qj7fVp|ivHl*K+i*CLFab@lGQr<#Y{ Z>@%tO2XSG$rjJ6t*^w7sOV@gF7F133Ty diff --git a/src/main/resources/assets/modulargolems/textures/item/card/path.png b/src/main/resources/assets/modulargolems/textures/item/card/path.png index 4430cb69b99c247c5acfa426a23e569856337a41..3dd4211a89f8ec8d8b52355a707217bbe4a5d168 100644 GIT binary patch delta 438 zcmV;n0ZIO;1J47HBYy#wNklBjE7=|Cmrc*M+Q}A#Q`~x!h0@57t;2)q> z3DVjiI%RCPOeN68Lrut5GWib_YG_eG;339?!Gj|>mtb%Z4phzZb%-S5#34f%rin{|!%!ku*(TF3DjLkwoNWlKZghx{_vse}9rZgp(|R>$=a^$>Bsq zwAPYlu+~}<5t$ex6JsPC48#utS-THAt}CABv01CJx4X;tDB@4H`x-@DPp1IRCs%Ez?W`!2|nE4=XyHjGL8$l)9LW} z6wxQfNG}Yf7k`FD^gKaHDJ7O=VcRy1MuU32j_>=-W-~sWo^pG0!<+SW04~O3qF(Rr zeYuUZU1x&QzG07*qoM6N<$f@6l#)&Kwi delta 400 zcmV;B0dM}#1E~X$BYyw^b5ch_0Itp)=>Px$V@X6oR5*>*lD|trQ545NmLTa9Tr{=W zB3uF~EwC}DsU>g-8XFpdmX?NEY7qJtnxxe~AQU%?gd)u7nV8R>@bp=x6u8)sUHpmB z)^|F5@BN%}&p8+Vy$r(+yuLtd6r4^a4FeN+eSubRb-mBGN`I1wFB2DJb9s!zV5=md zDtY18^a=p;OF>Fnd2kE8m0b>dSMriprv6%?rdP;j?$Ff&M=$JvkyCPY4*m zs1=@w#bV-;+dbKp;9$7l+(#^wb}>&T4#R$$Z!2;eE~x$j~ihh5CQ-I00{s|MNUMnLSTZr#JOt# diff --git a/src/main/resources/assets/modulargolems/textures/item/equipments/golem_beacon_level_1.png b/src/main/resources/assets/modulargolems/textures/item/equipments/golem_beacon_level_1.png deleted file mode 100644 index 2e5ee9982f460bb7057b57cd9644d30aaabbc4d1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPGa3-AeX{r~^}yZ`^M{r`95|GzVD zKFs;_HvjP*&#Py&Pan|UxnaYLV`@N^$(}BbAr-fh8<@|{G`6;~O7ly6Fz4dMxQiD# zQ%a^xpE|wVC-FgszQ4Ej`V2;+Q%$~?8+p!s3sHV*Ah6gbGVp|stVSqX(iCP<=OqGN wiMI~2OCnr2qf` diff --git a/src/main/resources/assets/modulargolems/textures/item/equipments/golem_beacon_level_2.png b/src/main/resources/assets/modulargolems/textures/item/equipments/golem_beacon_level_2.png deleted file mode 100644 index 2e5ee9982f460bb7057b57cd9644d30aaabbc4d1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPGa3-AeX{r~^}yZ`^M{r`95|GzVD zKFs;_HvjP*&#Py&Pan|UxnaYLV`@N^$(}BbAr-fh8<@|{G`6;~O7ly6Fz4dMxQiD# zQ%a^xpE|wVC-FgszQ4Ej`V2;+Q%$~?8+p!s3sHV*Ah6gbGVp|stVSqX(iCP<=OqGN wiMI~2OCnr2qf` diff --git a/src/main/resources/assets/modulargolems/textures/item/equipments/golem_beacon_level_3.png b/src/main/resources/assets/modulargolems/textures/item/equipments/golem_beacon_level_3.png deleted file mode 100644 index 2e5ee9982f460bb7057b57cd9644d30aaabbc4d1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPGa3-AeX{r~^}yZ`^M{r`95|GzVD zKFs;_HvjP*&#Py&Pan|UxnaYLV`@N^$(}BbAr-fh8<@|{G`6;~O7ly6Fz4dMxQiD# zQ%a^xpE|wVC-FgszQ4Ej`V2;+Q%$~?8+p!s3sHV*Ah6gbGVp|stVSqX(iCP<=OqGN wiMI~2OCnr2qf` diff --git a/src/main/resources/assets/modulargolems/textures/item/equipments/golem_beacon_level_4.png b/src/main/resources/assets/modulargolems/textures/item/equipments/golem_beacon_level_4.png deleted file mode 100644 index 2e5ee9982f460bb7057b57cd9644d30aaabbc4d1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPGa3-AeX{r~^}yZ`^M{r`95|GzVD zKFs;_HvjP*&#Py&Pan|UxnaYLV`@N^$(}BbAr-fh8<@|{G`6;~O7ly6Fz4dMxQiD# zQ%a^xpE|wVC-FgszQ4Ej`V2;+Q%$~?8+p!s3sHV*Ah6gbGVp|stVSqX(iCP<=OqGN wiMI~2OCnr2qf` diff --git a/src/main/resources/assets/modulargolems/textures/item/equipments/golem_beacon_level_5.png b/src/main/resources/assets/modulargolems/textures/item/equipments/golem_beacon_level_5.png deleted file mode 100644 index 2e5ee9982f460bb7057b57cd9644d30aaabbc4d1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPGa3-AeX{r~^}yZ`^M{r`95|GzVD zKFs;_HvjP*&#Py&Pan|UxnaYLV`@N^$(}BbAr-fh8<@|{G`6;~O7ly6Fz4dMxQiD# zQ%a^xpE|wVC-FgszQ4Ej`V2;+Q%$~?8+p!s3sHV*Ah6gbGVp|stVSqX(iCP<=OqGN wiMI~2OCnr2qf` From 29c7587595fa776d3a87b35d43a8fd2ae9ba4edc Mon Sep 17 00:00:00 2001 From: D12epic <1619640542@qq.com> Date: Mon, 29 Jul 2024 20:14:10 +0800 Subject: [PATCH 32/32] Merge branch 'Minecraft-LightLand:1.20' into D12's_1.20.1(AnimateRebuild) --- .../materials/create/CoatingModifier.java | 30 +++++ .../materials/create/CreateJEIEvents.java | 12 ++ .../create/CreateMixingRecipeGen.java | 67 ++++++++++ .../materials/create/CreateRecipeEvents.java | 27 ++++ .../create/DeployerUpgradeRecipe.java | 48 +++++++ .../client/armor/MetalGolemBasicModels.java | 126 ++++++++++++++++++ .../content/client/pose/PoseStateMachine.java | 46 +++++++ .../entity/humanoid/ClientProfileManager.java | 51 +++++++ .../entity/humanoid/PlayerSkinRenderer.java | 45 +++++++ .../entity/humanoid/SpecialRenderProfile.java | 9 ++ 10 files changed, 461 insertions(+) create mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/create/CoatingModifier.java create mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/create/CreateJEIEvents.java create mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/create/CreateMixingRecipeGen.java create mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/create/CreateRecipeEvents.java create mode 100644 src/main/java/dev/xkmc/modulargolems/compat/materials/create/DeployerUpgradeRecipe.java create mode 100644 src/main/java/dev/xkmc/modulargolems/content/client/armor/MetalGolemBasicModels.java create mode 100644 src/main/java/dev/xkmc/modulargolems/content/client/pose/PoseStateMachine.java create mode 100644 src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/ClientProfileManager.java create mode 100644 src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/PlayerSkinRenderer.java create mode 100644 src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/SpecialRenderProfile.java diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/CoatingModifier.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/CoatingModifier.java new file mode 100644 index 000000000..6ce3bf3f2 --- /dev/null +++ b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/CoatingModifier.java @@ -0,0 +1,30 @@ +package dev.xkmc.modulargolems.compat.materials.create; + +import dev.xkmc.modulargolems.content.core.StatFilterType; +import dev.xkmc.modulargolems.content.entity.common.AbstractGolemEntity; +import dev.xkmc.modulargolems.content.modifier.base.GolemModifier; +import dev.xkmc.modulargolems.init.data.MGConfig; +import net.minecraft.ChatFormatting; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraftforge.event.entity.living.LivingDamageEvent; + +import java.util.List; + +public class CoatingModifier extends GolemModifier { + + public CoatingModifier() { + super(StatFilterType.MASS, 5); + } + + public List getDetail(int v) { + double reduce = v * MGConfig.COMMON.coating.get(); + return List.of(Component.translatable(getDescriptionId() + ".desc", reduce).withStyle(ChatFormatting.GREEN)); + } + + @Override + public void onDamaged(AbstractGolemEntity entity, LivingDamageEvent event, int level) { + event.setAmount((float) Math.max(0, event.getAmount() - level * MGConfig.COMMON.coating.get())); + } + +} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/CreateJEIEvents.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/CreateJEIEvents.java new file mode 100644 index 000000000..3845afcdc --- /dev/null +++ b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/CreateJEIEvents.java @@ -0,0 +1,12 @@ +package dev.xkmc.modulargolems.compat.materials.create; + +import dev.xkmc.modulargolems.compat.jei.CustomRecipeEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; + +public class CreateJEIEvents { + + @SubscribeEvent + public static void onJEICustomRecipe(CustomRecipeEvent event) { + } + +} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/CreateMixingRecipeGen.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/CreateMixingRecipeGen.java new file mode 100644 index 000000000..195ba43d7 --- /dev/null +++ b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/CreateMixingRecipeGen.java @@ -0,0 +1,67 @@ +package dev.xkmc.modulargolems.compat.materials.create; + +import com.simibubi.create.AllRecipeTypes; +import com.simibubi.create.content.kinetics.mixer.MixingRecipe; +import com.simibubi.create.content.processing.recipe.HeatCondition; +import com.simibubi.create.content.processing.recipe.ProcessingRecipeBuilder; +import com.simibubi.create.content.processing.recipe.ProcessingRecipeSerializer; +import com.tterrag.registrate.providers.RegistrateRecipeProvider; +import dev.xkmc.l2library.serial.config.ConfigDataProvider; +import dev.xkmc.modulargolems.compat.materials.common.CompatManager; +import dev.xkmc.modulargolems.compat.materials.common.ModDispatch; +import dev.xkmc.modulargolems.content.config.GolemMaterialConfig; +import dev.xkmc.modulargolems.content.item.golem.GolemPart; +import dev.xkmc.modulargolems.init.ModularGolems; +import dev.xkmc.modulargolems.init.data.MGConfigGen; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.crafting.Ingredient; +import net.minecraftforge.common.crafting.conditions.ModLoadedCondition; +import net.minecraftforge.registries.ForgeRegistries; + +import java.util.HashMap; +import java.util.Map; + +public class CreateMixingRecipeGen { + + public static void genAllUpgradeRecipes(RegistrateRecipeProvider pvd) { + var ing = gatherConfig(); + ProcessingRecipeSerializer serializer = AllRecipeTypes.MIXING.getSerializer(); + for (var part : GolemPart.LIST) { + for (var ent : ing.entrySet()) { + String item_name = ForgeRegistries.ITEMS.getResourceKey(part).get().location().getPath(); + String name = item_name + "_apply_" + ent.getKey().getPath(); + var recipe = new ProcessingRecipeBuilder<>(serializer.getFactory(), new ResourceLocation(ModularGolems.MODID, name)); + recipe.require(part); + for (int i = 0; i < part.count; i++) { + recipe.require(ent.getValue()); + } + recipe.requiresHeat(HeatCondition.HEATED); + recipe.output(GolemPart.setMaterial(part.getDefaultInstance(), ent.getKey())); + String modid = ent.getKey().getNamespace(); + recipe.withCondition(new ModLoadedCondition(CreateDispatch.MODID)); + if (!modid.equals(ModularGolems.MODID) && !modid.equals(CreateDispatch.MODID)) { + recipe.withCondition(new ModLoadedCondition(modid)); + } + recipe.build(pvd); + } + } + } + + @SuppressWarnings("ConstantConditions") + private static Map gatherConfig() { + ConfigDataProvider.Collector map = new ConfigDataProvider.Collector(new HashMap<>()); + for (ModDispatch dispatch : CompatManager.LIST) { + var gen = dispatch.getDataGen(null); + gen.add(map); + } + new MGConfigGen(null).add(map); + Map ing = new HashMap<>(); + for (ConfigDataProvider.ConfigEntry config : map.map().values()) { + if (config.config() instanceof GolemMaterialConfig mat) { + ing.putAll(mat.ingredients); + } + } + return ing; + } + +} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/CreateRecipeEvents.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/CreateRecipeEvents.java new file mode 100644 index 000000000..dbe2f22f1 --- /dev/null +++ b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/CreateRecipeEvents.java @@ -0,0 +1,27 @@ +package dev.xkmc.modulargolems.compat.materials.create; + +import com.simibubi.create.content.kinetics.deployer.DeployerRecipeSearchEvent; +import dev.xkmc.modulargolems.content.item.golem.GolemHolder; +import dev.xkmc.modulargolems.content.item.upgrade.UpgradeItem; +import dev.xkmc.modulargolems.events.CraftEventListeners; +import net.minecraft.world.item.ItemStack; +import net.minecraftforge.eventbus.api.SubscribeEvent; + +import java.util.Optional; + +public class CreateRecipeEvents { + + @SubscribeEvent + public static void addRecipe(DeployerRecipeSearchEvent event) { + ItemStack first = event.getInventory().getItem(0); + ItemStack second = event.getInventory().getItem(1); + if (first.getItem() instanceof GolemHolder holder && + second.getItem() instanceof UpgradeItem upgrade) { + ItemStack result = CraftEventListeners.appendUpgrade(first, holder, upgrade); + if (!result.isEmpty()) { + event.addRecipe(() -> Optional.of(new DeployerUpgradeRecipe(result)), 1000); + } + } + } + +} diff --git a/src/main/java/dev/xkmc/modulargolems/compat/materials/create/DeployerUpgradeRecipe.java b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/DeployerUpgradeRecipe.java new file mode 100644 index 000000000..ebb07366a --- /dev/null +++ b/src/main/java/dev/xkmc/modulargolems/compat/materials/create/DeployerUpgradeRecipe.java @@ -0,0 +1,48 @@ +package dev.xkmc.modulargolems.compat.materials.create; + +import net.minecraft.core.RegistryAccess; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.Container; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.RecipeSerializer; +import net.minecraft.world.item.crafting.RecipeType; +import net.minecraft.world.level.Level; + +public record DeployerUpgradeRecipe(ItemStack result) implements Recipe { + @Override + public boolean matches(Container p_44002_, Level p_44003_) { + return false; + } + + @Override + public ItemStack assemble(Container p_44001_, RegistryAccess p_267165_) { + return ItemStack.EMPTY; + } + + @Override + public boolean canCraftInDimensions(int p_43999_, int p_44000_) { + return false; + } + + @Override + public ItemStack getResultItem(RegistryAccess p_267052_) { + return result.copy(); + } + + @Override + public ResourceLocation getId() { + return null; + } + + @Override + public RecipeSerializer getSerializer() { + return null; + } + + @Override + public RecipeType getType() { + return null; + } + +} diff --git a/src/main/java/dev/xkmc/modulargolems/content/client/armor/MetalGolemBasicModels.java b/src/main/java/dev/xkmc/modulargolems/content/client/armor/MetalGolemBasicModels.java new file mode 100644 index 000000000..6f7f9423d --- /dev/null +++ b/src/main/java/dev/xkmc/modulargolems/content/client/armor/MetalGolemBasicModels.java @@ -0,0 +1,126 @@ +package dev.xkmc.modulargolems.content.client.armor; + +import dev.xkmc.modulargolems.init.ModularGolems; +import net.minecraft.client.model.geom.ModelLayerLocation; +import net.minecraft.client.model.geom.PartPose; +import net.minecraft.client.model.geom.builders.*; +import net.minecraft.resources.ResourceLocation; +import net.minecraftforge.client.event.EntityRenderersEvent; + +import java.util.ArrayList; +import java.util.List; + +public class MetalGolemBasicModels { + + public static final List LIST = new ArrayList<>(); + + public static final ModelLayerLocation HELMET_LAYER = new ModelLayerLocation(new ResourceLocation(ModularGolems.MODID, "golem_helmet"), "main"); + public static final ModelLayerLocation CHESTPLATE_LAYER = new ModelLayerLocation(new ResourceLocation(ModularGolems.MODID, "golem_chestplate"), "main"); + public static final ModelLayerLocation SHINGUARD_LAYER = new ModelLayerLocation(new ResourceLocation(ModularGolems.MODID, "golem_shinguard"), "main"); + public static final ModelLayerLocation METALGOLEM = new ModelLayerLocation(new ResourceLocation(ModularGolems.MODID, "metalgolem"), "model"); + + public static MeshDefinition buildGolemBaseLayers() { + MeshDefinition mesh = new MeshDefinition(); + PartDefinition partdefinition = mesh.getRoot(); + partdefinition.addOrReplaceChild("head", CubeListBuilder.create().texOffs(0, 0).addBox(-4.0F, -12.0F, -5.5F, 8.0F, 10.0F, 8.0F).texOffs(24, 0).addBox(-1.0F, -5.0F, -7.5F, 2.0F, 4.0F, 2.0F), PartPose.offset(0.0F, -7.0F, -2.0F)); + partdefinition.addOrReplaceChild("body", CubeListBuilder.create().texOffs(0, 40).addBox(-9.0F, -2.0F, -6.0F, 18.0F, 12.0F, 11.0F).texOffs(0, 70).addBox(-4.5F, 10.0F, -3.0F, 9.0F, 5.0F, 6.0F, new CubeDeformation(0.5F)), PartPose.offset(0.0F, -7.0F, 0.0F)); + partdefinition.addOrReplaceChild("right_arm", CubeListBuilder.create().texOffs(60, 21).addBox(-13.0F, -2.5F, -3.0F, 4.0F, 14.0F, 6.0F), PartPose.offset(0.0F, -7.0F, 0.0F)); + partdefinition.addOrReplaceChild("left_arm", CubeListBuilder.create().texOffs(60, 58).addBox(9.0F, -2.5F, -3.0F, 4.0F, 14.0F, 6.0F), PartPose.offset(0.0F, -7.0F, 0.0F)); + partdefinition.addOrReplaceChild("right_leg", CubeListBuilder.create().texOffs(37, 0).addBox(-3.5F, -3.0F, -3.0F, 6.0F, 16.0F, 5.0F), PartPose.offset(-4.0F, 11.0F, 0.0F)); + partdefinition.addOrReplaceChild("left_leg", CubeListBuilder.create().texOffs(60, 0).mirror().addBox(-3.5F, -3.0F, -3.0F, 6.0F, 16.0F, 5.0F), PartPose.offset(5.0F, 11.0F, 0.0F)); + PartDefinition root1 = mesh.getRoot().getChild("right_arm"); + root1.addOrReplaceChild("right_forearm", CubeListBuilder.create().texOffs(60, 35).addBox(-12.99F, 0F, -6.0F, 4.0F, 16.0F, 6.0F), PartPose.offsetAndRotation(0.0F, 11.5F, 3.0F, 0.0F, 0.0F, 0.0F)); + PartDefinition root2 = mesh.getRoot().getChild("left_arm"); + root2.addOrReplaceChild("left_forearm", CubeListBuilder.create().texOffs(60, 72).addBox(8.99F, 0F, -6.0F, 4.0F, 16.0F, 6.0F), PartPose.offsetAndRotation(0.0F, 11.5F, 3.0F, 0.0F, 0.0F, 0.0F)); + PartDefinition root3 = root1.getChild("right_forearm").addOrReplaceChild("weapon", CubeListBuilder.create().texOffs(80,0).addBox(-1.0F, -1.0F, -2.0F, 2.0F, 2.0F, 22.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 14.7273F, -5.8134F)); + root3.getChild("weapon"); + PartDefinition root4 = root2.getChild("left_forearm").addOrReplaceChild("shield", CubeListBuilder.create().texOffs(0, 0).addBox(-0.5F, -1.0F, -1.0F, 1.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(2.5F, 11.5F, -4.0F)); + root4.getChild("shield"); + return mesh; + } + + public static LayerDefinition createHelmetLayer() { + MeshDefinition mesh = buildGolemBaseLayers(); + PartDefinition root = mesh.getRoot().getChild("head"); + root.addOrReplaceChild("helmet3", CubeListBuilder.create().texOffs(0, 48).addBox(-4.0F, -44.0F, -8.0F, 9.0F, 12.0F, 9.0F, new CubeDeformation(0.0F)) + .texOffs(76, 39).addBox(-4.5F, -37.0F, -6.25F, 10.0F, 5.0F, 8.0F, new CubeDeformation(0.0F)), PartPose.offset(-0.5F, 31.0F, 2.0F)); + + root.addOrReplaceChild("helmet17", CubeListBuilder.create().texOffs(48, 105).addBox(-5.5F, 28.0F, 0.0F, 9.0F, 12.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-5.5F, -43.0F, -1.5F, 0.0F, 0.8727F, 0.0F)); + + root.addOrReplaceChild("helmet16", CubeListBuilder.create().texOffs(108, 52).addBox(-3.5F, 28.0F, 0.0F, 9.0F, 12.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(5.5F, -43.0F, -1.5F, 0.0F, -0.8727F, 0.0F)); + + root.addOrReplaceChild("helmet15", CubeListBuilder.create(), PartPose.offsetAndRotation(0.5F, -36.0F, -5.25F, 0.4363F, 0.0F, 0.0F)); + + root.addOrReplaceChild("helmet8", CubeListBuilder.create(), PartPose.offsetAndRotation(1.0F, 0.0F, -2.0F, 0.0F, 0.3491F, 0.0F)); + + root.addOrReplaceChild("helmet9", CubeListBuilder.create().texOffs(50, 0).addBox(2.0F, 28.0F, -2.0F, 6.0F, 4.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-4.5F, -40.5F, -3.5F, 0.0F, 0.0F, 0.2182F)); + + root.addOrReplaceChild("helmet10", CubeListBuilder.create().texOffs(70, 39).addBox(13.0F, 24.5F, 0.5F, 4.0F, 4.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-7.8669F, -41.8411F, -3.5F, 0.0F, 0.1309F, 0.5672F)); + + root.addOrReplaceChild("helmet11", CubeListBuilder.create().texOffs(0, 0).addBox(-17.0F, -4.5F, -5.5F, 4.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-2.384F, -0.549F, 0.0F, 0.0F, 0.0873F, 0.7418F)); + + root.addOrReplaceChild("helmet4", CubeListBuilder.create(), PartPose.offsetAndRotation(0.0F, 0.0F, -2.0F, 0.0F, -0.3491F, 0.0F)); + + root.addOrReplaceChild("helmet6", CubeListBuilder.create().texOffs(105, 14).addBox(-8.0F, 28.0F, -2.0F, 6.0F, 4.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(4.5F, -40.5F, -3.5F, 0.0F, 0.0F, -0.2182F)); + + root.addOrReplaceChild("helmet5", CubeListBuilder.create().texOffs(73, 18).addBox(-16.0F, 24.5F, 0.5F, 4.0F, 4.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(7.8669F, -41.8411F, -3.5F, 0.0F, -0.1309F, -0.5672F)); + + root.addOrReplaceChild("helmet7", CubeListBuilder.create().texOffs(0, 5).addBox(14.0F, -4.5F, -5.5F, 4.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(2.384F, -0.549F, 0.0F, 0.0F, -0.0873F, -0.7418F)); + + root.addOrReplaceChild("helmet", CubeListBuilder.create().texOffs(58, 12).addBox(-1.0F, -49.0F, -6.0F, 1.0F, 14.0F, 13.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 31.0F, 2.0F)); + return LayerDefinition.create(mesh, 128, 128); + } + + public static LayerDefinition createChestplateLayer() { + MeshDefinition mesh = buildGolemBaseLayers(); + PartDefinition root = mesh.getRoot().getChild("body"); + root.addOrReplaceChild("main_body", CubeListBuilder.create().texOffs(0, 0).addBox(-9.5F, 4.5F, -6.6F, 19.0F, 13.0F, 12.0F, new CubeDeformation(0.0F)) + .texOffs(19, 110).addBox(5.5F, 3.5F, -7.75F, 2.0F, 8.0F, 7.0F, new CubeDeformation(0.0F)) + .texOffs(105, 28).addBox(-7.5F, 3.5F, -7.75F, 2.0F, 8.0F, 7.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -7.0F, 0.0F)); + PartDefinition root_ra1 = mesh.getRoot().getChild("right_arm"); + PartDefinition root_rfa = mesh.getRoot().getChild("right_arm").getChild("right_forearm"); + root_ra1.addOrReplaceChild("main_rightarm1", CubeListBuilder.create().texOffs(0, 83).addBox(-14.5F, -33.5F, -3.5F, 6.0F, 10.0F, 7.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 31.0F, 0.0F)); + root_rfa.addOrReplaceChild("main_rightforearm", CubeListBuilder.create().texOffs(89, 104).addBox(-13.0F, -29.5F, -6.5F, 4.01F, 7.0F, 7.0F, new CubeDeformation(0.0F)) + .texOffs(0, 111).addBox(-17.0F, -32.75F, -3.5F, 5.0F, 12.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 31.0F, 0.0F)); + root_ra1.addOrReplaceChild("main_rightarm2", CubeListBuilder.create().texOffs(90, 65).addBox(27.75F, 8.75F, -5.0F, 7.0F, 3.0F, 8.0F, new CubeDeformation(0.0F)) + .texOffs(76, 52).addBox(27F, 4.75F, -5.5F, 7.0F, 4.0F, 9.0F, new CubeDeformation(0.0F)) + .texOffs(65, 67).addBox(26.25F, 2.75F, -6.5F, 7.0F, 3.0F, 11.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-11.75F, -31.75F, 1.0F, 0.0F, 0.0F, 1.3526F)); + PartDefinition root_la1 = mesh.getRoot().getChild("left_arm"); + PartDefinition root_lfa = mesh.getRoot().getChild("left_arm").getChild("left_forearm"); + root_la1.addOrReplaceChild("main_leftarm1", CubeListBuilder.create().texOffs(86, 18).addBox(8.75F, -33.5F, -3.5F, 6.0F, 10.0F, 7.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 31.0F, 0.0F)); + root_la1.addOrReplaceChild("main_leftarm2", CubeListBuilder.create().texOffs(96, 82).addBox(-34.5F, 8.75F, -5.0F, 7.0F, 3.0F, 8.0F, new CubeDeformation(0.0F)) + .texOffs(47, 81).addBox(-33.75F, 4.75F, -5.5F, 7.0F, 4.0F, 9.0F, new CubeDeformation(0.0F)) + .texOffs(0, 69).addBox(-33.0F, 2.75F, -6.5F, 7.0F, 3.0F, 11.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(11.75F, -31.75F, 1.0F, 0.0F, 0.0F, -1.3526F)); + root_lfa.addOrReplaceChild("main_leftforearm", CubeListBuilder.create().texOffs(105, 0).addBox(8.98F, -29.5F, -6.5F, 4.01F, 7.0F, 7.0F, new CubeDeformation(0.0F)) + .texOffs(68, 111).addBox(11.75F, -32.75F, -3.5F, 5.0F, 12.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 31.0F, 0.0F)); + return LayerDefinition.create(mesh, 128, 128); + } + + public static LayerDefinition createShinGuard() { + MeshDefinition mesh = buildGolemBaseLayers(); + PartDefinition root1 = mesh.getRoot().getChild("body"); + root1.addOrReplaceChild("main_shinguard", CubeListBuilder.create().texOffs(70, 81).addBox(-5.0F, 19.0F, -3.5F, 10.0F, 2.0F, 7.0F, new CubeDeformation(0.5F)), PartPose.offset(0.0F, -7.0F, 0.0F)); + PartDefinition root2 = mesh.getRoot().getChild("right_leg"); + root2.addOrReplaceChild("shinguard1", CubeListBuilder.create().texOffs(48, 94).addBox(0.0F, -9.0F, -3.5F, 7.0F, 5.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offset(-4.0F, 11.0F, 0.0F)); + PartDefinition root3 = mesh.getRoot().getChild("left_leg"); + root3.addOrReplaceChild("shinguard2", CubeListBuilder.create().texOffs(0, 100).addBox(-9.0F, -9.0F, -3.5F, 7.0F, 5.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offset(5.0F, 11.0F, 0.0F)); + return LayerDefinition.create(mesh, 128, 128); + } + + public static LayerDefinition createGolemLayer() { + MeshDefinition mesh = buildGolemBaseLayers(); + return LayerDefinition.create(mesh, 128, 128); + } + + public static void registerArmorLayer(EntityRenderersEvent.RegisterLayerDefinitions event) { + LIST.add(HELMET_LAYER); + event.registerLayerDefinition(HELMET_LAYER, MetalGolemBasicModels::createHelmetLayer); + LIST.add(CHESTPLATE_LAYER); + event.registerLayerDefinition(CHESTPLATE_LAYER, MetalGolemBasicModels::createChestplateLayer); + LIST.add(SHINGUARD_LAYER); + event.registerLayerDefinition(SHINGUARD_LAYER, MetalGolemBasicModels::createShinGuard); + event.registerLayerDefinition(METALGOLEM, MetalGolemBasicModels::createGolemLayer); + } + +} + diff --git a/src/main/java/dev/xkmc/modulargolems/content/client/pose/PoseStateMachine.java b/src/main/java/dev/xkmc/modulargolems/content/client/pose/PoseStateMachine.java new file mode 100644 index 000000000..1f6da8702 --- /dev/null +++ b/src/main/java/dev/xkmc/modulargolems/content/client/pose/PoseStateMachine.java @@ -0,0 +1,46 @@ +package dev.xkmc.modulargolems.content.client.pose; +import dev.xkmc.modulargolems.content.entity.metalgolem.MetalGolemEntity; +import net.minecraft.sounds.SoundEvents; +import static dev.xkmc.modulargolems.content.client.pose.PoseStateMachine.State.*; +public class PoseStateMachine { + private final MetalGolemEntity mg; + public PoseStateMachine(MetalGolemEntity mg){ + this.mg=mg; + } + public enum State {RaiseArms, LayArmsDown, StartAttacking} + private PoseStateMachine.State state = LayArmsDown; + public void tick() { + int atkTick = mg.getAttackAnimationTick(); + if(!mg.level().isClientSide){return;} + if (mg.isAggressive()) {signalWarning();} + else{signalEndWarning();} + if (atkTick <= 0) {signalEndAttacking();} + } + public void signalWarning() { + if (state == LayArmsDown) { + state = RaiseArms; + mg.warningAnimationState.start(mg.tickCount); + } + } + public void signalEndWarning() { + if (state == RaiseArms) { + state = LayArmsDown; + mg.warningAnimationState.stop(); + } + } + public void signalAttacking() { + if (state == RaiseArms || state == LayArmsDown) { + state = StartAttacking; + mg.warningAnimationState.stop(); + mg.attackAnimationState.start(mg.tickCount); + mg.playSound(SoundEvents.IRON_GOLEM_ATTACK, 1.0F, 1.0F); + } + } + public void signalEndAttacking() { + if (state == StartAttacking) { + state = LayArmsDown; + mg.attackAnimationState.stop(); + } + } + +} \ No newline at end of file diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/ClientProfileManager.java b/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/ClientProfileManager.java new file mode 100644 index 000000000..ec713318a --- /dev/null +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/ClientProfileManager.java @@ -0,0 +1,51 @@ +package dev.xkmc.modulargolems.content.entity.humanoid; + +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.minecraft.MinecraftProfileTexture; +import dev.xkmc.modulargolems.compat.curio.CurioCompatRegistry; +import net.minecraft.client.Minecraft; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.level.block.entity.SkullBlockEntity; + +import javax.annotation.Nullable; +import java.util.Map; +import java.util.TreeMap; + +public class ClientProfileManager { + + private static final Map CACHE = new TreeMap<>(); + + @Nullable + public static SpecialRenderProfile get(HumanoidGolemEntity entity) { + var curio = CurioCompatRegistry.get(); + if (curio == null) return null; + String name = curio.getSkin(entity); + if (name == null) return null; + return get(name); + } + + @Nullable + private static SpecialRenderProfile get(String name) { + var profile = getProfile(name); + if (profile == null) return null; + var skins = Minecraft.getInstance().getSkinManager(); + var skin = skins.getInsecureSkinInformation(profile).get(MinecraftProfileTexture.Type.SKIN); + if (skin == null) return null; + var skinModel = skin.getMetadata("model"); + boolean slim = skinModel != null && skinModel.equals("slim"); + ResourceLocation texture = skins.getInsecureSkinLocation(profile); + if (texture.equals(new ResourceLocation("missingno"))) + return null; + return new SpecialRenderProfile(slim, texture); + } + + @Nullable + private static GameProfile getProfile(String name) { + if (!CACHE.containsKey(name)) { + CACHE.put(name, null); + SkullBlockEntity.updateGameprofile(new GameProfile(null, name), e -> CACHE.put(name, e)); + } + return CACHE.get(name); + } + +} diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/PlayerSkinRenderer.java b/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/PlayerSkinRenderer.java new file mode 100644 index 000000000..ba347d611 --- /dev/null +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/PlayerSkinRenderer.java @@ -0,0 +1,45 @@ +package dev.xkmc.modulargolems.content.entity.humanoid; + +import com.mojang.blaze3d.vertex.PoseStack; +import dev.xkmc.l2library.util.Proxy; +import net.minecraft.client.player.AbstractClientPlayer; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.entity.EntityRendererProvider; +import net.minecraft.resources.ResourceLocation; + +public class PlayerSkinRenderer extends HumanoidGolemRenderer { + + public static PlayerSkinRenderer REGULAR; + public static PlayerSkinRenderer SLIM; + + public PlayerSkinRenderer(EntityRendererProvider.Context ctx, boolean slim) { + super(ctx, slim); + } + + @Override + protected boolean delegated(HumanoidGolemEntity entity) { + return true; + } + + @Override + public void render(HumanoidGolemEntity entity, float f1, float f2, PoseStack stack, MultiBufferSource source, int i) { + stack.pushPose(); + float r = entity.getScale(); + //stack.translate(0, (1 - r) * 1.501, 0); + stack.scale(r, r, r); + renderImpl(entity, f1, f2, stack, source, i); + stack.popPose(); + } + + @Override + public ResourceLocation getTextureLocation(HumanoidGolemEntity entity) { + var profile = ClientProfileManager.get(entity); + if (profile == null || profile.texture() == null) { + AbstractClientPlayer player = Proxy.getClientPlayer(); + assert player != null; + return player.getSkinTextureLocation(); + } + return profile.texture(); + } + +} diff --git a/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/SpecialRenderProfile.java b/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/SpecialRenderProfile.java new file mode 100644 index 000000000..02908e73a --- /dev/null +++ b/src/main/java/dev/xkmc/modulargolems/content/entity/humanoid/SpecialRenderProfile.java @@ -0,0 +1,9 @@ +package dev.xkmc.modulargolems.content.entity.humanoid; + +import net.minecraft.resources.ResourceLocation; + +import javax.annotation.Nullable; + +public record SpecialRenderProfile(boolean slim, @Nullable ResourceLocation texture) { + +}