区分MP5弹鼓和弹匣的换弹动画,添加光棱坦克水下阻力,调整数值
This commit is contained in:
parent
bd021dcf8a
commit
2c3c1d3b54
6 changed files with 1432 additions and 18 deletions
|
@ -165,7 +165,7 @@ public class RpgRocketEntity extends FastThrowableProjectile implements GeoEntit
|
|||
|
||||
if (ExplosionConfig.EXPLOSION_DESTROY.get()) {
|
||||
float hardness = this.level().getBlockState(BlockPos.containing(x, y, z)).getBlock().defaultDestroyTime();
|
||||
if (hardness <= 50 && hardness != -1) {
|
||||
if (hardness <= 10 && hardness != -1) {
|
||||
BlockPos blockPos = BlockPos.containing(x, y, z);
|
||||
Block.dropResources(this.level().getBlockState(blockPos), this.level(), BlockPos.containing(x, y, z), null);
|
||||
this.level().destroyBlock(blockPos, true);
|
||||
|
|
|
@ -178,14 +178,16 @@ public class PrismTankEntity extends ContainerMobileVehicleEntity implements Geo
|
|||
float f0 = 0.54f + 0.25f * Mth.abs(90 - (float) calculateAngle(this.getDeltaMovement(), this.getViewVector(1))) / 90;
|
||||
this.setDeltaMovement(this.getDeltaMovement().add(this.getViewVector(1).normalize().scale(0.05 * getDeltaMovement().dot(getViewVector(1)))));
|
||||
this.setDeltaMovement(this.getDeltaMovement().multiply(f0, 0.99, f0));
|
||||
} else if (this.isInWater()) {
|
||||
float f1 = 0.61f + 0.08f * Mth.abs(90 - (float) calculateAngle(this.getDeltaMovement(), this.getViewVector(1))) / 90;
|
||||
this.setDeltaMovement(this.getDeltaMovement().add(this.getViewVector(1).normalize().scale(0.04 * getDeltaMovement().dot(getViewVector(1)))));
|
||||
this.setDeltaMovement(this.getDeltaMovement().multiply(f1, 0.85, f1));
|
||||
} else {
|
||||
this.setDeltaMovement(this.getDeltaMovement().multiply(0.99, 0.99, 0.99));
|
||||
}
|
||||
|
||||
if (this.isInWater()) {
|
||||
float f1 = (float) (0.7f - (0.04f * Math.min(getSubmergedHeight(this), this.getBbHeight())) + 0.08f * Mth.abs(90 - (float) calculateAngle(this.getDeltaMovement(), this.getViewVector(1))) / 90);
|
||||
this.setDeltaMovement(this.getDeltaMovement().add(this.getViewVector(1).normalize().scale(0.04 * getDeltaMovement().dot(getViewVector(1)))));
|
||||
this.setDeltaMovement(this.getDeltaMovement().multiply(f1, 0.85, f1));
|
||||
}
|
||||
|
||||
if (this.level() instanceof ServerLevel serverLevel && this.isInWater() && this.getDeltaMovement().length() > 0.1) {
|
||||
sendParticle(serverLevel, ParticleTypes.CLOUD, this.getX() + 0.5 * this.getDeltaMovement().x, this.getY() + getSubmergedHeight(this) - 0.2, this.getZ() + 0.5 * this.getDeltaMovement().z, (int) (2 + 4 * this.getDeltaMovement().length()), 0.65, 0, 0.65, 0, true);
|
||||
sendParticle(serverLevel, ParticleTypes.BUBBLE_COLUMN_UP, this.getX() + 0.5 * this.getDeltaMovement().x, this.getY() + getSubmergedHeight(this) - 0.2, this.getZ() + 0.5 * this.getDeltaMovement().z, (int) (2 + 10 * this.getDeltaMovement().length()), 0.65, 0, 0.65, 0, true);
|
||||
|
|
|
@ -61,7 +61,7 @@ public class RpgItem extends GunItem implements GeoItem {
|
|||
var data = GunData.from(stack);
|
||||
|
||||
if (data.reload.empty()) {
|
||||
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.rpg.reload"));
|
||||
return event.setAndContinue(RawAnimation.begin().thenPlayAndHold("animation.rpg.reload"));
|
||||
}
|
||||
|
||||
if (player.isSprinting() && player.onGround() && ClientEventHandler.cantSprint == 0 && ClientEventHandler.drawTime < 0.01) {
|
||||
|
|
|
@ -46,13 +46,22 @@ public class Mp5Item extends GunItem implements GeoItem {
|
|||
if (player == null) return PlayState.STOP;
|
||||
ItemStack stack = player.getMainHandItem();
|
||||
if (!(stack.getItem() instanceof GunItem)) return PlayState.STOP;
|
||||
boolean drum = GunData.from(stack).attachment.get(AttachmentType.MAGAZINE) == 2;
|
||||
|
||||
if (GunData.from(stack).reload.empty()) {
|
||||
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.mp5.reload_empty"));
|
||||
if (drum) {
|
||||
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.mp5.reload_empty_drum"));
|
||||
} else {
|
||||
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.mp5.reload_empty"));
|
||||
}
|
||||
}
|
||||
|
||||
if (GunData.from(stack).reload.normal()) {
|
||||
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.mp5.reload_normal"));
|
||||
if (drum) {
|
||||
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.mp5.reload_normal_drum"));
|
||||
} else {
|
||||
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.mp5.reload_normal"));
|
||||
}
|
||||
}
|
||||
|
||||
if (player.isSprinting() && player.onGround() && ClientEventHandler.cantSprint == 0 && ClientEventHandler.drawTime < 0.01) {
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -12,7 +12,7 @@
|
|||
"Velocity": 4,
|
||||
"Magazine": 1,
|
||||
"Weight": 7,
|
||||
"EmptyReloadTime": 103,
|
||||
"EmptyReloadTime": 107,
|
||||
"RPM": 120,
|
||||
"AmmoType": "superbwarfare:rocket",
|
||||
"AvailablePerks": [
|
||||
|
|
Loading…
Add table
Reference in a new issue