将蘑菇方块加入能被载具创掉的列表里,平滑履带运动,修复快艇受到撞击伤害过高的问题
This commit is contained in:
parent
9252d29059
commit
a7d25de8fb
9 changed files with 93 additions and 34 deletions
|
@ -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
|
0acfd31854bf15f2c108138b3df7206bd2593e6b data/minecraft/tags/blocks/mineable/axe.json
|
||||||
8965b7e0b3f7494b78b596ed00b9721b483b0796 data/minecraft/tags/blocks/mineable/pickaxe.json
|
8965b7e0b3f7494b78b596ed00b9721b483b0796 data/minecraft/tags/blocks/mineable/pickaxe.json
|
||||||
3da7f021790388a122717f16f51c7ec5232eebcb data/minecraft/tags/blocks/mineable/shovel.json
|
3da7f021790388a122717f16f51c7ec5232eebcb data/minecraft/tags/blocks/mineable/shovel.json
|
||||||
f42a8c01336e64b74da966f03d45ee0d60ac5d6b data/minecraft/tags/blocks/needs_iron_tool.json
|
f42a8c01336e64b74da966f03d45ee0d60ac5d6b data/minecraft/tags/blocks/needs_iron_tool.json
|
||||||
eab6a1cfa3306b0dbf0c0c347fc135b8447fad83 data/superbwarfare/tags/blocks/hard_collision.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
|
||||||
|
|
|
@ -14,6 +14,9 @@
|
||||||
"minecraft:bell",
|
"minecraft:bell",
|
||||||
"minecraft:chain",
|
"minecraft:chain",
|
||||||
"minecraft:snow_block",
|
"minecraft:snow_block",
|
||||||
"minecraft:cobweb"
|
"minecraft:cobweb",
|
||||||
|
"minecraft:mushroom_stem",
|
||||||
|
"minecraft:brown_mushroom_block",
|
||||||
|
"minecraft:red_mushroom_block"
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -71,33 +71,54 @@ public class Bmp2Renderer extends GeoEntityRenderer<Bmp2Entity> {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 51; i++) {
|
for (int i = 0; i < 51; i++) {
|
||||||
|
float tO = animatable.leftTrackO + 2 * i;
|
||||||
float t = animatable.getLeftTrack() + 2 * i;
|
float t = animatable.getLeftTrack() + 2 * i;
|
||||||
float t2 = animatable.getRightTrack() + 2 * i;
|
|
||||||
|
|
||||||
if (t >= 100) {
|
while (t >= 100) {
|
||||||
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;
|
t2 -= 100;
|
||||||
}
|
}
|
||||||
|
while (t2 <= 0) {
|
||||||
|
t2 += 100;
|
||||||
|
}
|
||||||
|
while (tO2 >= 100) {
|
||||||
|
tO2 -= 100;
|
||||||
|
}
|
||||||
|
while (tO2 <= 0) {
|
||||||
|
tO2 += 100;
|
||||||
|
}
|
||||||
|
|
||||||
if (name.equals("trackL" + i)) {
|
if (name.equals("trackL" + i)) {
|
||||||
bone.setPosY(getBoneMoveY(t));
|
bone.setPosY(Mth.lerp(partialTick, getBoneMoveY(tO), getBoneMoveY(t)));
|
||||||
bone.setPosZ(getBoneMoveZ(t));
|
bone.setPosZ(Mth.lerp(partialTick, getBoneMoveZ(tO), getBoneMoveZ(t)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name.equals("trackR" + i)) {
|
if (name.equals("trackR" + i)) {
|
||||||
bone.setPosY(getBoneMoveY(t2));
|
bone.setPosY(Mth.lerp(partialTick, getBoneMoveY(tO2), getBoneMoveY(t2)));
|
||||||
bone.setPosZ(getBoneMoveZ(t2));
|
bone.setPosZ(Mth.lerp(partialTick, getBoneMoveZ(tO2), getBoneMoveZ(t2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name.equals("trackLRot" + i)) {
|
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)) {
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,33 +107,54 @@ public class Yx100Renderer extends GeoEntityRenderer<Yx100Entity> {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 41; i++) {
|
for (int i = 0; i < 41; i++) {
|
||||||
|
float tO = animatable.leftTrackO + 2 * i;
|
||||||
float t = animatable.getLeftTrack() + 2 * i;
|
float t = animatable.getLeftTrack() + 2 * i;
|
||||||
float t2 = animatable.getRightTrack() + 2 * i;
|
|
||||||
|
|
||||||
if (t >= 80) {
|
while (t >= 80) {
|
||||||
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;
|
t2 -= 80;
|
||||||
}
|
}
|
||||||
|
while (t2 <= 0) {
|
||||||
|
t2 += 80;
|
||||||
|
}
|
||||||
|
while (tO2 >= 80) {
|
||||||
|
tO2 -= 80;
|
||||||
|
}
|
||||||
|
while (tO2 <= 0) {
|
||||||
|
tO2 += 80;
|
||||||
|
}
|
||||||
|
|
||||||
if (name.equals("trackL" + i)) {
|
if (name.equals("trackL" + i)) {
|
||||||
bone.setPosY(getBoneMoveY(t));
|
bone.setPosY(Mth.lerp(partialTick, getBoneMoveY(tO), getBoneMoveY(t)));
|
||||||
bone.setPosZ(getBoneMoveZ(t));
|
bone.setPosZ(Mth.lerp(partialTick, getBoneMoveZ(tO), getBoneMoveZ(t)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name.equals("trackR" + i)) {
|
if (name.equals("trackR" + i)) {
|
||||||
bone.setPosY(getBoneMoveY(t2));
|
bone.setPosY(Mth.lerp(partialTick, getBoneMoveY(tO2), getBoneMoveY(t2)));
|
||||||
bone.setPosZ(getBoneMoveZ(t2));
|
bone.setPosZ(Mth.lerp(partialTick, getBoneMoveZ(tO2), getBoneMoveZ(t2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name.equals("trackLRot" + i)) {
|
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)) {
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class ModBlockTagProvider extends BlockTagsProvider {
|
||||||
this.tag(ModTags.Blocks.SOFT_COLLISION)
|
this.tag(ModTags.Blocks.SOFT_COLLISION)
|
||||||
.addTags(BlockTags.LEAVES, BlockTags.FENCES, BlockTags.FENCE_GATES, BlockTags.DOORS, BlockTags.TRAPDOORS, BlockTags.WALLS)
|
.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,
|
.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)
|
this.tag(ModTags.Blocks.HARD_COLLISION)
|
||||||
.addTags(BlockTags.LOGS, BlockTags.PLANKS, Tags.Blocks.GLASS, Tags.Blocks.GLASS_PANES)
|
.addTags(BlockTags.LOGS, BlockTags.PLANKS, Tags.Blocks.GLASS, Tags.Blocks.GLASS_PANES)
|
||||||
.add(Blocks.ICE, Blocks.FROSTED_ICE, Blocks.PACKED_ICE, Blocks.BLUE_ICE);
|
.add(Blocks.ICE, Blocks.FROSTED_ICE, Blocks.PACKED_ICE, Blocks.BLUE_ICE);
|
||||||
|
|
|
@ -118,7 +118,7 @@ public class SpeedboatEntity extends ContainerMobileVehicleEntity implements Geo
|
||||||
.multiply(4, DamageTypes.PLAYER_EXPLOSION)
|
.multiply(4, DamageTypes.PLAYER_EXPLOSION)
|
||||||
.multiply(0.8f, ModDamageTypes.CANNON_FIRE)
|
.multiply(0.8f, ModDamageTypes.CANNON_FIRE)
|
||||||
.multiply(0.16f, ModTags.DamageTypes.PROJECTILE)
|
.multiply(0.16f, ModTags.DamageTypes.PROJECTILE)
|
||||||
.multiply(10, ModDamageTypes.VEHICLE_STRIKE)
|
.multiply(2, ModDamageTypes.VEHICLE_STRIKE)
|
||||||
.reduce(2);
|
.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));
|
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()) {
|
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)));
|
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)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.atsuishio.superbwarfare.ModUtils;
|
||||||
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
|
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
|
||||||
import com.atsuishio.superbwarfare.entity.MortarEntity;
|
import com.atsuishio.superbwarfare.entity.MortarEntity;
|
||||||
import com.atsuishio.superbwarfare.entity.vehicle.base.MobileVehicleEntity;
|
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.ModDamageTypes;
|
||||||
import com.atsuishio.superbwarfare.init.ModEntities;
|
import com.atsuishio.superbwarfare.init.ModEntities;
|
||||||
import com.atsuishio.superbwarfare.init.ModSounds;
|
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
|
@Override
|
||||||
protected void defineSynchedData() {
|
protected void defineSynchedData() {
|
||||||
super.defineSynchedData();
|
super.defineSynchedData();
|
||||||
|
|
|
@ -189,18 +189,20 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti
|
||||||
public void baseTick() {
|
public void baseTick() {
|
||||||
super.baseTick();
|
super.baseTick();
|
||||||
|
|
||||||
while (getLeftTrack() > 80F) {
|
if (getLeftTrack() < 0) {
|
||||||
setLeftTrack(getLeftTrack() - 80F);
|
setLeftTrack(80);
|
||||||
}
|
|
||||||
while (getLeftTrack() <= 0) {
|
|
||||||
setLeftTrack(getLeftTrack() + 80F);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while (getRightTrack() > 80F) {
|
if (getLeftTrack() > 80) {
|
||||||
setRightTrack(getRightTrack() - 80F);
|
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) {
|
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)));
|
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);
|
gunnerAngle(15, 15);
|
||||||
lowHealthWarning();
|
lowHealthWarning();
|
||||||
this.refreshDimensions();
|
this.refreshDimensions();
|
||||||
|
|
|
@ -68,6 +68,8 @@ public abstract class MobileVehicleEntity extends EnergyVehicleEntity {
|
||||||
public float leftWheelRotO;
|
public float leftWheelRotO;
|
||||||
public float rightWheelRotO;
|
public float rightWheelRotO;
|
||||||
|
|
||||||
|
public float leftTrackO;
|
||||||
|
public float rightTrackO;
|
||||||
public float leftTrack;
|
public float leftTrack;
|
||||||
public float rightTrack;
|
public float rightTrack;
|
||||||
|
|
||||||
|
@ -111,6 +113,9 @@ public abstract class MobileVehicleEntity extends EnergyVehicleEntity {
|
||||||
leftWheelRotO = this.getLeftWheelRot();
|
leftWheelRotO = this.getLeftWheelRot();
|
||||||
rightWheelRotO = this.getRightWheelRot();
|
rightWheelRotO = this.getRightWheelRot();
|
||||||
|
|
||||||
|
leftTrackO = this.getLeftTrack();
|
||||||
|
rightTrackO = this.getRightTrack();
|
||||||
|
|
||||||
rotorRotO = this.getRotorRot();
|
rotorRotO = this.getRotorRot();
|
||||||
|
|
||||||
rudderRotO = this.getRudderRot();
|
rudderRotO = this.getRudderRot();
|
||||||
|
|
Loading…
Add table
Reference in a new issue