mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-28 16:32:09 +00:00
Use returned value for setEntityType, attempt fixing name setting
This commit is contained in:
parent
51b52ac343
commit
121b262d1b
2 changed files with 16 additions and 4 deletions
|
@ -135,17 +135,17 @@ public class ItemDb implements IConf, net.ess3.api.IItemDb {
|
|||
if (mat == null) {
|
||||
throw new Exception(tl("unknownItemId", itemid));
|
||||
}
|
||||
final ItemStack retval = new ItemStack(mat);
|
||||
retval.setAmount(mat.getMaxStackSize());
|
||||
ItemStack retval = new ItemStack(mat);
|
||||
if (mat == Material.MOB_SPAWNER) {
|
||||
try {
|
||||
ess.getSpawnerProvider().setEntityType(retval, EntityType.fromId(metaData));
|
||||
retval = ess.getSpawnerProvider().setEntityType(retval, EntityType.fromId(metaData));
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new Exception("Can't spawn entity ID " + metaData + " from mob spawners.");
|
||||
}
|
||||
} else {
|
||||
retval.setDurability(metaData);
|
||||
}
|
||||
retval.setAmount(mat.getMaxStackSize());
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue