Skip to content

Commit

Permalink
workaround a spigot dumb-dumb, thanks Patrons!
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Aug 18, 2017
1 parent ebba776 commit c10cda9
Showing 1 changed file with 5 additions and 7 deletions.
Expand Up @@ -13,6 +13,7 @@
import net.aufdemrand.denizencore.scripts.containers.ScriptContainer;
import net.aufdemrand.denizencore.utilities.CoreUtilities;
import org.bukkit.Bukkit;
import org.bukkit.event.Event;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
Expand Down Expand Up @@ -62,13 +63,10 @@ private boolean couldMatchIn(String lower) {
if (index == -1) return true;

String in = CoreUtilities.getXthArg(index + 1, lower);
if (in.equals("notable")
|| dWorld.matches(in)
|| dCuboid.matches(in)
|| dEllipsoid.matches(in)) {
return true;
if (in.equals("inventory")) {
return false;
}
return false;
return true;
}

private boolean runUsingCheck(ScriptContainer scriptContainer, String s, String lower) {
Expand Down Expand Up @@ -208,7 +206,7 @@ public void playerClicksBlock(PlayerInteractEvent event) {
location = event.hasBlock() ? new dLocation(event.getClickedBlock().getLocation()) : null;
relative = event.hasBlock() ? new dLocation(event.getClickedBlock().getRelative(event.getBlockFace()).getLocation()) : null;
click_type = new Element(event.getAction().name());
cancelled = event.isCancelled();
cancelled = event.isCancelled() && event.useItemInHand() == Event.Result.DENY; // Spigot is dumb!
this.event = event;
fire();
event.setCancelled(cancelled);
Expand Down

0 comments on commit c10cda9

Please sign in to comment.