mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Throw, catch, and rethrow our own exception to make sure we're finding the culprit to a possible shaded-FAWE.
This commit is contained in:
parent
9e8f0e7325
commit
52fa44516e
@ -232,9 +232,16 @@ public class BlockTypesCache {
|
|||||||
defaultState = id;
|
defaultState = id;
|
||||||
}
|
}
|
||||||
if (values[internalId] != null) {
|
if (values[internalId] != null) {
|
||||||
|
// Ugly way of ensuring a stacktrace is printed so we can see the culprit. Rethrow because we still
|
||||||
|
// want to cancel whatever initialised the class.
|
||||||
|
try {
|
||||||
throw new IllegalStateException(String.format(
|
throw new IllegalStateException(String.format(
|
||||||
"Invalid duplicate id for %s! Something has gone very wrong. Are " +
|
"Invalid duplicate id for %s! Something has gone very wrong. Are " +
|
||||||
"any plugins shading FAWE?!", id));
|
"any plugins shading FAWE?!", id));
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
BlockType type = register(defaultState, internalId, stateList, tickList);
|
BlockType type = register(defaultState, internalId, stateList, tickList);
|
||||||
// Note: Throws IndexOutOfBoundsError if nothing is registered and blocksMap is empty
|
// Note: Throws IndexOutOfBoundsError if nothing is registered and blocksMap is empty
|
||||||
|
Loading…
Reference in New Issue
Block a user