diff options
author | Bjarne Koll <[email protected]> | 2024-08-09 22:05:50 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-08-09 22:05:50 +0200 |
commit | 77a5779e24b55fd900d337ac071a7e4327d735bf (patch) | |
tree | c034a7fb0587b3f849d91b92af95a3ee4324b3e8 /patches/server/0818-Avoid-Lazy-Initialization-for-Enum-Fields.patch | |
parent | 4e6a2a13a3e1f6fa1067a7821d2f018339395533 (diff) | |
download | Paper-77a5779e24b55fd900d337ac071a7e4327d735bf.tar.gz Paper-77a5779e24b55fd900d337ac071a7e4327d735bf.zip |
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#11197)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
2ec53f49 PR-1050: Fix empty result check for Complex Recipes
10671012 PR-1044: Add CrafterCraftEvent
4d87ffe0 Use correct method in JavaDoc
ae5e5817 SPIGOT-7850: Add API for Bogged shear state
46b6d445 SPIGOT-7837: Support data pack banner patterns
d5d0cefc Fix JavaDoc error
b3c2b83d PR-1036: Add API for InventoryView derivatives
1fe2c75a SPIGOT-7809: Add ShieldMeta
CraftBukkit Changes:
8ee6fd1b8 SPIGOT-7857: Improve ItemMeta block data deserialization
8f26c30c6 SPIGOT-7857: Fix spurious internal NBT tag when deserializing BlockStateMeta
759061b93 SPIGOT-7855: Fire does not spread or burn blocks
00fc9fb64 SPIGOT-7853: AnvilInventory#getRepairCost() always returns 0
7501e2e04 PR-1450: Add CrafterCraftEvent
8c51673e7 SPIGOT-5731: PortalCreateEvent#getEntity returns null for nether portals ignited by flint and steel
d53d0d0b1 PR-1456: Fix inverted logic in CraftCrafterView#setSlotDisabled
682a678c8 SPIGOT-7850: Add API for Bogged shear state
fccf5243a SPIGOT-7837: Support data pack banner patterns
9c3bd4390 PR-1431: Add API for InventoryView derivatives
0cc6acbc4 SPIGOT-7849: Fix FoodComponent serialize with "using-converts-to" using null
2c5474952 Don't rely on tags for CraftItemMetas
20d107e46 SPIGOT-7846: Fix ItemMeta for hanging signs
76f59e315 Remove redundant clone in Dropper InventoryMoveItemEvent
e61a53d25 SPIGOT-7817: Call InventoryMoveItemEvent for Crafters
894682e2d SPIGOT-7839: Remove redundant Java version checks
2c12b2187 SPIGOT-7809: Add ShieldMeta and fix setting shield base colours
Spigot Changes:
fb8fb722 Rebuild patches
34bd42b7 SPIGOT-7835: Fix issue with custom hopper settings
Diffstat (limited to 'patches/server/0818-Avoid-Lazy-Initialization-for-Enum-Fields.patch')
-rw-r--r-- | patches/server/0818-Avoid-Lazy-Initialization-for-Enum-Fields.patch | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/patches/server/0818-Avoid-Lazy-Initialization-for-Enum-Fields.patch b/patches/server/0818-Avoid-Lazy-Initialization-for-Enum-Fields.patch new file mode 100644 index 0000000000..becde16ce8 --- /dev/null +++ b/patches/server/0818-Avoid-Lazy-Initialization-for-Enum-Fields.patch @@ -0,0 +1,40 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Owen1212055 <[email protected]> +Date: Sun, 14 May 2023 00:47:28 -0400 +Subject: [PATCH] Avoid Lazy Initialization for Enum Fields + +This patch is meant to get rid of any instances of lazy initialization that Minecraft introduces for enums. +This has the possibility to create race condition issues, and generally don't make sense to be lazily done anyways. + +diff --git a/src/main/java/com/mojang/math/OctahedralGroup.java b/src/main/java/com/mojang/math/OctahedralGroup.java +index 0a3b6b8e250bd35530c05a1cdaf2eb8a9af4c72b..9aa82fc757c67a9456b2bdec744c0cb474d64df6 100644 +--- a/src/main/java/com/mojang/math/OctahedralGroup.java ++++ b/src/main/java/com/mojang/math/OctahedralGroup.java +@@ -110,6 +110,7 @@ public enum OctahedralGroup implements StringRepresentable { + this.permutation = axisTransformation; + this.transformation = new Matrix3f().scaling(flipX ? -1.0F : 1.0F, flipY ? -1.0F : 1.0F, flipZ ? -1.0F : 1.0F); + this.transformation.mul(axisTransformation.transformation()); ++ this.initializeRotationDirections(); // Paper - Avoid Lazy Initialization for Enum Fields + } + + private BooleanList packInversions() { +@@ -138,7 +139,7 @@ public enum OctahedralGroup implements StringRepresentable { + return this.name; + } + +- public Direction rotate(Direction direction) { ++ public void initializeRotationDirections() { // Paper - Avoid Lazy Initialization for Enum Fields + if (this.rotatedDirections == null) { + this.rotatedDirections = Maps.newEnumMap(Direction.class); + Direction.Axis[] axiss = Direction.Axis.values(); +@@ -153,6 +154,10 @@ public enum OctahedralGroup implements StringRepresentable { + } + } + ++ // Paper start - Avoid Lazy Initialization for Enum Fields ++ } ++ public Direction rotate(Direction direction) { ++ // Paper end - Avoid Lazy Initialization for Enum Fields + return this.rotatedDirections.get(direction); + } + |