Skip to content

Commit 0ddbeae

Browse files
authored
fix collision shape cache (#512)
* fix collision shape cache * rebuild patches * Revert "rebuild patches" This reverts commit 3671269. * rebuild patches * add water
1 parent 12b4906 commit 0ddbeae

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

leaf-server/minecraft-patches/features/0293-optimize-collision-shape.patch

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,22 @@ Subject: [PATCH] optimize collision shape
55

66

77
diff --git a/net/minecraft/world/level/block/state/BlockBehaviour.java b/net/minecraft/world/level/block/state/BlockBehaviour.java
8-
index 503420bbeaf3da0c568c28c55582f45469f40aeb..20fb2439c11f24790f58fe9d9caa100b398308a0 100644
8+
index 503420bbeaf3da0c568c28c55582f45469f40aeb..e186b435e7a25ba4c5a203a8748b1531dbf7b1b8 100644
99
--- a/net/minecraft/world/level/block/state/BlockBehaviour.java
1010
+++ b/net/minecraft/world/level/block/state/BlockBehaviour.java
11-
@@ -619,6 +619,13 @@ public abstract class BlockBehaviour implements FeatureElement {
11+
@@ -619,6 +619,18 @@ public abstract class BlockBehaviour implements FeatureElement {
1212
this.emptyConstantCollisionShape = this.constantCollisionShape != null && this.constantCollisionShape.isEmpty();
1313
// init caches
1414
initCaches(collisionShape, true);
1515
+ // Leaf start - optimize collision shape
1616
+ switch (getBlock()) {
17-
+ case net.minecraft.world.level.block.FireBlock fireBlock -> {}
18-
+ case net.minecraft.world.level.block.LiquidBlock liquidBlock -> {}
17+
+ case net.minecraft.world.level.block.LiquidBlock ignore -> {
18+
+ if (getFluidState().is(Fluids.WATER)) {
19+
+ this.constantCollisionShape = collisionShape;
20+
+ }
21+
+ }
22+
+ case net.minecraft.world.level.block.ScaffoldingBlock ignore -> {}
23+
+ case net.minecraft.world.level.block.PowderSnowBlock ignore -> {}
1924
+ default -> this.constantCollisionShape = collisionShape;
2025
+ }
2126
+ // Leaf end - optimize collision shape

0 commit comments

Comments
 (0)