From 19d449a3efd0b72e7e64821241e3afea0988c0dc Mon Sep 17 00:00:00 2001 From: 54M44R <26176694+54M44R@users.noreply.github.com> Date: Thu, 29 Feb 2024 00:56:40 -0500 Subject: [PATCH 1/3] Port to 1.20.4 --- build.gradle | 4 ++-- gradle.properties | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index a1fa9866..d721d8fd 100755 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id "architectury-plugin" version "3.4-SNAPSHOT" - id "dev.architectury.loom" version "1.3-SNAPSHOT" apply false + id "dev.architectury.loom" version "1.5-SNAPSHOT" apply false } architectury { @@ -19,7 +19,7 @@ subprojects { // The following line declares the mojmap mappings, you may use other mappings as well mappings loom.layered() { officialMojangMappings() - parchment("org.parchmentmc.data:parchment-1.20.1:2023.09.03@zip") + parchment("org.parchmentmc.data:parchment-1.20.4:2024.02.25@zip") } // The following line declares the yarn mappings you may select this one as well. // mappings "net.fabricmc:yarn:1.20.1+build.10:v2" diff --git a/gradle.properties b/gradle.properties index dadb5140..36f333f4 100755 --- a/gradle.properties +++ b/gradle.properties @@ -1,21 +1,21 @@ org.gradle.jvmargs=-Xmx2048M -minecraft_version=1.20.1 +minecraft_version=1.20.4 enabled_platforms=quilt,fabric,forge archives_base_name=jecalculation mod_version=4.0.4 maven_group=me.towdium.jecalculation -architectury_version=9.1.12 +architectury_version=11.1.13 -fabric_loader_version=0.14.23 -fabric_api_version=0.90.4+1.20.1 +fabric_loader_version=0.15.7 +fabric_api_version=0.96.4+1.20.4 -forge_version=1.20.1-47.2.1 +forge_version=1.20.4-49.0.30 -quilt_loader_version=0.21.2-beta.2 +quilt_loader_version=0.24.0-beta.8 quilt_fabric_api_version=7.4.0+0.90.0-1.20.1 -jei_version=15.2.0.27 -rei_version=12.0.684 +jei_version=17.3.0.49 +rei_version=14.0.688 From 6852b16ed7f8e6ceddcfb137f81175b3322dae02 Mon Sep 17 00:00:00 2001 From: 54M44R <26176694+54M44R@users.noreply.github.com> Date: Thu, 29 Feb 2024 01:08:06 -0500 Subject: [PATCH 2/3] Added new required parameters to onMouseScroll(), disabled tick & background methods - Added additional required parameters to onMouseScroll() The following seems to be handled by the game, and are no longer required: - Commented out containerTick() - Commented out onTick() - Commented out renderBackground() --- .../events/GuiScreenEventHandler.java | 4 ++-- .../me/towdium/jecalculation/gui/JecaGui.java | 16 ++++++++-------- .../jecalculation/gui/widgets/IWidget.java | 4 ++-- .../jecalculation/gui/widgets/WContainer.java | 8 ++++---- .../jecalculation/gui/widgets/WTextField.java | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/common/src/main/java/me/towdium/jecalculation/events/GuiScreenEventHandler.java b/common/src/main/java/me/towdium/jecalculation/events/GuiScreenEventHandler.java index 64f42a5b..9e162979 100644 --- a/common/src/main/java/me/towdium/jecalculation/events/GuiScreenEventHandler.java +++ b/common/src/main/java/me/towdium/jecalculation/events/GuiScreenEventHandler.java @@ -119,10 +119,10 @@ public EventResult onTooltip(GuiGraphics guiGraphics, List label return false; } - default void onTick(JecaGui gui) { - } +// default void onTick(JecaGui gui) { +// } @FunctionalInterface interface ListenerValue { diff --git a/common/src/main/java/me/towdium/jecalculation/gui/widgets/WContainer.java b/common/src/main/java/me/towdium/jecalculation/gui/widgets/WContainer.java index 9fc8c059..e9074608 100644 --- a/common/src/main/java/me/towdium/jecalculation/gui/widgets/WContainer.java +++ b/common/src/main/java/me/towdium/jecalculation/gui/widgets/WContainer.java @@ -138,8 +138,8 @@ public boolean getLabelUnderMouse(int xMouse, int yMouse, Wrapper label) .anyMatch(i -> i.getLabelUnderMouse(xMouse - offsetX, yMouse - offsetY, label)); } - @Override - public void onTick(JecaGui gui) { - widgets.forEach(i -> i.onTick(gui)); - } +// @Override +// public void onTick(JecaGui gui) { +// widgets.forEach(i -> i.onTick(gui)); +// } } diff --git a/common/src/main/java/me/towdium/jecalculation/gui/widgets/WTextField.java b/common/src/main/java/me/towdium/jecalculation/gui/widgets/WTextField.java index 9a25741c..1dec2e6e 100644 --- a/common/src/main/java/me/towdium/jecalculation/gui/widgets/WTextField.java +++ b/common/src/main/java/me/towdium/jecalculation/gui/widgets/WTextField.java @@ -36,10 +36,10 @@ public void onMouseFocused(JecaGui gui, int xMouse, int yMouse, int button) { textField.mouseClicked(xMouse, yMouse, button); } - @Override - public void onTick(JecaGui gui) { - textField.tick(); - } +// @Override +// public void onTick(JecaGui gui) { +// textField.tick(); +// } @Override public boolean onMouseClicked(JecaGui gui, int xMouse, int yMouse, int button) { From bf3ab396e021d86c0f86827f1b02d970da2a26fa Mon Sep 17 00:00:00 2001 From: 54M44R <26176694+54M44R@users.noreply.github.com> Date: Thu, 29 Feb 2024 01:10:14 -0500 Subject: [PATCH 3/3] Replace deprecated method isForge() with isForgeLike() --- .../me/towdium/jecalculation/compat/jei/JecaJEIPlugin.java | 2 +- .../towdium/jecalculation/data/label/labels/LFluidStack.java | 2 +- .../jecalculation/gui/guis/pickers/PickerItemStack.java | 4 ++-- .../main/java/me/towdium/jecalculation/utils/Utilities.java | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/me/towdium/jecalculation/compat/jei/JecaJEIPlugin.java b/common/src/main/java/me/towdium/jecalculation/compat/jei/JecaJEIPlugin.java index ab9ae83f..656c3dd0 100644 --- a/common/src/main/java/me/towdium/jecalculation/compat/jei/JecaJEIPlugin.java +++ b/common/src/main/java/me/towdium/jecalculation/compat/jei/JecaJEIPlugin.java @@ -106,7 +106,7 @@ public void registerRecipeTransferHandlers(IRecipeTransferRegistration registrat public void onRuntimeAvailable(IJeiRuntime jeiRuntime) { runtime = jeiRuntime; ModCompat.isJEILoaded = true; - if (Platform.isForge()) + if (Platform.isForgeLike()) try { FORGE_FLUID_INGREDIENT_CLASS = Class.forName("net.minecraftforge.fluids.FluidStack"); } catch (ClassNotFoundException e) { diff --git a/common/src/main/java/me/towdium/jecalculation/data/label/labels/LFluidStack.java b/common/src/main/java/me/towdium/jecalculation/data/label/labels/LFluidStack.java index b32326aa..4b3358ef 100644 --- a/common/src/main/java/me/towdium/jecalculation/data/label/labels/LFluidStack.java +++ b/common/src/main/java/me/towdium/jecalculation/data/label/labels/LFluidStack.java @@ -100,7 +100,7 @@ public String getAmountString(boolean round) { public static String format(long amount) { float bucket = FluidStackHooks.bucketAmount(); return amount >= bucket ? Utilities.cutNumber(amount / bucket, 4) + "B" - : amount + (Platform.isForge() ? "mB" : "U"); + : amount + (Platform.isForgeLike() ? "mB" : "U"); } @Override diff --git a/common/src/main/java/me/towdium/jecalculation/gui/guis/pickers/PickerItemStack.java b/common/src/main/java/me/towdium/jecalculation/gui/guis/pickers/PickerItemStack.java index 7788ac1a..5299ecfa 100644 --- a/common/src/main/java/me/towdium/jecalculation/gui/guis/pickers/PickerItemStack.java +++ b/common/src/main/java/me/towdium/jecalculation/gui/guis/pickers/PickerItemStack.java @@ -46,7 +46,7 @@ public boolean acceptsLabel() { public void update(ILabel l) { raw = l; - setFCap(!Platform.isForge()); + setFCap(!Platform.isForgeLike()); setFMeta(false); setFNbt(false); boolean b = l == ILabel.EMPTY; @@ -65,7 +65,7 @@ private void setFMeta(boolean b) { } private void setFCap(boolean b) { - if (Platform.isForge()) + if (Platform.isForgeLike()) setF(b, bCapN, bCapF, () -> fCap = b); } diff --git a/common/src/main/java/me/towdium/jecalculation/utils/Utilities.java b/common/src/main/java/me/towdium/jecalculation/utils/Utilities.java index 698edf23..5b346f29 100644 --- a/common/src/main/java/me/towdium/jecalculation/utils/Utilities.java +++ b/common/src/main/java/me/towdium/jecalculation/utils/Utilities.java @@ -144,14 +144,14 @@ public static ItemStack createItemStackWithCap(Item item, int count, CompoundTag throw new AssertionError(); } - public static TagKey IRON_INGOTS = tag(Registries.ITEM, Platform.isForge() ? "ingots/iron" : "iron_ingots"); + public static TagKey IRON_INGOTS = tag(Registries.ITEM, Platform.isForgeLike() ? "ingots/iron" : "iron_ingots"); public static TagKey tag(ResourceKey> key, String tag) { return TagKey.create(key, new ResourceLocation(getTagNamespace(), tag)); } public static String getTagNamespace() { - return Platform.isForge() ? "forge" : "c"; + return Platform.isForgeLike() ? "forge" : "c"; } // MOD NAME