Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-24 18:10:08 +01: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.
Dieser Commit ist enthalten in:
Ursprung
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);
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren