Merge pull request #44 from LegameMc/hopper-event

Hopper Event - Check if the event is cancelled by other plugin such as ChestShop, QuickShop, etc
This commit is contained in:
James Peters 2021-03-21 12:13:46 +00:00 committed by GitHub
commit 115c9c2912
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,6 +35,8 @@ public class HopperListener implements Listener {
//TO HOPPER
if(event.getDestination().getHolder() instanceof Hopper){
if(event.getDestination().getLocation() != null){
// If the event is cancelled by other plugin
if(event.isCancelled()) return;
if(event.getDestination().getLocation().getBlock().isBlockPowered()) return;
}
event.setCancelled(!HopperFilter.isInFilter(event.getDestination().getLocation().getBlock(),event.getItem()));