aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0095-Optional-TNT-doesn-t-move-in-water.patch
diff options
context:
space:
mode:
authorJake <[email protected]>2021-11-23 17:09:49 -0800
committerMiniDigger | Martin <[email protected]>2021-11-30 19:26:33 +0100
commite481692afdb08c4486866bc856919c585d6d9646 (patch)
tree66774ecbddc504c3b0fb9460139b6dc8c367d03d /patches/server/0095-Optional-TNT-doesn-t-move-in-water.patch
parent7665ae86d65b964822b307c085fc86c0fcc442f2 (diff)
downloadPaper-e481692afdb08c4486866bc856919c585d6d9646.tar.gz
Paper-e481692afdb08c4486866bc856919c585d6d9646.zip
move extra plugins patch up & more work
Diffstat (limited to 'patches/server/0095-Optional-TNT-doesn-t-move-in-water.patch')
-rw-r--r--patches/server/0095-Optional-TNT-doesn-t-move-in-water.patch82
1 files changed, 0 insertions, 82 deletions
diff --git a/patches/server/0095-Optional-TNT-doesn-t-move-in-water.patch b/patches/server/0095-Optional-TNT-doesn-t-move-in-water.patch
deleted file mode 100644
index ec8346cf75..0000000000
--- a/patches/server/0095-Optional-TNT-doesn-t-move-in-water.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Zach Brown <[email protected]>
-Date: Sun, 22 May 2016 20:20:55 -0500
-Subject: [PATCH] Optional TNT doesn't move in water
-
-
-diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
-index 1c8ca94e981b216c338f8b0a34303d558901c5d8..6324c3465cf34cea2e7fd7d8c26a0cbeeb20eefd 100644
---- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
-+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
-@@ -332,4 +332,14 @@ public class PaperWorldConfig {
- );
- }
- }
-+
-+ public boolean preventTntFromMovingInWater;
-+ private void preventTntFromMovingInWater() {
-+ if (PaperConfig.version < 13) {
-+ boolean oldVal = getBoolean("enable-old-tnt-cannon-behaviors", false);
-+ set("prevent-tnt-from-moving-in-water", oldVal);
-+ }
-+ preventTntFromMovingInWater = getBoolean("prevent-tnt-from-moving-in-water", false);
-+ log("Prevent TNT from moving in water: " + preventTntFromMovingInWater);
-+ }
- }
-diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
-index 28210d31d10de624aba1aeb30b99f3f576d5c4e6..3d27cbf5e9105def2f38525a85da5acf8ebf8fe9 100644
---- a/src/main/java/net/minecraft/server/level/ServerEntity.java
-+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
-@@ -67,7 +67,7 @@ public class ServerEntity {
- private boolean wasRiding;
- private boolean wasOnGround;
- // CraftBukkit start
-- private final Set<ServerPlayerConnection> trackedPlayers;
-+ final Set<ServerPlayerConnection> trackedPlayers; // Paper - private -> package
-
- public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer<Packet<?>> consumer, Set<ServerPlayerConnection> trackedPlayers) {
- this.trackedPlayers = trackedPlayers;
-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 7135e22a2ee274eaef52804d60f15002176ff1db..114ea3c898a23575bb2b06bf5c754330c38495e7 100644
---- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
-+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
-@@ -97,6 +97,27 @@ public class PrimedTnt extends Entity {
- }
- }
-
-+ // Paper start - Optional prevent TNT from moving in water
-+ if (!this.isRemoved() && this.wasTouchingWater && this.level.paperConfig.preventTntFromMovingInWater) {
-+ /*
-+ * Author: Jedediah Smith <[email protected]>
-+ */
-+ // Send position and velocity updates to nearby players on every tick while the TNT is in water.
-+ // This does pretty well at keeping their clients in sync with the server.
-+ net.minecraft.server.level.ChunkMap.TrackedEntity ete = ((net.minecraft.server.level.ServerLevel)this.level).getChunkSource().chunkMap.entityMap.get(this.getId());
-+ if (ete != null) {
-+ net.minecraft.network.protocol.game.ClientboundSetEntityMotionPacket velocityPacket = new net.minecraft.network.protocol.game.ClientboundSetEntityMotionPacket(this);
-+ net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket positionPacket = new net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket(this);
-+
-+ ete.seenBy.stream()
-+ .filter(viewer -> (viewer.getPlayer().getX() - this.getX()) * (viewer.getPlayer().getY() - this.getY()) * (viewer.getPlayer().getZ() - this.getZ()) < 16 * 16)
-+ .forEach(viewer -> {
-+ viewer.send(velocityPacket);
-+ viewer.send(positionPacket);
-+ });
-+ }
-+ }
-+ // Paper end
- }
-
- private void explode() {
-@@ -152,4 +173,11 @@ public class PrimedTnt extends Entity {
- public Packet<?> getAddEntityPacket() {
- return new ClientboundAddEntityPacket(this);
- }
-+
-+ // Paper start - Optional prevent TNT from moving in water
-+ @Override
-+ public boolean isPushedByFluid() {
-+ return !level.paperConfig.preventTntFromMovingInWater && super.isPushedByFluid();
-+ }
-+ // Paper end
- }