mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 14:38:49 +00:00
It works kinda
This commit is contained in:
1 parent
ace3a496ef
commit
ecb80cef34
23 files changed
+407
-264
No files matched your search
@@ -0,0 +1,9 @@
|
||||
package net.draycia.carbon.api;
|
||||
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
public interface CarbonChat {
|
||||
|
||||
@NonNull Logger logger();
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package net.draycia.carbon.api;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public final class CarbonChatProvider {
|
||||
|
||||
private CarbonChatProvider() {
|
||||
}
|
||||
|
||||
private static @Nullable CarbonChat instance;
|
||||
|
||||
public static void register(final @NonNull CarbonChat carbonChat) {
|
||||
CarbonChatProvider.instance = carbonChat;
|
||||
}
|
||||
|
||||
public static @NonNull CarbonChat carbonChat() {
|
||||
if (CarbonChatProvider.instance == null) {
|
||||
throw new IllegalStateException("CarbonChat not initialized!"); // LuckPerms design go brrrr
|
||||
}
|
||||
|
||||
return CarbonChatProvider.instance;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package net.draycia.carbon.api;
|
||||
|
||||
import net.kyori.registry.DefaultedRegistryGetter;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* An extension of the DefaultedRegistryGetter that declares a defaultValue method
|
||||
* @param <K>
|
||||
* @param <V>
|
||||
*/
|
||||
public interface DefaultedKeyValueRegistry<K, V> extends DefaultedRegistryGetter<K, V> {
|
||||
|
||||
/**
|
||||
* Gets the default value.
|
||||
*
|
||||
* @return the default value
|
||||
*/
|
||||
@NonNull V defaultValue();
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user