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,48 @@
|
||||
import net.draycia.carbon.*
|
||||
|
||||
description="CarbonChat-API"
|
||||
|
||||
dependencies {
|
||||
api("org.checkerframework:checker-qual:${CHECKER_QUAL_VER}")
|
||||
|
||||
api("net.kyori:adventure-api:$ADVENTURE_VER")
|
||||
api("net.kyori:adventure-nbt:$ADVENTURE_VER")
|
||||
api("net.kyori:adventure-platform-api:$ADVENTURE_PLATFORM_VER")
|
||||
api("net.kyori:adventure-text-serializer-plain:$ADVENTURE_VER")
|
||||
api("net.kyori:adventure-text-serializer-gson:$ADVENTURE_VER") {
|
||||
//excludeGroup("com.google.code.gson")
|
||||
}
|
||||
api("net.kyori:adventure-text-serializer-legacy:$ADVENTURE_VER")
|
||||
api("net.kyori:adventure-text-minimessage:$MINIMESSAGE_VER")
|
||||
|
||||
api("net.kyori:event-api:$KYORI_EVENT_API_VER")
|
||||
api("net.kyori:registry:$KYORI_REGISTRY_VER")
|
||||
|
||||
api("cloud.commandframework:cloud-core:$CLOUD_VER")
|
||||
|
||||
api("org.spongepowered:configurate-core:$CONFIGURATE_VER")
|
||||
|
||||
api("com.google.guava:guava:$GUAVA_VER")
|
||||
|
||||
compileOnlyApi("com.proximyst.moonshine:core:$MOONSHINE_VER")
|
||||
|
||||
// Provided by Minecraft
|
||||
compileOnlyApi("org.apache.logging.log4j:log4j-api:2.11.2")
|
||||
|
||||
compileOnlyApi("net.luckperms:api:$LUCKPERMS_API_VER")
|
||||
}
|
||||
|
||||
|
||||
publishing {
|
||||
/*
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
groupId = "net.draycia"
|
||||
artifactId = description
|
||||
version = projectVersion // No hash
|
||||
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -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