!Small cleanup

This commit is contained in:
Indyuce 2020-12-23 16:57:41 +01:00
parent 069a62b39d
commit dc6bb4efca
2 changed files with 11 additions and 3 deletions

View File

@ -50,13 +50,21 @@ public class MMOItemDropItem extends DropItem {
@Override
public ItemStack getItem(PlayerData player, int amount) {
if(!MMOItems.plugin.getTemplates().hasTemplate(type, id)) return null;
if (!MMOItems.plugin.getTemplates().hasTemplate(type, id))
return null;
ItemStack item = player == null ? MMOItems.plugin.getItem(type, id) : MMOItems.plugin.getItem(type, id, player);
if (item == null || item.getType() == Material.AIR)
return null;
/*
* Apply unidentification before editing the item amount
*/
if (rollIdentification())
item = type.getUnidentifiedTemplate().newBuilder(NBTItem.get(item)).build();
item.setAmount(amount);
return rollIdentification() ? type.getUnidentifiedTemplate().newBuilder(NBTItem.get(item)).build() : item;
return item;
}
@Override

View File

@ -32,7 +32,7 @@ public class MythicMobsHook implements Listener {
*/
/*
* MUST NOT BE REMOVED - this class must be kept as vitam aeternam in case we
* MUST NOT BE REMOVED - this class must be kept ad vitam aeternam in case we
* need to change something in MM compatibility and sent it back to MM devs
*/
public MythicMobsHook() {