Optimise check for wand item

This commit is contained in:
Julian Krings
2023-11-17 11:49:23 +01:00
parent e7e46f78c7
commit c809f50c3b

View File

@@ -54,6 +54,7 @@ import java.util.Objects;
public class WandSVC implements IrisService {
private static ItemStack dust;
private static ItemStack wand;
public static void pasteSchematic(IrisObject s, Location at) {
s.place(at);
@@ -253,7 +254,6 @@ public class WandSVC implements IrisService {
* @return True if it is
*/
public static boolean isWand(ItemStack is) {
ItemStack wand = createWand();
if (is.getItemMeta() == null) return false;
return is.getType().equals(wand.getType()) &&
is.getItemMeta().getDisplayName().equals(wand.getItemMeta().getDisplayName()) &&
@@ -263,7 +263,7 @@ public class WandSVC implements IrisService {
@Override
public void onEnable() {
ItemStack wand = createWand();
wand = createWand();
dust = createDust();
J.ar(() -> {