Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): UnknownRegistryEntryException
- Loading branch information
1 parent
d2b9dcf
commit 787f85e
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
src/main/java/org/auioc/mcmod/arnicalib/api/game/registry/RegistryEntryException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.auioc.mcmod.arnicalib.api.game.registry; | ||
|
||
import org.auioc.mcmod.arnicalib.api.java.function.ThrowableSupplier; | ||
|
||
public class RegistryEntryException extends RuntimeException { | ||
|
||
public static final ThrowableSupplier<RegistryEntryException> UNKNOWN_ITEM = (id) -> () -> new Unknown("item", id); | ||
public static final ThrowableSupplier<RegistryEntryException> UNKNOWN_BLOCK = (id) -> () -> new Unknown("block", id); | ||
public static final ThrowableSupplier<RegistryEntryException> UNKNOWN_ENTITY_TYPE = (id) -> () -> new Unknown("entity type", id); | ||
public static final ThrowableSupplier<RegistryEntryException> UNKNOWN_MOB_EFFECT = (id) -> () -> new Unknown("mob effect", id); | ||
public static final ThrowableSupplier<RegistryEntryException> UNKNOWN_POTION = (id) -> () -> new Unknown("potion", id); | ||
public static final ThrowableSupplier<RegistryEntryException> UNKNOWN_SOUND_EVENT = (id) -> () -> new Unknown("sound event", id); | ||
|
||
public RegistryEntryException(String message) { | ||
super(message); | ||
} | ||
|
||
public RegistryEntryException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
public RegistryEntryException(Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
public static class Unknown extends RegistryEntryException { | ||
|
||
public Unknown(String type, String id) { | ||
super("Unknown " + type + " '" + id + "'"); | ||
} | ||
|
||
} | ||
|
||
} |