nevermind

This commit is contained in:
GearShocky 2025-04-02 14:31:05 +05:00
parent 863d52230e
commit c73729f8e7
27 changed files with 553 additions and 58 deletions

1
src/bb/dronel.bbmodel Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,55 @@
package ru.dbotthepony.mc.otm.client.animation;
import net.minecraft.client.animation.AnimationChannel;
import net.minecraft.client.animation.AnimationDefinition;
import net.minecraft.client.animation.Keyframe;
import net.minecraft.client.animation.KeyframeAnimations;
public class DroneAnimation {
public static final AnimationDefinition LOOP = AnimationDefinition.Builder.withLength(3.0F).looping()
.addAnimation("eye", new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.32F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.4F, KeyframeAnimations.posVec(0.0F, 0.2F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.52F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.08F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.16F, KeyframeAnimations.posVec(-0.3F, -0.3F, 0.3F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.28F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.92F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(2.0F, KeyframeAnimations.posVec(0.0F, 0.0F, -0.4F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(2.12F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(2.72F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(2.8F, KeyframeAnimations.posVec(0.3F, 0.3F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(2.92F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("gyroL", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(3.0F, KeyframeAnimations.degreeVec(720.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("gyroR", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(3.0F, KeyframeAnimations.degreeVec(720.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("antennaL", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.CATMULLROM),
new Keyframe(1.52F, KeyframeAnimations.degreeVec(5.5795F, 4.4039F, 2.4381F), AnimationChannel.Interpolations.CATMULLROM),
new Keyframe(3.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.CATMULLROM)
))
.addAnimation("antennaR", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.CATMULLROM),
new Keyframe(1.52F, KeyframeAnimations.degreeVec(5.5795F, -4.4039F, -2.4381F), AnimationChannel.Interpolations.CATMULLROM),
new Keyframe(3.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.CATMULLROM)
))
.addAnimation("finL", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.CATMULLROM),
new Keyframe(1.52F, KeyframeAnimations.degreeVec(0.0F, 20.0F, 0.0F), AnimationChannel.Interpolations.CATMULLROM),
new Keyframe(3.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.CATMULLROM)
))
.addAnimation("finR", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.CATMULLROM),
new Keyframe(1.52F, KeyframeAnimations.degreeVec(0.0F, -20.0F, 0.0F), AnimationChannel.Interpolations.CATMULLROM),
new Keyframe(3.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.CATMULLROM)
))
.build();
}

View File

@ -6,29 +6,89 @@ import net.minecraft.client.animation.Keyframe;
import net.minecraft.client.animation.KeyframeAnimations;
public class EnforcerAnimation {
public static final AnimationDefinition CHARGE = AnimationDefinition.Builder.withLength(0.12F).looping()
public static final AnimationDefinition CHARGE = AnimationDefinition.Builder.withLength(0.6F).looping()
.addAnimation("root", new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(0.0F, -1.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.posVec(0.0F, -1.1F, 0.0F), AnimationChannel.Interpolations.LINEAR)
new Keyframe(0.12F, KeyframeAnimations.posVec(0.0F, -1.1F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.24F, KeyframeAnimations.posVec(0.0F, -1.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.36F, KeyframeAnimations.posVec(0.0F, -1.1F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.posVec(0.0F, -1.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.6F, KeyframeAnimations.posVec(0.0F, -1.1F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("Body", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(7.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("leg_FL", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(-0.0089F, 24.7408F, -0.0342F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.degreeVec(-0.8438F, 24.7408F, -0.0342F), AnimationChannel.Interpolations.LINEAR)
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.3977F, 21.8144F, -4.1091F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.degreeVec(-0.4394F, 21.7555F, -4.066F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.24F, KeyframeAnimations.degreeVec(0.3977F, 21.8144F, -4.1091F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.36F, KeyframeAnimations.degreeVec(-0.4394F, 21.7555F, -4.066F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.degreeVec(0.3977F, 21.8144F, -4.1091F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.6F, KeyframeAnimations.degreeVec(-0.4394F, 21.7555F, -4.066F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("leg_FR", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(-0.0452F, -24.7102F, -0.3574F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.degreeVec(-0.8765F, -24.7156F, -0.3213F), AnimationChannel.Interpolations.LINEAR)
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.3635F, -21.7813F, 3.7159F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.degreeVec(-0.4705F, -21.7281F, 3.709F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.24F, KeyframeAnimations.degreeVec(0.3635F, -21.7813F, 3.7159F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.36F, KeyframeAnimations.degreeVec(-0.4705F, -21.7281F, 3.709F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.degreeVec(0.3635F, -21.7813F, 3.7159F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.6F, KeyframeAnimations.degreeVec(-0.4705F, -21.7281F, 3.709F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("leg_BR", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0089F, 24.7408F, 0.0342F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.degreeVec(0.9506F, 24.7408F, 0.0342F), AnimationChannel.Interpolations.LINEAR)
new Keyframe(0.0F, KeyframeAnimations.degreeVec(-0.3977F, 21.8144F, 4.1091F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.degreeVec(0.5465F, 21.748F, 4.0604F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.24F, KeyframeAnimations.degreeVec(-0.3977F, 21.8144F, 4.1091F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.36F, KeyframeAnimations.degreeVec(0.5465F, 21.748F, 4.0604F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.degreeVec(-0.3977F, 21.8144F, 4.1091F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.6F, KeyframeAnimations.degreeVec(0.5465F, 21.748F, 4.0604F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("leg_BL", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0089F, -24.7408F, -0.0342F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.degreeVec(0.9506F, -24.7408F, -0.0342F), AnimationChannel.Interpolations.LINEAR)
new Keyframe(0.0F, KeyframeAnimations.degreeVec(-0.3977F, -21.8144F, -4.1091F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.degreeVec(0.5465F, -21.748F, -4.0604F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.24F, KeyframeAnimations.degreeVec(-0.3977F, -21.8144F, -4.1091F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.36F, KeyframeAnimations.degreeVec(0.5465F, -21.748F, -4.0604F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.degreeVec(-0.3977F, -21.8144F, -4.1091F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.6F, KeyframeAnimations.degreeVec(0.5465F, -21.748F, -4.0604F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("joint0_FL", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(-22.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("joint1_FL", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(22.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("joint0_FR", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(-22.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("joint1_FR", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(22.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("joint0_BL", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(22.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("joint1_BL", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(22.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("joint0_BR", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(22.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("joint1_BR", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(22.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("wheelFR", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.6F, KeyframeAnimations.degreeVec(360.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("wheelFL", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.6F, KeyframeAnimations.degreeVec(355.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("wheelBL", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.6F, KeyframeAnimations.degreeVec(-360.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("wheelBR", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.6F, KeyframeAnimations.degreeVec(-360.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.build();

View File

@ -0,0 +1,95 @@
package ru.dbotthepony.mc.otm.client.model.entity;
import net.minecraft.client.model.HierarchicalModel;
import net.minecraft.client.model.geom.ModelLayerLocation;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.client.model.geom.PartPose;
import net.minecraft.client.model.geom.builders.*;
import net.neoforged.neoforge.client.event.EntityRenderersEvent;
import org.jetbrains.annotations.NotNull;
import ru.dbotthepony.mc.otm.client.animation.BreadMonsterAnimation;
import ru.dbotthepony.mc.otm.client.animation.DroneAnimation;
import ru.dbotthepony.mc.otm.entity.BreadMonster;
import ru.dbotthepony.mc.otm.entity.Drone;
import ru.dbotthepony.mc.otm.registry.MNames;
import static ru.dbotthepony.mc.otm.OverdriveThatMatters.loc;
public class DroneModel {
public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(loc(MNames.DRONE), "main");
private static HierarchicalModel<Drone> model;
private static LayerDefinition def;
public static HierarchicalModel<Drone> getModel() {
if (def == null) {
def = createBodyLayer();
}
if (model == null) {
return model = new DroneModel.DroneHierarchicalModel<>(def.bakeRoot());
}
return model;
}
public static LayerDefinition createBodyLayer() {
MeshDefinition meshdefinition = new MeshDefinition();
PartDefinition partdefinition = meshdefinition.getRoot();
PartDefinition root = partdefinition.addOrReplaceChild("root", CubeListBuilder.create(), PartPose.offset(0.0F, 24.0F, 0.0F));
PartDefinition body = root.addOrReplaceChild("body", CubeListBuilder.create().texOffs(0, 21).addBox(-3.0F, -3.0F, 0.0F, 6.0F, 6.0F, 6.0F, new CubeDeformation(0.0F))
.texOffs(0, 0).addBox(-6.0F, -6.0F, -8.0F, 12.0F, 12.0F, 9.0F, new CubeDeformation(0.0F))
.texOffs(24, 21).addBox(-4.0F, -4.0F, -10.0F, 8.0F, 8.0F, 2.0F, new CubeDeformation(0.0F))
.texOffs(13, 43).addBox(-5.0F, -5.0F, -6.0F, 10.0F, 10.0F, 11.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -8.0F, 1.0F));
PartDefinition eye = body.addOrReplaceChild("eye", CubeListBuilder.create().texOffs(0, 33).addBox(-3.0F, -3.0F, -3.0F, 6.0F, 6.0F, 6.0F, new CubeDeformation(-0.2F)), PartPose.offsetAndRotation(0.0F, 0.0F, -4.5F, 0.0F, 0.0F, 0.0F));
PartDefinition gyroL = body.addOrReplaceChild("gyroL", CubeListBuilder.create().texOffs(40, 31).addBox(-1.0F, -3.0F, -3.0F, 2.0F, 6.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offset(4.0F, 0.0F, 0.0F));
PartDefinition gyroR = body.addOrReplaceChild("gyroR", CubeListBuilder.create().texOffs(24, 31).addBox(-1.0F, -3.0F, -3.0F, 2.0F, 6.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offset(-4.0F, 0.0F, 0.0F));
PartDefinition antennaL = body.addOrReplaceChild("antennaL", CubeListBuilder.create().texOffs(46, -2).addBox(0.0F, -22.0F, -1.0F, 0.0F, 23.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(4.0F, -2.0F, 3.0F, -1.1695F, 0.2013F, 0.0846F));
PartDefinition antennaR = body.addOrReplaceChild("antennaR", CubeListBuilder.create().texOffs(42, -2).addBox(0.0F, -22.0F, -1.0F, 0.0F, 23.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-4.0F, -2.0F, 3.0F, -1.1695F, -0.2013F, -0.0846F));
PartDefinition finL = body.addOrReplaceChild("finL", CubeListBuilder.create().texOffs(39, 0).addBox(-1.0F, 0.0F, -1.0F, 5.0F, 0.0F, 11.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(5.0F, 4.5F, 4.0F, 0.2849F, 0.274F, 0.8249F));
PartDefinition finR = body.addOrReplaceChild("finR", CubeListBuilder.create().texOffs(39, 11).addBox(-4.0F, 0.0F, -1.0F, 5.0F, 0.0F, 11.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-5.0F, 4.5F, 4.0F, 0.2849F, -0.274F, -0.8249F));
model = null;
return def = LayerDefinition.create(meshdefinition, 64, 64);
}
private static class DroneHierarchicalModel<T extends Drone> extends HierarchicalModel<T> {
private final ModelPart root;
private final ModelPart body;
private final ModelPart eye;
public DroneHierarchicalModel(ModelPart root) {
this.root = root.getChild("root");
this.body = this.root.getChild("body");
this.eye = this.body.getChild("eye");
}
@Override
public void setupAnim(@NotNull T entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
this.root().getAllParts().forEach(ModelPart::resetPose);
this.body.getChild("eye").yRot = netHeadYaw * ((float) Math.PI / 180F);
this.body.getChild("eye").xRot = headPitch * ((float) Math.PI / 180F);
this.animate(entity.getIdleState(), DroneAnimation.LOOP, ageInTicks, 1.0F);
}
@Override
public @NotNull ModelPart root() {
return this.root;
}
}
public static void register(EntityRenderersEvent.RegisterLayerDefinitions event) {
event.registerLayerDefinition(LAYER_LOCATION, DroneModel::createBodyLayer);
}
}

View File

@ -37,47 +37,106 @@ public class EnforcerModel {
MeshDefinition meshdefinition = new MeshDefinition();
PartDefinition partdefinition = meshdefinition.getRoot();
PartDefinition root = partdefinition.addOrReplaceChild("root", CubeListBuilder.create(), PartPose.offset(0.0F, 24.0F, 0.0F));
PartDefinition root = partdefinition.addOrReplaceChild("root", CubeListBuilder.create(), PartPose.offset(0.0F, 18.0F, 0.0F));
PartDefinition base = root.addOrReplaceChild("base", CubeListBuilder.create().texOffs(140, 104).addBox(-8.0F, -4.0F, -7.0F, 16.0F, 5.0F, 14.0F, new CubeDeformation(0.0F))
.texOffs(92, 33).addBox(-5.0F, -2.0F, -10.0F, 10.0F, 14.0F, 20.0F, new CubeDeformation(0.0F))
.texOffs(70, 0).addBox(-8.0F, -1.0F, -11.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F))
.texOffs(70, 5).addBox(5.0F, -1.0F, -11.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -22.0F, 0.0F));
PartDefinition base = root.addOrReplaceChild("base", CubeListBuilder.create().texOffs(132, 1).addBox(-8.0F, -2.0F, -7.0F, 16.0F, 5.0F, 14.0F, new CubeDeformation(0.0F))
.texOffs(92, 0).addBox(-5.0F, 0.0F, -10.0F, 10.0F, 14.0F, 20.0F, new CubeDeformation(0.0F))
.texOffs(70, 0).addBox(-7.0F, 1.0F, -11.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F))
.texOffs(70, 5).addBox(4.0F, 1.0F, -11.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F))
.texOffs(152, 73).addBox(-6.0F, -5.0F, -6.0F, 12.0F, 3.0F, 12.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -22.0F, 0.0F));
PartDefinition Body = base.addOrReplaceChild("Body", CubeListBuilder.create().texOffs(70, 0).addBox(-9.0F, -18.4F, -8.1F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F))
.texOffs(70, 5).addBox(-5.0F, -18.4F, -8.1F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F))
.texOffs(80, 76).addBox(-11.0F, -17.4F, 10.9F, 22.0F, 14.0F, 14.0F, new CubeDeformation(0.0F))
.texOffs(0, 0).addBox(-12.0F, -15.4F, -11.1F, 24.0F, 16.0F, 22.0F, new CubeDeformation(0.0F))
.texOffs(0, 38).addBox(-12.0F, -15.4F, -11.1F, 24.0F, 16.0F, 22.0F, new CubeDeformation(0.5F))
.texOffs(122, 168).addBox(12.0F, -13.4F, -6.1F, 2.0F, 12.0F, 12.0F, new CubeDeformation(0.0F))
.texOffs(150, 168).addBox(-14.0F, -13.4F, -6.1F, 2.0F, 12.0F, 12.0F, new CubeDeformation(0.0F))
.texOffs(140, 123).addBox(-7.0F, -2.0F, 10.0F, 15.0F, 5.0F, 5.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -4.6F, 0.1F));
PartDefinition Body = base.addOrReplaceChild("Body", CubeListBuilder.create().texOffs(70, 0).addBox(-9.0F, -16.4F, -8.1F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F))
.texOffs(70, 5).addBox(-5.0F, -16.4F, -8.1F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F))
.texOffs(92, 34).addBox(-11.0F, -15.4F, 10.9F, 22.0F, 14.0F, 14.0F, new CubeDeformation(0.0F))
.texOffs(0, 0).addBox(-12.0F, -13.4F, -11.1F, 24.0F, 16.0F, 22.0F, new CubeDeformation(0.0F))
.texOffs(0, 38).addBox(-12.0F, -13.4F, -11.1F, 24.0F, 16.0F, 22.0F, new CubeDeformation(0.5F))
.texOffs(192, 49).addBox(12.0F, -11.4F, -6.1F, 2.0F, 12.0F, 12.0F, new CubeDeformation(0.0F))
.texOffs(164, 49).addBox(-14.0F, -11.4F, -6.1F, 2.0F, 12.0F, 12.0F, new CubeDeformation(0.0F))
.texOffs(92, 62).addBox(-7.0F, 0.0F, 10.0F, 15.0F, 5.0F, 5.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -6.6F, 0.1F));
PartDefinition cube_r1 = Body.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(178, 168).addBox(0.0F, -18.5F, -1.0F, 0.0F, 19.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(8.0F, -14.9F, 7.9F, -0.1745F, 0.0F, 0.0F));
PartDefinition cube_r1 = Body.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(80, -2).addBox(0.0F, -18.5F, -1.0F, 0.0F, 19.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(8.0F, -12.9F, 7.9F, -0.1745F, 0.0F, 0.0F));
PartDefinition Head = Body.addOrReplaceChild("Head", CubeListBuilder.create().texOffs(92, 67).addBox(-4.0F, -3.0F, -1.0F, 7.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offset(-4.0F, 1.6F, -11.1F));
PartDefinition Head = Body.addOrReplaceChild("Head", CubeListBuilder.create().texOffs(0, 0).addBox(-4.0F, -1.0F, -1.0F, 7.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offset(-4.0F, 1.6F, -11.1F));
PartDefinition rocket = Body.addOrReplaceChild("rocket", CubeListBuilder.create().texOffs(0, 76).addBox(-12.0F, -10.5F, -14.0F, 12.0F, 21.0F, 28.0F, new CubeDeformation(0.0F)), PartPose.offset(-14.0F, -7.9F, -0.1F));
PartDefinition rocket = Body.addOrReplaceChild("rocket", CubeListBuilder.create().texOffs(164, 0).addBox(-13.0F, -8.5F, -14.0F, 13.0F, 21.0F, 28.0F, new CubeDeformation(0.0F)), PartPose.offset(-14.0F, -7.9F, -0.1F));
PartDefinition flamethrower = Body.addOrReplaceChild("flamethrower", CubeListBuilder.create().texOffs(44, 168).addBox(-0.25F, -5.2654F, -4.9728F, 10.0F, 10.0F, 10.0F, new CubeDeformation(0.0F))
.texOffs(92, 0).addBox(2.75F, 1.7346F, -13.9728F, 10.0F, 10.0F, 23.0F, new CubeDeformation(0.0F))
.texOffs(84, 168).addBox(4.75F, 3.7346F, -26.9728F, 6.0F, 6.0F, 13.0F, new CubeDeformation(0.0F)), PartPose.offset(14.25F, -7.1346F, -0.1272F));
PartDefinition gun = Body.addOrReplaceChild("gun", CubeListBuilder.create().texOffs(185, 73).addBox(2.0F, -6.0F, -7.0F, 7.0F, 14.0F, 15.0F, new CubeDeformation(0.0F))
.texOffs(187, 102).addBox(1.0F, -7.0F, -6.0F, 9.0F, 16.0F, 13.0F, new CubeDeformation(-0.6F))
.texOffs(218, 170).addBox(2.5F, 4.0F, -1.0F, 6.0F, 6.0F, 13.0F, new CubeDeformation(0.0F))
.texOffs(218, 189).addBox(2.5F, -8.0F, -1.0F, 6.0F, 6.0F, 13.0F, new CubeDeformation(0.0F))
.texOffs(184, 170).addBox(3.5F, -6.0F, -20.0F, 4.0F, 6.0F, 13.0F, new CubeDeformation(0.0F))
.texOffs(220, 56).addBox(2.5F, -2.0F, -17.0F, 6.0F, 6.0F, 11.0F, new CubeDeformation(0.0F))
.texOffs(184, 189).addBox(3.5F, 2.0F, -20.0F, 4.0F, 6.0F, 13.0F, new CubeDeformation(0.0F))
.texOffs(80, 160).addBox(-6.0F, -5.0F, -5.0F, 10.0F, 10.0F, 10.0F, new CubeDeformation(0.0F)), PartPose.offset(14.0F, -5.5F, 0.0F));
PartDefinition cube_r2 = flamethrower.addOrReplaceChild("cube_r2", CubeListBuilder.create().texOffs(152, 33).addBox(-4.0F, -4.0F, 0.5F, 8.0F, 8.0F, 15.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(7.75F, 5.7346F, 6.5272F, 0.5236F, 0.0F, 0.0F));
PartDefinition leg_FL = root.addOrReplaceChild("leg_FL", CubeListBuilder.create().texOffs(45, 76).addBox(-3.561F, -4.2978F, -11.0972F, 7.0F, 9.0F, 13.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(9.5F, -15.5F, -5.5F, 0.9425F, -0.5061F, -0.0349F));
PartDefinition leg_FL = root.addOrReplaceChild("leg_FL", CubeListBuilder.create().texOffs(80, 104).addBox(-5.5F, -2.5F, -24.5F, 11.0F, 13.0F, 19.0F, new CubeDeformation(0.0F))
.texOffs(158, 0).addBox(-4.5F, -5.5F, -9.5F, 9.0F, 11.0F, 13.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(9.5F, -13.5F, -6.5F, 0.1571F, -0.5061F, -0.0349F));
PartDefinition joint0_FL = leg_FL.addOrReplaceChild("joint0_FL", CubeListBuilder.create().texOffs(82, 233).addBox(-3.061F, -9.3731F, -7.1617F, 6.0F, 15.0F, 8.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -3.0F, -8.0F, -0.3054F, 0.0F, 0.0F));
PartDefinition leg_FR = root.addOrReplaceChild("leg_FR", CubeListBuilder.create().texOffs(0, 125).addBox(-5.5F, -2.5F, -24.5F, 11.0F, 13.0F, 19.0F, new CubeDeformation(0.0F))
.texOffs(152, 80).addBox(-4.5F, -5.5F, -9.5F, 9.0F, 11.0F, 13.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-9.5F, -13.5F, -6.5F, 0.1571F, 0.5061F, 0.0349F));
PartDefinition joint1_FL = joint0_FL.addOrReplaceChild("joint1_FL", CubeListBuilder.create().texOffs(88, 91).addBox(-2.061F, -1.7726F, -14.7213F, 4.0F, 3.0F, 16.0F, new CubeDeformation(0.0F))
.texOffs(110, 230).addBox(-4.061F, -8.7726F, -15.7213F, 8.0F, 7.0F, 19.0F, new CubeDeformation(0.0F))
.texOffs(103, 225).addBox(-3.061F, -4.7726F, -15.7213F, 6.0F, 9.0F, 6.0F, new CubeDeformation(0.0F))
.texOffs(30, 124).addBox(-5.061F, -2.7726F, -25.7213F, 2.0F, 5.0F, 13.0F, new CubeDeformation(0.0F))
.texOffs(30, 142).addBox(2.939F, -1.7726F, -25.7213F, 2.0F, 5.0F, 13.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -9.0F, -4.0F, 0.1309F, 0.0F, 0.0F));
PartDefinition leg_BL = root.addOrReplaceChild("leg_BL", CubeListBuilder.create().texOffs(60, 136).addBox(-5.5F, -2.1667F, 5.1667F, 11.0F, 13.0F, 19.0F, new CubeDeformation(0.0F))
.texOffs(199, 24).addBox(-4.5F, -7.1667F, 13.1667F, 9.0F, 11.0F, 13.0F, new CubeDeformation(0.0F))
.texOffs(0, 157).addBox(-4.5F, -5.1667F, -3.8333F, 9.0F, 11.0F, 13.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(9.5F, -13.8333F, 6.8333F, -0.1571F, 0.5061F, -0.0349F));
PartDefinition cube_r2 = joint1_FL.addOrReplaceChild("cube_r2", CubeListBuilder.create().texOffs(24, 184).addBox(-3.939F, 1.6269F, -0.1617F, 7.0F, 10.0F, 5.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.5F, -6.5F, -12.0F, -1.9635F, 0.0F, 0.0F));
PartDefinition wheelFL = joint1_FL.addOrReplaceChild("wheelFL", CubeListBuilder.create(), PartPose.offset(-0.061F, 0.2274F, -23.7213F));
PartDefinition cube_r3 = wheelFL.addOrReplaceChild("cube_r3", CubeListBuilder.create().texOffs(184, 232).addBox(-3.061F, -5.9313F, -7.9979F, 6.0F, 12.0F, 12.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.061F, -1.4613F, 1.3641F, 0.7854F, 0.0F, 0.0F));
PartDefinition leg_FR = root.addOrReplaceChild("leg_FR", CubeListBuilder.create().texOffs(0, 76).addBox(-3.439F, -4.2978F, -11.0972F, 7.0F, 9.0F, 13.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-9.5F, -15.5F, -5.5F, 0.9425F, 0.5061F, 0.0349F));
PartDefinition joint0_FR = leg_FR.addOrReplaceChild("joint0_FR", CubeListBuilder.create().texOffs(0, 233).addBox(-2.939F, -9.3731F, -7.1617F, 6.0F, 15.0F, 8.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -3.0F, -8.0F, -0.3054F, 0.0F, 0.0F));
PartDefinition joint1_FR = joint0_FR.addOrReplaceChild("joint1_FR", CubeListBuilder.create().texOffs(88, 72).addBox(-1.939F, -1.7726F, -14.7213F, 4.0F, 3.0F, 16.0F, new CubeDeformation(0.0F))
.texOffs(28, 230).addBox(-3.939F, -8.7726F, -15.7213F, 8.0F, 7.0F, 19.0F, new CubeDeformation(0.0F))
.texOffs(21, 225).addBox(-2.939F, -4.7726F, -15.7213F, 6.0F, 9.0F, 6.0F, new CubeDeformation(0.0F))
.texOffs(0, 124).addBox(-4.939F, -2.7726F, -25.7213F, 2.0F, 5.0F, 13.0F, new CubeDeformation(0.0F))
.texOffs(0, 142).addBox(3.061F, -2.7726F, -25.7213F, 2.0F, 5.0F, 13.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -9.0F, -4.0F, 0.1309F, 0.0F, 0.0F));
PartDefinition cube_r4 = joint1_FR.addOrReplaceChild("cube_r4", CubeListBuilder.create().texOffs(24, 184).addBox(-3.939F, 1.6269F, -0.1617F, 7.0F, 10.0F, 5.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.5F, -6.5F, -12.0F, -1.9635F, 0.0F, 0.0F));
PartDefinition wheelFR = joint1_FR.addOrReplaceChild("wheelFR", CubeListBuilder.create(), PartPose.offset(0.061F, 0.2274F, -23.7213F));
PartDefinition cube_r5 = wheelFR.addOrReplaceChild("cube_r5", CubeListBuilder.create().texOffs(220, 232).addBox(-2.939F, -5.9313F, -7.9979F, 6.0F, 12.0F, 12.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-0.061F, -1.4613F, 1.3641F, 0.7854F, 0.0F, 0.0F));
PartDefinition leg_BL = root.addOrReplaceChild("leg_BL", CubeListBuilder.create().texOffs(45, 100).addBox(-3.561F, -3.9644F, -2.2362F, 7.0F, 9.0F, 13.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(9.5F, -15.8333F, 5.8333F, -0.9425F, 0.5061F, -0.0349F));
PartDefinition joint0_BL = leg_BL.addOrReplaceChild("joint0_BL", CubeListBuilder.create().texOffs(0, 202).addBox(-3.061F, -9.0749F, -0.7948F, 6.0F, 15.0F, 8.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -2.6667F, 7.6667F, 0.3491F, 0.0F, 0.0F));
PartDefinition joint1_BL = joint0_BL.addOrReplaceChild("joint1_BL", CubeListBuilder.create().texOffs(128, 72).addBox(-1.939F, -1.7726F, -14.7213F, 4.0F, 3.0F, 16.0F, new CubeDeformation(0.0F))
.texOffs(28, 199).addBox(-3.939F, -8.7726F, -15.7213F, 8.0F, 7.0F, 19.0F, new CubeDeformation(0.0F))
.texOffs(0, 187).addBox(-2.939F, -4.8726F, -15.7213F, 6.0F, 9.0F, 6.0F, new CubeDeformation(0.0F))
.texOffs(60, 124).addBox(-4.939F, -2.7726F, -25.7213F, 2.0F, 5.0F, 13.0F, new CubeDeformation(0.0F))
.texOffs(60, 142).addBox(3.061F, -2.8726F, -25.7213F, 2.0F, 5.0F, 13.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -8.7509F, 4.1156F, -2.9671F, 0.0F, -3.1416F));
PartDefinition thruster_r1 = joint1_BL.addOrReplaceChild("thruster_r1", CubeListBuilder.create().texOffs(0, 160).addBox(0.0F, -9.0F, -14.0F, 7.0F, 11.0F, 13.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-3.5F, -2.7491F, -3.6156F, -0.7418F, 0.0F, 0.0F));
PartDefinition cube_r6 = joint1_BL.addOrReplaceChild("cube_r6", CubeListBuilder.create().texOffs(48, 184).addBox(-3.939F, 1.6269F, -0.1617F, 7.0F, 10.0F, 5.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.5F, -6.7491F, -26.1156F, 1.1781F, 0.0F, 0.0F));
PartDefinition wheelBL = joint1_BL.addOrReplaceChild("wheelBL", CubeListBuilder.create(), PartPose.offset(0.061F, 0.2274F, -22.7213F));
PartDefinition cube_r7 = wheelBL.addOrReplaceChild("cube_r7", CubeListBuilder.create().texOffs(184, 208).addBox(-2.939F, -5.9313F, -7.9979F, 6.0F, 12.0F, 12.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-0.061F, -1.4613F, 1.3641F, 0.7854F, 0.0F, 0.0F));
PartDefinition leg_BR = root.addOrReplaceChild("leg_BR", CubeListBuilder.create().texOffs(1, 100).addBox(-3.439F, -3.9644F, -1.5695F, 7.0F, 9.0F, 13.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-9.5F, -15.8333F, 5.1667F, -0.9425F, -0.5061F, 0.0349F));
PartDefinition joint0_BR = leg_BR.addOrReplaceChild("joint0_BR", CubeListBuilder.create().texOffs(82, 202).addBox(-2.939F, -9.0749F, -0.7948F, 6.0F, 15.0F, 8.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -2.6667F, 8.3333F, 0.3491F, 0.0F, 0.0F));
PartDefinition joint1_BR = joint0_BR.addOrReplaceChild("joint1_BR", CubeListBuilder.create().texOffs(128, 91).addBox(-2.061F, -1.7726F, -14.7213F, 4.0F, 3.0F, 16.0F, new CubeDeformation(0.0F))
.texOffs(110, 199).addBox(-4.061F, -8.7726F, -15.7213F, 8.0F, 7.0F, 19.0F, new CubeDeformation(0.0F))
.texOffs(83, 187).addBox(-3.061F, -4.7726F, -15.7213F, 6.0F, 9.0F, 6.0F, new CubeDeformation(0.0F))
.texOffs(90, 124).addBox(-5.061F, -2.7726F, -25.7213F, 2.0F, 5.0F, 13.0F, new CubeDeformation(0.0F))
.texOffs(90, 142).addBox(2.939F, -2.7726F, -25.7213F, 2.0F, 5.0F, 13.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -8.7509F, 4.1156F, -2.9671F, 0.0F, -3.1416F));
PartDefinition thruster_r2 = joint1_BR.addOrReplaceChild("thruster_r2", CubeListBuilder.create().texOffs(40, 160).addBox(0.0F, -9.0F, -14.0F, 7.0F, 11.0F, 13.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-3.5F, -2.7491F, -3.6156F, -0.7418F, 0.0F, 0.0F));
PartDefinition cube_r8 = joint1_BR.addOrReplaceChild("cube_r8", CubeListBuilder.create().texOffs(48, 184).addBox(-3.939F, 1.6269F, -0.1617F, 7.0F, 10.0F, 5.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.5F, -6.7491F, -26.1156F, 1.1781F, 0.0F, 0.0F));
PartDefinition wheelBR = joint1_BR.addOrReplaceChild("wheelBR", CubeListBuilder.create(), PartPose.offset(-0.061F, 0.2274F, -23.7213F));
PartDefinition cube_r9 = wheelBR.addOrReplaceChild("cube_r9", CubeListBuilder.create().texOffs(220, 208).addBox(-3.061F, -5.9313F, -7.9979F, 6.0F, 12.0F, 12.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.061F, -1.4613F, 1.3641F, 0.7854F, 0.0F, 0.0F));
PartDefinition leg_BR = root.addOrReplaceChild("leg_BR", CubeListBuilder.create().texOffs(152, 56).addBox(-4.5F, -5.1667F, -3.1667F, 9.0F, 11.0F, 13.0F, new CubeDeformation(0.0F))
.texOffs(120, 136).addBox(-5.5F, -2.1667F, 5.8333F, 11.0F, 13.0F, 19.0F, new CubeDeformation(0.0F))
.texOffs(202, 0).addBox(-4.5F, -7.1667F, 13.8333F, 9.0F, 11.0F, 13.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-9.5F, -13.8333F, 6.1667F, -0.1571F, -0.5061F, 0.0349F));
model = null;
return def = LayerDefinition.create(meshdefinition, 256, 256);
@ -89,25 +148,25 @@ public class EnforcerModel {
private final ModelPart Body;
private final ModelPart Head;
private final ModelPart rocket;
private final ModelPart flamethrower;
private final ModelPart gun;
public EnforcerHierarchicalModel(ModelPart root) {
this.root = root.getChild("root");
this.base = this.root.getChild("base");
this.Body = this.base.getChild("Body");
this.Head = this.Body.getChild("Head");
this.rocket = this.Body.getChild("rocket");
this.flamethrower = this.Body.getChild("flamethrower");
this.gun = this.Body.getChild("gun");
}
@Override
public void setupAnim(@NotNull T entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
this.root().getAllParts().forEach(ModelPart::resetPose);
this.Body.getChild("Head").xRot = headPitch * ((float) Math.PI / 180F);
this.base.getChild("Body").yRot = netHeadYaw * ((float) Math.PI / 180F);
this.Head.xRot = headPitch * ((float) Math.PI / 180F);
this.Body.yRot = netHeadYaw * ((float) Math.PI / 180F);
this.Body.getChild("rocket").xRot = headPitch * ((float) Math.PI / 180F);
this.Body.getChild("flamethrower").xRot = headPitch * ((float) Math.PI / 180F);
this.rocket.xRot = headPitch * ((float) Math.PI / 180F);
this.gun.xRot = headPitch * ((float) Math.PI / 180F);
//this.animate(entity.getChargeState(), EnforcerAnimation.CHARGE, ageInTicks, 1.0F);

View File

@ -0,0 +1,58 @@
package ru.dbotthepony.mc.otm.client.render.entity
import com.mojang.blaze3d.vertex.PoseStack
import net.minecraft.client.model.HierarchicalModel
import net.minecraft.client.renderer.MultiBufferSource
import net.minecraft.client.renderer.RenderType
import net.minecraft.client.renderer.entity.EntityRendererProvider
import net.minecraft.client.renderer.entity.MobRenderer
import net.minecraft.client.renderer.entity.layers.RenderLayer
import net.minecraft.client.renderer.texture.OverlayTexture
import net.minecraft.resources.ResourceLocation
import ru.dbotthepony.mc.otm.OverdriveThatMatters.loc
import ru.dbotthepony.mc.otm.client.model.entity.DroneModel
import ru.dbotthepony.mc.otm.entity.Drone
class DroneRenderer(context: EntityRendererProvider.Context)
: MobRenderer<Drone, HierarchicalModel<Drone>>(context, DroneModel.getModel(), 0.8f) {
override fun getTextureLocation(entity: Drone): ResourceLocation = TEXTURE_LOCATION
init {
this.addLayer(DroneEmissiveLayer(this, model))
}
companion object {
private val TEXTURE_LOCATION = loc("textures/entity/drone.png")
}
}
class DroneEmissiveLayer(
entityRenderer: DroneRenderer,
model: HierarchicalModel<Drone>
) : RenderLayer<Drone, HierarchicalModel<Drone>>(entityRenderer) {
private val emissive = loc("textures/entity/drone_emissive.png")
override fun render(
poseStack: PoseStack,
bufferSource: MultiBufferSource,
packedLight: Int,
entity: Drone,
limbSwing: Float,
limbSwingAmount: Float,
partialTicks: Float,
ageInTicks: Float,
netHeadYaw: Float,
headPitch: Float
) {
val buffer = bufferSource.getBuffer(RenderType.eyes(emissive))
this.parentModel.renderToBuffer(
poseStack,
buffer,
15728640,
OverlayTexture.NO_OVERLAY
)
}
}

View File

@ -9,7 +9,6 @@ import net.minecraft.client.renderer.entity.MobRenderer
import net.minecraft.client.renderer.entity.layers.RenderLayer
import net.minecraft.client.renderer.texture.OverlayTexture
import net.minecraft.resources.ResourceLocation
import ru.dbotthepony.mc.otm.OverdriveThatMatters
import ru.dbotthepony.mc.otm.OverdriveThatMatters.loc
import ru.dbotthepony.mc.otm.client.model.entity.EnforcerModel
import ru.dbotthepony.mc.otm.entity.Enforcer

View File

@ -1,8 +1,13 @@
package ru.dbotthepony.mc.otm.client.render.entity
import com.mojang.blaze3d.vertex.PoseStack
import net.minecraft.client.model.HierarchicalModel
import net.minecraft.client.renderer.MultiBufferSource
import net.minecraft.client.renderer.RenderType
import net.minecraft.client.renderer.entity.EntityRendererProvider
import net.minecraft.client.renderer.entity.MobRenderer
import net.minecraft.client.renderer.entity.layers.RenderLayer
import net.minecraft.client.renderer.texture.OverlayTexture
import net.minecraft.resources.ResourceLocation
import ru.dbotthepony.mc.otm.OverdriveThatMatters.loc
import ru.dbotthepony.mc.otm.client.model.entity.LoaderModel
@ -12,7 +17,42 @@ class LoaderRenderer(context: EntityRendererProvider.Context)
: MobRenderer<Loader, HierarchicalModel<Loader>>(context, LoaderModel.getModel(), 0.8f) {
override fun getTextureLocation(entity: Loader): ResourceLocation = TEXTURE_LOCATION
init {
this.addLayer(LoaderEmissiveLayer(this, model))
}
companion object {
private val TEXTURE_LOCATION = loc("textures/entity/loader.png")
}
}
class LoaderEmissiveLayer(
entityRenderer: LoaderRenderer,
model: HierarchicalModel<Loader>
) : RenderLayer<Loader, HierarchicalModel<Loader>>(entityRenderer) {
private val emissive = loc("textures/entity/loader_emissive.png")
override fun render(
poseStack: PoseStack,
bufferSource: MultiBufferSource,
packedLight: Int,
entity: Loader,
limbSwing: Float,
limbSwingAmount: Float,
partialTicks: Float,
ageInTicks: Float,
netHeadYaw: Float,
headPitch: Float
) {
val buffer = bufferSource.getBuffer(RenderType.eyes(emissive))
this.parentModel.renderToBuffer(
poseStack,
buffer,
15728640,
OverlayTexture.NO_OVERLAY
)
}
}

View File

@ -73,6 +73,7 @@ class AndroidMelee(type: EntityType<AndroidMelee>, level: Level) : Monster(type,
return createMonsterAttributes()
.add(Attributes.MAX_HEALTH, 30.0)
.add(Attributes.ARMOR, 4.0)
.add(Attributes.ARMOR_TOUGHNESS, 2.0)
.add(Attributes.SCALE, 1.1)
.add(Attributes.MOVEMENT_SPEED, 0.3)
.add(Attributes.ATTACK_DAMAGE, 4.0)

View File

@ -14,11 +14,7 @@ import net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal
import net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal
import net.minecraft.world.entity.ai.navigation.GroundPathNavigation
import net.minecraft.world.entity.ai.navigation.PathNavigation
import net.minecraft.world.entity.monster.AbstractIllager
import net.minecraft.world.entity.monster.AbstractSkeleton
import net.minecraft.world.entity.monster.Monster
import net.minecraft.world.entity.monster.Zombie
import net.minecraft.world.entity.npc.Villager
import net.minecraft.world.entity.player.Player
import net.minecraft.world.level.Level
import ru.dbotthepony.mc.otm.registry.game.MEntityTypes

View File

@ -0,0 +1,114 @@
package ru.dbotthepony.mc.otm.entity
import net.minecraft.sounds.SoundEvent
import net.minecraft.sounds.SoundEvents
import net.minecraft.world.entity.*
import net.minecraft.world.entity.ai.attributes.AttributeSupplier
import net.minecraft.world.entity.ai.attributes.Attributes
import net.minecraft.world.entity.ai.control.MoveControl
import net.minecraft.world.entity.ai.goal.*
import net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal
import net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal
import net.minecraft.world.entity.ai.navigation.FlyingPathNavigation
import net.minecraft.world.entity.ai.navigation.PathNavigation
import net.minecraft.world.entity.monster.Monster
import net.minecraft.world.entity.player.Player
import net.minecraft.world.level.Level
import net.minecraft.world.phys.Vec3
import ru.dbotthepony.mc.otm.registry.game.MEntityTypes
import java.util.*
import kotlin.math.cos
import kotlin.math.sin
class Drone(type: EntityType<Drone>, level: Level) : Monster(type, level) {
constructor(level: Level) : this(MEntityTypes.DRONE, level)
var attackTarget: LivingEntity? = null
var attackTime = 0
var attackDuration = 40
val idleState = AnimationState()
override fun createNavigation(level: Level): PathNavigation = FlyingPathNavigation(this, level())
init {
idleState.start(tickCount)
this.isNoGravity = true
}
override fun registerGoals() {
goalSelector.addGoal(8, RandomLookAroundGoal(this))
goalSelector.addGoal(8, LookAtPlayerGoal(this, Player::class.java, 12f))
goalSelector.addGoal(3, NearestAttackableTargetGoal(this, Player::class.java , true, true))
goalSelector.addGoal(2, DroneBeamAttackGoal(this))
targetSelector.addGoal(1, HurtByTargetGoal(this))
}
override fun getHurtSound(damageSource: net.minecraft.world.damagesource.DamageSource): SoundEvent {
return SoundEvents.HEAVY_CORE_BREAK
}
override fun getDeathSound(): SoundEvent {
return SoundEvents.VAULT_BREAK
}
//essentially same attack as guardians
//probably needs to render a beam too
class DroneBeamAttackGoal(private val mob: Drone) : Goal() {
private var attackCooldown = 0
override fun canUse(): Boolean {
val target = mob.target
return target != null && mob.distanceToSqr(target) < 100
}
override fun start() {
mob.attackTarget = mob.target
mob.attackTime = 0
}
override fun stop() {
mob.attackTarget = null
mob.attackTime = 0
}
override fun tick() {
val target = mob.attackTarget ?: return
mob.lookAt(target, 30.0f, 30.0f)
if (mob.attackTime < mob.attackDuration) {
mob.attackTime++
if (mob.attackTime == mob.attackDuration / 2) {
mob.playSound(SoundEvents.GUARDIAN_ATTACK, 1.0f, 1.0f)
}
} else {
val direction = Vec3(target.x - mob.x, target.eyeY - mob.eyeY, target.z - mob.z).normalize()
target.hurt(mob.damageSources().magic(), 6.0f)
mob.attackTime = 0
attackCooldown = 60
}
if (attackCooldown > 0) {
attackCooldown--
}
}
}
companion object {
fun createAttributes() : AttributeSupplier.Builder {
return createMonsterAttributes()
.add(Attributes.MAX_HEALTH, 10.0)
.add(Attributes.MOVEMENT_SPEED, 0.4)
.add(Attributes.ATTACK_DAMAGE, 3.0)
.add(Attributes.GRAVITY, 0.0)
.add(Attributes.KNOCKBACK_RESISTANCE, 0.4)
.add(Attributes.FALL_DAMAGE_MULTIPLIER, 0.0)
}
}
}

View File

@ -48,6 +48,7 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
init {
idleState.start(tickCount)
this.setPersistenceRequired()
}
companion object {
@ -55,6 +56,7 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
return createMonsterAttributes()
.add(Attributes.MAX_HEALTH, 300.0)
.add(Attributes.ARMOR, 20.0)
.add(Attributes.ARMOR_TOUGHNESS, 6.0)
.add(Attributes.MOVEMENT_SPEED, 0.3)
.add(Attributes.STEP_HEIGHT, 1.0)
.add(Attributes.KNOCKBACK_RESISTANCE, 1.0)
@ -143,13 +145,13 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
private fun shootFireball(math: Float) {
if (level().isClientSide) return
val offset_dist = 1.4
val offset_dist = 1.2
val viewVector = this.getViewVector(1.0F).normalize()
val leftVec = Vec3(viewVector.z, 0.0, -viewVector.x).normalize().scale(offset_dist)
val gun_x = x + leftVec.x
val gun_z = z + leftVec.z
val gun_y = y + 1.2
val gun_y = y + 2.2
//stfu idea i like my underscores
@ -168,6 +170,9 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
private fun shootMissile(math: Float) {
if (level().isClientSide) return
//idea: make it fire 3 rockets that fall onto the ground instead of just straight/homing missiles/rockets
//TODO
val offset_dist = 1.4
val viewVector = this.getViewVector(1.0F).normalize()
val leftVec = Vec3(-viewVector.z, 0.0, viewVector.x).normalize().scale(offset_dist)
@ -242,7 +247,7 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
val leftPartic_x = mob.x - mob.lookAngle.x * 2 - 0.8f * mob.lookAngle.z
val rightPartic_x = mob.x - mob.lookAngle.x * 2 + 0.8f * mob.lookAngle.z
val smoke_y = mob.y + 0.6f
val smoke_y = mob.y + 1.6f
val leftPartic_z = mob.z - mob.lookAngle.z * 2 + 0.8f * mob.lookAngle.x
val rightPartic_z = mob.z - mob.lookAngle.z * 2 - 0.8f * mob.lookAngle.x
@ -399,7 +404,7 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
}
companion object {
private val SHOOT_AT = intArrayOf(5, 10, 15)
private val SHOOT_AT = intArrayOf(5, 7, 9)
private const val MIN_COOLDOWN = 5
private const val MAX_COOLDOWN = 15
private const val CYCLE_LENGTH = 20

View File

@ -344,6 +344,7 @@ object MNames {
const val BREAD_MONSTER = "bread_monster"
const val LOADER = "loader"
const val CLEANER = "cleaner"
const val DRONE = "drone"
const val ANDROID_MELEE = "android_melee"
const val ANDROID_RANGED = "android_ranged"

View File

@ -60,6 +60,15 @@ object MEntityTypes {
.build(MNames.CLEANER)
}
val DRONE: EntityType<Drone> by registry.register(MNames.DRONE) {
EntityType.Builder.of(::Drone, MobCategory.MONSTER)
.sized(0.8f, 0.8f)
.eyeHeight(0.3f)
.passengerAttachments(0.8f)
.clientTrackingRange(8)
.build(MNames.DRONE)
}
val LOADER: EntityType<Loader> by registry.register(MNames.LOADER) {
EntityType.Builder.of(::Loader, MobCategory.MONSTER)
.sized(1.2f, 2.5f)
@ -80,9 +89,9 @@ object MEntityTypes {
val ENFORCER: EntityType<Enforcer> by registry.register(MNames.ENFORCER) {
EntityType.Builder.of(::Enforcer, MobCategory.MONSTER)
.sized(2.4f, 2.5f)
.sized(2.4f, 3f)
.eyeHeight(2.0f)
.passengerAttachments(2.5f)
.passengerAttachments(3f)
.clientTrackingRange(12)
.fireImmune()
.build(MNames.ENFORCER)
@ -103,6 +112,7 @@ object MEntityTypes {
event.put(ENFORCER, Enforcer.createAttributes().build())
event.put(CLEANER, Cleaner.createAttributes().build())
event.put(DRONE, Drone.createAttributes().build())
}
@Suppress("unchecked_cast")
@ -119,6 +129,7 @@ object MEntityTypes {
EntityRenderers.register(LOADER, ::LoaderRenderer)
EntityRenderers.register(CLEANER, ::CleanerRenderer)
EntityRenderers.register(DRONE, ::DroneRenderer)
EntityRenderers.register(ENFORCER, ::EnforcerRenderer)

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 711 B

After

Width:  |  Height:  |  Size: 708 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B