mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-03-01 15:51:03 +01:00
!Small cleanup
This commit is contained in:
parent
069a62b39d
commit
dc6bb4efca
@ -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
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user