2021-06-11 12:02:28 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Byteflux <byte@byteflux.net>
|
|
|
|
Date: Tue, 1 Mar 2016 14:14:15 -0600
|
|
|
|
Subject: [PATCH] Drop falling block and tnt entities at the specified height
|
|
|
|
|
2022-10-09 06:52:09 +00:00
|
|
|
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
|
2021-06-11 12:02:28 +00:00
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
2022-10-09 06:52:09 +00:00
|
|
|
index 7e1594e8df4fd09cd1aecbc5f3784797b04a8337..ba5f365cc0ae9773e63ff58ad0a8f8bb4087889a 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
2022-04-30 16:27:41 +00:00
|
|
|
@@ -137,6 +137,17 @@ public class FallingBlockEntity extends Entity {
|
2021-06-11 12:02:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
this.move(MoverType.SELF, this.getDeltaMovement());
|
|
|
|
+
|
|
|
|
+ // Paper start - Configurable EntityFallingBlock height nerf
|
2022-10-09 06:52:09 +00:00
|
|
|
+ if (this.level.paperConfig().fixes.fallingBlockHeightNerf.test(v -> this.getY() > v)) {
|
2021-06-11 12:02:28 +00:00
|
|
|
+ if (this.dropItem && this.level.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
|
|
|
|
+ this.spawnAtLocation(block);
|
|
|
|
+ }
|
|
|
|
+
|
2021-06-11 22:37:16 +00:00
|
|
|
+ this.discard();
|
2021-06-11 12:02:28 +00:00
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
if (!this.level.isClientSide) {
|
2022-03-01 05:43:03 +00:00
|
|
|
BlockPos blockposition = this.blockPosition();
|
2021-06-11 12:02:28 +00:00
|
|
|
boolean flag = this.blockState.getBlock() instanceof ConcretePowderBlock;
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
2022-10-09 06:52:09 +00:00
|
|
|
index e24b46820394c5f220d5bf7c4e763ef95ff9e9ab..54a8548e8d3ddee049d3fed41332c94e368ba2c4 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
2021-06-11 22:37:16 +00:00
|
|
|
@@ -68,6 +68,12 @@ public class PrimedTnt extends Entity {
|
2021-06-11 12:02:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
this.move(MoverType.SELF, this.getDeltaMovement());
|
|
|
|
+ // Paper start - Configurable TNT entity height nerf
|
2022-10-09 06:52:09 +00:00
|
|
|
+ if (this.level.paperConfig().fixes.tntEntityHeightNerf.test(v -> this.getY() > v)) {
|
2021-06-11 22:37:16 +00:00
|
|
|
+ this.discard();
|
2021-06-11 12:02:28 +00:00
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
this.setDeltaMovement(this.getDeltaMovement().scale(0.98D));
|
|
|
|
if (this.onGround) {
|
|
|
|
this.setDeltaMovement(this.getDeltaMovement().multiply(0.7D, -0.5D, 0.7D));
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java b/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java
|
2022-12-03 18:19:09 +00:00
|
|
|
index 5b31c85d3bb5bcbd966d69c129e3caea14148821..beb542b2f810da9fb8379056b4d16c2b98717f28 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java
|
2022-12-03 18:19:09 +00:00
|
|
|
@@ -50,6 +50,12 @@ public class MinecartTNT extends AbstractMinecart {
|
2021-06-11 12:02:28 +00:00
|
|
|
public void tick() {
|
|
|
|
super.tick();
|
|
|
|
if (this.fuse > 0) {
|
|
|
|
+ // Paper start - Configurable TNT entity height nerf
|
2022-10-09 06:52:09 +00:00
|
|
|
+ if (this.level.paperConfig().fixes.tntEntityHeightNerf.test(v -> this.getY() > v)) {
|
2021-06-11 22:37:16 +00:00
|
|
|
+ this.discard();
|
2021-06-11 12:02:28 +00:00
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
--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) {
|