-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove stream in BlockBehaviour cache blockstate
- Loading branch information
1 parent
f74d9de
commit dda5812
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
patches/server/0092-Remove-stream-in-BlockBehaviour-cache-blockstate.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
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/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java | ||
index d38d8fc7ef22fb68e867cc29dab1171c9aa6ac35..97afec56a40229a070dfef63a32ec6ca9326d5d7 100644 | ||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java | ||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java | ||
@@ -1435,7 +1435,7 @@ public abstract class BlockBehaviour implements FeatureElement { | ||
@Nullable | ||
final VoxelShape[] occlusionShapes; | ||
protected final VoxelShape collisionShape; | ||
- protected final boolean largeCollisionShape; | ||
+ protected boolean largeCollisionShape; // Leaf - not final | ||
private final boolean[] faceSturdy; | ||
protected final boolean isCollisionShapeFullBlock; | ||
|
||
@@ -1467,9 +1467,14 @@ public abstract class BlockBehaviour implements FeatureElement { | ||
if (!this.collisionShape.isEmpty() && state.hasOffsetFunction()) { | ||
throw new IllegalStateException(String.format(Locale.ROOT, "%s has a collision shape and an offset type, but is not marked as dynamicShape in its properties.", BuiltInRegistries.BLOCK.getKey(block))); | ||
} else { | ||
- this.largeCollisionShape = Arrays.stream(Direction.Axis.values()).anyMatch((enumdirection_enumaxis) -> { | ||
- return this.collisionShape.min(enumdirection_enumaxis) < 0.0D || this.collisionShape.max(enumdirection_enumaxis) > 1.0D; | ||
- }); | ||
+ // Leaf start - Remove stream | ||
+ for (Direction.Axis axis : Direction.Axis.values()) { | ||
+ if (this.collisionShape.min(axis) < 0.0D || this.collisionShape.max(axis) > 1.0D) { | ||
+ this.largeCollisionShape = true; | ||
+ break; | ||
+ } | ||
+ } | ||
+ // Leaf end - Remove stream | ||
this.faceSturdy = new boolean[BlockBehaviour.BlockStateBase.Cache.DIRECTIONS.length * BlockBehaviour.BlockStateBase.Cache.SUPPORT_TYPE_COUNT]; | ||
Direction[] aenumdirection1 = BlockBehaviour.BlockStateBase.Cache.DIRECTIONS; | ||
int k = aenumdirection1.length; |