9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0147-Remove-stream-in-BlockBehaviour-cache-blockstate.patch
2025-06-03 09:49:56 +08:00

28 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
Date: Fri, 7 Jun 2024 17:43:43 +0800
Subject: [PATCH] Remove stream in BlockBehaviour cache blockstate
diff --git a/net/minecraft/world/level/block/state/BlockBehaviour.java b/net/minecraft/world/level/block/state/BlockBehaviour.java
index 3741afd1b2a5cb5cfce5e14cb78aa5ff5c3b218e..331474bb33c8612283a0ec478c1ae8768180b22d 100644
--- a/net/minecraft/world/level/block/state/BlockBehaviour.java
+++ b/net/minecraft/world/level/block/state/BlockBehaviour.java
@@ -1064,8 +1064,14 @@ public abstract class BlockBehaviour implements FeatureElement {
)
);
} else {
- this.largeCollisionShape = Arrays.stream(Direction.Axis.values())
- .anyMatch(dir -> this.collisionShape.min(dir) < 0.0 || this.collisionShape.max(dir) > 1.0);
+ // Leaf start - Remove stream in BlockBehaviour cache blockstate
+ for (Direction.Axis axis : Direction.Axis.values()) {
+ if (this.collisionShape.min(axis) < 0.0 || this.collisionShape.max(axis) > 1.0) {
+ this.largeCollisionShape = true;
+ break;
+ }
+ }
+ // Leaf end - Remove stream in BlockBehaviour cache blockstate
this.faceSturdy = new boolean[DIRECTIONS.length * SUPPORT_TYPE_COUNT];
for (Direction direction : DIRECTIONS) {