fix create command problem and ender chest issue

Former-commit-id: fc5b2567835dfd7aa64a52b0c77cd4495770653d [formerly 76c6792eb83336bb395a37c73013010a5fccde92]
Former-commit-id: 5ed4111e0fb3fca386380472d53df4fe147898be
This commit is contained in:
portlek committed 2019-11-25 23:50:10 +03:00
1 parent 8de46ecffd
commit 5dd77a6467
2 files changed
+15 -9

No files matched your search

@@ -26,7 +26,7 @@ public class SubCommand_Create implements CommandProcesser {
@Override
public @Nullable List<String> onTabComplete(@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] cmdArg) {
ArrayList<String> list = new ArrayList<>();
list.add(MsgUtil.getMessage("tabcomplete.amount", sender));
list.add(MsgUtil.getMessage("tabcomplete.price", sender));
return list;
}
@@ -72,12 +72,18 @@ public class SubCommand_Create implements CommandProcesser {
return;
}
// Send creation menu.
plugin.getShopManager().getActions().put(
p.getUniqueId(),
new Info(
b.getLocation(),
ShopAction.CREATE,
p.getInventory().getItemInMainHand(),
b.getRelative(p.getFacing().getOppositeFace())
)
);
if (cmdArg.length < 1) {
// Send creation menu.
Info info = new Info(b.getLocation(), ShopAction.CREATE,
p.getInventory().getItemInMainHand(),
b.getRelative(p.getFacing().getOppositeFace()));
plugin.getShopManager().getActions().put(p.getUniqueId(), info);
p.sendMessage(
MsgUtil.getMessage("how-much-to-trade-for", sender, Util.getItemStackName(item)));
} else {
@@ -110,11 +110,11 @@ public class Util {
if (isBlacklistWorld(b.getWorld())) {
return false;
}
if (b.getType() == Material.ENDER_CHEST) {
if(plugin.getOpenInvPlugin() == null){
return false;
}
return plugin.getOpenInvPlugin() != null;
}
return bs instanceof InventoryHolder;
}