Permalink
Browse files

Skip range collected items if PipeRequestEvent is cancelled (#199)

  • Loading branch information...
BillyGalbreath authored and me4502 committed Jan 29, 2017
1 parent c9c4ad4 commit e6820ecafb84071ae52ac0d9e6e2265bdb7618e1
@@ -138,6 +138,10 @@ public boolean collect() {
PipeRequestEvent event = new PipeRequestEvent(pipe, new ArrayList<ItemStack>(Collections.singletonList(stack)), getBackBlock());
Bukkit.getPluginManager().callEvent(event);
+ if (event.isCancelled()) {
+ continue;
+ }
+
if(event.getItems().isEmpty()) {
entity.remove();
return true;

0 comments on commit e6820ec

Please sign in to comment.