Skip to content

Commit

Permalink
1.19.2 port
Browse files Browse the repository at this point in the history
  • Loading branch information
JackyyTV committed May 23, 2023
1 parent de6d97f commit 9c33103
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 26 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ repositories {
dependencies {
minecraft "net.minecraftforge:forge:${mc_version}-${forge_version}"

implementation fg.deobf("mezz.jei:jei-1.18.2:+")
implementation fg.deobf("curse.maven:jade-324717:4082408") //1.18.2-5.2.6
implementation fg.deobf("mezz.jei:jei-1.19.2-forge:+")
implementation fg.deobf("curse.maven:jade-324717:4433884") //1.19.2-8.8.1
}

jar {
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
org.gradle.jvmargs=-Xmx4G
mod_name=NoAutoJump
mc_version=1.18.2
forge_version=40.2.2
mc_version=1.19.2
forge_version=43.2.10
mod_version=1.0
mappings_channel=official
mappings_version=1.18.2
mappings_version=1.19.2
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
16 changes: 11 additions & 5 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

#
# Copyright © 2015-2021 the original authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,10 +32,10 @@
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
Expand Down Expand Up @@ -205,6 +205,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
14 changes: 8 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,7 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/jackyy/noautojump/NoAutoJump.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import net.minecraft.client.gui.components.CycleButton;
import net.minecraft.client.gui.components.Widget;
import net.minecraft.client.gui.screens.controls.ControlsScreen;
import net.minecraft.network.chat.TranslatableComponent;
import net.minecraft.network.chat.Component;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.event.ScreenEvent;
Expand Down Expand Up @@ -32,19 +32,19 @@ public NoAutoJump() {
public void onClientTick(TickEvent.ClientTickEvent event) {
if (ModConfigs.CONFIG.enableMod.get()) {
if (event.phase == TickEvent.Phase.END) {
Minecraft.getInstance().options.autoJump = false;
Minecraft.getInstance().options.autoJump().set(false);
}
}
}

@SubscribeEvent @OnlyIn(Dist.CLIENT)
public void onInitGui(ScreenEvent.InitScreenEvent.Post event) {
public void onInitGui(ScreenEvent.Init.Post event) {
if (ModConfigs.CONFIG.enableMod.get()) {
if (event.getScreen() instanceof ControlsScreen) {
for (Widget button : event.getScreen().renderables) {
if (button instanceof CycleButton<?>) {
TranslatableComponent autoJumpOn = new TranslatableComponent("options.generic_value", new TranslatableComponent("options.autoJump"), new TranslatableComponent("options.on"));
TranslatableComponent autoJumpOff = new TranslatableComponent("options.generic_value", new TranslatableComponent("options.autoJump"), new TranslatableComponent("options.off"));
Component autoJumpOn = Component.translatable("options.generic_value", Component.translatable("options.autoJump"), Component.translatable("options.on"));
Component autoJumpOff = Component.translatable("options.generic_value", Component.translatable("options.autoJump"), Component.translatable("options.off"));
if (((CycleButton<?>) button).getMessage().equals(autoJumpOn) || ((CycleButton<?>) button).getMessage().equals(autoJumpOff)) {
((CycleButton<?>) button).active = false;
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
modLoader="javafml"
loaderVersion="[38,)"
loaderVersion="[41,)"
license="Jacky's Minecraft Mods License"

[[mods]]
modId="noautojump"
version="1.18.2-1.0"
version="1.19.2-1.0"
displayName="No Auto Jump"
displayURL="https://github.com/JackyyTV/NoAutoJump"
authors="Jackyy"
Expand All @@ -15,12 +15,12 @@ Simply forces Auto-Jump to be disabled!
[[dependencies.noautojump]]
modId="forge"
mandatory=true
versionRange="[38,)"
versionRange="[41,)"
ordering="NONE"
side="CLIENT"
[[dependencies.noautojump]]
modId="minecraft"
mandatory=true
versionRange="[1.18,1.19)"
versionRange="[1.19,1.19.2)"
ordering="NONE"
side="CLIENT"
2 changes: 1 addition & 1 deletion src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"pack": {
"description": "No Auto Jump Resources",
"pack_format": 8
"pack_format": 9
}
}

0 comments on commit 9c33103

Please sign in to comment.