Skip to content

Commit

Permalink
why
Browse files Browse the repository at this point in the history
  • Loading branch information
KrLite committed Oct 2, 2023
1 parent 6104c54 commit 8744844
Show file tree
Hide file tree
Showing 156 changed files with 4 additions and 13,818 deletions.
64 changes: 0 additions & 64 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -84,70 +84,6 @@ dependencies {
modImplementation(libs.quilt.loader)
modImplementation(libs.quilted.fabric.api)

// Create
/*
modImplementation(
"com.simibubi.create:create-fabric-" +
"${property("minecraftVersion")}" + ":" +
"${property("createVersion")}" +
"+mc" + "${property("minecraftVersion")}"
) { exclude(group = "com.github.AlphaMode") }
*/

// Implemented Mods
// - Miscellaneous
modImplementation(
"slimeknights.mantle:Mantle:" +
"${property("minecraftVersion")}" + "-" +
"${property("mantleVersion")}"
) { exclude(group = "com.github.AlphaMode") }

// - Modrinth Maven
modImplementation("maven.modrinth:ad-astra:${property("adAstraVersion")}")
modImplementation("maven.modrinth:architectury-api:${property("architecturyVersion")}+fabric")
modImplementation("maven.modrinth:bits-and-chisels:${property("bitsAndChiselsVersion")}")
modImplementation("maven.modrinth:farmers-delight-fabric:${property("farmersDelightVersion")}")
modImplementation("maven.modrinth:hephaestus:${property("minecraftVersion")}-${property("hephaestusVersion")}")
modImplementation("maven.modrinth:let:${property("letVersion")}-mc${property("minecraftMajorVersion")}")

// - Curse Maven
modImplementation("curse.maven:industrial-revolution-391708:${property("indrevVersion")}")
modImplementation("curse.maven:ftb-quests-fabric-438496:${property("ftbQuestsVersion")}")
modImplementation("curse.maven:ftb-library-fabric-438495:${property("ftbLibraryVersion")}")

// - JitPack
modImplementation("com.github.KrLite.Equator-v2:build:${property("equatorVersion")}-mc${property("minecraftMajorVersion")}")

// Mod Apis
modApi("com.terraformersmc:modmenu:${property("modmenuVersion")}")
modApi("me.shedaniel.cloth:cloth-config-fabric:${property("clothConfigVersion")}") {
exclude(group = "net.fabricmc.fabric-api")
}

// Included
include("com.github.DM-Earth:Tags-Binder:${property("tagsBinderVersion")}")?.let {
modApi(it)
}

include("pers.solid:brrp-fabric:${property("brrpVersion")}-${property("minecraftVersion")}")?.let {
modApi(it)
}

include("com.github.KrLite:Pierced:${property("piercedVersion")}")?.let {
api(it)
}

include("net.objecthunter:exp4j:${property("exp4jVersion")}")?.let {
implementation(it)
}

// Development
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")

modCompileOnly("me.shedaniel:RoughlyEnoughItems-default-plugin-fabric:${property("reiVersion")}")
modCompileOnly("me.shedaniel:RoughlyEnoughItems-api-fabric:${property("reiVersion")}")
modRuntimeOnly("me.shedaniel:RoughlyEnoughItems-fabric:${property("reiVersion")}")
}

tasks {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# The latest versions are available at https://lambdaurora.dev/tools/import_quilt.html
minecraft = "1.20.1"
quilt_mappings = "1.20.1+build.23"
quilt_loader = "0.21.0"
quilt_loader = "0.17.0"

quilted_fabric_api = "7.3.1+0.89.3-1.20.1"

Expand Down
163 changes: 0 additions & 163 deletions src/main/java/dm/earth/cabricality/Cabricality.java
Original file line number Diff line number Diff line change
@@ -1,176 +1,13 @@
package dm.earth.cabricality;

import dm.earth.cabricality.config.CabfConfig;
import dm.earth.cabricality.content.alchemist.Alchemist;
import dm.earth.cabricality.content.core.TechThread;
import dm.earth.cabricality.content.entries.CabfBlockEntityTypes;
import dm.earth.cabricality.content.entries.CabfBlocks;
import dm.earth.cabricality.content.entries.CabfFluids;
import dm.earth.cabricality.content.entries.CabfItems;
import dm.earth.cabricality.content.entries.CabfRecipeSerializers;
import dm.earth.cabricality.content.entries.CabfSounds;
import dm.earth.cabricality.content.trading.data.recipe.Trading;
import dm.earth.cabricality.listener.DeployerCuttingRecipeHandler;
import dm.earth.cabricality.listener.UseEntityListener;
import dm.earth.cabricality.network.CabfReceiver;
import dm.earth.cabricality.tweak.BlockTagTweaks;
import dm.earth.cabricality.tweak.ItemTagTweaks;
import io.github.fabricators_of_create.porting_lib.util.EnvExecutor;
import net.fabricmc.api.EnvType;
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;
import net.krlite.equator.visual.color.AccurateColor;
import net.krlite.equator.visual.texture.Texture;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.sound.SoundEvent;
import net.minecraft.sound.SoundEvents;
import net.minecraft.text.MutableText;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.quiltmc.loader.api.ModContainer;
import org.quiltmc.loader.api.minecraft.ClientOnly;
import org.quiltmc.qsl.base.api.entrypoint.ModInitializer;
import org.quiltmc.qsl.resource.loader.api.ResourceLoader;
import org.quiltmc.qsl.resource.loader.api.ResourcePackActivationType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pers.solid.brrp.v1.api.RuntimeResourcePack;
import pers.solid.brrp.v1.fabric.api.RRPCallback;

import java.util.function.Supplier;

public class Cabricality implements ModInitializer {
public static class Colors {
public static final AccurateColor OLD_CABF_PURPLE = AccurateColor.fromARGB(0x6117DE);
public static final AccurateColor OLD_CABF_MID_PURPLE = AccurateColor.fromARGB(0x3A1677);
public static final AccurateColor OLD_CABF_DIM_PURPLE = AccurateColor.fromARGB(0x1B1329);
public static final AccurateColor OLD_CABF_GRAY_PURPLE = AccurateColor.fromARGB(0x2F2939);
public static final AccurateColor OLD_CABF_BRIGHT_PURPLE = AccurateColor.fromARGB(0xE0DBE8);
public static final AccurateColor OLD_CABF_BLACK = AccurateColor.fromARGB(0x0D0C0E);
public static final AccurateColor QUEST_DEPENDENCY = AccurateColor.fromARGB(0x4BFE90);
public static final AccurateColor QUEST_DEPENDENT = AccurateColor.fromARGB(0x7B62FF);

// assets/brand.png
public static final AccurateColor WHITE = AccurateColor.fromARGB(0xF6F8FF);
public static final AccurateColor WHITESMOKE = AccurateColor.fromARGB(0xC8C7FF);
public static final AccurateColor TURQUOISE = AccurateColor.fromARGB(0x3CFFCE);
public static final AccurateColor BLACK = AccurateColor.fromARGB(0x001011);
public static final AccurateColor PURPLE_BRIGHTEST = AccurateColor.fromARGB(0x7769FF);
public static final AccurateColor PURPLE_BRIGHTER = AccurateColor.fromARGB(0x5D43FF);
public static final AccurateColor PURPLE_BRIGHT = AccurateColor.fromARGB(0x4F27FF);
public static final AccurateColor PURPLE = AccurateColor.fromARGB(0x4D00FF);
public static final AccurateColor PURPLE_DIM = AccurateColor.fromARGB(0x3C0FAA);
public static final AccurateColor PURPLE_DIMMER = AccurateColor.fromARGB(0x380B9C);
public static final AccurateColor PURPLE_DIMMEST = AccurateColor.fromARGB(0x300680);
}

public static class Textures {
public static final Texture CABRICALITY_LOGO = texture("gui", "title", "logo");
public static final Texture CABRICALITY_LOGO_NEON = texture("gui", "title", "logo_neon");
}

public static class Sounds {
public static final SoundEvent[] FINISH_LOADING = {
SoundEvents.BLOCK_BEACON_ACTIVATE, SoundEvents.BLOCK_BELL_RESONATE
};
}

public static class ItemGroups {
public static ItemGroup GENERAL = create(Cabricality.id("main"),
() -> Registries.ITEM.get(Cabricality.id("andesite_machine")).getDefaultStack());
public static ItemGroup SUBSTRATES = create(Cabricality.id("substrates"),
() -> Registries.ITEM.get(Cabricality.id("jar")).getDefaultStack());

private static ItemGroup create(Identifier identifier, Supplier<ItemStack> icon) {
RegistryKey<ItemGroup> key = RegistryKey.of(RegistryKeys.ITEM_GROUP, identifier);

return Registry.register(Registries.ITEM_GROUP, key, FabricItemGroup.builder()
.icon(icon)
.build());
}
}

public static class RRPs {
public static final RuntimeResourcePack CLIENT_RESOURCES = RuntimeResourcePack
.create(id("client_resources"));
public static final RuntimeResourcePack SERVER_RESOURCES = RuntimeResourcePack
.create(id("server_resources"));
}

public static final String ID = "cabricality", NAME = "Cabricality";
public static final Logger LOGGER = LoggerFactory.getLogger(ID);
public static final CabfConfig CONFIG = new CabfConfig();
private static long initTime = -1;

@Contract("_ -> new")
public static @NotNull Identifier id(String... paths) {
return new Identifier(ID, String.join("/", paths));
}

@Contract("_ -> new")
public static @NotNull Texture texture(String... paths) {
return Texture.fromNamespacePath(ID, paths);
}

@Contract("_,_ -> new")
public static @NotNull String genTranslationKey(String type, String... path) {
return type + "." + ID + "." + String.join(".", path);
}

@Contract("_,_ -> new")
public static @NotNull MutableText genTranslatableText(String type, String... path) {
return Text.translatable(genTranslationKey(type, path));
}

@ClientOnly
private static void initClientAssets() {
RRPCallback.AFTER_VANILLA.register(list -> list.add(RRPs.CLIENT_RESOURCES));
}

@Override
public void onInitialize(ModContainer mod) {
CONFIG.save();
LOGGER.info("📦 Initializing " + NAME + "...");
initTime = System.currentTimeMillis();

CabfReceiver.registerServer();

Trading.load();
Alchemist.load();
DeployerCuttingRecipeHandler.load();
CabfItems.register();
CabfBlocks.register();
CabfFluids.register();
CabfSounds.register();
CabfBlockEntityTypes.register();
CabfRecipeSerializers.register();

ItemTagTweaks.load();
BlockTagTweaks.load();
for (TechThread thread : TechThread.THREADS)
thread.load();
UseEntityListener.load();
EnvExecutor.runWhenOn(EnvType.CLIENT, () -> Cabricality::initClientAssets);
RRPCallback.AFTER_VANILLA.register(list -> list.add(RRPs.SERVER_RESOURCES));

ResourceLoader.registerBuiltinResourcePack(id("data_overrides"),
ResourcePackActivationType.ALWAYS_ENABLED);
}

public static void finishLoading() {
if (initTime != -1) {
double millis = System.currentTimeMillis() - initTime;

Cabricality.LOGGER.info("⚙️ " + NAME + " has initialized in "
+ (millis >= 1000 ? (millis / 1000.0 + "s") : (millis + "ms")) + "!");

initTime = -1;
}
}
}
3 changes: 1 addition & 2 deletions src/main/java/dm/earth/cabricality/CabricalityPreInit.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package dm.earth.cabricality;

import dm.earth.cabricality.lib.util.mod.CabfModConflict;
import org.jetbrains.annotations.Nullable;
import org.quiltmc.loader.api.ModContainer;
import org.quiltmc.loader.api.entrypoint.PreLaunchEntrypoint;

public class CabricalityPreInit implements PreLaunchEntrypoint {
@Override
public void onPreLaunch(ModContainer mod) {
CabfModConflict.checkAndExit();
// CabfModConflict.checkAndExit();

// Prevents PCL2 from launching
@Nullable String launcherBrand = System.getProperty("minecraft.launcher.brand");
Expand Down
85 changes: 0 additions & 85 deletions src/main/java/dm/earth/cabricality/client/CabricalityClient.java

This file was deleted.

19 changes: 0 additions & 19 deletions src/main/java/dm/earth/cabricality/client/FluidColorRegistry.java

This file was deleted.

Loading

0 comments on commit 8744844

Please sign in to comment.