Merge pull request #23 from RandomPanda30/master
+ Added ability to hide as a Flower Pot. And added permission for "Block Chooser". Closes #8 and Closes #18.
This commit is contained in:
commit
21039611f7
@ -176,6 +176,34 @@ public class ArenaHandler {
|
||||
player.getInventory().addItem(
|
||||
shopBlockChooser);
|
||||
}
|
||||
if (!PermissionsM.hasPerm(player,
|
||||
Permissions.vip, true)) {
|
||||
ItemStack shopBlockChooser = new ItemStack(
|
||||
Material.getMaterial((String) W.config
|
||||
.get(ConfigC.shop_blockChooserIDname)),
|
||||
1);
|
||||
ItemMeta shopBlockChooser_IM = shopBlockChooser
|
||||
.getItemMeta();
|
||||
shopBlockChooser_IM
|
||||
.setDisplayName(MessageM
|
||||
.replaceAll((String) W.config
|
||||
.get(ConfigC.shop_blockChooserName)));
|
||||
List<String> lores = W.config
|
||||
.getFile()
|
||||
.getStringList(
|
||||
ConfigC.shop_blockChooserDescription.location);
|
||||
List<String> lores2 = new ArrayList<String>();
|
||||
for (String lore : lores) {
|
||||
lores2.add(MessageM
|
||||
.replaceAll(lore));
|
||||
}
|
||||
shopBlockChooser_IM.setLore(lores2);
|
||||
shopBlockChooser
|
||||
.setItemMeta(shopBlockChooser_IM);
|
||||
|
||||
player.getInventory().addItem(
|
||||
shopBlockChooser);
|
||||
}
|
||||
}
|
||||
|
||||
if ((Boolean) W.config
|
||||
|
@ -39,9 +39,12 @@ public class OnInventoryClickEvent implements Listener {
|
||||
if (inv.getName().contains("DisguiseBlocks")) {
|
||||
if (event.getCurrentItem() != null) {
|
||||
if (!event.getCurrentItem().getType().isBlock()) {
|
||||
event.setCancelled(true);
|
||||
MessageM.sendFMessage(player,
|
||||
ConfigC.error_setNotABlock);
|
||||
if (!event.getCurrentItem().getType()
|
||||
.equals(Material.FLOWER_POT_ITEM)) {
|
||||
event.setCancelled(true);
|
||||
MessageM.sendFMessage(player,
|
||||
ConfigC.error_setNotABlock);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,11 @@ public class OnInventoryCloseEvent implements Listener {
|
||||
for (ItemStack item : inv.getContents()) {
|
||||
if (item != null) {
|
||||
if (!item.getType().equals(Material.PAPER)) {
|
||||
blocks.add(item);
|
||||
if (item.getType().equals(Material.FLOWER_POT_ITEM)) {
|
||||
blocks.add(new ItemStack(Material.FLOWER_POT));
|
||||
} else {
|
||||
blocks.add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,8 @@ public class PermissionsC {
|
||||
signcreate (main + "signcreate", PType.MODERATOR),
|
||||
remove (main + "remove", PType.ADMIN),
|
||||
tokens (main + "tokens", PType.ADMIN),
|
||||
allcommands (main + "allcommands", PType.OP);
|
||||
allcommands (main + "allcommands", PType.OP),
|
||||
vip (main + "vip", PType.ADMIN);
|
||||
|
||||
public String perm;
|
||||
public PType type;
|
||||
|
Loading…
x
Reference in New Issue
Block a user