[ci skip] Add more patch identifying comments, cleanup

This commit is contained in:
Nassim Jahnke 2024-01-21 17:39:05 +01:00
parent e9e0bc168d
commit d9df6bc5e6
No known key found for this signature in database
GPG key ID: EF6771C01F6EF02F
110 changed files with 502 additions and 617 deletions

View file

@ -7,21 +7,21 @@ Avoids a hashmap lookup by cacheing a reference to the CraftBlockData
and cloning it when one is needed.
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 a009fca54665cbc3f11cad776256fbf1fbbb18c7..2c7d025b2af3a66772c3f394620483045fb80242 100644
index a009fca54665cbc3f11cad776256fbf1fbbb18c7..7e4264f87a0f81db71d49dbede32a1bad87f7ca8 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
@@ -876,6 +876,14 @@ public abstract class BlockBehaviour implements FeatureElement {
this.replaceable = blockbase_info.replaceable;
this.conditionallyFullOpaque = this.canOcclude & this.useShapeForLightOcclusion; // Paper
}
+ // Paper start - impl cached craft block data, lazy load to fix issue with loading at the wrong time
+ // Paper start - Perf: impl cached craft block data, lazy load to fix issue with loading at the wrong time
+ private org.bukkit.craftbukkit.block.data.CraftBlockData cachedCraftBlockData;
+
+ public org.bukkit.craftbukkit.block.data.CraftBlockData createCraftBlockData() {
+ if (cachedCraftBlockData == null) cachedCraftBlockData = org.bukkit.craftbukkit.block.data.CraftBlockData.createData(asState());
+ return (org.bukkit.craftbukkit.block.data.CraftBlockData) cachedCraftBlockData.clone();
+ }
+ // Paper end
+ // Paper end - Perf: impl cached craft block data, lazy load to fix issue with loading at the wrong time
private boolean calculateSolid() {
if (((Block) this.owner).properties.forceSolidOn) {