Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>vault-repo</id>
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>placeholderapi</id>
Expand All @@ -42,18 +42,14 @@
<version>1.13.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency> <!-- Spigot (this includes Spigot API, Bukkit API, Craftbukkit and NMS) -->
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.13.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- Vault -->
<dependency>
<groupId>net.milkbowl.vault</groupId>
<groupId>com.github.MilkBowl</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.7</version>
<scope>provided</scope>
</dependency>
<!-- Placeholder API -->
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,22 +129,24 @@ public static boolean isNumeric(String str) {
}

private boolean validClick(InventoryClickEvent e) {
if (!(e.getWhoClicked() instanceof Player) || e.isCancelled())
// Check if a player clicked the inventory
if (!(e.getWhoClicked() instanceof Player))
return false;
// Clicks the inventory
if (!e.getInventory().equals(invs.get(e.getWhoClicked())))

// Check if event was canceled
if (e.isCancelled())
return false;
// Checks if click is valid
try {
e.getCurrentItem().getItemMeta().getDisplayName();
} catch (NullPointerException ex) {

// Check if they clicked a GUI from this plugin
if (!e.getInventory().equals(invs.get(e.getWhoClicked())))
return false;
}
// Clicks their own inventory

// Check if they clicked their own inventory
if (!e.getClickedInventory().equals(invs.get(e.getWhoClicked()))) {
e.setCancelled(true);
return false;
}

return true;
}
}