mirror of
https://github.com/PaperMC/Paper.git
synced 2024-09-10 05:58:07 +02:00
25 lines
1.3 KiB
Diff
25 lines
1.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Shane Freeder <theboyetronic@gmail.com>
|
|
Date: Thu, 16 Feb 2023 03:19:19 +0000
|
|
Subject: [PATCH] Temp fix for EntityType.translationKey()
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
|
index 2d5c4d4170e9a7cae9200280de3706e4be317413..1244c1ca5e0907298b1ca6de538db82b2209ec4d 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
|
@@ -440,7 +440,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
|
|
|
@Override
|
|
public String getTranslationKey(EntityType entityType) {
|
|
- return net.minecraft.world.entity.EntityType.byString(entityType.name()).map(net.minecraft.world.entity.EntityType::getDescriptionId).orElseThrow();
|
|
+ // Paper start
|
|
+ if (entityType.getName() == null || entityType == EntityType.UNKNOWN) {
|
|
+ throw new IllegalArgumentException("Cannot lookup translation key of entity type " + entityType);
|
|
+ }
|
|
+ return net.minecraft.world.entity.EntityType.byString(entityType.getName()).map(net.minecraft.world.entity.EntityType::getDescriptionId).orElseThrow();
|
|
+ // Paper end
|
|
}
|
|
|
|
@Override
|