Hopper Event

Check if the event is cancelled by other plugin such as ChestShop, QuickShop, etc
This commit is contained in:
LegameMc 2021-03-21 13:26:42 +08:00 committed by GitHub
parent cb99d7dcb3
commit 81e1d0f945
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()));