diff --git a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Language.java b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Language.java index f4e52c2..fc02774 100644 --- a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Language.java +++ b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Language.java @@ -23,7 +23,7 @@ import org.bukkit.plugin.java.JavaPlugin; import org.jetbrains.annotations.NotNull; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; public class Language extends at.pcgamingfreaks.Bukkit.Language @@ -43,7 +43,7 @@ protected void doUpgrade(@NotNull YamlFileManager oldLang) { if(oldLang.getVersion() < 10) // Pre v2.0 versions { - OldFileUpdater.updateLanguage(oldLang.getYaml(), getYaml(), plugin.getLogger()); + OldFileUpdater.updateLanguage(oldLang.getYamlE(), getYaml(), plugin.getLogger()); } else { @@ -58,7 +58,7 @@ public String[] getCommandAliases(final String command) public String[] getCommandAliases(final String command, final @NotNull String... defaults) { - List aliases = getLang().getStringList("Command." + command, new LinkedList<>()); + List aliases = getLangE().getStringList("Command." + command, new ArrayList<>(0)); return (aliases.size() > 0) ? aliases.toArray(new String[0]) : defaults; } } \ No newline at end of file diff --git a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Listener/ItemShortcut.java b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Listener/ItemShortcut.java index 934ea2c..089d397 100644 --- a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Listener/ItemShortcut.java +++ b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Listener/ItemShortcut.java @@ -50,7 +50,7 @@ public class ItemShortcut implements Listener { private static final UUID MINEPACKS_UUID = UUID.nameUUIDFromBytes("Minepacks".getBytes()); private final Minepacks plugin; - private final String itemName, value; + private final String itemName, value, openCommand; private final Message messageDoNotRemoveItem; private final boolean improveDeathChestCompatibility, blockAsHat, allowRightClickOnContainers; private final int preferredSlotId; @@ -65,6 +65,7 @@ public ItemShortcut(Minepacks plugin) blockAsHat = plugin.getConfiguration().isItemShortcutBlockAsHatEnabled(); allowRightClickOnContainers = plugin.getConfiguration().isItemShortcutRightClickOnContainerAllowed(); preferredSlotId = plugin.getConfiguration().getItemShortcutPreferredSlotId(); + openCommand = plugin.getLanguage().getCommandAliases("Backpack", "backpack")[0] + ' ' + plugin.getLanguage().getCommandAliases("Open", "open")[0]; messageDoNotRemoveItem = plugin.getLanguage().getMessage("Ingame.DontRemoveShortcut"); if(allowRightClickOnContainers) @@ -160,7 +161,7 @@ public void onItemInteract(PlayerInteractEvent event) //noinspection ConstantConditions if(containerMaterials.contains(event.getClickedBlock().getType())) return; } - event.getPlayer().performCommand("backpack open"); + event.getPlayer().performCommand(openCommand); event.setCancelled(true); } } @@ -170,7 +171,7 @@ public void onArmorStandManipulation(PlayerArmorStandManipulateEvent event) { if(isItemShortcut(event.getPlayerItem())) { - event.getPlayer().performCommand("backpack open"); + event.getPlayer().performCommand(openCommand); event.setCancelled(true); } } @@ -190,7 +191,7 @@ public void onItemFrameInteract(PlayerInteractEntityEvent event) } if(isItemShortcut(item)) { - event.getPlayer().performCommand("backpack open"); + event.getPlayer().performCommand(openCommand); event.setCancelled(true); } } @@ -200,7 +201,7 @@ public void onBlockPlace(BlockPlaceEvent event) { if(isItemShortcut(event.getItemInHand())) { - event.getPlayer().performCommand("backpack open"); + event.getPlayer().performCommand(openCommand); event.setCancelled(true); } } @@ -238,7 +239,7 @@ public void onItemClick(InventoryClickEvent event) } else if(event.getClick() == ClickType.RIGHT || event.getClick() == ClickType.SHIFT_RIGHT) { - player.performCommand("backpack open"); + player.performCommand(openCommand); event.setCancelled(true); } else if(event.getAction() == InventoryAction.MOVE_TO_OTHER_INVENTORY) diff --git a/pom.xml b/pom.xml index 0aa31a7..ce6f554 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ pom - 2.3.5-RC1 + 2.3.5-RC2 UTF-8 UTF-8