替换yx100的模型
This commit is contained in:
parent
44ed7ea028
commit
5c5dd0bfc6
7 changed files with 41619 additions and 9037 deletions
|
@ -53,7 +53,7 @@ public class Yx100Renderer extends GeoEntityRenderer<Yx100Entity> {
|
|||
@Override
|
||||
public void renderRecursively(PoseStack poseStack, Yx100Entity animatable, GeoBone bone, RenderType renderType, MultiBufferSource bufferSource, VertexConsumer buffer, boolean isReRender, float partialTick, int packedLight, int packedOverlay, int color) {
|
||||
String name = bone.getName();
|
||||
for (int i = 0; i < 8; i++) {
|
||||
for (int i = 0; i < 9; i++) {
|
||||
if (name.equals("wheelL" + i)) {
|
||||
bone.setRotX(1.5f * Mth.lerp(partialTick, animatable.leftWheelRotO, animatable.getLeftWheelRot()));
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ public class Yx100Renderer extends GeoEntityRenderer<Yx100Entity> {
|
|||
);
|
||||
}
|
||||
|
||||
if (name.equals("jiqiang")) {
|
||||
if (name.equals("HMG")) {
|
||||
bone.setRotY(Mth.lerp(partialTick, animatable.gunYRotO, animatable.getGunYRot()) * Mth.DEG_TO_RAD - Mth.lerp(partialTick, animatable.turretYRotO, animatable.getTurretYRot()) * Mth.DEG_TO_RAD);
|
||||
}
|
||||
if (name.equals("qiangguan")) {
|
||||
|
@ -123,10 +123,6 @@ public class Yx100Renderer extends GeoEntityRenderer<Yx100Entity> {
|
|||
bone.setRotZ((float) (0.5 * (Math.random() - 0.5)));
|
||||
}
|
||||
|
||||
if (name.equals("leida") && animatable.getEnergy() > 0) {
|
||||
bone.setRotY((System.currentTimeMillis() % 36000000) / 300f);
|
||||
}
|
||||
|
||||
if (name.equals("base")) {
|
||||
float a = animatable.getEntityData().get(YAW);
|
||||
float r = (Mth.abs(a) - 90f) / 90f;
|
||||
|
@ -193,7 +189,7 @@ public class Yx100Renderer extends GeoEntityRenderer<Yx100Entity> {
|
|||
bone.setPosZ(Mth.lerp(partialTick, getBoneMoveZ(tO), getBoneMoveZ(t)));
|
||||
}
|
||||
|
||||
if (name.equals("trackR" + i)) {
|
||||
if (name.equals("TrackR" + i)) {
|
||||
bone.setPosY(Mth.lerp(partialTick, getBoneMoveY(tO2), getBoneMoveY(t2)));
|
||||
bone.setPosZ(Mth.lerp(partialTick, getBoneMoveZ(tO2), getBoneMoveZ(t2)));
|
||||
}
|
||||
|
@ -210,51 +206,67 @@ public class Yx100Renderer extends GeoEntityRenderer<Yx100Entity> {
|
|||
super.renderRecursively(poseStack, animatable, bone, renderType, bufferSource, buffer, isReRender, partialTick, packedLight, packedOverlay, color);
|
||||
}
|
||||
|
||||
|
||||
public float getBoneRotX(float t) {
|
||||
if (t <= 32.5833) return 0F;
|
||||
if (t <= 33.5833) return Mth.lerp(t - 32.5833F, 0F, -45F);
|
||||
if (t <= 34.5833) return Mth.lerp(t - 33.5833F, -45F, -90F);
|
||||
if (t <= 36.8333) return Mth.lerp((t - 34.5833F) / (36.8333F - 34.5833F), -90F, -150F);
|
||||
if (t <= 40.5833) return -150F;
|
||||
if (t <= 41.0833) return Mth.lerp((t - 40.5833F) / (41.0833F - 40.5833F), -150F, -180F);
|
||||
if (t <= 70) return -180F;
|
||||
if (t <= 71) return Mth.lerp(t - 70F, -180F, -210F);
|
||||
if (t <= 74.25) return -210F;
|
||||
if (t <= 76.5) return Mth.lerp((t - 74.25F) / (76.5F - 74.25F), -210F, -270F);
|
||||
if (t <= 77.5) return Mth.lerp(t - 76.5F, -270F, -315F);
|
||||
if (t <= 79.75) return Mth.lerp((t - 77.5F) / (79.75F - 77.5F), -315F, -360F);
|
||||
if (t <= 34.75) return 0F;
|
||||
if (t <= 35.5) return Mth.lerp((t - 34.75F) / (35.5F - 34.75F), 0F, -45F);
|
||||
if (t <= 35.8333) return -45F;
|
||||
if (t <= 36.5) return Mth.lerp((t - 35.8333F) / (36.5F - 35.8333F), -45F, -90F);
|
||||
if (t <= 36.6667) return -90F;
|
||||
if (t <= 37) return Mth.lerp((t - 36.6667F) / (37F - 36.6667F), -90F, -112.5F);
|
||||
if (t <= 37.3333) return -112.5F;
|
||||
if (t <= 37.5) return -112.5F;
|
||||
if (t <= 38.1667) return Mth.lerp((t - 37.5F) / (38.1667F - 37.5F), -112.5F, -135F);
|
||||
if (t <= 41.9167) return -135F;
|
||||
if (t <= 42.4167) return Mth.lerp((t - 41.9167F) / (42.4167F - 41.9167F), -135F, -157.5F);
|
||||
if (t <= 43.1667) return -157.5F;
|
||||
if (t <= 43.6667) return Mth.lerp((t - 43.1667F) / (43.6667F - 43.1667F), -157.5F, -180F);
|
||||
if (t <= 68) return -180F;
|
||||
if (t <= 68.5) return Mth.lerp((t - 68F) / (68.5F - 68F), -180F, -202.5F);
|
||||
if (t <= 69.25) return -202.5F;
|
||||
if (t <= 69.8333) return Mth.lerp((t - 69.25F) / (69.8333F - 69.25F), -202.5F, -220F);
|
||||
if (t <= 73.5) return -220F;
|
||||
if (t <= 74.1667) return Mth.lerp((t - 73.5F) / (74.1667F - 73.5F), -220F, -242.5F);
|
||||
if (t <= 75.6667) return -242.5F;
|
||||
if (t <= 76.1667) return Mth.lerp((t - 75.6667F) / (76.1667F - 75.6667F), -242.5F, -295F);
|
||||
if (t <= 76.6667) return -295F;
|
||||
if (t <= 77.1667) return Mth.lerp((t - 76.6667F) / (77.1667F - 76.6667F), -295F, -340F);
|
||||
if (t <= 77.8333) return Mth.lerp((t - 77.1667F) / (77.8333F - 77.1667F), -340F, -360F);
|
||||
if (t <= 79.5) return -360F;
|
||||
|
||||
return 0F;
|
||||
}
|
||||
|
||||
public float getBoneMoveY(float t) {
|
||||
if (t <= 32.5833) return 0F;
|
||||
if (t <= 33.0833) return Mth.lerp((t - 32.5833F) / (33.0833F - 32.5833F), 0F, -1F);
|
||||
if (t <= 34.0833) return Mth.lerp(t - 33.0833F, -1F, -2.5F);
|
||||
if (t <= 35.5833) return Mth.lerp((t - 34.0833F) / (35.5833F - 34.0833F), -2.5F, -7.5F);
|
||||
if (t <= 36.8333) return Mth.lerp((t - 35.5833F) / (36.8333F - 35.5833F), -7.5F, -12.25F);
|
||||
if (t <= 41.0833) return Mth.lerp((t - 36.8333F) / (41.0833F - 36.8333F), -12.25F, -20.9F);
|
||||
if (t <= 70) return -20.9F;
|
||||
if (t <= 74.25) return Mth.lerp((t - 70F) / (74.25F - 70F), -20.9F, -12.25F);
|
||||
if (t <= 76) return Mth.lerp((t - 74.25F) / (76F - 74.25F), -12.25F, -7.5F);
|
||||
if (t <= 77.75) return Mth.lerp((t - 76F) / (77.75F - 76F), -7.5F, -2F);
|
||||
if (t <= 79.25) return Mth.lerp((t - 77.75F) / (79.25F - 77.75F), -2F, -0.3F);
|
||||
if (t <= 35.1667) return 0F;
|
||||
if (t <= 36.1667) return Mth.lerp(t - 35.1667F, 0F, -2.91F);
|
||||
if (t <= 37) return Mth.lerp((t - 36.1667F) / (37F - 36.1667F), -2.91F, -6.79F);
|
||||
if (t <= 37.8333) return Mth.lerp((t - 37F) / (37.8333F - 37F), -6.79F, -10.005F);
|
||||
if (t <= 42.1667) return Mth.lerp((t - 37.8333F) / (42.1667F - 37.8333F), -10.005F, -22.38F);
|
||||
if (t <= 43.4167) return Mth.lerp((t - 42.1667F) / (43.4167F - 42.1667F), -22.38F, -24.14F);
|
||||
if (t <= 68.25) return -24.14F;
|
||||
if (t <= 69.5) return Mth.lerp((t - 68.25F) / (69.5F - 68.25F), -24.14F, -22.45F);
|
||||
if (t <= 73.8333) return Mth.lerp((t - 69.5F) / (73.8333F - 69.5F), -22.45F, -11.12F);
|
||||
if (t <= 75.9167) return Mth.lerp((t - 73.8333F) / (75.9167F - 73.8333F), -11.12F, -4.155F);
|
||||
if (t <= 76.9167) return Mth.lerp(t - 75.9167F, -4.155F, -0.855F);
|
||||
if (t <= 78.0833) return Mth.lerp((t - 76.9167F) / (78.0833F - 76.9167F), -0.855F, 0F);
|
||||
|
||||
return Mth.lerp((t - 79.25F) / (80F - 79.25F), -0.3F, 0F);
|
||||
return Mth.lerp((t - 79.25F) / (80F - 79.25F), -0.025F, 0F);
|
||||
}
|
||||
|
||||
public float getBoneMoveZ(float t) {
|
||||
if (t <= 32.5833) return Mth.lerp(t / (32.5833F - 0F), 0F, 135.6F);
|
||||
if (t <= 33.0833) return Mth.lerp((t - 32.5833F) / (33.0833F - 32.5833F), 135.6F, 137.75F);
|
||||
if (t <= 34.0833) return Mth.lerp(t - 33.0833F, 137.75F, 140.25F);
|
||||
if (t <= 35.5833) return 140.25F;
|
||||
if (t <= 36.8333) return Mth.lerp((t - 35.5833F) / (36.8333F - 35.5833F), 140.25F, 137.25F);
|
||||
if (t <= 41.0833) return Mth.lerp((t - 36.8333F) / (41.0833F - 36.8333F), 137.25F, 121.5F);
|
||||
if (t <= 70) return Mth.lerp((t - 41.0833F) / (70F - 41.0833F), 121.5F, 11.5F);
|
||||
if (t <= 74.25) return Mth.lerp((t - 70F) / (74.25F - 70F), 11.5F, -3.75F);
|
||||
if (t <= 76) return Mth.lerp((t - 74.25F) / (76F - 74.25F), -3.75F, -10F);
|
||||
if (t <= 77.75) return Mth.lerp((t - 76F) / (77.75F - 76F), -10F, -8.25F);
|
||||
if (t <= 79.25) return Mth.lerp((t - 77.75F) / (79.25F - 77.75F), -8.25F, -4.12F);
|
||||
if (t <= 35.1667) return Mth.lerp(t / (35.1667F - 0F), 0F, 121.385F);
|
||||
if (t <= 36.1667) return Mth.lerp(t - 35.1667F, 121.385F, 124.37F);
|
||||
if (t <= 37) return 124.37F;
|
||||
if (t <= 37.8333) return Mth.lerp((t - 37F) / (37.8333F - 37F), 124.37F, 122.73F);
|
||||
if (t <= 42.1667) return Mth.lerp((t - 37.8333F) / (42.1667F - 37.8333F), 122.73F, 110.455F);
|
||||
if (t <= 43.4167) return Mth.lerp((t - 42.1667F) / (43.4167F - 42.1667F), 110.455F, 105.805F);
|
||||
if (t <= 68.25) return Mth.lerp((t - 43.4167F) / (68.25F - 43.4167F), 105.805F, 10.09F);
|
||||
if (t <= 69.5) return Mth.lerp((t - 68.25F) / (69.5F - 68.25F), 10.09F, 5.625F);
|
||||
if (t <= 73.8333) return Mth.lerp((t - 69.5F) / (73.8333F - 69.5F), 5.625F, -8.025F);
|
||||
if (t <= 75.9167) return Mth.lerp((t - 73.8333F) / (75.9167F - 73.8333F), -8.025F, -11.175F);
|
||||
if (t <= 76.9167) return Mth.lerp(t - 75.9167F, -11.175F, -9.35F);
|
||||
if (t <= 78.0833) return Mth.lerp((t - 76.9167F) / (78.0833F - 76.9167F), -9.35F, -5.38F);
|
||||
|
||||
return Mth.lerp((t - 79.25F) / (80F - 79.25F), -4.12F, 0F);
|
||||
}
|
||||
|
|
|
@ -168,11 +168,6 @@ public class SenpaiEntity extends Monster implements GeoEntity {
|
|||
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.senpai.idle"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die(@NotNull DamageSource source) {
|
||||
super.die(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tickDeath() {
|
||||
++this.deathTime;
|
||||
|
|
|
@ -329,7 +329,7 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti
|
|||
turretAngle(5, 5);
|
||||
gunnerAngle(15, 15);
|
||||
lowHealthWarning();
|
||||
this.terrainCompat(4.6f, 6.7f);
|
||||
this.terrainCompat(4.375f, 6.3125f);
|
||||
inertiaRotate(1.2f);
|
||||
|
||||
releaseSmokeDecoy();
|
||||
|
@ -595,46 +595,46 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti
|
|||
int ammo = this.getEntityData().get(LOADED_DRONE);
|
||||
|
||||
if (ammo == 1) {
|
||||
worldPosition = transformPosition(transformT, -2.315275f, 0.71894375f, -0.25390625f);
|
||||
worldPosition = transformPosition(transformT, -1.6290875f, 0.75536875f, -1.76616875f);
|
||||
}
|
||||
if (ammo == 2) {
|
||||
worldPosition = transformPosition(transformT, 2.315275f, 0.71894375f, -0.25390625f);
|
||||
worldPosition = transformPosition(transformT, 1.6290875f, 0.75536875f, -1.76616875f);
|
||||
}
|
||||
if (ammo == 3) {
|
||||
worldPosition = transformPosition(transformT, -2.49105625f, 0.71894375f, -0.4296875f);
|
||||
worldPosition = transformPosition(transformT, -1.7822125f, 0.75536875f, -1.9193f);
|
||||
}
|
||||
if (ammo == 4) {
|
||||
worldPosition = transformPosition(transformT, 2.49105625f, 0.71894375f, -0.4296875f);
|
||||
worldPosition = transformPosition(transformT, 1.7822125f, 0.75536875f, -1.9193f);
|
||||
}
|
||||
if (ammo == 5) {
|
||||
worldPosition = transformPosition(transformT, -2.315275f, 0.71894375f, -0.60546875f);
|
||||
worldPosition = transformPosition(transformT, -1.6290875f, 0.75536875f, -2.07241875f);
|
||||
}
|
||||
if (ammo == 6) {
|
||||
worldPosition = transformPosition(transformT, 2.315275f, 0.71894375f, -0.60546875f);
|
||||
worldPosition = transformPosition(transformT, 1.6290875f, 0.75536875f, -2.07241875f);
|
||||
}
|
||||
if (ammo == 7) {
|
||||
worldPosition = transformPosition(transformT, -2.49105625f, 0.71894375f, -0.78125f);
|
||||
worldPosition = transformPosition(transformT, -1.7822125f, 0.75536875f, -2.22555f);
|
||||
}
|
||||
if (ammo == 8) {
|
||||
worldPosition = transformPosition(transformT, 2.49105625f, 0.71894375f, -0.78125f);
|
||||
worldPosition = transformPosition(transformT, 1.7822125f, 0.75536875f, -2.22555f);
|
||||
}
|
||||
if (ammo == 9) {
|
||||
worldPosition = transformPosition(transformT, -2.315275f, 0.71894375f, -0.95703125f);
|
||||
worldPosition = transformPosition(transformT, -1.6290875f, 0.75536875f, -2.37866875f);
|
||||
}
|
||||
if (ammo == 10) {
|
||||
worldPosition = transformPosition(transformT, 2.315275f, 0.71894375f, -0.95703125f);
|
||||
worldPosition = transformPosition(transformT, 1.6290875f, 0.75536875f, -2.37866875f);
|
||||
}
|
||||
if (ammo == 11) {
|
||||
worldPosition = transformPosition(transformT, -2.49105625f, 0.71894375f, -1.1328125f);
|
||||
worldPosition = transformPosition(transformT, -1.7822125f, 0.75536875f, -2.5318f);
|
||||
}
|
||||
if (ammo == 12) {
|
||||
worldPosition = transformPosition(transformT, 2.49105625f, 0.71894375f, -1.1328125f);
|
||||
worldPosition = transformPosition(transformT, 1.7822125f, 0.75536875f, -2.5318f);
|
||||
}
|
||||
if (ammo == 13) {
|
||||
worldPosition = transformPosition(transformT, -2.315275f, 0.71894375f, -1.30859375f);
|
||||
worldPosition = transformPosition(transformT, -1.6290875f, 0.75536875f, -2.68491875f);
|
||||
}
|
||||
if (ammo == 14) {
|
||||
worldPosition = transformPosition(transformT, 2.315275f, 0.71894375f, -1.30859375f);
|
||||
worldPosition = transformPosition(transformT, 1.6290875f, 0.75536875f, -2.68491875f);
|
||||
}
|
||||
|
||||
Vec3 lookVec = player.getViewVector(1);
|
||||
|
@ -751,9 +751,9 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti
|
|||
int i = this.getOrderedPassengers().indexOf(passenger);
|
||||
|
||||
var worldPosition = switch (i) {
|
||||
case 0 -> transformPosition(transform, 0.8669625f, 0.2f, 0.6076875f);
|
||||
case 1 -> transformPosition(transform, -0.87890625f, 0.5f, -0.6640625f);
|
||||
case 2 -> transformPosition(transform, 1f, 0.15f, -0.6640625f);
|
||||
case 0 -> transformPosition(transform, 0.6669625f, 0.07f, 0.4776875f);
|
||||
case 1 -> transformPosition(transform, -0.75805625f, 0.3f, -0.57275625f);
|
||||
case 2 -> transformPosition(transform, 0.86219375f, 0.07f, -0.5696875f);
|
||||
default -> throw new IllegalStateException("Unexpected value: " + i);
|
||||
};
|
||||
|
||||
|
@ -772,14 +772,7 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti
|
|||
@Override
|
||||
public Vec3 driverZoomPos(float ticks) {
|
||||
Matrix4f transform = getTurretTransform(ticks);
|
||||
Vector4f worldPosition = transformPosition(transform, 0, 1.2f, 0.6076875f);
|
||||
return new Vec3(worldPosition.x, worldPosition.y, worldPosition.z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3 getNewEyePos(float pPartialTicks) {
|
||||
Matrix4f transform = getTurretTransform(pPartialTicks);
|
||||
Vector4f worldPosition = transformPosition(transform, 0, 1.65f, 0.6076875f);
|
||||
Vector4f worldPosition = transformPosition(transform, 0, 1f, 0.6076875f);
|
||||
return new Vec3(worldPosition.x, worldPosition.y, worldPosition.z);
|
||||
}
|
||||
|
||||
|
@ -806,7 +799,7 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti
|
|||
Matrix4f transformT = getTurretTransform(ticks);
|
||||
|
||||
Matrix4f transform = new Matrix4f();
|
||||
Vector4f worldPosition = transformPosition(transform, 0f, 0.653275f, 0.750975f);
|
||||
Vector4f worldPosition = transformPosition(transform, 0f, 0.56345f, 0.6477125f);
|
||||
|
||||
transformT.translate(worldPosition.x, worldPosition.y, worldPosition.z);
|
||||
|
||||
|
@ -838,7 +831,7 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti
|
|||
Matrix4f transformV = getVehicleTransform(ticks);
|
||||
|
||||
Matrix4f transform = new Matrix4f();
|
||||
Vector4f worldPosition = transformPosition(transform, 0, 2.1484375f, 0);
|
||||
Vector4f worldPosition = transformPosition(transform, 0, 2.1059375f, -0.43125f);
|
||||
|
||||
transformV.translate(worldPosition.x, worldPosition.y, worldPosition.z);
|
||||
transformV.rotate(Axis.YP.rotationDegrees(Mth.lerp(ticks, turretYRotO, getTurretYRot())));
|
||||
|
@ -849,7 +842,7 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti
|
|||
Matrix4f transformT = getTurretTransform(ticks);
|
||||
|
||||
Matrix4f transform = new Matrix4f();
|
||||
Vector4f worldPosition = transformPosition(transform, -0.87890625f, 1.31171875F, -0.6640625f);
|
||||
Vector4f worldPosition = transformPosition(transform, -0.75805625f, 1.1446375F, -0.57275625f);
|
||||
|
||||
transformT.translate(worldPosition.x, worldPosition.y, worldPosition.z);
|
||||
transformT.rotate(Axis.YP.rotationDegrees(Mth.lerp(ticks, gunYRotO, getGunYRot()) - Mth.lerp(ticks, turretYRotO, getTurretYRot())));
|
||||
|
@ -860,7 +853,7 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti
|
|||
Matrix4f transformG = getGunTransform(ticks);
|
||||
|
||||
Matrix4f transform = new Matrix4f();
|
||||
Vector4f worldPosition = transformPosition(transform, 0f, 0.4325125f, 0.0632125f);
|
||||
Vector4f worldPosition = transformPosition(transform, 0f, 0.35984375f, 0.0551625f);
|
||||
|
||||
transformG.translate(worldPosition.x, worldPosition.y, worldPosition.z);
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ public class ModEntities {
|
|||
public static final DeferredHolder<EntityType<?>, EntityType<Bmp2Entity>> BMP_2 = register("bmp_2",
|
||||
EntityType.Builder.of(Bmp2Entity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(1).fireImmune().sized(4f, 3f));
|
||||
public static final DeferredHolder<EntityType<?>, EntityType<Yx100Entity>> YX_100 = register("yx_100",
|
||||
EntityType.Builder.of(Yx100Entity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(1).fireImmune().sized(5.5f, 3.25f));
|
||||
EntityType.Builder.of(Yx100Entity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(1).fireImmune().sized(4.6f, 3.25f));
|
||||
|
||||
public static final DeferredHolder<EntityType<?>, EntityType<DroneEntity>> DRONE = register("drone",
|
||||
EntityType.Builder.of(DroneEntity::new, MobCategory.MISC).setTrackingRange(64).setUpdateInterval(1).sized(0.6f, 0.2f));
|
||||
|
|
File diff suppressed because it is too large
Load diff
Binary file not shown.
Before Width: | Height: | Size: 184 KiB After Width: | Height: | Size: 122 KiB |
Binary file not shown.
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
Loading…
Add table
Reference in a new issue