mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 02:35:49 +01:00
Add additional validation to Player#breakBlock
By: md_5 <git@md-5.net>
This commit is contained in:
parent
c799ab1f6e
commit
472f590189
1 changed files with 3 additions and 0 deletions
|
@ -536,6 +536,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||
|
||||
@Override
|
||||
public boolean breakBlock(Block block) {
|
||||
Preconditions.checkArgument(block != null, "Block cannot be null");
|
||||
Preconditions.checkArgument(block.getWorld().equals(getWorld()), "Cannot break blocks across worlds");
|
||||
|
||||
return getHandle().gameMode.breakBlock(new BlockPosition(block.getX(), block.getY(), block.getZ()));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue