mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-02 10:57:11 +00:00
Fail silently if correct NMS version is not found.
This will fix errors when trying to set blocks when using the wrong minecraft version. However, if users want support for schematics or copy/pasting blocks with advanced data (eg things not yet supported by Bukkit like mob spawner potentials or blocks from mods), they will have to use the WorldEdit version corresponding to their Minecraft version.
This commit is contained in:
parent
c634ad6d08
commit
090052df5a
@ -886,10 +886,8 @@ public class BukkitWorld extends LocalWorld {
|
||||
public boolean isValidBlockType(int type) {
|
||||
if (!skipNmsValidBlockCheck) {
|
||||
try {
|
||||
return type == 0 || (type >= 1 && 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 NmsBlock.isValidBlockType(type);
|
||||
} catch (Throwable e) {
|
||||
skipNmsValidBlockCheck = true;
|
||||
}
|
||||
}
|
||||
|
@ -434,4 +434,9 @@ class NmsBlock extends BaseBlock implements TileEntityBlock {
|
||||
+ foreign.getClass().getCanonicalName());
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isValidBlockType(int type) throws NoClassDefFoundError {
|
||||
return type == 0 || (type >= 1 && type < net.minecraft.server.Block.byId.length
|
||||
&& net.minecraft.server.Block.byId[type] != null);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user