From a7d25de8fbeca68a67469373d28a1a5d9e1d5013 Mon Sep 17 00:00:00 2001 From: Atsuihsio <842960157@qq.com> Date: Fri, 14 Mar 2025 02:09:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E8=98=91=E8=8F=87=E6=96=B9=E5=9D=97?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E8=83=BD=E8=A2=AB=E8=BD=BD=E5=85=B7=E5=88=9B?= =?UTF-8?q?=E6=8E=89=E7=9A=84=E5=88=97=E8=A1=A8=E9=87=8C=EF=BC=8C=E5=B9=B3?= =?UTF-8?q?=E6=BB=91=E5=B1=A5=E5=B8=A6=E8=BF=90=E5=8A=A8=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=BF=AB=E8=89=87=E5=8F=97=E5=88=B0=E6=92=9E=E5=87=BB?= =?UTF-8?q?=E4=BC=A4=E5=AE=B3=E8=BF=87=E9=AB=98=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aea51f45d35dbbd3220b84682ce1417a457a0246 | 4 +- .../tags/blocks/soft_collision.json | 5 ++- .../client/renderer/entity/Bmp2Renderer.java | 39 ++++++++++++++----- .../client/renderer/entity/Yx100Renderer.java | 39 ++++++++++++++----- .../datagen/ModBlockTagProvider.java | 2 +- .../entity/vehicle/SpeedboatEntity.java | 4 +- .../entity/vehicle/WheelChairEntity.java | 7 ++++ .../entity/vehicle/Yx100Entity.java | 22 ++++++----- .../vehicle/base/MobileVehicleEntity.java | 5 +++ 9 files changed, 93 insertions(+), 34 deletions(-) diff --git a/src/generated/resources/.cache/aea51f45d35dbbd3220b84682ce1417a457a0246 b/src/generated/resources/.cache/aea51f45d35dbbd3220b84682ce1417a457a0246 index 3d4ae845c..e20a82b25 100644 --- a/src/generated/resources/.cache/aea51f45d35dbbd3220b84682ce1417a457a0246 +++ b/src/generated/resources/.cache/aea51f45d35dbbd3220b84682ce1417a457a0246 @@ -1,7 +1,7 @@ -// 1.20.1 2025-02-12T01:37:34.4011277 Tags for minecraft:block mod id superbwarfare +// 1.20.1 2025-03-13T22:25:43.7679304 Tags for minecraft:block mod id superbwarfare 0acfd31854bf15f2c108138b3df7206bd2593e6b data/minecraft/tags/blocks/mineable/axe.json 8965b7e0b3f7494b78b596ed00b9721b483b0796 data/minecraft/tags/blocks/mineable/pickaxe.json 3da7f021790388a122717f16f51c7ec5232eebcb data/minecraft/tags/blocks/mineable/shovel.json f42a8c01336e64b74da966f03d45ee0d60ac5d6b data/minecraft/tags/blocks/needs_iron_tool.json eab6a1cfa3306b0dbf0c0c347fc135b8447fad83 data/superbwarfare/tags/blocks/hard_collision.json -a51086ebba958e75552ea6c02a068924e0d78fad data/superbwarfare/tags/blocks/soft_collision.json +2f52d564d89eb8a125f3dba5d99ec7cb3bc8d7ba data/superbwarfare/tags/blocks/soft_collision.json diff --git a/src/generated/resources/data/superbwarfare/tags/blocks/soft_collision.json b/src/generated/resources/data/superbwarfare/tags/blocks/soft_collision.json index 04b95b610..29c12762b 100644 --- a/src/generated/resources/data/superbwarfare/tags/blocks/soft_collision.json +++ b/src/generated/resources/data/superbwarfare/tags/blocks/soft_collision.json @@ -14,6 +14,9 @@ "minecraft:bell", "minecraft:chain", "minecraft:snow_block", - "minecraft:cobweb" + "minecraft:cobweb", + "minecraft:mushroom_stem", + "minecraft:brown_mushroom_block", + "minecraft:red_mushroom_block" ] } \ No newline at end of file diff --git a/src/main/java/com/atsuishio/superbwarfare/client/renderer/entity/Bmp2Renderer.java b/src/main/java/com/atsuishio/superbwarfare/client/renderer/entity/Bmp2Renderer.java index f4050eb0c..1acbd2c55 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/renderer/entity/Bmp2Renderer.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/renderer/entity/Bmp2Renderer.java @@ -71,33 +71,54 @@ public class Bmp2Renderer extends GeoEntityRenderer { } for (int i = 0; i < 51; i++) { + float tO = animatable.leftTrackO + 2 * i; float t = animatable.getLeftTrack() + 2 * i; - float t2 = animatable.getRightTrack() + 2 * i; - if (t >= 100) { + while (t >= 100) { t -= 100; } + while (t <= 0) { + t += 100; + } + while (tO >= 100) { + tO -= 100; + } + while (tO <= 0) { + tO += 100; + } - if (t2 >= 100) { + float tO2 = animatable.rightTrackO + 2 * i; + float t2 = animatable.getRightTrack() + 2 * i; + + while (t2 >= 100) { t2 -= 100; } + while (t2 <= 0) { + t2 += 100; + } + while (tO2 >= 100) { + tO2 -= 100; + } + while (tO2 <= 0) { + tO2 += 100; + } if (name.equals("trackL" + i)) { - bone.setPosY(getBoneMoveY(t)); - bone.setPosZ(getBoneMoveZ(t)); + bone.setPosY(Mth.lerp(partialTick, getBoneMoveY(tO), getBoneMoveY(t))); + bone.setPosZ(Mth.lerp(partialTick, getBoneMoveZ(tO), getBoneMoveZ(t))); } if (name.equals("trackR" + i)) { - bone.setPosY(getBoneMoveY(t2)); - bone.setPosZ(getBoneMoveZ(t2)); + bone.setPosY(Mth.lerp(partialTick, getBoneMoveY(tO2), getBoneMoveY(t2))); + bone.setPosZ(Mth.lerp(partialTick, getBoneMoveZ(tO2), getBoneMoveZ(t2))); } if (name.equals("trackLRot" + i)) { - bone.setRotX(-getBoneRotX(t) * Mth.DEG_TO_RAD); + bone.setRotX(-Mth.lerp(partialTick, getBoneRotX(tO), getBoneRotX(t)) * Mth.DEG_TO_RAD); } if (name.equals("trackRRot" + i)) { - bone.setRotX(-getBoneRotX(t2) * Mth.DEG_TO_RAD); + bone.setRotX(-Mth.lerp(partialTick, getBoneRotX(tO2), getBoneRotX(t2)) * Mth.DEG_TO_RAD); } } diff --git a/src/main/java/com/atsuishio/superbwarfare/client/renderer/entity/Yx100Renderer.java b/src/main/java/com/atsuishio/superbwarfare/client/renderer/entity/Yx100Renderer.java index 18eb8f10b..09f4d8f55 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/renderer/entity/Yx100Renderer.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/renderer/entity/Yx100Renderer.java @@ -107,33 +107,54 @@ public class Yx100Renderer extends GeoEntityRenderer { } for (int i = 0; i < 41; i++) { + float tO = animatable.leftTrackO + 2 * i; float t = animatable.getLeftTrack() + 2 * i; - float t2 = animatable.getRightTrack() + 2 * i; - if (t >= 80) { + while (t >= 80) { t -= 80; } + while (t <= 0) { + t += 80; + } + while (tO >= 80) { + tO -= 80; + } + while (tO <= 0) { + tO += 80; + } - if (t2 >= 80) { + float tO2 = animatable.rightTrackO + 2 * i; + float t2 = animatable.getRightTrack() + 2 * i; + + while (t2 >= 80) { t2 -= 80; } + while (t2 <= 0) { + t2 += 80; + } + while (tO2 >= 80) { + tO2 -= 80; + } + while (tO2 <= 0) { + tO2 += 80; + } if (name.equals("trackL" + i)) { - bone.setPosY(getBoneMoveY(t)); - bone.setPosZ(getBoneMoveZ(t)); + bone.setPosY(Mth.lerp(partialTick, getBoneMoveY(tO), getBoneMoveY(t))); + bone.setPosZ(Mth.lerp(partialTick, getBoneMoveZ(tO), getBoneMoveZ(t))); } if (name.equals("trackR" + i)) { - bone.setPosY(getBoneMoveY(t2)); - bone.setPosZ(getBoneMoveZ(t2)); + bone.setPosY(Mth.lerp(partialTick, getBoneMoveY(tO2), getBoneMoveY(t2))); + bone.setPosZ(Mth.lerp(partialTick, getBoneMoveZ(tO2), getBoneMoveZ(t2))); } if (name.equals("trackLRot" + i)) { - bone.setRotX(-getBoneRotX(t) * Mth.DEG_TO_RAD); + bone.setRotX(-Mth.lerp(partialTick, getBoneRotX(tO), getBoneRotX(t)) * Mth.DEG_TO_RAD); } if (name.equals("trackRRot" + i)) { - bone.setRotX(-getBoneRotX(t2) * Mth.DEG_TO_RAD); + bone.setRotX(-Mth.lerp(partialTick, getBoneRotX(tO2), getBoneRotX(t2)) * Mth.DEG_TO_RAD); } } diff --git a/src/main/java/com/atsuishio/superbwarfare/datagen/ModBlockTagProvider.java b/src/main/java/com/atsuishio/superbwarfare/datagen/ModBlockTagProvider.java index 60c54b58b..b360fb139 100644 --- a/src/main/java/com/atsuishio/superbwarfare/datagen/ModBlockTagProvider.java +++ b/src/main/java/com/atsuishio/superbwarfare/datagen/ModBlockTagProvider.java @@ -39,7 +39,7 @@ public class ModBlockTagProvider extends BlockTagsProvider { this.tag(ModTags.Blocks.SOFT_COLLISION) .addTags(BlockTags.LEAVES, BlockTags.FENCES, BlockTags.FENCE_GATES, BlockTags.DOORS, BlockTags.TRAPDOORS, BlockTags.WALLS) .add(Blocks.CACTUS, Blocks.BAMBOO, Blocks.MELON, Blocks.PUMPKIN, Blocks.HAY_BLOCK, Blocks.BELL, Blocks.CHAIN, Blocks.SNOW_BLOCK, - Blocks.COBWEB); + Blocks.COBWEB, Blocks.MUSHROOM_STEM, Blocks.BROWN_MUSHROOM_BLOCK, Blocks.RED_MUSHROOM_BLOCK); this.tag(ModTags.Blocks.HARD_COLLISION) .addTags(BlockTags.LOGS, BlockTags.PLANKS, Tags.Blocks.GLASS, Tags.Blocks.GLASS_PANES) .add(Blocks.ICE, Blocks.FROSTED_ICE, Blocks.PACKED_ICE, Blocks.BLUE_ICE); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java index e0851a571..1ecc69c4d 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java @@ -118,7 +118,7 @@ public class SpeedboatEntity extends ContainerMobileVehicleEntity implements Geo .multiply(4, DamageTypes.PLAYER_EXPLOSION) .multiply(0.8f, ModDamageTypes.CANNON_FIRE) .multiply(0.16f, ModTags.DamageTypes.PROJECTILE) - .multiply(10, ModDamageTypes.VEHICLE_STRIKE) + .multiply(2, ModDamageTypes.VEHICLE_STRIKE) .reduce(2); } @@ -319,7 +319,7 @@ public class SpeedboatEntity extends ContainerMobileVehicleEntity implements Geo this.setRudderRot(Mth.clamp(this.getRudderRot() - this.entityData.get(DELTA_ROT), -1.25f, 1.25f) * 0.7f * (this.entityData.get(POWER) > 0 ? 1 : -1)); if (this.isInWater() || this.isUnderWater()) { - this.setYRot((float) (this.getYRot() - Math.max(5 * this.getDeltaMovement().length(), 0.3) * this.entityData.get(DELTA_ROT))); + this.setYRot((float) (this.getYRot() - Math.max(12 * this.getDeltaMovement().length(), 0.8) * this.entityData.get(DELTA_ROT))); this.setDeltaMovement(this.getDeltaMovement().add(Mth.sin(-this.getYRot() * 0.017453292F) * this.entityData.get(POWER), 0.0, Mth.cos(this.getYRot() * 0.017453292F) * this.entityData.get(POWER))); } } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/WheelChairEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/WheelChairEntity.java index 229fb3c48..b651d7dc1 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/WheelChairEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/WheelChairEntity.java @@ -4,6 +4,7 @@ import com.atsuishio.superbwarfare.ModUtils; import com.atsuishio.superbwarfare.config.server.ExplosionConfig; import com.atsuishio.superbwarfare.entity.MortarEntity; import com.atsuishio.superbwarfare.entity.vehicle.base.MobileVehicleEntity; +import com.atsuishio.superbwarfare.entity.vehicle.damage.DamageModifier; import com.atsuishio.superbwarfare.init.ModDamageTypes; import com.atsuishio.superbwarfare.init.ModEntities; import com.atsuishio.superbwarfare.init.ModSounds; @@ -67,6 +68,12 @@ public class WheelChairEntity extends MobileVehicleEntity implements GeoEntity { } } + @Override + public DamageModifier getDamageModifier() { + return super.getDamageModifier() + .multiply(2, ModDamageTypes.VEHICLE_STRIKE); + } + @Override protected void defineSynchedData() { super.defineSynchedData(); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java index a252bace6..0a3bc09c4 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java @@ -189,18 +189,20 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti public void baseTick() { super.baseTick(); - while (getLeftTrack() > 80F) { - setLeftTrack(getLeftTrack() - 80F); - } - while (getLeftTrack() <= 0) { - setLeftTrack(getLeftTrack() + 80F); + if (getLeftTrack() < 0) { + setLeftTrack(80); } - while (getRightTrack() > 80F) { - setRightTrack(getRightTrack() - 80F); + if (getLeftTrack() > 80) { + setLeftTrack(0); } - while (getRightTrack() <= 0) { - setRightTrack(getRightTrack() + 80F); + + if (getRightTrack() < 0) { + setRightTrack(80); + } + + if (getRightTrack() > 80) { + setRightTrack(0); } if (this.entityData.get(CANNON_FIRE_TIME) > 0) { @@ -264,7 +266,7 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti this.setRecoilShake(Math.pow(entityData.get(CANNON_FIRE_TIME), 4) * 0.0000007 * Math.sin(0.2 * Math.PI * (entityData.get(CANNON_FIRE_TIME) - 2.5))); - turretAngle(7, 7); + turretAngle(5, 5); gunnerAngle(15, 15); lowHealthWarning(); this.refreshDimensions(); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/MobileVehicleEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/MobileVehicleEntity.java index 7daf1597a..92dc79877 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/MobileVehicleEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/MobileVehicleEntity.java @@ -68,6 +68,8 @@ public abstract class MobileVehicleEntity extends EnergyVehicleEntity { public float leftWheelRotO; public float rightWheelRotO; + public float leftTrackO; + public float rightTrackO; public float leftTrack; public float rightTrack; @@ -111,6 +113,9 @@ public abstract class MobileVehicleEntity extends EnergyVehicleEntity { leftWheelRotO = this.getLeftWheelRot(); rightWheelRotO = this.getRightWheelRot(); + leftTrackO = this.getLeftTrack(); + rightTrackO = this.getRightTrack(); + rotorRotO = this.getRotorRot(); rudderRotO = this.getRudderRot();