mirror of
https://github.com/Flowsqy/ShopChest.git
synced 2024-12-01 01:53:22 +01:00
Fix EntityType error in SpawnEggMeta
This commit is contained in:
parent
aa2546e4b8
commit
d6bc25ef3a
@ -11,6 +11,20 @@ import de.epiceric.shopchest.utils.Utils;
|
||||
|
||||
public class SpawnEggMeta {
|
||||
|
||||
private final static EntityType MOOSHROOM;
|
||||
|
||||
static {
|
||||
// The constant name changed in 1.20.5
|
||||
// Doing this ensure compatibility with older version when using reflection nms module
|
||||
EntityType MOOSHROOM_ENTITY_TYPE;
|
||||
try {
|
||||
MOOSHROOM_ENTITY_TYPE = EntityType.valueOf("MUSHROOM_COW");
|
||||
} catch (IllegalArgumentException e) {
|
||||
MOOSHROOM_ENTITY_TYPE = EntityType.MOOSHROOM;
|
||||
}
|
||||
MOOSHROOM = MOOSHROOM_ENTITY_TYPE;
|
||||
}
|
||||
|
||||
private static String getNBTEntityID(ShopChest plugin, ItemStack stack) {
|
||||
try {
|
||||
OBCClassResolver obcClassResolver = new OBCClassResolver();
|
||||
@ -77,7 +91,7 @@ public class SpawnEggMeta {
|
||||
case "LavaSlime":
|
||||
return EntityType.MAGMA_CUBE;
|
||||
case "MushroomCow":
|
||||
return EntityType.MUSHROOM_COW;
|
||||
return MOOSHROOM;
|
||||
case "EntityHorse":
|
||||
return EntityType.HORSE;
|
||||
case "PolarBear":
|
||||
|
Loading…
Reference in New Issue
Block a user