Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,10 @@ public void onPistonEvent(@NotNull BlockPistonEvent e, final @NotNull List<Block
// prevent hoppers on cruising crafts
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onHopperEvent(@NotNull InventoryMoveItemEvent e) {
if (!(e.getSource().getHolder() instanceof Hopper))
if (!(e.getSource().getHolder(false) instanceof Hopper hopper))
return;

Hopper block = (Hopper) e.getSource().getHolder();
Location location = block.getLocation();
Location location = hopper.getLocation();
MovecraftLocation loc = MathUtils.bukkit2MovecraftLoc(location);
for (Craft craft : MathUtils.craftsNearLocFast(CraftManager.getInstance().getCrafts(), location)) {
if (craft.isNotProcessing() || !craft.getHitBox().contains(loc))
Expand Down
Loading