mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-25 09:31:46 +01:00
Prevents instant lava placing when scooping.
https://github.com/BentoBoxWorld/BentoBox/issues/1459
This commit is contained in:
parent
ab6799c159
commit
284b5865da
@ -50,6 +50,7 @@ public class ObsidianScoopingListener extends FlagListener {
|
||||
}
|
||||
|
||||
user.sendMessage("protection.flags.OBSIDIAN_SCOOPING.scooping");
|
||||
e.setCancelled(true);
|
||||
if (e.getItem().getAmount() == 1) {
|
||||
// Needs some special handling when there is only 1 bucket in the stack
|
||||
e.getItem().setType(Material.LAVA_BUCKET);
|
||||
|
@ -1,5 +1,6 @@
|
||||
package world.bentobox.bentobox.listeners.flags.worldsettings;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
@ -20,6 +21,7 @@ import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event.Result;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
@ -278,6 +280,7 @@ public class ObsidianScoopingListenerTest {
|
||||
// Test where the area is free of obby
|
||||
when(world.getBlockAt(Mockito.anyInt(), Mockito.anyInt(), Mockito.anyInt())).thenReturn(airBlock);
|
||||
assertTrue(listener.onPlayerInteract(event));
|
||||
assertEquals(Result.DENY, event.useInteractedBlock());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user