diff --git a/src/main/java/net/zepalesque/zenith/Zenith.java b/src/main/java/net/zepalesque/zenith/Zenith.java index 43c1524..0989e2d 100644 --- a/src/main/java/net/zepalesque/zenith/Zenith.java +++ b/src/main/java/net/zepalesque/zenith/Zenith.java @@ -14,6 +14,7 @@ import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent; import net.neoforged.fml.loading.FMLPaths; +import net.neoforged.neoforge.data.event.GatherDataEvent; import net.neoforged.neoforge.registries.DataPackRegistryEvent; import net.zepalesque.zenith.api.condition.Condition; import net.zepalesque.zenith.api.condition.ConditionElements; @@ -51,6 +52,14 @@ public Zenith(IEventBus bus, Dist dist) { ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, ZConfig.COMMON_SPEC, MODID + "/common.toml"); } + + + + + + + + private void commonSetup(final FMLCommonSetupEvent event) { } diff --git a/src/main/java/net/zepalesque/zenith/config/ZConfig.java b/src/main/java/net/zepalesque/zenith/config/ZConfig.java index b549eba..c7bfa64 100644 --- a/src/main/java/net/zepalesque/zenith/config/ZConfig.java +++ b/src/main/java/net/zepalesque/zenith/config/ZConfig.java @@ -19,8 +19,8 @@ public static class Common { public Common(ModConfigSpec.Builder builder) { builder.push("TODO"); placeholder = builder - .comment("Temporary placeholder config") - .define("placeholder", true); + .comment("Temporary placeholder config, used") + .define("Placeholder Config", true); builder.pop(); } } diff --git a/src/main/java/net/zepalesque/zenith/util/DataGenUtil.java b/src/main/java/net/zepalesque/zenith/util/DataGenUtil.java index 843387f..19e8685 100644 --- a/src/main/java/net/zepalesque/zenith/util/DataGenUtil.java +++ b/src/main/java/net/zepalesque/zenith/util/DataGenUtil.java @@ -1,15 +1,13 @@ package net.zepalesque.zenith.util; import net.minecraft.core.Registry; -import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.level.block.Block; -import net.neoforged.neoforge.registries.NeoForgeRegistries; +import net.neoforged.neoforge.registries.DeferredHolder; import org.codehaus.plexus.util.StringUtils; import java.util.function.Supplier; -public class DataGenUtil { +public class DatagenUtil { public static ResourceLocation getId(Supplier object, Registry registry) { return registry.getKey(object.get()); @@ -22,4 +20,8 @@ public static String getNameLocalized(String id) { public static String getNameLocalized(Supplier object, Registry registry) { return getNameLocalized(getId(object, registry).getPath()); } + + public static String getNameLocalized(DeferredHolder holder) { + return getNameLocalized(holder.getId().getPath()); + } } diff --git a/src/main/java/net/zepalesque/zenith/util/lambda/consumer/HexConsumer.java b/src/main/java/net/zepalesque/zenith/util/lambda/consumer/HexConsumer.java new file mode 100644 index 0000000..a4bf079 --- /dev/null +++ b/src/main/java/net/zepalesque/zenith/util/lambda/consumer/HexConsumer.java @@ -0,0 +1,26 @@ +package net.zepalesque.zenith.util.lambda.consumer; + +/** + * An operation that accepts six upper arguments and returns no result. + * + * @param type of the first argument + * @param type of the second argument + * @param type of the third argument + * @param type of the fourth argument + * @param type of the fifth argument + * @param type of the sixth argument + * + */ +public interface HexConsumer { + + /** + * Performs the operation given the specified arguments. + * @param k the first upper argument + * @param v the second upper argument + * @param s the third upper argument + * @param t the fourth upper argument + * @param r the fifth upper argument + * @param y the sixth upper argument + */ + void accept(K k, V v, S s, T t, R r, Y y); +} \ No newline at end of file diff --git a/src/main/java/net/zepalesque/zenith/util/lambda/consumer/QuadConsumer.java b/src/main/java/net/zepalesque/zenith/util/lambda/consumer/QuadConsumer.java new file mode 100644 index 0000000..1de0d23 --- /dev/null +++ b/src/main/java/net/zepalesque/zenith/util/lambda/consumer/QuadConsumer.java @@ -0,0 +1,22 @@ +package net.zepalesque.zenith.util.lambda.consumer; + +/** + * An operation that accepts four upper arguments and returns no result. + * + * @param type of the first argument + * @param type of the second argument + * @param type of the third argument + * @param type of the fourth argument + + */ +public interface QuadConsumer { + + /** + * Performs the operation given the specified arguments. + * @param k the first upper argument + * @param v the second upper argument + * @param s the third upper argument + * @param t the fourth upper argument + */ + void accept(K k, V v, S s, T t); +} \ No newline at end of file diff --git a/src/main/java/net/zepalesque/zenith/util/lambda/consumer/SeptConsumer.java b/src/main/java/net/zepalesque/zenith/util/lambda/consumer/SeptConsumer.java new file mode 100644 index 0000000..81a86c8 --- /dev/null +++ b/src/main/java/net/zepalesque/zenith/util/lambda/consumer/SeptConsumer.java @@ -0,0 +1,28 @@ +package net.zepalesque.zenith.util.lambda.consumer; + +/** + * An operation that accepts seven upper arguments and returns no result. + * + * @param type of the first argument + * @param type of the second argument + * @param type of the third argument + * @param type of the fourth argument + * @param type of the fifth argument + * @param type of the sixth argument + * @param type of the seventh argument + + */ +public interface SeptConsumer { + + /** + * Performs the operation given the specified arguments. + * @param k the first upper argument + * @param v the second upper argument + * @param s the third upper argument + * @param t the fourth upper argument + * @param r the fifth upper argument + * @param q the sixth upper argument + * @param l the seventh upper argument + */ + void accept(K k, V v, S s, T t, R r, Q q, L l); +} \ No newline at end of file diff --git a/src/main/java/net/zepalesque/zenith/util/lambda/function/HexFunction.java b/src/main/java/net/zepalesque/zenith/util/lambda/function/HexFunction.java new file mode 100644 index 0000000..9f3adb5 --- /dev/null +++ b/src/main/java/net/zepalesque/zenith/util/lambda/function/HexFunction.java @@ -0,0 +1,28 @@ +package net.zepalesque.zenith.util.lambda.function; + +/** + * An operation that accepts six upper arguments and returns a result. + * + * @param type of the first argument + * @param type of the second argument + * @param type of the third argument + * @param type of the fourth argument + * @param type of the fifth argument + * @param type of the sixth argument + * + * @param type of the return value + + */ +public interface HexFunction { + + /** + * Performs the operation given the specified arguments. + * @param k the first upper argument + * @param v the second upper argument + * @param s the third upper argument + * @param t the fourth upper argument + * @param r the fifth upper argument + * @param y the sixth upper argument + */ + Z apply(K k, V v, S s, T t, R r, Y y); +} \ No newline at end of file diff --git a/src/main/java/net/zepalesque/zenith/util/lambda/function/OctoFunction.java b/src/main/java/net/zepalesque/zenith/util/lambda/function/OctoFunction.java new file mode 100644 index 0000000..9afd316 --- /dev/null +++ b/src/main/java/net/zepalesque/zenith/util/lambda/function/OctoFunction.java @@ -0,0 +1,32 @@ +package net.zepalesque.zenith.util.lambda.function; + +/** + * An operation that accepts eight upper arguments and returns a result. + * + * @param type of the first argument + * @param type of the second argument + * @param type of the third argument + * @param type of the fourth argument + * @param type of the fifth argument + * @param type of the sixth argument + * @param type of the seventh argument + * @param type of the eighth argument + * + * @param type of the return value + + */ +public interface OctoFunction { + + /** + * Performs the operation given the specified arguments. + * @param k the first upper argument + * @param v the second upper argument + * @param s the third upper argument + * @param t the fourth upper argument + * @param r the fifth upper argument + * @param q the sixth upper argument + * @param l the seventh upper argument + * @param x the eighth upper argument + */ + Z apply(K k, V v, S s, T t, R r, Q q, L l, X x); +} \ No newline at end of file diff --git a/src/main/java/net/zepalesque/zenith/util/lambda/function/QuadFunction.java b/src/main/java/net/zepalesque/zenith/util/lambda/function/QuadFunction.java new file mode 100644 index 0000000..1f7ca73 --- /dev/null +++ b/src/main/java/net/zepalesque/zenith/util/lambda/function/QuadFunction.java @@ -0,0 +1,23 @@ +package net.zepalesque.zenith.util.lambda.function; + +/** + * An operation that accepts four upper arguments and returns a result. + * + * @param type of the first argument + * @param type of the second argument + * @param type of the third argument + * @param type of the fourth argument + * @param type of the result + + */ +public interface QuadFunction { + + /** + * Performs the operation given the specified arguments. + * @param k the first upper argument + * @param v the second upper argument + * @param s the third upper argument + * @param t the fourth upper argument + */ + R apply(K k, V v, S s, T t); +} \ No newline at end of file