refactor of Manager
This commit is contained in:
parent
5ffb921150
commit
b769de9db4
7 changed files with 13 additions and 13 deletions
|
@ -27,7 +27,7 @@ public class Items {
|
|||
}
|
||||
|
||||
public static @NotNull Double getTotalAttribute(EntityEquipment inv, Attribute attribute) {
|
||||
ItemManager im = (ItemManager) ItemManager.getInstance(ItemManager.class);
|
||||
ItemManager im = ItemManager.getInstance(ItemManager.class);
|
||||
if (im == null) return 0.0;
|
||||
|
||||
AtomicReference<Double> total = new AtomicReference<>(0.0);
|
||||
|
@ -43,7 +43,7 @@ public class Items {
|
|||
}
|
||||
|
||||
public static Double getAttribute(ItemStack item, Attribute attribute) {
|
||||
ItemManager im = (ItemManager) ItemManager.getInstance(ItemManager.class);
|
||||
ItemManager im = ItemManager.getInstance(ItemManager.class);
|
||||
if (im == null) return 0.0;
|
||||
if (item == null) return 0.0;
|
||||
if (item.getType().equals(Material.AIR)) return 0.0;
|
||||
|
@ -71,7 +71,7 @@ public class Items {
|
|||
*/
|
||||
public static ItemStack lore(ItemStack stack) {
|
||||
|
||||
ItemManager im = (ItemManager) ItemManager.getInstance(ItemManager.class);
|
||||
ItemManager im = ItemManager.getInstance(ItemManager.class);
|
||||
if (im == null) return stack;
|
||||
if (stack == null) return stack;
|
||||
if (stack.getType().equals(Material.AIR)) return stack;
|
||||
|
@ -122,7 +122,7 @@ public class Items {
|
|||
}
|
||||
|
||||
public static void updatePlayer(@NotNull Player player, ItemStack oldItem, ItemStack newItem) {
|
||||
PlayerManager pm = (PlayerManager) PlayerManager.getInstance(PlayerManager.class);
|
||||
PlayerManager pm = PlayerManager.getInstance(PlayerManager.class);
|
||||
if (pm == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ public class Items {
|
|||
return;
|
||||
}
|
||||
|
||||
ItemManager im = (ItemManager) ItemManager.getInstance(ItemManager.class);
|
||||
ItemManager im = ItemManager.getInstance(ItemManager.class);
|
||||
if (im == null) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue