From 5abe1dfb9ad86b2dba598853e555399b9ce53dbb Mon Sep 17 00:00:00 2001 From: Taiyou06 Date: Sat, 26 Apr 2025 01:38:59 +0200 Subject: [PATCH] no need for this, already immutable --- .../0158-optimize-BlockEntityType-isValid.patch | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/leaf-server/minecraft-patches/features/0158-optimize-BlockEntityType-isValid.patch b/leaf-server/minecraft-patches/features/0158-optimize-BlockEntityType-isValid.patch index af50473a..d1814b1c 100644 --- a/leaf-server/minecraft-patches/features/0158-optimize-BlockEntityType-isValid.patch +++ b/leaf-server/minecraft-patches/features/0158-optimize-BlockEntityType-isValid.patch @@ -5,17 +5,10 @@ Subject: [PATCH] optimize BlockEntityType#isValid diff --git a/net/minecraft/world/level/block/entity/BlockEntityType.java b/net/minecraft/world/level/block/entity/BlockEntityType.java -index a2a674f18d7f2c2e50a6b25f9ac3bf4534275976..bcfd5dc20d20fe6b74d726c7086a0cc7ae2565de 100644 +index a2a674f18d7f2c2e50a6b25f9ac3bf4534275976..073b2ca9f1af94934afc39104e0916c97b84ef0e 100644 --- a/net/minecraft/world/level/block/entity/BlockEntityType.java +++ b/net/minecraft/world/level/block/entity/BlockEntityType.java -@@ -246,12 +246,20 @@ public class BlockEntityType { - } - - Util.fetchChoiceType(References.BLOCK_ENTITY, name); -- return Registry.register(BuiltInRegistries.BLOCK_ENTITY_TYPE, name, new BlockEntityType<>(factory, Set.of(validBlocks))); -+ return Registry.register(BuiltInRegistries.BLOCK_ENTITY_TYPE, name, new BlockEntityType<>(factory, com.google.common.collect.ImmutableSet.copyOf(validBlocks))); // Leaf - ensure immutable - } - +@@ -252,6 +252,14 @@ public class BlockEntityType { private BlockEntityType(BlockEntityType.BlockEntitySupplier factory, Set validBlocks) { this.factory = factory; this.validBlocks = validBlocks;