mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-01-03 06:37:47 +01:00
Cleanup 2
This commit is contained in:
parent
c1401eb784
commit
8b108c1aa1
@ -9,18 +9,18 @@ import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
public class VolatileMMOItem extends ReadMMOItem {
|
||||
|
||||
/*
|
||||
* instead of loading all the item data directly when the constructor is
|
||||
* called, some systems do not require to know all the data from a specific
|
||||
* item. therefore the data is only loaded when the stat is being checked on
|
||||
* hasData()
|
||||
* using VolatileMMOItem compared to LiveMMOItem, MMOItems only loads the item
|
||||
* data it really NEEDS. the item data is only read when using hasData(ItemStat)
|
||||
* for the first time, whereas LiveMMOItem reads everything on constructor ; it
|
||||
* is purely a performance concern
|
||||
*/
|
||||
public VolatileMMOItem(NBTItem item) {
|
||||
super(item);
|
||||
}
|
||||
|
||||
/*
|
||||
* since it checks for the data every time this method is called, this
|
||||
* method must only be used once if we want the best performance
|
||||
* since it checks for the data every time this method is called, this method
|
||||
* must only be called ONCE if we want the best performance
|
||||
*/
|
||||
@Override
|
||||
public boolean hasData(ItemStat stat) {
|
||||
@ -28,8 +28,8 @@ public class VolatileMMOItem extends ReadMMOItem {
|
||||
try {
|
||||
stat.whenLoaded(this);
|
||||
} catch (IllegalArgumentException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING,
|
||||
"Could not load stat '" + stat.getId() + "'item data from '" + getId() + "': " + exception.getMessage());
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not load stat '" + stat.getId()
|
||||
+ "'item data from '" + getId() + "': " + exception.getMessage());
|
||||
}
|
||||
return super.hasData(stat);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user