mirror of
https://github.com/JamesPeters98/ChestsPlusPlus.git
synced 2025-01-26 02:01:55 +01:00
Hopper Event
Check if the event is cancelled by other plugin such as ChestShop, QuickShop, etc
This commit is contained in:
parent
cb99d7dcb3
commit
81e1d0f945
@ -35,6 +35,8 @@ public class HopperListener implements Listener {
|
|||||||
//TO HOPPER
|
//TO HOPPER
|
||||||
if(event.getDestination().getHolder() instanceof Hopper){
|
if(event.getDestination().getHolder() instanceof Hopper){
|
||||||
if(event.getDestination().getLocation() != null){
|
if(event.getDestination().getLocation() != null){
|
||||||
|
// If the event is cancelled by other plugin
|
||||||
|
if(event.isCancelled()) return;
|
||||||
if(event.getDestination().getLocation().getBlock().isBlockPowered()) return;
|
if(event.getDestination().getLocation().getBlock().isBlockPowered()) return;
|
||||||
}
|
}
|
||||||
event.setCancelled(!HopperFilter.isInFilter(event.getDestination().getLocation().getBlock(),event.getItem()));
|
event.setCancelled(!HopperFilter.isInFilter(event.getDestination().getLocation().getBlock(),event.getItem()));
|
||||||
|
Loading…
Reference in New Issue
Block a user