Drop falling block and tnt entities at the specified height
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
This commit is contained in:
@@ -19,7 +19,20 @@
|
||||
|
||||
public MinecartTNT(EntityType<? extends MinecartTNT> type, Level world) {
|
||||
super(type, world);
|
||||
@@ -117,8 +122,16 @@
|
||||
@@ -51,6 +56,12 @@
|
||||
public void tick() {
|
||||
super.tick();
|
||||
if (this.fuse > 0) {
|
||||
+ // Paper start - Configurable TNT height nerf
|
||||
+ if (this.level().paperConfig().fixes.tntEntityHeightNerf.test(v -> this.getY() > v)) {
|
||||
+ this.discard(EntityRemoveEvent.Cause.OUT_OF_WORLD);
|
||||
+ return;
|
||||
+ }
|
||||
+ // Paper end - Configurable TNT height nerf
|
||||
--this.fuse;
|
||||
this.level().addParticle(ParticleTypes.SMOKE, this.getX(), this.getY() + 0.5D, this.getZ(), 0.0D, 0.0D, 0.0D);
|
||||
} else if (this.fuse == 0) {
|
||||
@@ -117,8 +128,16 @@
|
||||
if (world instanceof ServerLevel worldserver) {
|
||||
double d1 = Math.min(Math.sqrt(power), 5.0D);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user