mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-28 19:39:17 +00:00
All patches done
This commit is contained in:
39
patches/server/0113-Cache-blockstate-cache.patch
Normal file
39
patches/server/0113-Cache-blockstate-cache.patch
Normal file
@@ -0,0 +1,39 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: HaHaWTH <102713261+HaHaWTH@users.noreply.github.com>
|
||||
Date: Tue, 22 Oct 2024 17:07:36 +0800
|
||||
Subject: [PATCH] Cache blockstate cache
|
||||
|
||||
|
||||
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 ca2b57d13128717ebb772dd6523d2909f12560cd..cabb4b79248725ea8f831d5f1b27902c3c9ea262 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
|
||||
@@ -1446,6 +1446,10 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
|
||||
private static final Direction[] DIRECTIONS = Direction.values();
|
||||
private static final int SUPPORT_TYPE_COUNT = SupportType.values().length;
|
||||
+ // Leaf start - Cache blockstate cache array
|
||||
+ private static final SupportType[] SUPPORT_TYPE_VALUES = SupportType.values();
|
||||
+ private static final Direction.Axis[] DIRECTION_AXIS_VALUES = Direction.Axis.values();
|
||||
+ // Leaf end - Cache blockstate cache array
|
||||
protected final VoxelShape collisionShape;
|
||||
protected boolean largeCollisionShape; // Leaf - not final
|
||||
private final boolean[] faceSturdy;
|
||||
@@ -1459,7 +1463,7 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
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 {
|
||||
// Leaf start - Remove stream
|
||||
- for (Direction.Axis axis : Direction.Axis.values()) {
|
||||
+ for (Direction.Axis axis : DIRECTION_AXIS_VALUES) { // Leaf - Cache blockstate cache array
|
||||
if (this.collisionShape.min(axis) < 0.0D || this.collisionShape.max(axis) > 1.0D) {
|
||||
this.largeCollisionShape = true;
|
||||
break;
|
||||
@@ -1472,7 +1476,7 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
Direction enumdirection = aenumdirection[j];
|
||||
- SupportType[] aenumblocksupport = SupportType.values();
|
||||
+ SupportType[] aenumblocksupport = SUPPORT_TYPE_VALUES; // Leaf - Cache blockstate cache array
|
||||
int k = aenumblocksupport.length;
|
||||
|
||||
for (int l = 0; l < k; ++l) {
|
||||
Reference in New Issue
Block a user