3 Commits

Author SHA1 Message Date
JaTiTV
c2782bbb97 Merge pull request 'open-gui-test' (#7) from open-gui-test into main
Reviewed-on: JaTiTV/CommandGUI#7
2022-04-16 14:09:16 +02:00
58409dc523 Update pom.xml 2022-04-15 20:30:20 +02:00
17b1a0568e bugfix
If you didn't have the permission to see an item, you could still click on it and get the message that you don't have the permission. This has now been changed so that you only get the message if you can see the item.
2022-04-06 20:21:19 +02:00
3 changed files with 15 additions and 13 deletions

View File

@@ -6,7 +6,7 @@
<groupId>net.t2code</groupId>
<artifactId>CommandGUI_V2</artifactId>
<version>2.6.2_Snapshop-1</version>
<version>2.6.2_Snapshot-2</version>
<packaging>jar</packaging>
<name>CommandGUI</name>
@@ -82,7 +82,7 @@
<dependency>
<groupId>net.t2code</groupId>
<artifactId>T2CodeLib</artifactId>
<version>11.2</version>
<version>11.4</version>
</dependency>
<dependency>
<groupId>net.t2code</groupId>

View File

@@ -46,13 +46,13 @@ public class GUI_Listener implements Listener {
e.setCancelled(true);
for (Slot slot : gui.GUI_Slots) {
if (e.getSlot() != slot.Slot) continue;
if (!slot.Perm
|| player.hasPermission("commandgui.gui." + gui.Command_Command + ".slot." + (slot.Slot + 1))
|| player.hasPermission("commandgui.gui." + gui.Command_Command + ".slot." + (slot.Slot + 1) + ".use")
|| player.hasPermission("commandgui.admin")) {
if (!slot.Enable) continue;
if (!e.getCurrentItem().getItemMeta().getDisplayName().equals(Replace.replace(prefix, slot.Name))) continue;
if (e.getCurrentItem().getType() == ItemVersion.getHead() || e.getCurrentItem().getType() == Material.valueOf(slot.Item.toUpperCase().replace(".", "_"))) {
if (e.getCurrentItem().getType() == ItemVersion.getHead() || e.getCurrentItem().getType() == Material.valueOf(slot.Item.toUpperCase().replace(".", "_"))) {
if (!slot.Perm
|| player.hasPermission("commandgui.gui." + gui.Command_Command + ".slot." + (slot.Slot + 1))
|| player.hasPermission("commandgui.gui." + gui.Command_Command + ".slot." + (slot.Slot + 1) + ".use")
|| player.hasPermission("commandgui.admin")) {
if (!slot.Enable) continue;
if (!e.getCurrentItem().getItemMeta().getDisplayName().equals(Replace.replace(prefix, slot.Name))) continue;
if (slot.Cost_Enable) {
if (slot.Command_Enable || slot.Message_Enable || slot.OpenGUI_Enable || slot.ServerChange) {
if (!Vault.buy(prefix, player, slot.Price)) {
@@ -63,7 +63,8 @@ public class GUI_Listener implements Listener {
}
}.runTaskLater(plugin, 1L);
player.sendMessage(SelectMessages.No_money);
if (SelectConfig.Sound_NoMoney_Enable && SelectConfig.Sound_Enable) player.playSound(player.getLocation(), SelectConfig.Sound_NoMoney, 3, 1);
if (SelectConfig.Sound_NoMoney_Enable && SelectConfig.Sound_Enable)
player.playSound(player.getLocation(), SelectConfig.Sound_NoMoney, 3, 1);
} else {
player.sendMessage(SelectMessages.Buy_msg.replace("[itemname]", Replace.replace(prefix, slot.Name))
.replace("[price]", slot.Price + " " + SelectConfig.Currency));
@@ -71,9 +72,9 @@ public class GUI_Listener implements Listener {
}
}
} else execute(slot, player, e, gui);
}
} else player.sendMessage(SelectMessages.NoPermissionForItem.replace("[item]", Replace.replace(prefix, slot.Name))
} else player.sendMessage(SelectMessages.NoPermissionForItem.replace("[item]", Replace.replace(prefix, slot.Name))
.replace("[perm]", "commandgui.gui." + gui.Command_Command + ".slot." + (slot.Slot + 1)));
}
}
}
}

View File

@@ -69,7 +69,8 @@ public final class Main extends JavaPlugin {
if (PluginCheck.plotSquaredGUI()) {
PlotSquaredGUI = true;
addonEnable(Bukkit.getPluginManager().getPlugin("PlotSquaredGUI"));
}if (PluginCheck.luckyBox()) {
}
if (PluginCheck.luckyBox()) {
LuckyBox = true;
addonEnable(Bukkit.getPluginManager().getPlugin("T2C-LuckyBox"));
}