mirror of
https://github.com/songoda/EpicHoppers.git
synced 2025-01-09 17:37:46 +01:00
Dupe fix.
CommandManager modification.
This commit is contained in:
parent
c5db4c7794
commit
4c51e570e7
4
.gitignore
vendored
4
.gitignore
vendored
@ -6,3 +6,7 @@ out/
|
||||
/EpicHoppers.iml
|
||||
|
||||
target/
|
||||
|
||||
EpicHoppers-API/EpicHoppers-API\.iml
|
||||
|
||||
EpicHoppers-Plugin/EpicHoppers-Plugin\.iml
|
||||
|
@ -14,12 +14,11 @@ public class CommandEpicHoppers extends AbstractCommand {
|
||||
@Override
|
||||
protected ReturnType runCommand(EpicHoppersPlugin instance, CommandSender sender, String... args) {
|
||||
sender.sendMessage("");
|
||||
sender.sendMessage(TextComponent.formatText("&f>>&m------------&6&l EpicHoppers Help &f&m------------&f<<"));
|
||||
sender.sendMessage(TextComponent.formatText(" &7Version " + instance.getDescription().getVersion() + " Created by &5&l&oBrianna"));
|
||||
sender.sendMessage(TextComponent.formatText(instance.references.getPrefix() + "&7Version " + instance.getDescription().getVersion() + " Created with <3 by &5&l&oBrianna"));
|
||||
|
||||
for (AbstractCommand command : instance.getCommandManager().getCommands()) {
|
||||
if (command.getPermissionNode() == null || sender.hasPermission(command.getPermissionNode())) {
|
||||
sender.sendMessage(TextComponent.formatText("&6" + command.getSyntax() + "&7 - " + command.getDescription()));
|
||||
sender.sendMessage(TextComponent.formatText("&8 - &a" + command.getSyntax() + "&7 - " + command.getDescription()));
|
||||
}
|
||||
}
|
||||
sender.sendMessage("");
|
||||
|
@ -157,9 +157,7 @@ public class InventoryListeners implements Listener {
|
||||
}
|
||||
|
||||
Hopper hopper = playerData.getLastHopper();
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(instance, () -> {
|
||||
((EHopper)hopper).compile(player);
|
||||
}, 1);
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(instance, () -> ((EHopper)hopper).compile(player), 1);
|
||||
if (e.getSlot() == 40) {
|
||||
playerData.setSyncType(SyncType.FILTERED);
|
||||
player.sendMessage(instance.references.getPrefix() + instance.getLocale().getMessage("event.hopper.syncnext"));
|
||||
@ -225,15 +223,15 @@ public class InventoryListeners implements Listener {
|
||||
ItemStack item = event.getInventory().getItem(13);
|
||||
hopper.setAutoCrafting(item == null ? Material.AIR : item.getType());
|
||||
}
|
||||
if (playerData.getInMenu() != MenuType.NOT_IN) {
|
||||
Hopper hopper = instance.getHopperManager().getHopperFromPlayer(player);
|
||||
if (hopper != null)
|
||||
hopper.setLastPlayer(null);
|
||||
}
|
||||
if (playerData.getInMenu() == MenuType.FILTER) {
|
||||
Hopper hopper = instance.getHopperManager().getHopperFromPlayer(player);
|
||||
((EHopper)hopper).compile(player);
|
||||
}
|
||||
if (playerData.getInMenu() != MenuType.NOT_IN) {
|
||||
Hopper hopper = instance.getHopperManager().getHopperFromPlayer(player);
|
||||
if (hopper != null)
|
||||
hopper.setLastPlayer(null);
|
||||
}
|
||||
playerData.setInMenu(MenuType.NOT_IN);
|
||||
if (playerData.getSyncType() == SyncType.FILTERED) {
|
||||
((EHopper)playerData.getLastHopper()).compile(player);
|
||||
|
Loading…
Reference in New Issue
Block a user