9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-31 04:46:38 +00:00

no need for this, already immutable

This commit is contained in:
Taiyou06
2025-04-26 01:38:59 +02:00
parent 1d19912f1a
commit 5abe1dfb9a

View File

@@ -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<T extends BlockEntity> {
}
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<T extends BlockEntity> {
private BlockEntityType(BlockEntityType.BlockEntitySupplier<? extends T> factory, Set<Block> validBlocks) {
this.factory = factory;
this.validBlocks = validBlocks;