mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-14 05:01:28 +00:00
Fix giving spawn eggs in 1.9 (use SpawnEgg API)
This commit is contained in:
parent
6eb63fd3fd
commit
767abe83f9
1 changed files with 7 additions and 0 deletions
|
@ -11,6 +11,7 @@ import org.bukkit.enchantments.Enchantment;
|
|||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.*;
|
||||
import org.bukkit.material.SpawnEgg;
|
||||
import org.bukkit.potion.Potion;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
|
||||
|
@ -143,6 +144,12 @@ public class ItemDb implements IConf, net.ess3.api.IItemDb {
|
|||
} catch (IllegalArgumentException e) {
|
||||
throw new Exception("Can't spawn entity ID " + metaData + " from mob spawners.");
|
||||
}
|
||||
} else if (mat == Material.MONSTER_EGG) {
|
||||
try {
|
||||
retval = new SpawnEgg(EntityType.fromId(metaData)).toItemStack();
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new Exception("Can't spawn entity ID " + metaData + " from spawn eggs.");
|
||||
}
|
||||
} else {
|
||||
retval.setDurability(metaData);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue