Skip to content

Commit

Permalink
Lazy 1.21.2 port
Browse files Browse the repository at this point in the history
  • Loading branch information
Riflusso committed Nov 27, 2024
1 parent c4bf6df commit 055a262
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 20 deletions.
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

0 comments on commit 055a262

Please sign in to comment.