Prevented potential errors when trying to break blocks above world height

This commit is contained in:
Auxilor
2021-02-08 21:38:53 +00:00
parent 870dcd5c3f
commit ffe113d29d
4 changed files with 12 additions and 0 deletions

View File

@@ -11,6 +11,9 @@ public final class BlockBreak implements BlockBreakProxy {
@Override
public void breakBlock(@NotNull final Player player,
@NotNull final Block block) {
if (block.getY() > 255) {
return;
}
((CraftPlayer) player).getHandle().playerInteractManager.breakBlock(new BlockPosition(block.getX(), block.getY(), block.getZ()));
}
}

View File

@@ -11,6 +11,9 @@ public final class BlockBreak implements BlockBreakProxy {
@Override
public void breakBlock(@NotNull final Player player,
@NotNull final Block block) {
if (block.getY() > 255) {
return;
}
((CraftPlayer) player).getHandle().playerInteractManager.breakBlock(new BlockPosition(block.getX(), block.getY(), block.getZ()));
}
}

View File

@@ -11,6 +11,9 @@ public final class BlockBreak implements BlockBreakProxy {
@Override
public void breakBlock(@NotNull final Player player,
@NotNull final Block block) {
if (block.getY() > 255) {
return;
}
((CraftPlayer) player).getHandle().playerInteractManager.breakBlock(new BlockPosition(block.getX(), block.getY(), block.getZ()));
}
}

View File

@@ -11,6 +11,9 @@ public final class BlockBreak implements BlockBreakProxy {
@Override
public void breakBlock(@NotNull final Player player,
@NotNull final Block block) {
if (block.getY() > 255) {
return;
}
((CraftPlayer) player).getHandle().playerInteractManager.breakBlock(new BlockPosition(block.getX(), block.getY(), block.getZ()));
}
}