Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to 1.21.2+ #58

Open
wants to merge 2 commits into
base: 1.21
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
id 'java'
id 'maven-publish'
//id 'org.spongepowered.gradle.vanilla' version '0.2.1-SNAPSHOT'
id 'fabric-loom' version '1.7-SNAPSHOT'
id 'fabric-loom' version '1.8-SNAPSHOT'
}


Expand All @@ -26,8 +26,8 @@ loom {
}

dependencies {
modImplementation("dev.isxander:yet-another-config-lib:3.5.0+1.21-fabric")
modImplementation("io.gitlab.jfronny.libjf:libjf-resource-pack-entry-widgets-v0:3.17.0")
modImplementation("dev.isxander:yet-another-config-lib:3.6.0+1.21.2-fabric")
modImplementation("io.gitlab.jfronny.libjf:libjf-resource-pack-entry-widgets-v0:3.18.0")

minecraft "com.mojang:minecraft:${minecraft_version}"
mappings loom.officialMojangMappings()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import net.minecraft.client.gui.components.events.GuiEventListener;
import net.minecraft.client.gui.narration.NarratableEntry;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.locale.Language;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.FormattedText;
Expand Down Expand Up @@ -60,7 +61,7 @@ public static void runAtUI(Runnable o) {

public static void drawTexture(GuiGraphics context, ResourceLocation texture, int x, int y, float u, float v, int width, int height, int textureWidth, int textureHeight) {
RenderSystem.setShaderTexture(0, texture);
context.blit(texture, x, y, u, v, width, height, textureWidth, textureHeight);
context.blit(RenderType::guiTextured, texture, x, y, u, v, width, height, textureWidth, textureHeight);
}

// in 1.20.2(and later maybe) not needed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import net.minecraft.SharedConstants;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.components.toasts.SystemToast;
import net.minecraft.client.gui.components.toasts.ToastComponent;
import net.minecraft.client.gui.components.toasts.ToastManager;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.network.chat.ClickEvent;
import net.minecraft.network.chat.Component;
Expand Down Expand Up @@ -43,7 +43,7 @@ public void setToastContent(Component title, Component text) {
}

if (toast == null || (System.currentTimeMillis() - toastUpdated > 1000*5)) {
ToastComponent toastManager = Minecraft.getInstance().getToasts();
ToastManager toastManager = Minecraft.getInstance().getToastManager();
toastManager.addToast(toast = new SystemToast(/*1.20.4 port*/new SystemToast.SystemToastId(5000), title, text));
} else {
toast.reset(title, text);
Expand All @@ -63,19 +63,19 @@ private Component createDownloadComponent() {

public void onWorldJoinForUpdateChecks(LocalPlayer player) {
if (SharedConstrains.isDebugMessageOnWorldJoin()) {
player.sendSystemMessage(Component.literal("Debug message on world join").withStyle(ChatFormatting.GREEN));
player.displayClientMessage(Component.literal("Debug message on world join").withStyle(ChatFormatting.GREEN), true);
}

if (player == null) {
Out.warn("player == null on world join");

} else if (!StatusChecker.isSafe()) {
player.sendSystemMessage(Component.translatable("dynamicpack.status_checker.not_safe", createDownloadComponent()));
player.displayClientMessage(Component.translatable("dynamicpack.status_checker.not_safe", createDownloadComponent()), true);
setToastContent(Component.translatable("dynamicpack.status_checker.not_safe.toast.title"),
Component.translatable("dynamicpack.status_checker.not_safe.toast.description"));

} else if (!StatusChecker.isFormatActual()) {
player.sendSystemMessage(Component.translatable("dynamicpack.status_checker.format_not_actual", createDownloadComponent()));
player.displayClientMessage(Component.translatable("dynamicpack.status_checker.format_not_actual", createDownloadComponent()), true);

} else if (StatusChecker.isModUpdateAvailable()) {
Out.println("DynamicPack mod update available: " + SharedConstrains.MODRINTH_URL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ public class PackRepositoryMixin {
}

try {
RenderSystem.applyModelViewMatrix();
// RenderSystem.applyModelViewMatrix();
RenderSystem.clearColor(0.074f + (((float)syncing.getPercentage() / 100f)), 0.04f, (float) (0.24f + (Math.sin(System.currentTimeMillis() / 300f) / 2)), 1f);
RenderSystem.clear(16640, ON_OSX);
RenderSystem.clear(16640);
GLFW.glfwSwapBuffers(client.getWindow().getWindow());

} catch (Exception e) {
Expand Down
8 changes: 4 additions & 4 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'java'
id 'idea'
id 'maven-publish'
id 'fabric-loom' version '1.7-SNAPSHOT'
id 'fabric-loom' version '1.8-SNAPSHOT'
}

base {
Expand All @@ -11,9 +11,9 @@ base {


dependencies {
modImplementation "com.terraformersmc:modmenu:11.0.0"
modImplementation("dev.isxander:yet-another-config-lib:3.5.0+1.21-fabric")
include(modImplementation("io.gitlab.jfronny.libjf:libjf-resource-pack-entry-widgets-v0:3.17.0"))
modImplementation "com.terraformersmc:modmenu:12.0.0-beta.1"
modImplementation("dev.isxander:yet-another-config-lib:3.6.0+1.21.2-fabric")
include(modImplementation("io.gitlab.jfronny.libjf:libjf-resource-pack-entry-widgets-v0:3.18.0"))

minecraft "com.mojang:minecraft:${minecraft_version}"
mappings loom.officialMojangMappings()
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ version=1.1
group=com.adamcalculator.dynamicpack

# Common
minecraft_version=1.21
minecraft_version=1.21.2
mod_name=DynamicPack
mod_author=AdamCalculator
mod_id=dynamicpack
license=MIT
credits=
description=Adds auto-update support for resource packs
minecraft_version_range=[1.21, 1.22)
minecraft_version_range=[1.21.2, 1.22)

# Fabric
fabric_version=0.100.3+1.21
fabric_loader_version=0.15.11
fabric_minecraft_version=>=1.21
fabric_version=0.106.1+1.21.2
fabric_loader_version=0.16.7
fabric_minecraft_version=>=1.21.2

# NeoForge
neoforge_version=20.4.83-beta
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down