Remove unnecessary serializations
This commit is contained in:
parent
9933345a7b
commit
5564b07a36
@ -71,21 +71,6 @@ public class ItemListener implements Listener, Runnable
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle updated CustomItem stats and lore upon player
|
||||
* switching items.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
@EventHandler
|
||||
public void onItemHeldChanged(PlayerItemHeldEvent event)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
PlayerGear gear = getGear(player);
|
||||
|
||||
gear.onItemHeldChanged(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the trigger of custom gear related effects and abilities.
|
||||
*
|
||||
|
@ -56,7 +56,6 @@ public class PlayerGear
|
||||
if (legendary.OriginalOwner == null)
|
||||
{
|
||||
legendary.OriginalOwner = getPlayer().getUniqueId().toString();
|
||||
getPlayer().setItemInHand(legendary.toItemStack());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -109,22 +108,6 @@ public class PlayerGear
|
||||
forEachGear(item -> item.onAttacked(event));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update appropriate gear status and item lores.
|
||||
*
|
||||
* @param event - the triggering item held change event.
|
||||
*/
|
||||
public void onItemHeldChanged(PlayerItemHeldEvent event)
|
||||
{
|
||||
ItemStack item = getPlayer().getItemInHand();
|
||||
CustomItem weapon = getWeapon();
|
||||
|
||||
if (weapon != null)
|
||||
{
|
||||
weapon.update(item); // Update held-item's stats.
|
||||
}
|
||||
}
|
||||
|
||||
private void forEachGear(Consumer<CustomItem> itemConsumer)
|
||||
{
|
||||
CustomItem weapon = getWeapon();
|
||||
|
Loading…
Reference in New Issue
Block a user