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