aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0009-MC-Utils.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0009-MC-Utils.patch')
-rw-r--r--patches/server/0009-MC-Utils.patch37
1 files changed, 2 insertions, 35 deletions
diff --git a/patches/server/0009-MC-Utils.patch b/patches/server/0009-MC-Utils.patch
index 6419eaf2c2..93316510a8 100644
--- a/patches/server/0009-MC-Utils.patch
+++ b/patches/server/0009-MC-Utils.patch
@@ -7628,43 +7628,10 @@ index 0000000000000000000000000000000000000000..909b2c98e7a9117d2f737245e4661792
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
-index 6bd320b6742f614ebc589c44ad4cbcfa099bcd4e..d31cf9cc09e5d92f62ee8ea545f53a0c79952479 100644
+index 6bd320b6742f614ebc589c44ad4cbcfa099bcd4e..cadb7bc5cb029075326c7c97457fd82c6d37ebb8 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
-@@ -117,8 +117,17 @@ public final class CraftMagicNumbers implements UnsafeValues {
- private static final Map<Item, Material> ITEM_MATERIAL = new HashMap<>();
- private static final Map<Material, Item> MATERIAL_ITEM = new HashMap<>();
- private static final Map<Material, Block> MATERIAL_BLOCK = new HashMap<>();
-+ // Paper start
-+ private static final Map<org.bukkit.entity.EntityType, net.minecraft.world.entity.EntityType<?>> ENTITY_TYPE_ENTITY_TYPES = new HashMap<>();
-+ private static final Map<net.minecraft.world.entity.EntityType<?>, org.bukkit.entity.EntityType> ENTITY_TYPES_ENTITY_TYPE = new HashMap<>();
-
- static {
-+ for (org.bukkit.entity.EntityType type : org.bukkit.entity.EntityType.values()) {
-+ if (type == org.bukkit.entity.EntityType.UNKNOWN) continue;
-+ ENTITY_TYPE_ENTITY_TYPES.put(type, net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.get(CraftNamespacedKey.toMinecraft(type.getKey())));
-+ ENTITY_TYPES_ENTITY_TYPE.put(net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.get(CraftNamespacedKey.toMinecraft(type.getKey())), type);
-+ }
-+ // Paper end
- for (Block block : CraftRegistry.getMinecraftRegistry().registryOrThrow(Registries.BLOCK)) {
- BLOCK_MATERIAL.put(block, Material.getMaterial(CraftRegistry.getMinecraftRegistry().registryOrThrow(Registries.BLOCK).getKey(block).getPath().toUpperCase(Locale.ROOT)));
- }
-@@ -173,6 +182,14 @@ public final class CraftMagicNumbers implements UnsafeValues {
- public static ResourceLocation key(Material mat) {
- return CraftNamespacedKey.toMinecraft(mat.getKey());
- }
-+ // Paper start
-+ public static net.minecraft.world.entity.EntityType<?> getEntityTypes(org.bukkit.entity.EntityType type) {
-+ return ENTITY_TYPE_ENTITY_TYPES.get(type);
-+ }
-+ public static org.bukkit.entity.EntityType getEntityType(net.minecraft.world.entity.EntityType<?> entityTypes) {
-+ return ENTITY_TYPES_ENTITY_TYPE.get(entityTypes);
-+ }
-+ // Paper end
- // ========================================================================
-
- public static byte toLegacyData(BlockState data) {
-@@ -209,6 +226,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
+@@ -209,6 +209,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
return material;
}