From 225d03919b87b8027f1f6a31f979cd2b61bccae5 Mon Sep 17 00:00:00 2001 From: MartinSVK12 <37455793+MartinSVK12@users.noreply.github.com> Date: Wed, 2 Aug 2023 19:42:01 +0200 Subject: [PATCH] Updated to BTA 1.7.7.0! --- build.gradle | 58 +++++++++---------- gradle.properties | 6 +- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle | 6 +- .../io/github/prospector/modmenu/ModMenu.java | 5 +- .../prospector/modmenu/api/ModMenuApi.java | 11 ++-- .../modmenu/config/ModMenuConfig.java | 1 + .../modmenu/config/ModMenuConfigManager.java | 1 + .../gui/AlwaysSelectedEntryListWidget.java | 1 + .../modmenu/gui/DescriptionListWidget.java | 3 +- .../modmenu/gui/EntryListWidget.java | 16 ++--- .../prospector/modmenu/gui/ModListEntry.java | 5 +- .../prospector/modmenu/gui/ModListScreen.java | 10 ++-- .../prospector/modmenu/gui/ModListWidget.java | 3 +- .../modmenu/gui/ModMenuButtonWidget.java | 2 +- .../gui/ModMenuTexturedButtonWidget.java | 7 ++- .../modmenu/gui/TextFieldWidget.java | 15 ++--- .../modmenu/gui/entries/ChildEntry.java | 1 + .../modmenu/gui/entries/IndependentEntry.java | 1 + .../modmenu/gui/entries/ParentEntry.java | 5 +- .../modmenu/impl/ModMenuApiImpl.java | 1 + .../modmenu/mixin/GuiButtonAccessor.java | 3 +- .../modmenu/mixin/MinecraftAccessor.java | 7 ++- .../modmenu/mixin/MixinGuiIngameMenu.java | 7 ++- .../modmenu/mixin/MixinGuiMainMenu.java | 7 ++- .../modmenu/mixin/MixinTexturePacks.java | 5 +- .../mixin/TextFieldEditorAccessor.java | 3 +- .../modmenu/util/BadgeRenderer.java | 1 + .../prospector/modmenu/util/ButtonUtil.java | 3 +- .../modmenu/util/HardcodedUtil.java | 5 +- .../modmenu/util/ModListSearch.java | 1 + .../prospector/modmenu/util/RenderUtils.java | 5 +- .../modmenu/util/TestModContainer.java | 10 +++- src/main/resources/fabric.mod.json | 3 +- 34 files changed, 130 insertions(+), 90 deletions(-) diff --git a/build.gradle b/build.gradle index d532677e5..765e25b85 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'babric-loom' version '1.0.+' + id "org.quiltmc.loom" version "1.+" id 'java' } @@ -8,10 +8,10 @@ archivesBaseName = project.mod_name version = project.mod_version loom { - // gluedMinecraftJar() - noIntermediateMappings() clientOnlyMinecraftJar() - customMinecraftManifest.set("https://github.com/Turnip-Labs/bta-manifest-repo/releases/download/v${project.bta_version}/${project.bta_version}.json") + //serverOnlyMinecraftJar() + noIntermediateMappings() + customMinecraftManifest.set("https://github.com/MartinSVK12/bta-manifest-repo/releases/download/v${project.bta_version}/${project.bta_version}.json") } repositories { @@ -35,35 +35,43 @@ repositories { ivy { url = "https://github.com/Turnip-Labs" patternLayout { - artifact "[organisation]/releases/download/v[revision]/[module].jar" + artifact "[organisation]/releases/download/v[revision]/[module]-[revision].jar" + m2compatible = true + } + metadataSources { artifact() } + } + ivy { + url = "https://piston-data.mojang.com" + patternLayout { + artifact "v1/[organisation]/[revision]/[module].jar" + m2compatible = true + } + metadataSources { artifact() } + } + ivy { + url = "https://github.com/MartinSVK12" + patternLayout { + artifact "[organisation]/releases/download/[revision]/[module]-[revision].jar" m2compatible = true } metadataSources { artifact() } } - ivy { - url = "https://piston-data.mojang.com" - patternLayout { - artifact "v1/[organisation]/[revision]/[module].jar" - m2compatible = true - } - metadataSources { artifact() } - } } dependencies { minecraft "bta-download-repo:bta:${project.bta_version}" - mappings loom.layered() {} + mappings loom.layered {} modRuntimeOnly "objects:client:43db9b498cb67058d2e12d394e6507722e71bb45" // https://piston-data.mojang.com/v1/objects/43db9b498cb67058d2e12d394e6507722e71bb45/client.jar - modImplementation "babric:fabric-loader:${project.loader_version}" - - modImplementation "org.slf4j:slf4j-api:1.8.0-beta4" - modImplementation "org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0" + modImplementation("quilt-loader:quilt-loader:${project.loader_version}") implementation include("org.apache.commons:commons-lang3:3.12.0") - implementation include("com.google.guava:guava:28.0-jre") - implementation include(group: 'com.google.code.gson', name: 'gson', version: '2.8.6') + implementation include("com.google.guava:guava:28.0-jre") + implementation include(group: 'com.google.code.gson', name: 'gson', version: '2.8.6') + + modImplementation "org.slf4j:slf4j-api:1.8.0-beta4" + modImplementation "org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0" } java { @@ -72,7 +80,7 @@ java { withSourcesJar() } -tasks.withType(JavaCompile) { +tasks.withType(JavaCompile).configureEach { options.release.set 8 } @@ -81,11 +89,3 @@ jar { rename { "${it}_${archivesBaseName}" } } } - -processResources { - inputs.property "version", version - - filesMatching("fabric.mod.json") { - expand "version": version - } -} diff --git a/gradle.properties b/gradle.properties index 0d6f5b7b6..21e078ce7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,10 +3,10 @@ org.gradle.jvmargs=-Xmx1G # Also makes builds more reliable and less likely to randomly fail. org.gradle.daemon=false -mod_version=2.0.0-beta.1 +mod_version=2.0.0 mod_group=io.github.turniplabs mod_name=modmenu-bta # yarn_mappings=df0e26c -bta_version=1.7.7.0-pre1 -loader_version=0.14.6-babric.1 +bta_version=1.7.7.0 +loader_version=0.20.0-beta.3-bta diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4c97587ec..e148c40ba 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip diff --git a/settings.gradle b/settings.gradle index 19d867d08..882a4c139 100644 --- a/settings.gradle +++ b/settings.gradle @@ -13,5 +13,9 @@ pluginManagement { name = 'Babric' url = 'https://maven.glass-launcher.net/babric' } + maven { + name = 'Quilt' + url = 'https://maven.quiltmc.org/repository/release' + } } -} +} \ No newline at end of file diff --git a/src/main/java/io/github/prospector/modmenu/ModMenu.java b/src/main/java/io/github/prospector/modmenu/ModMenu.java index 9af5747a4..8faa269d7 100644 --- a/src/main/java/io/github/prospector/modmenu/ModMenu.java +++ b/src/main/java/io/github/prospector/modmenu/ModMenu.java @@ -1,5 +1,6 @@ package io.github.prospector.modmenu; + import com.google.common.collect.ImmutableMap; import com.google.common.collect.LinkedListMultimap; import com.google.gson.FieldNamingPolicy; @@ -14,8 +15,8 @@ import net.fabricmc.loader.api.metadata.CustomValue; import net.fabricmc.loader.api.metadata.ModMetadata; import net.minecraft.client.Minecraft; -import net.minecraft.core.gui.GuiScreen; -import net.minecraft.core.gui.options.GuiOptionsPageGeneral; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.options.GuiOptionsPageGeneral; import java.text.NumberFormat; import java.util.*; diff --git a/src/main/java/io/github/prospector/modmenu/api/ModMenuApi.java b/src/main/java/io/github/prospector/modmenu/api/ModMenuApi.java index d07aa62b1..2025f1fe0 100644 --- a/src/main/java/io/github/prospector/modmenu/api/ModMenuApi.java +++ b/src/main/java/io/github/prospector/modmenu/api/ModMenuApi.java @@ -1,17 +1,18 @@ package io.github.prospector.modmenu.api; + import io.github.prospector.modmenu.ModMenu; +import io.github.prospector.modmenu.util.TriConsumer; +import net.minecraft.client.gui.GuiScreen; +import org.jetbrains.annotations.ApiStatus; + import java.util.Optional; import java.util.function.Function; import java.util.function.Supplier; -import io.github.prospector.modmenu.util.TriConsumer; -import net.minecraft.core.gui.GuiScreen; -import org.jetbrains.annotations.ApiStatus; - public interface ModMenuApi { /** - * Replaced with {@link ModMenuApi#getConfigScreen(net.minecraft.core.gui.GuiScreen)}, with + * Replaced with {@link ModMenuApi#getConfigScreen(GuiScreen)}, with * the ModMenuApi implemented onto a class that is added as an * entry point to your fabric mod metadata. * diff --git a/src/main/java/io/github/prospector/modmenu/config/ModMenuConfig.java b/src/main/java/io/github/prospector/modmenu/config/ModMenuConfig.java index 0fe83adf4..cd0841e8f 100644 --- a/src/main/java/io/github/prospector/modmenu/config/ModMenuConfig.java +++ b/src/main/java/io/github/prospector/modmenu/config/ModMenuConfig.java @@ -1,5 +1,6 @@ package io.github.prospector.modmenu.config; + import io.github.prospector.modmenu.util.HardcodedUtil; import net.fabricmc.loader.api.ModContainer; diff --git a/src/main/java/io/github/prospector/modmenu/config/ModMenuConfigManager.java b/src/main/java/io/github/prospector/modmenu/config/ModMenuConfigManager.java index 1c237475b..8d32db6c0 100644 --- a/src/main/java/io/github/prospector/modmenu/config/ModMenuConfigManager.java +++ b/src/main/java/io/github/prospector/modmenu/config/ModMenuConfigManager.java @@ -1,5 +1,6 @@ package io.github.prospector.modmenu.config; + import io.github.prospector.modmenu.ModMenu; import net.fabricmc.loader.api.FabricLoader; diff --git a/src/main/java/io/github/prospector/modmenu/gui/AlwaysSelectedEntryListWidget.java b/src/main/java/io/github/prospector/modmenu/gui/AlwaysSelectedEntryListWidget.java index b89ee9fc4..be7793968 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/AlwaysSelectedEntryListWidget.java +++ b/src/main/java/io/github/prospector/modmenu/gui/AlwaysSelectedEntryListWidget.java @@ -5,6 +5,7 @@ package io.github.prospector.modmenu.gui; + import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.Minecraft; diff --git a/src/main/java/io/github/prospector/modmenu/gui/DescriptionListWidget.java b/src/main/java/io/github/prospector/modmenu/gui/DescriptionListWidget.java index 1ccaad01e..486a2720b 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/DescriptionListWidget.java +++ b/src/main/java/io/github/prospector/modmenu/gui/DescriptionListWidget.java @@ -1,10 +1,11 @@ package io.github.prospector.modmenu.gui; + import io.github.prospector.modmenu.util.HardcodedUtil; import io.github.prospector.modmenu.util.RenderUtils; import net.fabricmc.loader.api.metadata.Person; import net.minecraft.client.Minecraft; -import net.minecraft.core.render.FontRenderer; +import net.minecraft.client.render.FontRenderer; import java.util.Collection; diff --git a/src/main/java/io/github/prospector/modmenu/gui/EntryListWidget.java b/src/main/java/io/github/prospector/modmenu/gui/EntryListWidget.java index f80de35d0..4f8177328 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/EntryListWidget.java +++ b/src/main/java/io/github/prospector/modmenu/gui/EntryListWidget.java @@ -1,20 +1,22 @@ package io.github.prospector.modmenu.gui; + import com.google.common.collect.Lists; -import java.util.AbstractList; -import java.util.Collection; -import java.util.List; -import java.util.Objects; -import javax.annotation.Nullable; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.Minecraft; -import net.minecraft.core.gui.GuiScreen; -import net.minecraft.core.render.Tessellator; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.render.Tessellator; import net.minecraft.core.util.helper.MathHelper; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL14; +import javax.annotation.Nullable; +import java.util.AbstractList; +import java.util.Collection; +import java.util.List; +import java.util.Objects; + @SuppressWarnings({"unchecked", "unused"}) @Environment(EnvType.CLIENT) public abstract class EntryListWidget> extends GuiScreen { diff --git a/src/main/java/io/github/prospector/modmenu/gui/ModListEntry.java b/src/main/java/io/github/prospector/modmenu/gui/ModListEntry.java index 127102fa1..7d4250162 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/ModListEntry.java +++ b/src/main/java/io/github/prospector/modmenu/gui/ModListEntry.java @@ -1,5 +1,6 @@ package io.github.prospector.modmenu.gui; + import io.github.prospector.modmenu.ModMenu; import io.github.prospector.modmenu.util.BadgeRenderer; import io.github.prospector.modmenu.util.HardcodedUtil; @@ -8,8 +9,8 @@ import net.fabricmc.loader.api.ModContainer; import net.fabricmc.loader.api.metadata.ModMetadata; import net.minecraft.client.Minecraft; -import net.minecraft.core.render.FontRenderer; -import net.minecraft.core.render.Tessellator; +import net.minecraft.client.render.FontRenderer; +import net.minecraft.client.render.Tessellator; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.lwjgl.opengl.GL11; diff --git a/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java b/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java index ce80956c8..9fb29edff 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java +++ b/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java @@ -1,5 +1,6 @@ package io.github.prospector.modmenu.gui; + import com.google.common.base.Joiner; import com.google.common.base.Splitter; import com.google.common.collect.Lists; @@ -13,10 +14,10 @@ import net.fabricmc.loader.api.metadata.ModMetadata; import net.fabricmc.loader.api.metadata.Person; import net.minecraft.client.Minecraft; -import net.minecraft.core.gui.GuiButton; -import net.minecraft.core.gui.GuiScreen; -import net.minecraft.core.render.FontRenderer; -import net.minecraft.core.render.Tessellator; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.render.FontRenderer; +import net.minecraft.client.render.Tessellator; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.lwjgl.Sys; @@ -108,6 +109,7 @@ public void initGui() { this.descriptionListWidget = new DescriptionListWidget(this.mc, paneWidth, this.height, paneY + 60, this.height - 36, 9 + 1, this); this.descriptionListWidget.setLeftPos(rightPaneX); GuiButton configureButton = new ModMenuTexturedButtonWidget(CONFIGURE_BUTTON_ID, width - 24, paneY, 20, 20, 0, 0, CONFIGURE_BUTTON_LOCATION, 32, 64) { + @Override public void render(Minecraft mc, int mouseX, int mouseY) { if (selected != null) { diff --git a/src/main/java/io/github/prospector/modmenu/gui/ModListWidget.java b/src/main/java/io/github/prospector/modmenu/gui/ModListWidget.java index 230de6dc3..1b964b757 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/ModListWidget.java +++ b/src/main/java/io/github/prospector/modmenu/gui/ModListWidget.java @@ -1,5 +1,6 @@ package io.github.prospector.modmenu.gui; + import io.github.prospector.modmenu.ModMenu; import io.github.prospector.modmenu.config.ModMenuConfigManager; import io.github.prospector.modmenu.gui.entries.ChildEntry; @@ -11,7 +12,7 @@ import net.fabricmc.loader.api.ModContainer; import net.fabricmc.loader.api.metadata.ModMetadata; import net.minecraft.client.Minecraft; -import net.minecraft.core.render.Tessellator; +import net.minecraft.client.render.Tessellator; import net.minecraft.core.util.helper.MathHelper; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/src/main/java/io/github/prospector/modmenu/gui/ModMenuButtonWidget.java b/src/main/java/io/github/prospector/modmenu/gui/ModMenuButtonWidget.java index e581c2235..990540222 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/ModMenuButtonWidget.java +++ b/src/main/java/io/github/prospector/modmenu/gui/ModMenuButtonWidget.java @@ -1,7 +1,7 @@ package io.github.prospector.modmenu.gui; -import net.minecraft.core.gui.GuiButton; +import net.minecraft.client.gui.GuiButton; public class ModMenuButtonWidget extends GuiButton { public ModMenuButtonWidget(int buttonId, int x, int y, int width, int height, String text) { diff --git a/src/main/java/io/github/prospector/modmenu/gui/ModMenuTexturedButtonWidget.java b/src/main/java/io/github/prospector/modmenu/gui/ModMenuTexturedButtonWidget.java index a9a2d8b85..3ab7d0199 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/ModMenuTexturedButtonWidget.java +++ b/src/main/java/io/github/prospector/modmenu/gui/ModMenuTexturedButtonWidget.java @@ -1,9 +1,10 @@ package io.github.prospector.modmenu.gui; + import net.minecraft.client.Minecraft; -import net.minecraft.core.gui.GuiButton; -import net.minecraft.core.render.FontRenderer; -import net.minecraft.core.render.Tessellator; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.render.FontRenderer; +import net.minecraft.client.render.Tessellator; import org.lwjgl.opengl.GL11; public class ModMenuTexturedButtonWidget extends GuiButton { diff --git a/src/main/java/io/github/prospector/modmenu/gui/TextFieldWidget.java b/src/main/java/io/github/prospector/modmenu/gui/TextFieldWidget.java index aa385a166..0a09030bf 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/TextFieldWidget.java +++ b/src/main/java/io/github/prospector/modmenu/gui/TextFieldWidget.java @@ -1,13 +1,14 @@ package io.github.prospector.modmenu.gui; + import io.github.prospector.modmenu.mixin.MinecraftAccessor; import io.github.prospector.modmenu.mixin.TextFieldEditorAccessor; -import net.minecraft.core.enums.EnumOS2; -import net.minecraft.core.gui.GuiScreen; -import net.minecraft.core.gui.text.ITextField; -import net.minecraft.core.gui.text.TextFieldEditor; -import net.minecraft.core.render.FontRenderer; -import net.minecraft.core.render.Tessellator; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.text.ITextField; +import net.minecraft.client.gui.text.TextFieldEditor; +import net.minecraft.client.render.FontRenderer; +import net.minecraft.client.render.Tessellator; +import net.minecraft.core.enums.EnumOS; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; @@ -693,7 +694,7 @@ public void setVisible(boolean isVisible) { } private static boolean isCtrlKeyDown() { - if (MinecraftAccessor.getOS() == EnumOS2.macos) { + if (MinecraftAccessor.getOS() == EnumOS.macos) { return Keyboard.isKeyDown(Keyboard.KEY_LMETA) || Keyboard.isKeyDown(Keyboard.KEY_RMETA); } else { return Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL); diff --git a/src/main/java/io/github/prospector/modmenu/gui/entries/ChildEntry.java b/src/main/java/io/github/prospector/modmenu/gui/entries/ChildEntry.java index 91017df62..65831e077 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/entries/ChildEntry.java +++ b/src/main/java/io/github/prospector/modmenu/gui/entries/ChildEntry.java @@ -1,5 +1,6 @@ package io.github.prospector.modmenu.gui.entries; + import io.github.prospector.modmenu.gui.ModListEntry; import io.github.prospector.modmenu.gui.ModListWidget; import net.fabricmc.loader.api.ModContainer; diff --git a/src/main/java/io/github/prospector/modmenu/gui/entries/IndependentEntry.java b/src/main/java/io/github/prospector/modmenu/gui/entries/IndependentEntry.java index 3e2328758..cecc1aaa8 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/entries/IndependentEntry.java +++ b/src/main/java/io/github/prospector/modmenu/gui/entries/IndependentEntry.java @@ -1,5 +1,6 @@ package io.github.prospector.modmenu.gui.entries; + import io.github.prospector.modmenu.gui.ModListEntry; import io.github.prospector.modmenu.gui.ModListWidget; import net.fabricmc.loader.api.ModContainer; diff --git a/src/main/java/io/github/prospector/modmenu/gui/entries/ParentEntry.java b/src/main/java/io/github/prospector/modmenu/gui/entries/ParentEntry.java index 2f953287d..9869315a2 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/entries/ParentEntry.java +++ b/src/main/java/io/github/prospector/modmenu/gui/entries/ParentEntry.java @@ -1,13 +1,14 @@ package io.github.prospector.modmenu.gui.entries; + import io.github.prospector.modmenu.ModMenu; import io.github.prospector.modmenu.gui.ModListEntry; import io.github.prospector.modmenu.gui.ModListWidget; import io.github.prospector.modmenu.util.ModListSearch; import net.fabricmc.loader.api.ModContainer; import net.minecraft.client.Minecraft; -import net.minecraft.core.render.FontRenderer; -import net.minecraft.core.render.Tessellator; +import net.minecraft.client.render.FontRenderer; +import net.minecraft.client.render.Tessellator; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; diff --git a/src/main/java/io/github/prospector/modmenu/impl/ModMenuApiImpl.java b/src/main/java/io/github/prospector/modmenu/impl/ModMenuApiImpl.java index 5bbede3f2..4496da662 100644 --- a/src/main/java/io/github/prospector/modmenu/impl/ModMenuApiImpl.java +++ b/src/main/java/io/github/prospector/modmenu/impl/ModMenuApiImpl.java @@ -1,5 +1,6 @@ package io.github.prospector.modmenu.impl; + import io.github.prospector.modmenu.api.ModMenuApi; import io.github.prospector.modmenu.util.TriConsumer; diff --git a/src/main/java/io/github/prospector/modmenu/mixin/GuiButtonAccessor.java b/src/main/java/io/github/prospector/modmenu/mixin/GuiButtonAccessor.java index a398d7bfe..f9bea585a 100644 --- a/src/main/java/io/github/prospector/modmenu/mixin/GuiButtonAccessor.java +++ b/src/main/java/io/github/prospector/modmenu/mixin/GuiButtonAccessor.java @@ -1,6 +1,7 @@ package io.github.prospector.modmenu.mixin; -import net.minecraft.core.gui.GuiButton; + +import net.minecraft.client.gui.GuiButton; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; diff --git a/src/main/java/io/github/prospector/modmenu/mixin/MinecraftAccessor.java b/src/main/java/io/github/prospector/modmenu/mixin/MinecraftAccessor.java index 049c5b52b..81ca9dba0 100644 --- a/src/main/java/io/github/prospector/modmenu/mixin/MinecraftAccessor.java +++ b/src/main/java/io/github/prospector/modmenu/mixin/MinecraftAccessor.java @@ -1,14 +1,15 @@ package io.github.prospector.modmenu.mixin; + import net.minecraft.client.Minecraft; -import net.minecraft.core.enums.EnumOS2; +import net.minecraft.core.enums.EnumOS; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Invoker; @Mixin(value = Minecraft.class, remap = false) public interface MinecraftAccessor { @Invoker("getOs") - static EnumOS2 getOS() { - return EnumOS2.windows; + static EnumOS getOS() { + return EnumOS.windows; } } diff --git a/src/main/java/io/github/prospector/modmenu/mixin/MixinGuiIngameMenu.java b/src/main/java/io/github/prospector/modmenu/mixin/MixinGuiIngameMenu.java index fb5511ec6..b0e73842a 100644 --- a/src/main/java/io/github/prospector/modmenu/mixin/MixinGuiIngameMenu.java +++ b/src/main/java/io/github/prospector/modmenu/mixin/MixinGuiIngameMenu.java @@ -1,11 +1,12 @@ package io.github.prospector.modmenu.mixin; + import io.github.prospector.modmenu.ModMenu; import io.github.prospector.modmenu.gui.ModListScreen; import io.github.prospector.modmenu.gui.ModMenuButtonWidget; -import net.minecraft.core.gui.GuiButton; -import net.minecraft.core.gui.GuiIngameMenu; -import net.minecraft.core.gui.GuiScreen; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiIngameMenu; +import net.minecraft.client.gui.GuiScreen; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; diff --git a/src/main/java/io/github/prospector/modmenu/mixin/MixinGuiMainMenu.java b/src/main/java/io/github/prospector/modmenu/mixin/MixinGuiMainMenu.java index 3688fc912..6d5ff59c2 100644 --- a/src/main/java/io/github/prospector/modmenu/mixin/MixinGuiMainMenu.java +++ b/src/main/java/io/github/prospector/modmenu/mixin/MixinGuiMainMenu.java @@ -1,11 +1,12 @@ package io.github.prospector.modmenu.mixin; + import io.github.prospector.modmenu.ModMenu; import io.github.prospector.modmenu.gui.ModListScreen; import io.github.prospector.modmenu.gui.ModMenuButtonWidget; -import net.minecraft.core.gui.GuiButton; -import net.minecraft.core.gui.GuiMainMenu; -import net.minecraft.core.gui.GuiScreen; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraft.client.gui.GuiScreen; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; diff --git a/src/main/java/io/github/prospector/modmenu/mixin/MixinTexturePacks.java b/src/main/java/io/github/prospector/modmenu/mixin/MixinTexturePacks.java index 8239b30b3..b5c25ae25 100644 --- a/src/main/java/io/github/prospector/modmenu/mixin/MixinTexturePacks.java +++ b/src/main/java/io/github/prospector/modmenu/mixin/MixinTexturePacks.java @@ -1,8 +1,9 @@ package io.github.prospector.modmenu.mixin; + import io.github.prospector.modmenu.ModMenu; -import net.minecraft.core.render.texturepack.TexturePackBase; -import net.minecraft.core.render.texturepack.TexturePackCustom; +import net.minecraft.client.render.texturepack.TexturePackBase; +import net.minecraft.client.render.texturepack.TexturePackCustom; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; diff --git a/src/main/java/io/github/prospector/modmenu/mixin/TextFieldEditorAccessor.java b/src/main/java/io/github/prospector/modmenu/mixin/TextFieldEditorAccessor.java index 307f11f0d..ae9815373 100644 --- a/src/main/java/io/github/prospector/modmenu/mixin/TextFieldEditorAccessor.java +++ b/src/main/java/io/github/prospector/modmenu/mixin/TextFieldEditorAccessor.java @@ -1,6 +1,7 @@ package io.github.prospector.modmenu.mixin; -import net.minecraft.core.gui.text.TextFieldEditor; + +import net.minecraft.client.gui.text.TextFieldEditor; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Invoker; diff --git a/src/main/java/io/github/prospector/modmenu/util/BadgeRenderer.java b/src/main/java/io/github/prospector/modmenu/util/BadgeRenderer.java index dc18af3c4..f65b7f6b8 100644 --- a/src/main/java/io/github/prospector/modmenu/util/BadgeRenderer.java +++ b/src/main/java/io/github/prospector/modmenu/util/BadgeRenderer.java @@ -1,5 +1,6 @@ package io.github.prospector.modmenu.util; + import io.github.prospector.modmenu.ModMenu; import io.github.prospector.modmenu.gui.ModListScreen; import net.fabricmc.loader.api.ModContainer; diff --git a/src/main/java/io/github/prospector/modmenu/util/ButtonUtil.java b/src/main/java/io/github/prospector/modmenu/util/ButtonUtil.java index b999e1857..08ba81b3f 100644 --- a/src/main/java/io/github/prospector/modmenu/util/ButtonUtil.java +++ b/src/main/java/io/github/prospector/modmenu/util/ButtonUtil.java @@ -1,7 +1,8 @@ package io.github.prospector.modmenu.util; + import io.github.prospector.modmenu.mixin.GuiButtonAccessor; -import net.minecraft.core.gui.GuiButton; +import net.minecraft.client.gui.GuiButton; public class ButtonUtil { public static GuiButton createButton(int buttonId, int x, int y, int width, int height, String text) { diff --git a/src/main/java/io/github/prospector/modmenu/util/HardcodedUtil.java b/src/main/java/io/github/prospector/modmenu/util/HardcodedUtil.java index 0ccc1f49b..f36e9e6cb 100644 --- a/src/main/java/io/github/prospector/modmenu/util/HardcodedUtil.java +++ b/src/main/java/io/github/prospector/modmenu/util/HardcodedUtil.java @@ -1,5 +1,6 @@ package io.github.prospector.modmenu.util; + import io.github.prospector.modmenu.ModMenu; import net.fabricmc.loader.api.FabricLoader; import net.fabricmc.loader.api.ModContainer; @@ -15,7 +16,7 @@ public class HardcodedUtil { private static final HashMap HARDCODED_DESCRIPTIONS = new HashMap<>(); public static void initializeHardcodings() { - FABRIC_MODS.add("fabric"); + /*FABRIC_MODS.add("fabric"); FABRIC_MODS.add("fabricloader"); HARDCODED_DESCRIPTIONS.put("fabric-api-base", "Contains the essentials for Fabric API modules."); HARDCODED_DESCRIPTIONS.put("fabric-biomes-v1", "Hooks for adding biomes to the default world generator."); @@ -41,7 +42,7 @@ public static void initializeHardcodings() { HARDCODED_DESCRIPTIONS.put("fabric-rendering-v0", "Hooks and registries for rendering-related things"); HARDCODED_DESCRIPTIONS.put("fabric-resource-loader-v0", "Asset and data resource loading."); HARDCODED_DESCRIPTIONS.put("fabric-tag-extensions-v0", "Hooks for tags."); - HARDCODED_DESCRIPTIONS.put("fabric-textures-v0", "Hooks for texture loading and registration."); + HARDCODED_DESCRIPTIONS.put("fabric-textures-v0", "Hooks for texture loading and registration.");*/ HARDCODED_DESCRIPTIONS.put("minecraft", new Random().nextInt(1000) == 0 ? "The based game." : "The base game."); } diff --git a/src/main/java/io/github/prospector/modmenu/util/ModListSearch.java b/src/main/java/io/github/prospector/modmenu/util/ModListSearch.java index 6e8f276bf..718112ffd 100644 --- a/src/main/java/io/github/prospector/modmenu/util/ModListSearch.java +++ b/src/main/java/io/github/prospector/modmenu/util/ModListSearch.java @@ -1,5 +1,6 @@ package io.github.prospector.modmenu.util; + import io.github.prospector.modmenu.ModMenu; import io.github.prospector.modmenu.gui.ModListScreen; import net.fabricmc.loader.api.ModContainer; diff --git a/src/main/java/io/github/prospector/modmenu/util/RenderUtils.java b/src/main/java/io/github/prospector/modmenu/util/RenderUtils.java index 56f50c79d..a4edf7c56 100644 --- a/src/main/java/io/github/prospector/modmenu/util/RenderUtils.java +++ b/src/main/java/io/github/prospector/modmenu/util/RenderUtils.java @@ -1,9 +1,10 @@ package io.github.prospector.modmenu.util; + import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.core.gui.GuiScreen; -import net.minecraft.core.render.FontRenderer; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.render.FontRenderer; import java.util.ArrayList; import java.util.Collections; diff --git a/src/main/java/io/github/prospector/modmenu/util/TestModContainer.java b/src/main/java/io/github/prospector/modmenu/util/TestModContainer.java index ee848d094..8657b19a8 100644 --- a/src/main/java/io/github/prospector/modmenu/util/TestModContainer.java +++ b/src/main/java/io/github/prospector/modmenu/util/TestModContainer.java @@ -1,7 +1,12 @@ package io.github.prospector.modmenu.util; -import net.fabricmc.loader.api.*; + +import net.fabricmc.loader.api.FabricLoader; +import net.fabricmc.loader.api.ModContainer; +import net.fabricmc.loader.api.SemanticVersion; +import net.fabricmc.loader.api.Version; import net.fabricmc.loader.api.metadata.*; +import net.fabricmc.loader.util.version.VersionParsingException; import java.nio.file.Path; import java.util.*; @@ -209,7 +214,8 @@ public Map getCustomValues() { return new HashMap<>(); } - @Override + @SuppressWarnings("UnstableApiUsage") + @Override public boolean containsCustomElement(String key) { return false; } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index fc65fdbea..e129fa7a0 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -49,7 +49,8 @@ "magneticflux", "Earthcomputer", "Ambos", - "Flamarine" + "Flamarine", + "sunsetsatellite" ], "description": "Adds a mod menu to view the list of mods you have installed.", "mixins": [