This commit is contained in:
Noah van der Aa 2024-10-22 20:09:28 +02:00
parent 3585434382
commit 6b27267fb7
No known key found for this signature in database
GPG Key ID: 547D90BC6FF753CF

View File

@ -5,21 +5,10 @@ Subject: [PATCH] Optional TNT doesn't move in water
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
index 3d489fdc14b3e29bab63f330d5edbbc1d354382a..fb631a01e6560632d49d4f59d37ff3bf771da18a 100644
index 3d489fdc14b3e29bab63f330d5edbbc1d354382a..f45a466120291103e4501276b3d8f97d79070360 100644
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
@@ -101,7 +101,9 @@ public class PrimedTnt extends Entity implements TraceableEntity {
@Override
public void tick() {
- if (this.level().spigotConfig.maxTntTicksPerTick > 0 && ++this.level().spigotConfig.currentPrimedTnt > this.level().spigotConfig.maxTntTicksPerTick) { return; } // Spigot
+ if (this.level().spigotConfig.maxTntTicksPerTick > 0 && ++this.level().spigotConfig.currentPrimedTnt > this.level().spigotConfig.maxTntTicksPerTick) {
+ return;
+ } // Spigot
this.handlePortal();
this.applyGravity();
this.move(MoverType.SELF, this.getDeltaMovement());
@@ -135,6 +137,27 @@ public class PrimedTnt extends Entity implements TraceableEntity {
@@ -135,6 +135,27 @@ public class PrimedTnt extends Entity implements TraceableEntity {
}
}
@ -47,16 +36,15 @@ index 3d489fdc14b3e29bab63f330d5edbbc1d354382a..fb631a01e6560632d49d4f59d37ff3bf
}
private void explode() {
@@ -217,8 +240,10 @@ public class PrimedTnt extends Entity implements TraceableEntity {
return entity;
@@ -221,4 +242,11 @@ public class PrimedTnt extends Entity implements TraceableEntity {
public final boolean hurtServer(ServerLevel world, DamageSource source, float amount) {
return false;
}
+
+ // Paper start - Option to prevent TNT from moving in water
@Override
- public final boolean hurtServer(ServerLevel world, DamageSource source, float amount) {
- return false;
+ @Override
+ public boolean isPushedByFluid() {
+ return !level().paperConfig().fixes.preventTntFromMovingInWater && super.isPushedByFluid();
}
+ }
+ // Paper end - Option to prevent TNT from moving in water
}