From a717e34c7d95d5a5b3653783c7c06b03bf73fb03 Mon Sep 17 00:00:00 2001 From: pkstDev Date: Sat, 25 Mar 2023 20:16:57 +0800 Subject: [PATCH] Updated to BTA 1.7.7.0-pre1 --- build.gradle | 3 ++- gradle.properties | 10 ++++---- jitpack.yml | 6 ++--- .../io/github/prospector/modmenu/ModMenu.java | 6 ++--- .../prospector/modmenu/api/ModMenuApi.java | 4 ++-- .../modmenu/gui/DescriptionListWidget.java | 3 +-- .../modmenu/gui/EntryListWidget.java | 6 ++--- .../prospector/modmenu/gui/ModListEntry.java | 4 ++-- .../prospector/modmenu/gui/ModListScreen.java | 21 ++++++++--------- .../prospector/modmenu/gui/ModListWidget.java | 4 ++-- .../modmenu/gui/ModMenuButtonWidget.java | 3 ++- .../gui/ModMenuTexturedButtonWidget.java | 12 +++++----- .../modmenu/gui/TextFieldWidget.java | 23 +++++++++++++------ .../modmenu/gui/entries/ParentEntry.java | 4 ++-- .../modmenu/mixin/GuiButtonAccessor.java | 2 +- .../modmenu/mixin/MinecraftAccessor.java | 3 +-- .../modmenu/mixin/MixinGuiIngameMenu.java | 8 +++---- .../modmenu/mixin/MixinGuiMainMenu.java | 8 +++---- .../modmenu/mixin/MixinTexturePacks.java | 4 ++-- .../mixin/TextFieldEditorAccessor.java | 11 +++++++++ .../prospector/modmenu/util/ButtonUtil.java | 2 +- .../prospector/modmenu/util/RenderUtils.java | 4 ++-- src/main/resources/fabric.mod.json | 2 +- src/main/resources/mixins.modmenu.json | 3 ++- 24 files changed, 87 insertions(+), 69 deletions(-) create mode 100644 src/main/java/io/github/prospector/modmenu/mixin/TextFieldEditorAccessor.java diff --git a/build.gradle b/build.gradle index e473c3055..d532677e5 100644 --- a/build.gradle +++ b/build.gradle @@ -8,8 +8,9 @@ archivesBaseName = project.mod_name version = project.mod_version loom { - gluedMinecraftJar() + // gluedMinecraftJar() noIntermediateMappings() + clientOnlyMinecraftJar() customMinecraftManifest.set("https://github.com/Turnip-Labs/bta-manifest-repo/releases/download/v${project.bta_version}/${project.bta_version}.json") } diff --git a/gradle.properties b/gradle.properties index b142179f6..0d6f5b7b6 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=1.8.6-bta.4 -mod_group=io.github.prospector -mod_name=modmenu +mod_version=2.0.0-beta.1 +mod_group=io.github.turniplabs +mod_name=modmenu-bta -yarn_mappings=df0e26c -bta_version=1.7.6.2_02 +# yarn_mappings=df0e26c +bta_version=1.7.7.0-pre1 loader_version=0.14.6-babric.1 diff --git a/jitpack.yml b/jitpack.yml index 3a61814d7..063b3cf02 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -1,4 +1,2 @@ -before_install: - - wget https://raw.githubusercontent.com/sormuras/bach/releases/11/install-jdk.sh - - source install-jdk.sh --feature 17 - - jshell --version +jdk: +   - openjdk17 diff --git a/src/main/java/io/github/prospector/modmenu/ModMenu.java b/src/main/java/io/github/prospector/modmenu/ModMenu.java index 0913b2b06..9af5747a4 100644 --- a/src/main/java/io/github/prospector/modmenu/ModMenu.java +++ b/src/main/java/io/github/prospector/modmenu/ModMenu.java @@ -14,8 +14,8 @@ import net.fabricmc.loader.api.metadata.CustomValue; import net.fabricmc.loader.api.metadata.ModMetadata; import net.minecraft.client.Minecraft; -import net.minecraft.src.GuiOptions; -import net.minecraft.src.GuiScreen; +import net.minecraft.core.gui.GuiScreen; +import net.minecraft.core.gui.options.GuiOptionsPageGeneral; import java.text.NumberFormat; import java.util.*; @@ -79,7 +79,7 @@ public void onInitializeClient() { CUSTOM_BADGE_MODS.put(api.getModId(), map); }); }); - factories.put("minecraft", (screenBase -> new GuiOptions(screenBase, ((Minecraft) FabricLoader.getInstance().getGameInstance()).gameSettings))); + factories.put("minecraft", (screenBase -> new GuiOptionsPageGeneral(screenBase, ((Minecraft) FabricLoader.getInstance().getGameInstance()).gameSettings))); configScreenFactories = factories.build(); Collection mods = FabricLoader.getInstance().getAllMods(); HardcodedUtil.initializeHardcodings(); 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 c47c9faac..d07aa62b1 100644 --- a/src/main/java/io/github/prospector/modmenu/api/ModMenuApi.java +++ b/src/main/java/io/github/prospector/modmenu/api/ModMenuApi.java @@ -6,12 +6,12 @@ import java.util.function.Supplier; import io.github.prospector.modmenu.util.TriConsumer; -import net.minecraft.src.GuiScreen; +import net.minecraft.core.gui.GuiScreen; import org.jetbrains.annotations.ApiStatus; public interface ModMenuApi { /** - * Replaced with {@link ModMenuApi#getConfigScreen(net.minecraft.src.GuiScreen)}, with + * Replaced with {@link ModMenuApi#getConfigScreen(net.minecraft.core.gui.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/gui/DescriptionListWidget.java b/src/main/java/io/github/prospector/modmenu/gui/DescriptionListWidget.java index 0850e4bde..1ccaad01e 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/DescriptionListWidget.java +++ b/src/main/java/io/github/prospector/modmenu/gui/DescriptionListWidget.java @@ -4,10 +4,9 @@ import io.github.prospector.modmenu.util.RenderUtils; import net.fabricmc.loader.api.metadata.Person; import net.minecraft.client.Minecraft; -import net.minecraft.src.FontRenderer; +import net.minecraft.core.render.FontRenderer; import java.util.Collection; -import java.util.List; public class DescriptionListWidget extends EntryListWidget { private final ModListScreen parent; 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 3f1956d28..f80de35d0 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/EntryListWidget.java +++ b/src/main/java/io/github/prospector/modmenu/gui/EntryListWidget.java @@ -9,9 +9,9 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.Minecraft; -import net.minecraft.src.GuiScreen; -import net.minecraft.src.MathHelper; -import net.minecraft.src.Tessellator; +import net.minecraft.core.gui.GuiScreen; +import net.minecraft.core.render.Tessellator; +import net.minecraft.core.util.helper.MathHelper; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL14; 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 2672aa54d..127102fa1 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/ModListEntry.java +++ b/src/main/java/io/github/prospector/modmenu/gui/ModListEntry.java @@ -8,8 +8,8 @@ import net.fabricmc.loader.api.ModContainer; import net.fabricmc.loader.api.metadata.ModMetadata; import net.minecraft.client.Minecraft; -import net.minecraft.src.FontRenderer; -import net.minecraft.src.Tessellator; +import net.minecraft.core.render.FontRenderer; +import net.minecraft.core.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 e1034bdf0..ce80956c8 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java +++ b/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java @@ -13,10 +13,10 @@ import net.fabricmc.loader.api.metadata.ModMetadata; import net.fabricmc.loader.api.metadata.Person; import net.minecraft.client.Minecraft; -import net.minecraft.src.FontRenderer; -import net.minecraft.src.GuiButton; -import net.minecraft.src.GuiScreen; -import net.minecraft.src.Tessellator; +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 org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.lwjgl.Sys; @@ -68,10 +68,9 @@ public ModListScreen(GuiScreen previousGui) { this.textTitle = "Mods"; } - @Override - public void handleMouseInput() { - super.handleMouseInput(); - int dWheel = Mouse.getEventDWheel()/50; + public void handleInput() { + super.handleInput(); + int dWheel = Mouse.getEventDWheel() / 50; if (dWheel != 0) { int mouseX = Mouse.getEventX() * this.width / this.mc.resolution.width; // field_6326_c int mouseY = this.height - Mouse.getEventY() * this.height / this.mc.resolution.height - 1; // field_6325_d @@ -189,7 +188,7 @@ public void drawButton(Minecraft mc, int mouseX, int mouseY) { } @Override - protected void actionPerformed(GuiButton button) { + protected void buttonPressed(GuiButton button) { switch (button.id) { case CONFIGURE_BUTTON_ID: { final String modid = Objects.requireNonNull(selected).getMetadata().getId(); @@ -246,7 +245,7 @@ public ModListWidget getModList() { } @Override - public void keyTyped(char char_1, int int_1) { + public void keyTyped(char char_1, int int_1, int mouseX, int mouseY) { this.searchBox.textboxKeyTyped(char_1, int_1); if (int_1 == 1) { this.mc.displayGuiScreen(this.parent); @@ -295,7 +294,7 @@ public void drawScreen(int mouseX, int mouseY, float delta) { this.modList.render(mouseX, mouseY, delta); this.searchBox.drawTextBox(); GL11.glDisable(GL11.GL_BLEND); - this.drawCenteredString(font, this.textTitle, this.modList.getWidth() / 2, 8, 0xffffff); + this.drawStringCentered(font, this.textTitle, this.modList.getWidth() / 2, 8, 0xffffff); super.drawScreen(mouseX, mouseY, delta); if (showModCount || !filterOptionsShown) { font.drawString("Showing " + NumberFormat.getInstance().format(modList.getDisplayedCount()) + "/" + NumberFormat.getInstance().format(FabricLoader.getInstance().getAllMods().size()) + " Mods", searchBoxX, 52, 0xFFFFFF); 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 47e2aadf3..230de6dc3 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/ModListWidget.java +++ b/src/main/java/io/github/prospector/modmenu/gui/ModListWidget.java @@ -11,8 +11,8 @@ import net.fabricmc.loader.api.ModContainer; import net.fabricmc.loader.api.metadata.ModMetadata; import net.minecraft.client.Minecraft; -import net.minecraft.src.MathHelper; -import net.minecraft.src.Tessellator; +import net.minecraft.core.render.Tessellator; +import net.minecraft.core.util.helper.MathHelper; 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/ModMenuButtonWidget.java b/src/main/java/io/github/prospector/modmenu/gui/ModMenuButtonWidget.java index 61b8b539c..e581c2235 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/ModMenuButtonWidget.java +++ b/src/main/java/io/github/prospector/modmenu/gui/ModMenuButtonWidget.java @@ -1,6 +1,7 @@ package io.github.prospector.modmenu.gui; -import net.minecraft.src.GuiButton; + +import net.minecraft.core.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 e2aa0e981..a9a2d8b85 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,9 @@ package io.github.prospector.modmenu.gui; import net.minecraft.client.Minecraft; -import net.minecraft.src.FontRenderer; -import net.minecraft.src.GuiButton; -import net.minecraft.src.Tessellator; +import net.minecraft.core.gui.GuiButton; +import net.minecraft.core.render.FontRenderer; +import net.minecraft.core.render.Tessellator; import org.lwjgl.opengl.GL11; public class ModMenuTexturedButtonWidget extends GuiButton { @@ -69,11 +69,11 @@ public void render(Minecraft mc, int mouseX, int mouseY) { this.mouseDragged(mc, mouseX, mouseY); if (!this.enabled) { - this.drawCenteredString(font, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, 0xffa0a0a0); + this.drawStringCentered(font, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, 0xffa0a0a0); } else if (hovered) { - this.drawCenteredString(font, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, 0xffffa0); + this.drawStringCentered(font, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, 0xffffa0); } else { - this.drawCenteredString(font, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, 0xe0e0e0); + this.drawStringCentered(font, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, 0xe0e0e0); } } } 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 e36d09ec2..aa385a166 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/TextFieldWidget.java +++ b/src/main/java/io/github/prospector/modmenu/gui/TextFieldWidget.java @@ -1,11 +1,13 @@ package io.github.prospector.modmenu.gui; import io.github.prospector.modmenu.mixin.MinecraftAccessor; -import net.minecraft.src.EnumOS2; -import net.minecraft.src.FontRenderer; -import net.minecraft.src.GuiScreen; -import net.minecraft.src.Tessellator; -import net.minecraft.src.helper.TextFieldInputHandler; +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 org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; @@ -13,8 +15,9 @@ import java.awt.datatransfer.StringSelection; import java.util.function.Predicate; -public class TextFieldWidget extends GuiScreen { +public class TextFieldWidget extends GuiScreen implements ITextField { private final FontRenderer font; + private final TextFieldEditor handler; public int x; public int y; /** @@ -67,6 +70,7 @@ public TextFieldWidget(FontRenderer font, int x, int y, int width, int height) { this.y = y; this.width = width; this.height = height; + this.handler = new TextFieldEditor(this); } /** @@ -98,6 +102,11 @@ public String getText() { return text; } + @Override + public int maxLength() { + return getMaxStringLength(); + } + /** * returns the text between the cursor and selectionEnd */ @@ -303,7 +312,7 @@ public boolean textboxKeyTyped(char typedChar, int keyCode) { return true; } else if (isKeyComboCtrlV(keyCode)) { if (isEnabled) { - writeText(TextFieldInputHandler.getClipboardString()); + writeText(((TextFieldEditorAccessor) handler).getClipboardContentString()); } return true; 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 ccfeab321..2f953287d 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 @@ -6,8 +6,8 @@ import io.github.prospector.modmenu.util.ModListSearch; import net.fabricmc.loader.api.ModContainer; import net.minecraft.client.Minecraft; -import net.minecraft.src.FontRenderer; -import net.minecraft.src.Tessellator; +import net.minecraft.core.render.FontRenderer; +import net.minecraft.core.render.Tessellator; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; 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 230686ad4..a398d7bfe 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,6 @@ package io.github.prospector.modmenu.mixin; -import net.minecraft.src.GuiButton; +import net.minecraft.core.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 5884bd047..049c5b52b 100644 --- a/src/main/java/io/github/prospector/modmenu/mixin/MinecraftAccessor.java +++ b/src/main/java/io/github/prospector/modmenu/mixin/MinecraftAccessor.java @@ -1,7 +1,7 @@ package io.github.prospector.modmenu.mixin; import net.minecraft.client.Minecraft; -import net.minecraft.src.EnumOS2; +import net.minecraft.core.enums.EnumOS2; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Invoker; @@ -11,5 +11,4 @@ public interface MinecraftAccessor { static EnumOS2 getOS() { return EnumOS2.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 3cc9f8918..fb5511ec6 100644 --- a/src/main/java/io/github/prospector/modmenu/mixin/MixinGuiIngameMenu.java +++ b/src/main/java/io/github/prospector/modmenu/mixin/MixinGuiIngameMenu.java @@ -3,9 +3,9 @@ import io.github.prospector.modmenu.ModMenu; import io.github.prospector.modmenu.gui.ModListScreen; import io.github.prospector.modmenu.gui.ModMenuButtonWidget; -import net.minecraft.src.GuiButton; -import net.minecraft.src.GuiIngameMenu; -import net.minecraft.src.GuiScreen; +import net.minecraft.core.gui.GuiButton; +import net.minecraft.core.gui.GuiIngameMenu; +import net.minecraft.core.gui.GuiScreen; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -19,7 +19,7 @@ public void drawMenuButton(CallbackInfo info) { this.controlList.add(new ModMenuButtonWidget(100, this.width / 2 - 100, this.height / 4 + 72 - 16, 200, 20, "Mods (" + ModMenu.getFormattedModCount() + " loaded)")); } - @Inject(method = "actionPerformed", at = @At("HEAD")) + @Inject(method = "buttonPressed", at = @At("HEAD")) private void onActionPerformed(GuiButton button, CallbackInfo ci) { if (button.id == 100) { mc.displayGuiScreen(new ModListScreen(this)); 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 adb7e498e..3688fc912 100644 --- a/src/main/java/io/github/prospector/modmenu/mixin/MixinGuiMainMenu.java +++ b/src/main/java/io/github/prospector/modmenu/mixin/MixinGuiMainMenu.java @@ -3,9 +3,9 @@ import io.github.prospector.modmenu.ModMenu; import io.github.prospector.modmenu.gui.ModListScreen; import io.github.prospector.modmenu.gui.ModMenuButtonWidget; -import net.minecraft.src.GuiButton; -import net.minecraft.src.GuiMainMenu; -import net.minecraft.src.GuiScreen; +import net.minecraft.core.gui.GuiButton; +import net.minecraft.core.gui.GuiMainMenu; +import net.minecraft.core.gui.GuiScreen; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -24,7 +24,7 @@ public void drawMenuButton(CallbackInfo info) { this.controlList.add(new ModMenuButtonWidget(100, this.width / 2 + 2, texturePackButton.yPosition, newWidth, 20, "Mods (" + ModMenu.getFormattedModCount() + " loaded)")); } - @Inject(method = "actionPerformed", at = @At("HEAD")) + @Inject(method = "buttonPressed", at = @At("HEAD")) private void onActionPerformed(GuiButton button, CallbackInfo ci) { if (button.id == 100) { mc.displayGuiScreen(new ModListScreen(this)); 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 8f4f2ccb1..8239b30b3 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,8 @@ package io.github.prospector.modmenu.mixin; import io.github.prospector.modmenu.ModMenu; -import net.minecraft.src.TexturePackBase; -import net.minecraft.src.TexturePackCustom; +import net.minecraft.core.render.texturepack.TexturePackBase; +import net.minecraft.core.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 new file mode 100644 index 000000000..307f11f0d --- /dev/null +++ b/src/main/java/io/github/prospector/modmenu/mixin/TextFieldEditorAccessor.java @@ -0,0 +1,11 @@ +package io.github.prospector.modmenu.mixin; + +import net.minecraft.core.gui.text.TextFieldEditor; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Invoker; + +@Mixin(value = TextFieldEditor.class, remap = false) +public interface TextFieldEditorAccessor { + @Invoker("clipboardToString") + String getClipboardContentString(); +} 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 d6d51fa49..b999e1857 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,7 @@ package io.github.prospector.modmenu.util; import io.github.prospector.modmenu.mixin.GuiButtonAccessor; -import net.minecraft.src.GuiButton; +import net.minecraft.core.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/RenderUtils.java b/src/main/java/io/github/prospector/modmenu/util/RenderUtils.java index 0d980df84..56f50c79d 100644 --- a/src/main/java/io/github/prospector/modmenu/util/RenderUtils.java +++ b/src/main/java/io/github/prospector/modmenu/util/RenderUtils.java @@ -2,8 +2,8 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.src.FontRenderer; -import net.minecraft.src.GuiScreen; +import net.minecraft.core.gui.GuiScreen; +import net.minecraft.core.render.FontRenderer; import java.util.ArrayList; import java.util.Collections; diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index bfccc8470..fc65fdbea 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -49,7 +49,7 @@ "magneticflux", "Earthcomputer", "Ambos", - "pkstDev" + "Flamarine" ], "description": "Adds a mod menu to view the list of mods you have installed.", "mixins": [ diff --git a/src/main/resources/mixins.modmenu.json b/src/main/resources/mixins.modmenu.json index 5546304e8..befd54a21 100644 --- a/src/main/resources/mixins.modmenu.json +++ b/src/main/resources/mixins.modmenu.json @@ -7,7 +7,8 @@ "MixinGuiMainMenu", "MixinTexturePacks", "GuiButtonAccessor", - "MinecraftAccessor" + "MinecraftAccessor", + "TextFieldEditorAccessor" ], "injectors": { "defaultRequire": 1