9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2026-01-03 22:16:38 +00:00
Files
SakuraMC/patches/server/0026-Optimise-TNT-fluid-state-and-pushing.patch
Samsuik 7fafdbf3cb Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@dc3ef2a Fix vanilla components not being translated (#9893)
PaperMC/Paper@7e15d97 Remove no longer needed diff from adventure patch
PaperMC/Paper@f1820dc Fix incorrect border collision detection
PaperMC/Paper@de04cbc Updated Upstream (Bukkit/CraftBukkit) (#10034)
PaperMC/Paper@ff26d54 send sound and particle packets immediately even if off main (#10033)
PaperMC/Paper@e3140fb hotfix spawning item/xp in wrong spot
PaperMC/Paper@0b95298 Make worldborder collisions consistent with Vanilla
PaperMC/Paper@47b2c18 Don't fire the drop event on player deaths (#10046)
PaperMC/Paper@8c007d9 properly read and store sus effect duration (#10050)
PaperMC/Paper@5385b21 [ci skip] Make test results viewable in-browser and downloadable (#10055)
PaperMC/Paper@086ca61 Fix world border edge collision (#10053)
PaperMC/Paper@45e01a2 Use correct max stack size in crafter (#10057)
PaperMC/Paper@d11a588 Remove duplicate code in chunk tick iteration (#10056)
PaperMC/Paper@b4c9e7e add missing Experimental annotations (#10012)
2023-12-22 11:11:22 +00:00

44 lines
1.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samsuik <40902469+Samsuik@users.noreply.github.com>
Date: Mon, 16 Oct 2023 22:57:55 +0100
Subject: [PATCH] Optimise TNT fluid state and pushing
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 8ff5e03e35cea60a53711d058f103e3b8569c170..4c55fe458378f2f376a8c31cec57e4751aa3d290 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2178,7 +2178,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
return this.isInWater() || flag;
}
- void updateInWaterStateAndDoWaterCurrentPushing() {
+ protected void updateInWaterStateAndDoWaterCurrentPushing() { // Sakura
Entity entity = this.getVehicle();
if (entity instanceof Boat) {
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 d534bc3ff8d5995ced0f9f89261cdcf1835698f4..dcb28daa8daf8fc2af020a7a94e3c9e51a2df63e 100644
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
@@ -116,6 +116,19 @@ public class PrimedTnt extends Entity implements TraceableEntity {
}
*/
// Sakura end
+ // Sakura start
+ protected boolean updateInWaterStateAndDoFluidPushing() {
+ if (this.isPushedByFluid()) {
+ return super.updateInWaterStateAndDoFluidPushing();
+ } else {
+ // super method also handles lava fluid pushing
+ // we only need to search for water to negate fall distance
+ this.fluidHeight.clear();
+ this.updateInWaterStateAndDoWaterCurrentPushing();
+ return this.isInWater();
+ }
+ }
+ // Sakura end
@Override
public void tick() {