mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 10:17:38 +01:00
[Bleeding] Add a check for illegal blocks. Addresses BUKKIT-1278. Needs more investigation.
By: feildmaster <admin@feildmaster.com>
This commit is contained in:
parent
6b217d17c4
commit
330cba4099
@ -514,6 +514,9 @@ public class CraftEventFactory {
|
|||||||
|
|
||||||
public static boolean callBlockBreakEvent(World world, int x, int y, int z, int id, int data, boolean creative, EntityHuman player) {
|
public static boolean callBlockBreakEvent(World world, int x, int y, int z, int id, int data, boolean creative, EntityHuman player) {
|
||||||
net.minecraft.server.Block blockType = net.minecraft.server.Block.byId[id];
|
net.minecraft.server.Block blockType = net.minecraft.server.Block.byId[id];
|
||||||
|
if (blockType == null) { // Illegal block ID
|
||||||
|
return true;
|
||||||
|
}
|
||||||
Block block = world.getWorld().getBlockAt(x, y, z);
|
Block block = world.getWorld().getBlockAt(x, y, z);
|
||||||
|
|
||||||
// Tell client the block is gone immediately then process events
|
// Tell client the block is gone immediately then process events
|
||||||
|
Loading…
Reference in New Issue
Block a user