mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-27 20:58:40 +01:00
New materials don't even have an ID anymore
Handle that case as well. Honestly the best solution would be to just get rid of getBlockIDAt as it's only used in two places where it could be trivially replaced
This commit is contained in:
parent
f6c45adc5f
commit
b7c88f9911
@ -183,12 +183,17 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
|||||||
} catch (NoSuchMethodError e) {
|
} catch (NoSuchMethodError e) {
|
||||||
// We failed once, no need to retry
|
// We failed once, no need to retry
|
||||||
tryNativeId.set(false);
|
tryNativeId.set(false);
|
||||||
|
} catch (java.lang.IllegalArgumentException e) {
|
||||||
|
// Ignore this entirely, as modern materials throw
|
||||||
|
// java.lang.IllegalArgumentException: Cannot get ID of Modern Material
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// We're living in a world where numerical IDs have been phased out completely.
|
// We're living in a world where numerical IDs have been phased out completely.
|
||||||
// Let's return *some* number, because we need one
|
// Let's return *some* number, because we need one.
|
||||||
return material.ordinal();
|
// Also in that case we are adding a constant to ensure we're not conflicting with the
|
||||||
|
// actual IDs
|
||||||
|
return material.ordinal() + (1 << 20);
|
||||||
}
|
}
|
||||||
private static final int getBlockIdFromBlock(Block block) {
|
private static final int getBlockIdFromBlock(Block block) {
|
||||||
return getBlockIdFromMaterial(block.getType());
|
return getBlockIdFromMaterial(block.getType());
|
||||||
|
Loading…
Reference in New Issue
Block a user