mirror of
https://github.com/Samsuik/Sakura.git
synced 2026-01-04 15:31:43 +00:00
44 lines
1.9 KiB
Diff
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 1265e7d7e5615481229c89d3a76244a6603fd756..5bd03c22c046938d90aa8de17f843b7a8394d0ae 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -2013,7 +2013,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
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 683d44becb21689b95ba4babd235ee9199f4f6d8..bf6d7411716ff73c2f65965ec9bc33f70f719e19 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
|
@@ -81,6 +81,19 @@ public class PrimedTnt extends Entity {
|
|
}
|
|
// Sakura - specialised explosions
|
|
// 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() {
|