9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-23 08:59:23 +00:00

Updated Upstream (Paper/Gale)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@755a775 [ci skip] rebuild patches
PaperMC/Paper@3b9db2b Updated Upstream (Bukkit/CraftBukkit) (#11501)
PaperMC/Paper@c13f9fd Fix potential annotation testing interruption (#11460)
PaperMC/Paper@260c3bb Always send Banner patterns to the client (#11506)
PaperMC/Paper@14a48cd Some small touchups to the GUI (#11505)
PaperMC/Paper@d348cb8 Restrict BlockProjectileSource#launchProjectile

Gale Changes:
Dreeam-qwq/Gale@e893e3d Updated Upstream (Paper)
This commit is contained in:
Dreeam
2024-10-22 22:05:12 -04:00
parent 09fa2d6a0f
commit f56dc061d3
58 changed files with 73 additions and 72 deletions

View 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 cdaa5a8af0c6a8a78e587141b9ab1c84766589e9..de299465937074a1067a6adfc208eaaa24bcae67 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
@@ -1379,6 +1379,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 boolean solidRender;
final boolean propagatesSkylightDown;
final int lightBlock;
@@ -1418,7 +1422,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;
@@ -1431,7 +1435,7 @@ public abstract class BlockBehaviour implements FeatureElement {
for (i = 0; i < k; ++i) {
Direction enumdirection1 = aenumdirection1[i];
- SupportType[] aenumblocksupport = SupportType.values();
+ SupportType[] aenumblocksupport = SUPPORT_TYPE_VALUES; // Leaf - Cache blockstate cache array
int l = aenumblocksupport.length;
for (int i1 = 0; i1 < l; ++i1) {