From ec438dc7d9b4d42d1ebf37be464b9b5b2dc8d397 Mon Sep 17 00:00:00 2001 From: ferriarnus <61201275+ferriarnus@users.noreply.github.com> Date: Tue, 19 Mar 2024 21:31:02 +0100 Subject: [PATCH] fix biome colors and rename --- gradle.properties | 2 +- src/main/java/me/cortex/voxy/MixyStub.java | 16 +++++++++++++ src/main/java/me/cortex/voxy/VoxyStub.java | 6 ----- src/main/java/me/cortex/voxy/client/Voxy.java | 3 ++- .../voxy/client/core/model/ModelManager.java | 4 ++-- .../voxy/common/config/Serialization.java | 3 ++- src/main/resources/META-INF/mods.toml | 23 +++++++++---------- 7 files changed, 34 insertions(+), 23 deletions(-) create mode 100644 src/main/java/me/cortex/voxy/MixyStub.java diff --git a/gradle.properties b/gradle.properties index 069eb2e9..d6a35e58 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ loader_version=0.15.1 # Mod Properties mod_version = 0.1.5-alpha maven_group = me.cortex -archives_base_name = voxy +archives_base_name = mixy fabric_version=0.91.1+1.20.4 diff --git a/src/main/java/me/cortex/voxy/MixyStub.java b/src/main/java/me/cortex/voxy/MixyStub.java new file mode 100644 index 00000000..924f3599 --- /dev/null +++ b/src/main/java/me/cortex/voxy/MixyStub.java @@ -0,0 +1,16 @@ +package me.cortex.voxy; + +import me.cortex.voxy.client.config.VoxyConfigScreenFactory; +import net.neoforged.fml.ModContainer; +import net.neoforged.fml.common.Mod; +import net.neoforged.neoforge.client.ConfigScreenHandler; + +@Mod(MixyStub.MODID) +public class MixyStub { + + public static final String MODID = "mixy"; + + public MixyStub(ModContainer container) { + container.registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class, () -> new ConfigScreenHandler.ConfigScreenFactory(VoxyConfigScreenFactory.getModConfigScreenFactory())); + } +} diff --git a/src/main/java/me/cortex/voxy/VoxyStub.java b/src/main/java/me/cortex/voxy/VoxyStub.java index 5f839a2e..c6ac2e3d 100644 --- a/src/main/java/me/cortex/voxy/VoxyStub.java +++ b/src/main/java/me/cortex/voxy/VoxyStub.java @@ -1,13 +1,7 @@ package me.cortex.voxy; -import me.cortex.voxy.client.config.VoxyConfigScreenFactory; -import net.neoforged.fml.ModContainer; import net.neoforged.fml.common.Mod; -import net.neoforged.neoforge.client.ConfigScreenHandler; @Mod("voxy") public class VoxyStub { - public VoxyStub(ModContainer container) { - container.registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class, () -> new ConfigScreenHandler.ConfigScreenFactory(VoxyConfigScreenFactory.getModConfigScreenFactory())); - } } diff --git a/src/main/java/me/cortex/voxy/client/Voxy.java b/src/main/java/me/cortex/voxy/client/Voxy.java index 52b8926e..44ee1509 100644 --- a/src/main/java/me/cortex/voxy/client/Voxy.java +++ b/src/main/java/me/cortex/voxy/client/Voxy.java @@ -1,5 +1,6 @@ package me.cortex.voxy.client; +import me.cortex.voxy.MixyStub; import me.cortex.voxy.client.core.VoxelCore; import me.cortex.voxy.client.saver.ContextSelectionSystem; import me.cortex.voxy.client.terrain.WorldImportCommand; @@ -15,7 +16,7 @@ public class Voxy { public static final String VERSION; static { - VERSION = ModList.get().getModFileById("voxy").versionString(); + VERSION = ModList.get().getModFileById(MixyStub.MODID).versionString(); } @SubscribeEvent diff --git a/src/main/java/me/cortex/voxy/client/core/model/ModelManager.java b/src/main/java/me/cortex/voxy/client/core/model/ModelManager.java index 842816ed..8dcb1ced 100644 --- a/src/main/java/me/cortex/voxy/client/core/model/ModelManager.java +++ b/src/main/java/me/cortex/voxy/client/core/model/ModelManager.java @@ -192,7 +192,7 @@ public int addEntry(int blockId, BlockState blockState) { this.fluidStateLUT[modelId] = clientFluidStateId; } - var colourProvider = MinecraftClient.getInstance().getBlockColors().providers.get(Registries.BLOCK.getRawId(blockState.getBlock())); + var colourProvider = MinecraftClient.getInstance().getBlockColors().providers.get(blockState.getBlock()); RenderLayer blockRenderLayer = null; @@ -385,7 +385,7 @@ public void addBiome(int id, Biome biome) { int i = 0; for (var entry : this.modelsRequiringBiomeColours) { - var colourProvider = MinecraftClient.getInstance().getBlockColors().providers.get(Registries.BLOCK.getRawId(entry.getRight().getBlock())); + var colourProvider = MinecraftClient.getInstance().getBlockColors().providers.get(entry.getRight().getBlock()); if (colourProvider == null) { throw new IllegalStateException(); } diff --git a/src/main/java/me/cortex/voxy/common/config/Serialization.java b/src/main/java/me/cortex/voxy/common/config/Serialization.java index 95d2c744..96c05781 100644 --- a/src/main/java/me/cortex/voxy/common/config/Serialization.java +++ b/src/main/java/me/cortex/voxy/common/config/Serialization.java @@ -4,6 +4,7 @@ import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import me.cortex.voxy.MixyStub; import net.neoforged.fml.loading.LoadingModList; import java.io.BufferedReader; @@ -94,7 +95,7 @@ public T read(JsonReader in) throws IOException { Map, GsonConfigSerialization> serializers = new HashMap<>(); Set clazzs = new LinkedHashSet<>(); - var path = LoadingModList.get().getModFileById("voxy").getFile().getFilePath().getRoot(); + var path = LoadingModList.get().getModFileById(MixyStub.MODID).getFile().getFilePath().getRoot(); clazzs.addAll(collectAllClasses(path, BASE_SEARCH_PACKAGE)); clazzs.addAll(collectAllClasses(BASE_SEARCH_PACKAGE)); int count = 0; diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 0dc84ea5..19b42572 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -2,9 +2,9 @@ modLoader="javafml" loaderVersion="[1,)" license="LGPL-3.0" [[mods]] -modId="voxy" +modId="mixy" version="${version}" -displayName="Voxy" +displayName="Mixy" displayTest = "IGNORE_SERVER_VERSION" #logoFile="assets/voxy/icon.png" authors="Cortex, Ferri_Arnus" @@ -39,13 +39,12 @@ config = "voxy.mixins.json" [[accessTransformers]] file="META-INF/accesstransformer.cfg" -#[[mods]] -#modId="nvidium" -#displayName="Nvidium (Acedium)" -#version="${version}" -#authors="Cortex" -#logoFile="assets/nvidium/nvidium.png" -#description=''' -#Experimental port of nvidium, bugs will be present -#Replacement rendering engine for sodium/embeddium -#''' \ No newline at end of file +[[mods]] +modId="voxy" +displayName="Voxy (Mixy)" +version="${version}" +authors="Cortex" +logoFile="assets/voxy/icon.png" +description=''' +Far distance rendering mod utilising LoDs +''' \ No newline at end of file