mirror of
https://github.com/songoda/UltimateRepairing.git
synced 2024-11-29 14:06:30 +01:00
Anther fix.
This commit is contained in:
parent
aed58781e5
commit
a518bfaf82
@ -22,9 +22,6 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public final class UltimateRepairing extends JavaPlugin implements Listener {
|
||||
private static CommandSender console = Bukkit.getConsoleSender();
|
||||
|
||||
|
@ -26,7 +26,7 @@ public class Editor {
|
||||
}
|
||||
|
||||
public void open(Player player, Block block) {
|
||||
UAnvil anvil = editing.put(player.getUniqueId(), instance.getAnvilManager().getAnvil(block));
|
||||
UAnvil anvil = instance.getAnvilManager().getAnvil(block);
|
||||
open(player, anvil);
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ public class Editor {
|
||||
|
||||
inventory.setItem(15, Methods.createButton(Material.FIREWORK_ROCKET, "&9&lToggle Particles", anvil.isParticles() ? "&7Currently: &aEnabled&7." : "&7Currently &cDisabled&7."));
|
||||
player.openInventory(inventory);
|
||||
|
||||
editing.put(player.getUniqueId(), anvil);
|
||||
}
|
||||
|
||||
public void toggleHologram(Player player) {
|
||||
@ -87,4 +87,8 @@ public class Editor {
|
||||
return editing.containsKey(player.getUniqueId());
|
||||
}
|
||||
|
||||
public void removeEditing(Player player) {
|
||||
editing.remove(player.getUniqueId());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.event.inventory.InventoryPickupItemEvent;
|
||||
|
||||
/**
|
||||
@ -72,4 +73,9 @@ public class InventoryListeners implements Listener {
|
||||
Debugger.runReport(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onClose(InventoryCloseEvent event) {
|
||||
instance.getEditor().removeEditing((Player)event.getPlayer());
|
||||
}
|
||||
}
|
@ -21,7 +21,7 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Created by songo on 6/4/2017.
|
||||
* Created by songoda on 6/4/2017.
|
||||
*/
|
||||
public class SettingsManager implements Listener {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user