diff --git a/elements/LabelCopyMachineCopyButtonPressed.mod.json b/elements/LabelCopyMachineCopyButtonPressed.mod.json
index c8a0d88..f407440 100644
--- a/elements/LabelCopyMachineCopyButtonPressed.mod.json
+++ b/elements/LabelCopyMachineCopyButtonPressed.mod.json
@@ -2,6 +2,6 @@
"_fv": 73,
"_type": "procedure",
"definition": {
- "procedurexml": "no_ext_triggerAND0CUSTOM:ShippingLabelANDGT10GT20MINUS1111MINUS2122ADD3103"
+ "procedurexml": "no_ext_triggerAND0CUSTOM:ShippingLabelANDGT10GT20MINUS1111MINUS2122ADD3103"
}
}
\ No newline at end of file
diff --git a/elements/Tux.mod.json b/elements/Tux.mod.json
index 20f0132..565d9c3 100644
--- a/elements/Tux.mod.json
+++ b/elements/Tux.mod.json
@@ -22,7 +22,41 @@
"fixedValue": 1.25
},
"modelLayers": [],
- "animations": [],
+ "animations": [
+ {
+ "animation": {
+ "value": "CUSTOM:tuxModelAnimation.walking"
+ },
+ "speed": 1.0,
+ "condition": {
+ "name": "TuxPlaybackConditionWalking"
+ },
+ "walking": true,
+ "amplitude": 1.0
+ },
+ {
+ "animation": {
+ "value": "CUSTOM:tuxModelAnimation.jumpUp"
+ },
+ "speed": 1.0,
+ "condition": {
+ "name": "TuxPlaybackConditionJumpUp"
+ },
+ "walking": false,
+ "amplitude": 1.0
+ },
+ {
+ "animation": {
+ "value": "CUSTOM:tuxModelAnimation.JumpDown"
+ },
+ "speed": 1.0,
+ "condition": {
+ "name": "TuxPlaybackConditionFalling"
+ },
+ "walking": false,
+ "amplitude": 1.0
+ }
+ ],
"modelWidth": 0.6,
"modelHeight": 1.8,
"modelShadowSize": 0.5,
diff --git a/elements/TuxPlaybackConditionFalling.mod.json b/elements/TuxPlaybackConditionFalling.mod.json
new file mode 100644
index 0000000..8ded6dc
--- /dev/null
+++ b/elements/TuxPlaybackConditionFalling.mod.json
@@ -0,0 +1,7 @@
+{
+ "_fv": 73,
+ "_type": "procedure",
+ "definition": {
+ "procedurexml": "no_ext_triggerLT0TRUEFALSE"
+ }
+}
\ No newline at end of file
diff --git a/elements/TuxPlaybackConditionJumpUp.mod.json b/elements/TuxPlaybackConditionJumpUp.mod.json
new file mode 100644
index 0000000..8b31746
--- /dev/null
+++ b/elements/TuxPlaybackConditionJumpUp.mod.json
@@ -0,0 +1,7 @@
+{
+ "_fv": 73,
+ "_type": "procedure",
+ "definition": {
+ "procedurexml": "no_ext_triggerGT0TRUEFALSE"
+ }
+}
\ No newline at end of file
diff --git a/elements/TuxPlaybackConditionWalking.mod.json b/elements/TuxPlaybackConditionWalking.mod.json
new file mode 100644
index 0000000..a5314eb
--- /dev/null
+++ b/elements/TuxPlaybackConditionWalking.mod.json
@@ -0,0 +1,7 @@
+{
+ "_fv": 73,
+ "_type": "procedure",
+ "definition": {
+ "procedurexml": "no_ext_triggerORGT0GT0TRUEFALSE"
+ }
+}
\ No newline at end of file
diff --git a/models/animations/tuxModelAnimation.java b/models/animations/tuxModelAnimation.java
new file mode 100644
index 0000000..b1b6d66
--- /dev/null
+++ b/models/animations/tuxModelAnimation.java
@@ -0,0 +1,104 @@
+// Save this class in your mod and generate all required imports
+
+/**
+ * Made with Blockbench 5.0.7 Exported for Minecraft version 1.19 or later with
+ * Mojang mappings
+ *
+ * @author Author
+ */
+public class tuxModelAnimation {
+ public static final AnimationDefinition walking = AnimationDefinition.Builder.withLength(1.0F).looping()
+ .addAnimation("LeftLeg",
+ new AnimationChannel(AnimationChannel.Targets.ROTATION,
+ new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F),
+ AnimationChannel.Interpolations.LINEAR),
+ new Keyframe(0.75F, KeyframeAnimations.degreeVec(0.0F, -5.0F, 0.0F),
+ AnimationChannel.Interpolations.LINEAR),
+ new Keyframe(1.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F),
+ AnimationChannel.Interpolations.LINEAR)))
+ .addAnimation("RightLeg",
+ 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(0.0F, 7.5F, 0.0F),
+ AnimationChannel.Interpolations.LINEAR),
+ new Keyframe(0.5F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F),
+ AnimationChannel.Interpolations.LINEAR)))
+ .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.25F, KeyframeAnimations.degreeVec(-27.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.75F, KeyframeAnimations.degreeVec(-27.5F, 0.0F, 0.0F),
+ AnimationChannel.Interpolations.LINEAR),
+ new Keyframe(1.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F),
+ AnimationChannel.Interpolations.LINEAR)))
+ .addAnimation("LeftArm",
+ 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(22.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.75F, KeyframeAnimations.degreeVec(22.5F, 0.0F, 0.0F),
+ AnimationChannel.Interpolations.LINEAR),
+ new Keyframe(1.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F),
+ AnimationChannel.Interpolations.LINEAR)))
+ .addAnimation("BodySegment",
+ 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(0.0F, 12.5F, 0.0F),
+ AnimationChannel.Interpolations.LINEAR),
+ new Keyframe(0.75F, KeyframeAnimations.degreeVec(0.0F, -12.5F, 0.0F),
+ AnimationChannel.Interpolations.LINEAR),
+ new Keyframe(1.0F, KeyframeAnimations.degreeVec(0.0F, 0.83F, 0.0F),
+ AnimationChannel.Interpolations.LINEAR)))
+ .build();
+
+ public static final AnimationDefinition jumpUp = AnimationDefinition.Builder.withLength(0.25F)
+ .addAnimation("root",
+ new AnimationChannel(AnimationChannel.Targets.POSITION,
+ new Keyframe(0.0F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F),
+ AnimationChannel.Interpolations.LINEAR),
+ new Keyframe(0.25F, KeyframeAnimations.posVec(0.0F, 5.0F, 0.0F),
+ AnimationChannel.Interpolations.LINEAR)))
+ .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.25F, KeyframeAnimations.degreeVec(-67.5F, 0.0F, 0.0F),
+ AnimationChannel.Interpolations.LINEAR)))
+ .addAnimation("LeftArm",
+ 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(65.0F, 0.0F, 0.0F),
+ AnimationChannel.Interpolations.LINEAR)))
+ .build();
+
+ public static final AnimationDefinition JumpDown = AnimationDefinition.Builder.withLength(0.25F)
+ .addAnimation("root",
+ new AnimationChannel(AnimationChannel.Targets.POSITION,
+ new Keyframe(0.0F, KeyframeAnimations.posVec(0.0F, 5.0F, 0.0F),
+ AnimationChannel.Interpolations.LINEAR),
+ new Keyframe(0.25F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F),
+ AnimationChannel.Interpolations.LINEAR)))
+ .addAnimation("RightArm",
+ new AnimationChannel(AnimationChannel.Targets.ROTATION,
+ new Keyframe(0.0F, KeyframeAnimations.degreeVec(-67.5F, 0.0F, 0.0F),
+ AnimationChannel.Interpolations.LINEAR),
+ new Keyframe(0.25F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F),
+ AnimationChannel.Interpolations.LINEAR)))
+ .addAnimation("LeftArm",
+ new AnimationChannel(AnimationChannel.Targets.ROTATION,
+ new Keyframe(0.0F, KeyframeAnimations.degreeVec(65.0F, 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/models/mojmap-1.20.x/Modelpeguin.java b/models/mojmap-1.20.x/Modelpeguin.java
index 5099477..255c643 100644
--- a/models/mojmap-1.20.x/Modelpeguin.java
+++ b/models/mojmap-1.20.x/Modelpeguin.java
@@ -74,11 +74,5 @@ public class Modelpeguin extends EntityModel {
public void setupAnim(T entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw,
float headPitch) {
- this.LeftLeg.xRot = Mth.cos(limbSwing * 1.0F) * -1.0F * limbSwingAmount;
- this.RightArm.xRot = Mth.cos(limbSwing * 0.6662F + (float) Math.PI) * limbSwingAmount;
- this.Head.yRot = netHeadYaw / (180F / (float) Math.PI);
- this.Head.xRot = headPitch / (180F / (float) Math.PI);
- this.RightLeg.xRot = Mth.cos(limbSwing * 1.0F) * 1.0F * limbSwingAmount;
- this.LeftArm.xRot = Mth.cos(limbSwing * 0.6662F) * limbSwingAmount;
}
}
\ No newline at end of file
diff --git a/nims_random_bullshit.mcreator b/nims_random_bullshit.mcreator
index 3ef4c36..8012e21 100644
--- a/nims_random_bullshit.mcreator
+++ b/nims_random_bullshit.mcreator
@@ -1785,6 +1785,10 @@
{
"name": "entity",
"type": "entity"
+ },
+ {
+ "name": "world",
+ "type": "world"
}
]
},
@@ -1869,6 +1873,66 @@
]
},
"path": "~/Mailbox"
+ },
+ {
+ "name": "TuxPlaybackConditionJumpUp",
+ "type": "procedure",
+ "compiles": true,
+ "locked_code": false,
+ "registry_name": "tux_playback_condition_jump_up",
+ "metadata": {
+ "return_type": "logic",
+ "files": [
+ "src/main/java/net/mcreator/nimsrandombullshit/procedures/TuxPlaybackConditionJumpUpProcedure.java"
+ ],
+ "dependencies": [
+ {
+ "name": "entity",
+ "type": "entity"
+ }
+ ]
+ },
+ "path": "~/Tux"
+ },
+ {
+ "name": "TuxPlaybackConditionFalling",
+ "type": "procedure",
+ "compiles": true,
+ "locked_code": false,
+ "registry_name": "tux_playback_condition_falling",
+ "metadata": {
+ "return_type": "logic",
+ "files": [
+ "src/main/java/net/mcreator/nimsrandombullshit/procedures/TuxPlaybackConditionFallingProcedure.java"
+ ],
+ "dependencies": [
+ {
+ "name": "entity",
+ "type": "entity"
+ }
+ ]
+ },
+ "path": "~/Mailbox"
+ },
+ {
+ "name": "TuxPlaybackConditionWalking",
+ "type": "procedure",
+ "compiles": true,
+ "locked_code": false,
+ "registry_name": "tux_playback_condition_walking",
+ "metadata": {
+ "return_type": "logic",
+ "files": [
+ "src/main/java/net/mcreator/nimsrandombullshit/procedures/TuxPlaybackConditionWalkingProcedure.java"
+ ],
+ "dependencies": [
+ {
+ "name": "entity",
+ "type": "entity"
+ }
+ ]
+ },
+ "path": "~/Tux"
}
],
"variable_elements": [],
diff --git a/src/main/java/net/mcreator/nimsrandombullshit/client/model/Modelpeguin.java b/src/main/java/net/mcreator/nimsrandombullshit/client/model/Modelpeguin.java
index 88130b1..3acef49 100644
--- a/src/main/java/net/mcreator/nimsrandombullshit/client/model/Modelpeguin.java
+++ b/src/main/java/net/mcreator/nimsrandombullshit/client/model/Modelpeguin.java
@@ -1,7 +1,6 @@
package net.mcreator.nimsrandombullshit.client.model;
import net.minecraft.world.entity.Entity;
-import net.minecraft.util.Mth;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.client.model.geom.builders.PartDefinition;
import net.minecraft.client.model.geom.builders.MeshDefinition;
@@ -65,11 +64,5 @@ public class Modelpeguin extends EntityModel {
}
public void setupAnim(T entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
- this.LeftLeg.xRot = Mth.cos(limbSwing * 1.0F) * -1.0F * limbSwingAmount;
- this.RightArm.xRot = Mth.cos(limbSwing * 0.6662F + (float) Math.PI) * limbSwingAmount;
- this.Head.yRot = netHeadYaw / (180F / (float) Math.PI);
- this.Head.xRot = headPitch / (180F / (float) Math.PI);
- this.RightLeg.xRot = Mth.cos(limbSwing * 1.0F) * 1.0F * limbSwingAmount;
- this.LeftArm.xRot = Mth.cos(limbSwing * 0.6662F) * limbSwingAmount;
}
}
diff --git a/src/main/java/net/mcreator/nimsrandombullshit/client/model/animations/tuxModelAnimation.java b/src/main/java/net/mcreator/nimsrandombullshit/client/model/animations/tuxModelAnimation.java
new file mode 100644
index 0000000..1abfdb3
--- /dev/null
+++ b/src/main/java/net/mcreator/nimsrandombullshit/client/model/animations/tuxModelAnimation.java
@@ -0,0 +1,56 @@
+package net.mcreator.nimsrandombullshit.client.model.animations;
+
+import net.minecraft.client.animation.KeyframeAnimations;
+import net.minecraft.client.animation.Keyframe;
+import net.minecraft.client.animation.AnimationDefinition;
+import net.minecraft.client.animation.AnimationChannel;
+
+// Save this class in your mod and generate all required imports
+/**
+ * Made with Blockbench 5.0.7 Exported for Minecraft version 1.19 or later with
+ * Mojang mappings
+ *
+ * @author Author
+ */
+public class tuxModelAnimation {
+ public static final AnimationDefinition walking = AnimationDefinition.Builder.withLength(1.0F).looping()
+ .addAnimation("LeftLeg",
+ new AnimationChannel(AnimationChannel.Targets.ROTATION, new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
+ new Keyframe(0.75F, KeyframeAnimations.degreeVec(0.0F, -5.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), new Keyframe(1.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)))
+ .addAnimation("RightLeg",
+ 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(0.0F, 7.5F, 0.0F), AnimationChannel.Interpolations.LINEAR), new Keyframe(0.5F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)))
+ .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.25F, KeyframeAnimations.degreeVec(-27.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.75F, KeyframeAnimations.degreeVec(-27.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), new Keyframe(1.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)))
+ .addAnimation("LeftArm",
+ 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(22.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.75F, KeyframeAnimations.degreeVec(22.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR), new Keyframe(1.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)))
+ .addAnimation("BodySegment",
+ 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(0.0F, 12.5F, 0.0F), AnimationChannel.Interpolations.LINEAR), new Keyframe(0.75F, KeyframeAnimations.degreeVec(0.0F, -12.5F, 0.0F), AnimationChannel.Interpolations.LINEAR),
+ new Keyframe(1.0F, KeyframeAnimations.degreeVec(0.0F, 0.83F, 0.0F), AnimationChannel.Interpolations.LINEAR)))
+ .build();
+ public static final AnimationDefinition jumpUp = AnimationDefinition.Builder.withLength(0.25F)
+ .addAnimation("root",
+ new AnimationChannel(AnimationChannel.Targets.POSITION, new Keyframe(0.0F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
+ new Keyframe(0.25F, KeyframeAnimations.posVec(0.0F, 5.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)))
+ .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.25F, KeyframeAnimations.degreeVec(-67.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)))
+ .addAnimation("LeftArm", 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(65.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)))
+ .build();
+ public static final AnimationDefinition JumpDown = AnimationDefinition.Builder.withLength(0.25F)
+ .addAnimation("root",
+ new AnimationChannel(AnimationChannel.Targets.POSITION, new Keyframe(0.0F, KeyframeAnimations.posVec(0.0F, 5.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
+ new Keyframe(0.25F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)))
+ .addAnimation("RightArm",
+ new AnimationChannel(AnimationChannel.Targets.ROTATION, new Keyframe(0.0F, KeyframeAnimations.degreeVec(-67.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
+ new Keyframe(0.25F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)))
+ .addAnimation("LeftArm", new AnimationChannel(AnimationChannel.Targets.ROTATION, new Keyframe(0.0F, KeyframeAnimations.degreeVec(65.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
+ new Keyframe(0.25F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)))
+ .build();
+}
diff --git a/src/main/java/net/mcreator/nimsrandombullshit/client/renderer/TuxRenderer.java b/src/main/java/net/mcreator/nimsrandombullshit/client/renderer/TuxRenderer.java
index b1058e1..d953e83 100644
--- a/src/main/java/net/mcreator/nimsrandombullshit/client/renderer/TuxRenderer.java
+++ b/src/main/java/net/mcreator/nimsrandombullshit/client/renderer/TuxRenderer.java
@@ -4,15 +4,19 @@ package net.mcreator.nimsrandombullshit.client.renderer;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
+import net.minecraft.client.model.geom.ModelPart;
+import net.minecraft.client.model.HierarchicalModel;
+import net.mcreator.nimsrandombullshit.procedures.TuxPlaybackConditionWalkingProcedure;
import net.mcreator.nimsrandombullshit.entity.TuxEntity;
+import net.mcreator.nimsrandombullshit.client.model.animations.tuxModelAnimation;
import net.mcreator.nimsrandombullshit.client.model.Modelpeguin;
import com.mojang.blaze3d.vertex.PoseStack;
public class TuxRenderer extends MobRenderer> {
public TuxRenderer(EntityRendererProvider.Context context) {
- super(context, new Modelpeguin(context.bakeLayer(Modelpeguin.LAYER_LOCATION)), 0.5f);
+ super(context, new AnimatedModel(context.bakeLayer(Modelpeguin.LAYER_LOCATION)), 0.5f);
}
@Override
@@ -24,4 +28,34 @@ public class TuxRenderer extends MobRenderer>
public ResourceLocation getTextureLocation(TuxEntity entity) {
return new ResourceLocation("nims_random_bullshit:textures/entities/tux.png");
}
+
+ private static final class AnimatedModel extends Modelpeguin {
+ private final ModelPart root;
+ private final HierarchicalModel animator = new HierarchicalModel() {
+ @Override
+ public ModelPart root() {
+ return root;
+ }
+
+ @Override
+ public void setupAnim(TuxEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
+ this.root().getAllParts().forEach(ModelPart::resetPose);
+ if (TuxPlaybackConditionWalkingProcedure.execute(entity))
+ this.animateWalk(tuxModelAnimation.walking, limbSwing, limbSwingAmount, 1f, 1f);
+ this.animate(entity.animationState1, tuxModelAnimation.jumpUp, ageInTicks, 1f);
+ this.animate(entity.animationState2, tuxModelAnimation.JumpDown, ageInTicks, 1f);
+ }
+ };
+
+ public AnimatedModel(ModelPart root) {
+ super(root);
+ this.root = root;
+ }
+
+ @Override
+ public void setupAnim(TuxEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
+ animator.setupAnim(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch);
+ super.setupAnim(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch);
+ }
+ }
}
diff --git a/src/main/java/net/mcreator/nimsrandombullshit/entity/TuxEntity.java b/src/main/java/net/mcreator/nimsrandombullshit/entity/TuxEntity.java
index b35049d..e39bfd4 100644
--- a/src/main/java/net/mcreator/nimsrandombullshit/entity/TuxEntity.java
+++ b/src/main/java/net/mcreator/nimsrandombullshit/entity/TuxEntity.java
@@ -23,6 +23,7 @@ import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.EntityDimensions;
import net.minecraft.world.entity.AreaEffectCloud;
+import net.minecraft.world.entity.AnimationState;
import net.minecraft.world.damagesource.DamageTypes;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.sounds.SoundEvent;
@@ -33,9 +34,13 @@ import net.minecraft.network.protocol.game.ClientGamePacketListener;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.chat.Component;
+import net.mcreator.nimsrandombullshit.procedures.TuxPlaybackConditionJumpUpProcedure;
+import net.mcreator.nimsrandombullshit.procedures.TuxPlaybackConditionFallingProcedure;
import net.mcreator.nimsrandombullshit.init.NimsRandomBullshitModEntities;
public class TuxEntity extends Monster {
+ public final AnimationState animationState1 = new AnimationState();
+ public final AnimationState animationState2 = new AnimationState();
private final ServerBossEvent bossInfo = new ServerBossEvent(this.getDisplayName(), ServerBossEvent.BossBarColor.BLUE, ServerBossEvent.BossBarOverlay.PROGRESS);
public TuxEntity(PlayMessages.SpawnEntity packet, Level world) {
@@ -108,6 +113,15 @@ public class TuxEntity extends Monster {
return super.hurt(damagesource, amount);
}
+ @Override
+ public void tick() {
+ super.tick();
+ if (this.level().isClientSide()) {
+ this.animationState1.animateWhen(TuxPlaybackConditionJumpUpProcedure.execute(this), this.tickCount);
+ this.animationState2.animateWhen(TuxPlaybackConditionFallingProcedure.execute(this), this.tickCount);
+ }
+ }
+
@Override
public boolean canChangeDimensions() {
return false;
diff --git a/src/main/java/net/mcreator/nimsrandombullshit/network/LabelCopyMachineGUIButtonMessage.java b/src/main/java/net/mcreator/nimsrandombullshit/network/LabelCopyMachineGUIButtonMessage.java
index eaf0f46..5efd065 100644
--- a/src/main/java/net/mcreator/nimsrandombullshit/network/LabelCopyMachineGUIButtonMessage.java
+++ b/src/main/java/net/mcreator/nimsrandombullshit/network/LabelCopyMachineGUIButtonMessage.java
@@ -64,7 +64,7 @@ public class LabelCopyMachineGUIButtonMessage {
return;
if (buttonID == 0) {
- LabelCopyMachineCopyButtonPressedProcedure.execute(entity);
+ LabelCopyMachineCopyButtonPressedProcedure.execute(world, entity);
}
}
diff --git a/src/main/java/net/mcreator/nimsrandombullshit/procedures/LabelCopyMachineCopyButtonPressedProcedure.java b/src/main/java/net/mcreator/nimsrandombullshit/procedures/LabelCopyMachineCopyButtonPressedProcedure.java
index 7b61e28..3c8de17 100644
--- a/src/main/java/net/mcreator/nimsrandombullshit/procedures/LabelCopyMachineCopyButtonPressedProcedure.java
+++ b/src/main/java/net/mcreator/nimsrandombullshit/procedures/LabelCopyMachineCopyButtonPressedProcedure.java
@@ -1,5 +1,6 @@
package net.mcreator.nimsrandombullshit.procedures;
+import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.inventory.Slot;
import net.minecraft.world.entity.player.Player;
@@ -11,73 +12,75 @@ import java.util.function.Supplier;
import java.util.Map;
public class LabelCopyMachineCopyButtonPressedProcedure {
- public static void execute(Entity entity) {
+ public static void execute(LevelAccessor world, Entity entity) {
if (entity == null)
return;
- if ((entity instanceof Player _plrSlotItem && _plrSlotItem.containerMenu instanceof Supplier _splr && _splr.get() instanceof Map _slt ? ((Slot) _slt.get(0)).getItem() : ItemStack.EMPTY).getItem() == NimsRandomBullshitModItems.SHIPPING_LABEL
- .get() && new Object() {
- public int getAmount(int sltid) {
- if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
- ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
- if (stack != null)
- return stack.getCount();
+ if (!world.isClientSide()) {
+ if ((entity instanceof Player _plrSlotItem && _plrSlotItem.containerMenu instanceof Supplier _splr && _splr.get() instanceof Map _slt ? ((Slot) _slt.get(0)).getItem() : ItemStack.EMPTY)
+ .getItem() == NimsRandomBullshitModItems.SHIPPING_LABEL.get() && new Object() {
+ public int getAmount(int sltid) {
+ if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
+ ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
+ if (stack != null)
+ return stack.getCount();
+ }
+ return 0;
}
- return 0;
- }
- }.getAmount(1) > 0 && new Object() {
- public int getAmount(int sltid) {
- if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
- ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
- if (stack != null)
- return stack.getCount();
+ }.getAmount(1) > 0 && new Object() {
+ public int getAmount(int sltid) {
+ if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
+ ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
+ if (stack != null)
+ return stack.getCount();
+ }
+ return 0;
}
- return 0;
- }
- }.getAmount(2) > 0) {
- if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
- ItemStack _setstack = (entity instanceof Player _plrSlotItem && _plrSlotItem.containerMenu instanceof Supplier _splr && _splr.get() instanceof Map _slt ? ((Slot) _slt.get(1)).getItem() : ItemStack.EMPTY).copy();
- _setstack.setCount((int) (new Object() {
- public int getAmount(int sltid) {
- if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
- ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
- if (stack != null)
- return stack.getCount();
+ }.getAmount(2) > 0) {
+ if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
+ ItemStack _setstack = (entity instanceof Player _plrSlotItem && _plrSlotItem.containerMenu instanceof Supplier _splr && _splr.get() instanceof Map _slt ? ((Slot) _slt.get(1)).getItem() : ItemStack.EMPTY).copy();
+ _setstack.setCount((int) (new Object() {
+ public int getAmount(int sltid) {
+ if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
+ ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
+ if (stack != null)
+ return stack.getCount();
+ }
+ return 0;
}
- return 0;
- }
- }.getAmount(1) - 1));
- ((Slot) _slots.get(1)).set(_setstack);
- _player.containerMenu.broadcastChanges();
- }
- if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
- ItemStack _setstack = (entity instanceof Player _plrSlotItem && _plrSlotItem.containerMenu instanceof Supplier _splr && _splr.get() instanceof Map _slt ? ((Slot) _slt.get(2)).getItem() : ItemStack.EMPTY).copy();
- _setstack.setCount((int) (new Object() {
- public int getAmount(int sltid) {
- if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
- ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
- if (stack != null)
- return stack.getCount();
+ }.getAmount(1) - 1));
+ ((Slot) _slots.get(1)).set(_setstack);
+ _player.containerMenu.broadcastChanges();
+ }
+ if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
+ ItemStack _setstack = (entity instanceof Player _plrSlotItem && _plrSlotItem.containerMenu instanceof Supplier _splr && _splr.get() instanceof Map _slt ? ((Slot) _slt.get(2)).getItem() : ItemStack.EMPTY).copy();
+ _setstack.setCount((int) (new Object() {
+ public int getAmount(int sltid) {
+ if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
+ ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
+ if (stack != null)
+ return stack.getCount();
+ }
+ return 0;
}
- return 0;
- }
- }.getAmount(2) - 1));
- ((Slot) _slots.get(2)).set(_setstack);
- _player.containerMenu.broadcastChanges();
- }
- if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
- ItemStack _setstack = (entity instanceof Player _plrSlotItem && _plrSlotItem.containerMenu instanceof Supplier _splr && _splr.get() instanceof Map _slt ? ((Slot) _slt.get(0)).getItem() : ItemStack.EMPTY).copy();
- _setstack.setCount((int) (new Object() {
- public int getAmount(int sltid) {
- if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
- ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
- if (stack != null)
- return stack.getCount();
+ }.getAmount(2) - 1));
+ ((Slot) _slots.get(2)).set(_setstack);
+ _player.containerMenu.broadcastChanges();
+ }
+ if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
+ ItemStack _setstack = (entity instanceof Player _plrSlotItem && _plrSlotItem.containerMenu instanceof Supplier _splr && _splr.get() instanceof Map _slt ? ((Slot) _slt.get(0)).getItem() : ItemStack.EMPTY).copy();
+ _setstack.setCount((int) (new Object() {
+ public int getAmount(int sltid) {
+ if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
+ ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
+ if (stack != null)
+ return stack.getCount();
+ }
+ return 0;
}
- return 0;
- }
- }.getAmount(3) + 1));
- ((Slot) _slots.get(3)).set(_setstack);
- _player.containerMenu.broadcastChanges();
+ }.getAmount(3) + 1));
+ ((Slot) _slots.get(3)).set(_setstack);
+ _player.containerMenu.broadcastChanges();
+ }
}
}
}
diff --git a/src/main/java/net/mcreator/nimsrandombullshit/procedures/TuxPlaybackConditionFallingProcedure.java b/src/main/java/net/mcreator/nimsrandombullshit/procedures/TuxPlaybackConditionFallingProcedure.java
new file mode 100644
index 0000000..05f6803
--- /dev/null
+++ b/src/main/java/net/mcreator/nimsrandombullshit/procedures/TuxPlaybackConditionFallingProcedure.java
@@ -0,0 +1,14 @@
+package net.mcreator.nimsrandombullshit.procedures;
+
+import net.minecraft.world.entity.Entity;
+
+public class TuxPlaybackConditionFallingProcedure {
+ public static boolean execute(Entity entity) {
+ if (entity == null)
+ return false;
+ if (entity.getDeltaMovement().y() < 0) {
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/src/main/java/net/mcreator/nimsrandombullshit/procedures/TuxPlaybackConditionJumpUpProcedure.java b/src/main/java/net/mcreator/nimsrandombullshit/procedures/TuxPlaybackConditionJumpUpProcedure.java
new file mode 100644
index 0000000..7b7b0d5
--- /dev/null
+++ b/src/main/java/net/mcreator/nimsrandombullshit/procedures/TuxPlaybackConditionJumpUpProcedure.java
@@ -0,0 +1,14 @@
+package net.mcreator.nimsrandombullshit.procedures;
+
+import net.minecraft.world.entity.Entity;
+
+public class TuxPlaybackConditionJumpUpProcedure {
+ public static boolean execute(Entity entity) {
+ if (entity == null)
+ return false;
+ if (entity.getDeltaMovement().y() > 0) {
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/src/main/java/net/mcreator/nimsrandombullshit/procedures/TuxPlaybackConditionWalkingProcedure.java b/src/main/java/net/mcreator/nimsrandombullshit/procedures/TuxPlaybackConditionWalkingProcedure.java
new file mode 100644
index 0000000..1cc4271
--- /dev/null
+++ b/src/main/java/net/mcreator/nimsrandombullshit/procedures/TuxPlaybackConditionWalkingProcedure.java
@@ -0,0 +1,14 @@
+package net.mcreator.nimsrandombullshit.procedures;
+
+import net.minecraft.world.entity.Entity;
+
+public class TuxPlaybackConditionWalkingProcedure {
+ public static boolean execute(Entity entity) {
+ if (entity == null)
+ return false;
+ if (entity.getDeltaMovement().x() > 0 || entity.getDeltaMovement().z() > 0) {
+ return true;
+ }
+ return false;
+ }
+}