anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: polyhedraldev/terra
Issue: [Bug] Bukkit incorrectly names minecraft:end_crystal

Bukkit's Entity enum incorrectly calls `minecraft:end_crystal` `ENDER_CRYSTAL`



Changed files:
platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java

diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java
index 33e2f6708..563a3b66e 100644
--- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java
+++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java
@@ -52,7 +52,12 @@ public class BukkitWorldHandle implements WorldHandle {
     @Override
     public @NotNull EntityType getEntity(@NotNull String id) {
         if(!id.startsWith("minecraft:")) throw new IllegalArgumentException("Invalid entity identifier " + id);
-        return new BukkitEntityType(org.bukkit.entity.EntityType.valueOf(id.toUpperCase(Locale.ROOT).substring(10)));
+        String entityID = id.toUpperCase(Locale.ROOT).substring(10);
+        
+        return new BukkitEntityType(switch(entityID) {
+            case "END_CRYSTAL" -> org.bukkit.entity.EntityType.ENDER_CRYSTAL;
+            case "ENDER_CRYSTAL" -> throw new IllegalArgumentException("Invalid entity identifier " + id); // make sure this issue can't happen the other way around.
+            default -> org.bukkit.entity.EntityType.valueOf(entityID);
+        });
     }
-    
 }