mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-22 17:44:03 +00:00
Fixed valid block check to not include items
This commit is contained in:
@@ -87,6 +87,7 @@ public class BukkitWorld extends LocalWorld {
|
|||||||
private World world;
|
private World world;
|
||||||
private boolean skipNmsAccess = false;
|
private boolean skipNmsAccess = false;
|
||||||
private boolean skipNmsSafeSet = false;
|
private boolean skipNmsSafeSet = false;
|
||||||
|
private boolean skipNmsValidBlockCheck = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct the object.
|
* Construct the object.
|
||||||
@@ -866,7 +867,15 @@ public class BukkitWorld extends LocalWorld {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean isValidBlockType(int type) {
|
public boolean isValidBlockType(int type) {
|
||||||
return type <= 4095 && Material.getMaterial(type) != null;
|
if (!skipNmsValidBlockCheck) {
|
||||||
|
try {
|
||||||
|
return type >=0 && type < net.minecraft.server.Block.byId.length
|
||||||
|
&& net.minecraft.server.Block.byId[type] != null;
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(Level.SEVERE, "Error checking NMS valid block type", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Material.getMaterial(type) != null && Material.getMaterial(type).isBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user