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 {
|
public class VolatileMMOItem extends ReadMMOItem {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* instead of loading all the item data directly when the constructor is
|
* using VolatileMMOItem compared to LiveMMOItem, MMOItems only loads the item
|
||||||
* called, some systems do not require to know all the data from a specific
|
* data it really NEEDS. the item data is only read when using hasData(ItemStat)
|
||||||
* item. therefore the data is only loaded when the stat is being checked on
|
* for the first time, whereas LiveMMOItem reads everything on constructor ; it
|
||||||
* hasData()
|
* is purely a performance concern
|
||||||
*/
|
*/
|
||||||
public VolatileMMOItem(NBTItem item) {
|
public VolatileMMOItem(NBTItem item) {
|
||||||
super(item);
|
super(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* since it checks for the data every time this method is called, this
|
* since it checks for the data every time this method is called, this method
|
||||||
* method must only be used once if we want the best performance
|
* must only be called ONCE if we want the best performance
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean hasData(ItemStat stat) {
|
public boolean hasData(ItemStat stat) {
|
||||||
@ -28,8 +28,8 @@ public class VolatileMMOItem extends ReadMMOItem {
|
|||||||
try {
|
try {
|
||||||
stat.whenLoaded(this);
|
stat.whenLoaded(this);
|
||||||
} catch (IllegalArgumentException exception) {
|
} catch (IllegalArgumentException exception) {
|
||||||
MMOItems.plugin.getLogger().log(Level.WARNING,
|
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not load stat '" + stat.getId()
|
||||||
"Could not load stat '" + stat.getId() + "'item data from '" + getId() + "': " + exception.getMessage());
|
+ "'item data from '" + getId() + "': " + exception.getMessage());
|
||||||
}
|
}
|
||||||
return super.hasData(stat);
|
return super.hasData(stat);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user