mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-19 10:25:00 +00:00
Fixed reported bug that block #0 (air) is not considered valid.
Fixed a reported bug that block #0 (air) is not considered valid. Also set skipNmsValidBlockCheck to true if the check fails (as I assume was originally intended).
This commit is contained in:
parent
877f14f242
commit
0f49186bf5
@ -869,10 +869,11 @@ public class BukkitWorld extends LocalWorld {
|
|||||||
public boolean isValidBlockType(int type) {
|
public boolean isValidBlockType(int type) {
|
||||||
if (!skipNmsValidBlockCheck) {
|
if (!skipNmsValidBlockCheck) {
|
||||||
try {
|
try {
|
||||||
return type >=0 && type < net.minecraft.server.Block.byId.length
|
return type == 0 || (type >= 1 && type < net.minecraft.server.Block.byId.length
|
||||||
&& net.minecraft.server.Block.byId[type] != null;
|
&& net.minecraft.server.Block.byId[type] != null);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.log(Level.SEVERE, "Error checking NMS valid block type", e);
|
logger.log(Level.SEVERE, "Error checking NMS valid block type", e);
|
||||||
|
skipNmsValidBlockCheck = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Material.getMaterial(type) != null && Material.getMaterial(type).isBlock();
|
return Material.getMaterial(type) != null && Material.getMaterial(type).isBlock();
|
||||||
|
Loading…
Reference in New Issue
Block a user