Skip to content

Commit 5318347

Browse files
committed
Merge remote-tracking branch 'origin/1.18' into 1.19.2
2 parents 061806e + 40ddd2d commit 5318347

File tree

10 files changed

+67
-145
lines changed

10 files changed

+67
-145
lines changed

.github/workflows/gradle.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# This workflow will build a Java project with Gradle
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3-
4-
name: Build mod
1+
name: Build ModernFix using Gradle
52

63
on:
74
push:
@@ -15,19 +12,22 @@ jobs:
1512
build:
1613
runs-on: ubuntu-latest
1714
steps:
18-
- uses: actions/checkout@v2
15+
- name: Checkout Repository
16+
uses: actions/checkout@v3
1917
with:
2018
fetch-depth: 0
21-
- uses: actions/setup-java@v3
19+
- name: Set up JDK 17
20+
uses: actions/setup-java@v3
2221
with:
2322
distribution: 'temurin'
24-
java-version: '17'
23+
java-version: 17
2524
cache: 'gradle'
26-
- name: Grant execute permission for gradlew
27-
run: chmod +x gradlew
28-
- name: Build the mod
29-
run: ./gradlew --no-daemon build
30-
- uses: actions/upload-artifact@v2
25+
- name: Build ModernFix using Gradle
26+
run: |
27+
chmod +x gradlew
28+
./gradlew --no-daemon build
29+
- name: Upload Artifacts to GitHub
30+
uses: actions/upload-artifact@v3
3131
with:
3232
name: Package
33-
path: bin
33+
path: bin

.github/workflows/release.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
1-
name: release-artifacts
1+
name: Release ModernFix Artifacts
22

33
on:
44
release:
55
types:
66
- published
77

88
jobs:
9-
build:
9+
release:
10+
if: github.repository_owner == 'embeddedt'
1011
runs-on: ubuntu-latest
1112
steps:
12-
- uses: actions/checkout@v2
13+
- name: Checkout Repository
14+
uses: actions/checkout@v3
1315
with:
1416
fetch-depth: 0
15-
- uses: actions/setup-java@v3
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@v3
1619
with:
1720
distribution: 'temurin'
18-
java-version: '17'
19-
- name: Grant execute permission for gradlew
20-
run: chmod +x gradlew
21+
java-version: 17
2122
- name: Build and publish mod to CurseForge & Modrinth
22-
run: ./gradlew forge:publishToModSites fabric:publishToModSites forge:copyJarToBin fabric:copyJarToBin
23+
run: |
24+
chmod +x gradlew
25+
./gradlew forge:publishToModSites fabric:publishToModSites forge:copyJarToBin fabric:copyJarToBin
2326
env:
2427
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
2528
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}

.github/workflows/wiki_update.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: update-wiki
1+
name: Update wiki using WikiGen
22

33
on:
44
push:
@@ -7,13 +7,18 @@ on:
77

88
jobs:
99
wikigen:
10+
if: github.repository_owner == 'embeddedt'
1011
runs-on: ubuntu-latest
11-
concurrency: wiki-generation
12+
concurrency:
13+
group: wiki-generation
14+
cancel-in-progress: false
1215
steps:
13-
- uses: actions/checkout@v2
16+
- name: Checkout Repository
17+
uses: actions/checkout@v3
1418
with:
1519
fetch-depth: 0
16-
- run: python3 scripts/gen-markdown-patchlist.py
20+
- name: Generate Markdown Patch-List
21+
run: python3 scripts/gen-markdown-patchlist.py
1722
- name: Upload generated file to wiki
1823
uses: SwiftDocOrg/github-wiki-publish-action@v1
1924
with:

common/src/main/java/org/embeddedt/modernfix/common/mixin/bugfix/paper_chunk_patches/ChunkHolderMixin.java

Lines changed: 0 additions & 61 deletions
This file was deleted.

common/src/main/java/org/embeddedt/modernfix/common/mixin/bugfix/paper_chunk_patches/ChunkMapMixin.java

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
11
package org.embeddedt.modernfix.common.mixin.bugfix.paper_chunk_patches;
22

33
import com.mojang.datafixers.util.Either;
4-
import net.minecraft.server.MinecraftServer;
54
import net.minecraft.server.level.*;
65
import net.minecraft.server.level.progress.ChunkProgressListener;
76
import net.minecraft.util.thread.BlockableEventLoop;
87
import net.minecraft.world.level.ChunkPos;
98
import net.minecraft.world.level.chunk.ChunkAccess;
109
import net.minecraft.world.level.chunk.ChunkStatus;
1110
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager;
12-
import org.embeddedt.modernfix.duck.IPaperChunkHolder;
1311
import org.spongepowered.asm.mixin.Final;
1412
import org.spongepowered.asm.mixin.Mixin;
1513
import org.spongepowered.asm.mixin.Shadow;
1614
import org.spongepowered.asm.mixin.injection.At;
1715
import org.spongepowered.asm.mixin.injection.Inject;
1816
import org.spongepowered.asm.mixin.injection.ModifyArg;
19-
import org.spongepowered.asm.mixin.injection.Redirect;
20-
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
2117
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
2218

2319
import java.util.Optional;
2420
import java.util.concurrent.CompletableFuture;
2521
import java.util.concurrent.Executor;
26-
import java.util.function.Function;
2722

2823

2924
@Mixin(ChunkMap.class)
@@ -41,45 +36,13 @@ public abstract class ChunkMapMixin {
4136
@Shadow protected abstract CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> scheduleChunkGeneration(ChunkHolder chunkHolder, ChunkStatus chunkStatus);
4237

4338
@Shadow @Final private StructureTemplateManager structureTemplateManager;
44-
private Executor mainInvokingExecutor;
45-
46-
@Inject(method = "<init>", at = @At("RETURN"))
47-
private void setup(CallbackInfo ci) {
48-
MinecraftServer server = this.level.getServer();
49-
this.mainInvokingExecutor = (runnable) -> {
50-
if(server.isSameThread())
51-
runnable.run();
52-
else
53-
this.mainThreadExecutor.execute(runnable);
54-
};
55-
}
56-
5739

5840
/* https://github.com/PaperMC/Paper/blob/ver/1.17.1/patches/server/0752-Fix-chunks-refusing-to-unload-at-low-TPS.patch */
5941
@ModifyArg(method = "prepareAccessibleChunk", at = @At(value = "INVOKE", target = "Ljava/util/concurrent/CompletableFuture;thenApplyAsync(Ljava/util/function/Function;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;"), index = 1)
6042
private Executor useMainThreadExecutor(Executor executor) {
6143
return this.mainThreadExecutor;
6244
}
6345

64-
/* https://github.com/PaperMC/Paper/blob/master/patches/removed/1.19.2-legacy-chunksystem/0482-Improve-Chunk-Status-Transition-Speed.patch */
65-
@ModifyArg(method = "prepareEntityTickingChunk", at = @At(value = "INVOKE", target = "Ljava/util/concurrent/CompletableFuture;thenApplyAsync(Ljava/util/function/Function;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;"), index = 1)
66-
private Executor useMainInvokingExecutor(Executor executor) {
67-
return this.mainInvokingExecutor;
68-
}
69-
70-
@SuppressWarnings({"rawtypes", "unchecked"})
71-
@Redirect(method = "scheduleChunkGeneration", at = @At(value = "INVOKE", target = "Ljava/util/concurrent/CompletableFuture;thenComposeAsync(Ljava/util/function/Function;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;"))
72-
private CompletableFuture skipWorkerIfPossible(CompletableFuture inputFuture, Function function, Executor executor, ChunkHolder holder) {
73-
Executor targetExecutor = (runnable) -> {
74-
if(((IPaperChunkHolder)holder).mfix$canAdvanceStatus()) {
75-
this.mainInvokingExecutor.execute(runnable);
76-
return;
77-
}
78-
executor.execute(runnable);
79-
};
80-
return inputFuture.thenComposeAsync(function, targetExecutor);
81-
}
82-
8346
/**
8447
* @author embeddedt
8548
* @reason revert 1.17 chunk system changes, significantly reduces time and RAM needed to load chunks

common/src/main/java/org/embeddedt/modernfix/duck/IPaperChunkHolder.java

Lines changed: 0 additions & 5 deletions
This file was deleted.

gradle/wrapper/gradle-wrapper.jar

3.47 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

gradlew

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,13 +80,10 @@ do
8080
esac
8181
done
8282

83-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84-
85-
APP_NAME="Gradle"
83+
# This is normally unused
84+
# shellcheck disable=SC2034
8685
APP_BASE_NAME=${0##*/}
87-
88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
86+
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
9087

9188
# Use the maximum available, or set MAX_FD != -1 to use that value.
9289
MAX_FD=maximum
@@ -133,22 +130,29 @@ location of your Java installation."
133130
fi
134131
else
135132
JAVACMD=java
136-
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
133+
if ! command -v java >/dev/null 2>&1
134+
then
135+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137136
138137
Please set the JAVA_HOME variable in your environment to match the
139138
location of your Java installation."
139+
fi
140140
fi
141141

142142
# Increase the maximum file descriptors if we can.
143143
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144144
case $MAX_FD in #(
145145
max*)
146+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147+
# shellcheck disable=SC3045
146148
MAX_FD=$( ulimit -H -n ) ||
147149
warn "Could not query maximum file descriptor limit"
148150
esac
149151
case $MAX_FD in #(
150152
'' | soft) :;; #(
151153
*)
154+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155+
# shellcheck disable=SC3045
152156
ulimit -n "$MAX_FD" ||
153157
warn "Could not set maximum file descriptor limit to $MAX_FD"
154158
esac
@@ -193,6 +197,10 @@ if "$cygwin" || "$msys" ; then
193197
done
194198
fi
195199

200+
201+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
202+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
203+
196204
# Collect all arguments for the java command;
197205
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
198206
# shell script including quotes and variable substitutions, so put them in
@@ -205,6 +213,12 @@ set -- \
205213
org.gradle.wrapper.GradleWrapperMain \
206214
"$@"
207215

216+
# Stop when "xargs" is not available.
217+
if ! command -v xargs >/dev/null 2>&1
218+
then
219+
die "xargs is not available"
220+
fi
221+
208222
# Use "xargs" to parse quoted args.
209223
#
210224
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
@@ -231,4 +245,4 @@ eval "set -- $(
231245
tr '\n' ' '
232246
)" '"$@"'
233247

234-
exec "$JAVACMD" "$@"
248+
exec "$JAVACMD" "$@"

gradlew.bat

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@rem limitations under the License.
1515
@rem
1616

17-
@if "%DEBUG%" == "" @echo off
17+
@if "%DEBUG%"=="" @echo off
1818
@rem ##########################################################################
1919
@rem
2020
@rem Gradle startup script for Windows
@@ -25,7 +25,8 @@
2525
if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
28-
if "%DIRNAME%" == "" set DIRNAME=.
28+
if "%DIRNAME%"=="" set DIRNAME=.
29+
@rem This is normally unused
2930
set APP_BASE_NAME=%~n0
3031
set APP_HOME=%DIRNAME%
3132

@@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
4041

4142
set JAVA_EXE=java.exe
4243
%JAVA_EXE% -version >NUL 2>&1
43-
if "%ERRORLEVEL%" == "0" goto execute
44+
if %ERRORLEVEL% equ 0 goto execute
4445

4546
echo.
4647
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -75,15 +76,17 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
7576

7677
:end
7778
@rem End local scope for the variables with windows NT shell
78-
if "%ERRORLEVEL%"=="0" goto mainEnd
79+
if %ERRORLEVEL% equ 0 goto mainEnd
7980

8081
:fail
8182
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
8283
rem the _cmd.exe /c_ return code!
83-
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84-
exit /b 1
84+
set EXIT_CODE=%ERRORLEVEL%
85+
if %EXIT_CODE% equ 0 set EXIT_CODE=1
86+
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
87+
exit /b %EXIT_CODE%
8588

8689
:mainEnd
8790
if "%OS%"=="Windows_NT" endlocal
8891

89-
:omega
92+
:omega

0 commit comments

Comments
 (0)