Skip to content

Commit

Permalink
fix command event, fixes #1657
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jun 28, 2018
1 parent 2d62b44 commit 410146a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.aufdemrand.denizen.objects.dCuboid;
import net.aufdemrand.denizen.objects.dEntity;
import net.aufdemrand.denizen.objects.dWorld;
import net.aufdemrand.denizen.scripts.containers.core.BukkitWorldScriptHelper;
import net.aufdemrand.denizen.utilities.DenizenAPI;
import net.aufdemrand.denizen.utilities.debugging.dB;
Expand Down Expand Up @@ -145,6 +146,9 @@ public void playerCommandPreprocess(PlayerCommandPreprocessEvent event) {
}
cuboid_context.add(cuboid.identifySimple());
}
for (String str : events) {
cuboidEvents.add(str + " in " + new dWorld(event.getPlayer().getLocation().getWorld()).identifySimple());
}
events.addAll(cuboidEvents);
// Add in cuboids context, with either the cuboids or an empty list
context.put("cuboids", cuboid_context);
Expand All @@ -162,7 +166,7 @@ public void playerCommandPreprocess(PlayerCommandPreprocessEvent event) {

// Run any event scripts and get the determination.
determination = BukkitWorldScriptHelper.doEvents(events,
null, dEntity.getPlayerFrom(event.getPlayer()), context).toUpperCase();
null, dEntity.getPlayerFrom(event.getPlayer()), context, true).toUpperCase();

// If a script has determined fulfilled, cancel this event so the player doesn't
// receive the default 'Invalid command' gibberish from bukkit.
Expand Down

0 comments on commit 410146a

Please sign in to comment.