diff --git a/src/main/java/com/songoda/ultimaterepairing/command/CommandManager.java b/src/main/java/com/songoda/ultimaterepairing/command/CommandManager.java index b66dc11..b4e3d47 100644 --- a/src/main/java/com/songoda/ultimaterepairing/command/CommandManager.java +++ b/src/main/java/com/songoda/ultimaterepairing/command/CommandManager.java @@ -25,7 +25,7 @@ public class CommandManager implements CommandExecutor { this.instance = instance; instance.getCommand("UltimateRepairing").setExecutor(this); - instance.getCommand("rpanvil").setExecutor(this); + instance.getCommand("uranvil").setExecutor(this); AbstractCommand commandUltimateRepairing = addCommand(new CommandUltimateRepairing()); addCommand(new CommandURAnvil()); diff --git a/src/main/java/com/songoda/ultimaterepairing/editor/Editor.java b/src/main/java/com/songoda/ultimaterepairing/editor/Editor.java index 4e97ab9..21f590f 100644 --- a/src/main/java/com/songoda/ultimaterepairing/editor/Editor.java +++ b/src/main/java/com/songoda/ultimaterepairing/editor/Editor.java @@ -63,7 +63,7 @@ public class Editor { } public void toggleHologram(Player player) { - String loc = ArconixAPI.getApi().serialize().serializeLocation(editing.get(player)); + String loc = ArconixAPI.getApi().serialize().serializeLocation(editing.get(player.getUniqueId())); if (instance.getConfig().getString("data.anvil." + loc + ".active") == null) instance.getConfig().set("data.anvil." + loc + ".active", true); @@ -74,11 +74,11 @@ public class Editor { } instance.getHologramHandler().updateHolograms(); instance.saveConfig(); - open(player, editing.get(player)); + open(player, editing.get(player.getUniqueId())); } public void toggleInfinity(Player player) { - String loc = ArconixAPI.getApi().serialize().serializeLocation(editing.get(player)); + String loc = ArconixAPI.getApi().serialize().serializeLocation(editing.get(player.getUniqueId())); if (instance.getConfig().getString("data.anvil." + loc + ".active") == null) instance.getConfig().set("data.anvil." + loc + ".active", true); if (instance.getConfig().getString("data.anvil." + loc + ".inf") == null) { @@ -87,11 +87,11 @@ public class Editor { instance.getConfig().set("data.anvil." + loc + ".inf", null); } instance.saveConfig(); - open(player, editing.get(player)); + open(player, editing.get(player.getUniqueId())); } public void toggleParticles(Player player) { - String loc = ArconixAPI.getApi().serialize().serializeLocation(editing.get(player)); + String loc = ArconixAPI.getApi().serialize().serializeLocation(editing.get(player.getUniqueId())); if (instance.getConfig().getString("data.anvil." + loc + ".active") == null) instance.getConfig().set("data.anvil." + loc + ".active", true); if (instance.getConfig().getString("data.anvil." + loc + ".particles") == null) { @@ -100,7 +100,7 @@ public class Editor { instance.getConfig().set("data.anvil." + loc + ".particles", null); } instance.saveConfig(); - open(player, editing.get(player)); + open(player, editing.get(player.getUniqueId())); } public boolean isEditing(Player player) { diff --git a/src/main/java/com/songoda/ultimaterepairing/events/InteractListeners.java b/src/main/java/com/songoda/ultimaterepairing/events/InteractListeners.java index a8a6836..e36b849 100644 --- a/src/main/java/com/songoda/ultimaterepairing/events/InteractListeners.java +++ b/src/main/java/com/songoda/ultimaterepairing/events/InteractListeners.java @@ -61,7 +61,9 @@ public class InteractListeners implements Listener { repair = true; } else repair = true; - } else if (p.isSneaking() && p.hasPermission("ultimaterepairing.admin")) { + } else if (p.isSneaking() + && p.hasPermission("ultimaterepairing.admin") + && e.getAction() == Action.RIGHT_CLICK_BLOCK) { instance.getEditor().open(p, e.getClickedBlock()); e.setCancelled(true); }