Skip to content

Commit

Permalink
Fix Anti spill (#644)
Browse files Browse the repository at this point in the history
* Working spill protect

* Start working back toward performance gains

* More changing back

* Even closer
  • Loading branch information
TylerS1066 authored Jun 4, 2024
1 parent 125a453 commit 6bb8199
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,11 @@ public void onBlockDispense(@NotNull BlockDispenseEvent e) {
public void onFlow(@NotNull BlockFromToEvent e) {
if (Settings.DisableSpillProtection || e.isCancelled())
return;
Block block = e.getToBlock();
Block block = e.getBlock();
if (!Tags.FLUID.contains(block.getType()))
return;

MovecraftLocation loc = MathUtils.bukkit2MovecraftLoc(e.getBlock().getLocation());
MovecraftLocation loc = MathUtils.bukkit2MovecraftLoc(block.getLocation());
MovecraftLocation toLoc = MathUtils.bukkit2MovecraftLoc(e.getToBlock().getLocation());
Craft craft = MathUtils.fastNearestCraftToLoc(CraftManager.getInstance().getCrafts(), e.getBlock().getLocation());
if (craft == null || !craft.getHitBox().contains((loc)) || craft.getFluidLocations().contains(toLoc))
Expand Down

0 comments on commit 6bb8199

Please sign in to comment.