geforkt von Mirrors/FastAsyncWorldEdit
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.
Dieser Commit ist enthalten in:
Ursprung
c634ad6d08
Commit
090052df5a
@ -886,10 +886,8 @@ 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 >= 1 && type < net.minecraft.server.Block.byId.length
|
return NmsBlock.isValidBlockType(type);
|
||||||
&& net.minecraft.server.Block.byId[type] != null);
|
} catch (Throwable e) {
|
||||||
} catch (Exception e) {
|
|
||||||
logger.log(Level.SEVERE, "Error checking NMS valid block type", e);
|
|
||||||
skipNmsValidBlockCheck = true;
|
skipNmsValidBlockCheck = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -434,4 +434,9 @@ class NmsBlock extends BaseBlock implements TileEntityBlock {
|
|||||||
+ foreign.getClass().getCanonicalName());
|
+ 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren