14 Commits
13 changed files with 204 additions and 158 deletions

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@ permissions:
jobs:
release-tags:
uses: FalsePattern/fpgradle-workflows/.github/workflows/release-tags.yml@master
uses: FalsePattern/fpgradle-workflows/.github/workflows/release-tags-2.yml@master
with:
workspace: "setupCIWorkspace"
secrets:
+2 -1
View File
@@ -1,5 +1,5 @@
plugins {
id("com.falsepattern.fpgradle-mc") version("2.1.0")
id("com.falsepattern.fpgradle-mc") version("4.1.0")
}
group = "com.falsepattern"
@@ -36,6 +36,7 @@ minecraft_fp {
}
curseforge {
projectId = "844484"
side = Both
}
modrinth {
projectId = "y0vBUOla"
Binary file not shown.
+3 -1
View File
@@ -1,7 +1,9 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.0-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+3 -3
View File
@@ -20,7 +20,7 @@
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
# gradlew start up script for POSIX generated by Gradle.
#
# Important for running:
#
@@ -29,7 +29,7 @@
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
# ksh gradlew
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/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/.
Vendored
+12 -23
View File
@@ -19,12 +19,12 @@
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem gradlew startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Set local scope for the variables, and ensure extensions are enabled
setlocal EnableExtensions
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@@ -51,7 +51,7 @@ 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
"%COMSPEC%" /c exit 1
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
@@ -65,29 +65,18 @@ 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
"%COMSPEC%" /c exit 1
:execute
@rem Setup the command line
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
@rem Execute gradlew
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
@rem which allows us to clear the local environment before executing the java command
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
:end
@rem End local scope for the variables with windows NT shell
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!
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
:omega
:exitWithErrorLevel
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
"%COMSPEC%" /c exit %ERRORLEVEL%
+19
View File
@@ -11,6 +11,15 @@ loading hooks, and more.
### Mod logo by Houstonruss
NotEnoughIDs Compatibility Notice
-----
This mod is NOT compatible with NotEnoughIDs (both the original and the GTNH variant). use [EndlessIDs](https://github.com/GTMEGA/EndlessIDs) instead.
**BACKUP YOUR SAVE FIRST!**
If you only need ID extension on block/item IDs, you can turn off the extensions of other ID types in EndlessIDs to prevent compatibility issues!
Goals
-----
@@ -112,7 +121,17 @@ Manager data:
| 4 | int | (m) Manager data length |
| m | byte[m] | Manager data |
## Strict No LLM / No AI Policy
No LLMs for issues.
No LLMs for patches / pull requests.
No LLMs for comments on the bug tracker, including translation.
English is encouraged, but not required. You are welcome to post in your native
language and rely on others to have their own translation tools of choice to
interpret your words.
Dependencies
------------
@@ -413,11 +413,14 @@ public class DataRegistryImpl {
StartupQuery.abort();
}
try {
ZipperUtil.backupWorld();
} catch (IOException e) {
StartupQuery.notify("The world backup couldn't be created.\n\n" + e);
StartupQuery.abort();
String skip = System.getProperty("fml.doNotBackup");
if (skip == null || !"true".equals(skip)) {
try {
ZipperUtil.backupWorld();
} catch (IOException e) {
StartupQuery.notify("The world backup couldn't be created.\n\n" + e);
StartupQuery.abort();
}
}
}
}
@@ -1,123 +0,0 @@
/*
* ChunkAPI
*
* Copyright (C) 2023-2025 FalsePattern, The MEGA Team, LegacyModdingMC contributors
* All Rights Reserved
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.chunk.internal.mixin.mixins.common.base;
import com.falsepattern.chunk.internal.mixin.helpers.LockHelper;
import lombok.val;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.play.server.S21PacketChunkData;
import net.minecraft.network.play.server.S26PacketMapChunkBulk;
import java.io.IOException;
import java.util.zip.DataFormatException;
import java.util.zip.Inflater;
@Mixin(S26PacketMapChunkBulk.class)
public abstract class S26PacketMapChunkBulkMixin {
@Shadow(aliases = "field_149268_i",
remap = false)
private static byte[] inflaterBuffer;
@Shadow(aliases = "field_149266_a",
remap = false)
private int[] xPositions;
@Shadow(aliases = "field_149264_b",
remap = false)
private int[] zPositions;
@Shadow(aliases = "field_149265_c",
remap = false)
private int[] subChunkMasks;
@Shadow(aliases = "field_149262_d",
remap = false)
private int[] subChunkMSBMasks;
@Shadow(aliases = "field_149261_g",
remap = false)
private int deflatedSize;
@Shadow(aliases = "field_149267_h",
remap = false)
private boolean skylight;
@Shadow(aliases = "field_149260_f",
remap = false)
private byte[][] datas;
/**
* @author FalsePattern
* @reason Replace functionality
*/
@Overwrite
public void readPacketData(PacketBuffer data) throws IOException {
short chunkCount = data.readShort();
val sizes = new int[chunkCount];
for (int i = 0; i < chunkCount; i++) {
sizes[i] = data.readInt();
}
deflatedSize = data.readInt();
skylight = data.readBoolean();
xPositions = new int[chunkCount];
zPositions = new int[chunkCount];
subChunkMasks = new int[chunkCount];
subChunkMSBMasks = new int[chunkCount];
datas = new byte[chunkCount][];
while (!LockHelper.bufferLockS26PacketMapChunkBulk.tryLock()) {
Thread.yield();
}
byte[] buf;
try {
if (inflaterBuffer.length < deflatedSize) {
inflaterBuffer = new byte[deflatedSize];
}
data.readBytes(inflaterBuffer, 0, deflatedSize);
buf = new byte[S21PacketChunkData.func_149275_c() * chunkCount];
Inflater inflater = new Inflater();
inflater.setInput(inflaterBuffer, 0, deflatedSize);
try {
inflater.inflate(buf);
} catch (DataFormatException dataformatexception) {
throw new IOException("Bad compressed data format");
} finally {
inflater.end();
}
} finally {
LockHelper.bufferLockS26PacketMapChunkBulk.unlock();
}
int pos = 0;
for (int i = 0; i < chunkCount; ++i) {
val size = sizes[i];
xPositions[i] = data.readInt();
zPositions[i] = data.readInt();
subChunkMasks[i] = data.readUnsignedShort();
datas[i] = new byte[size];
System.arraycopy(buf, pos, datas[i], 0, size);
pos += size;
}
}
}
@@ -23,16 +23,26 @@
package com.falsepattern.chunk.internal.mixin.mixins.common.thermos;
import com.falsepattern.chunk.internal.mixin.helpers.LockHelper;
import lombok.val;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.play.server.S21PacketChunkData;
import net.minecraft.network.play.server.S26PacketMapChunkBulk;
import java.io.IOException;
import java.util.zip.DataFormatException;
import java.util.zip.Inflater;
@Mixin(S26PacketMapChunkBulk.class)
public abstract class S26PacketMapChunkBulkMixin {
@Shadow(aliases = "field_149268_i",
remap = false)
private byte[] inflaterBuffer;
@Shadow(aliases = "field_149263_e",
remap = false)
private byte[] deflatedData;
@@ -45,6 +55,9 @@ public abstract class S26PacketMapChunkBulkMixin {
@Shadow(aliases = "field_149265_c",
remap = false)
private int[] subChunkMasks;
@Shadow(aliases = "field_149262_d",
remap = false)
private int[] subChunkMSBMasks;
@Shadow(aliases = "field_149261_g",
remap = false)
private int deflatedSize;
@@ -57,6 +70,64 @@ public abstract class S26PacketMapChunkBulkMixin {
@Shadow(remap = false)
protected abstract void compress();
/**
* @author FalsePattern
* @reason Replace functionality
*/
@Overwrite
public void readPacketData(PacketBuffer data) throws IOException {
short chunkCount = data.readShort();
val sizes = new int[chunkCount];
for (int i = 0; i < chunkCount; i++) {
sizes[i] = data.readInt();
}
deflatedSize = data.readInt();
skylight = data.readBoolean();
xPositions = new int[chunkCount];
zPositions = new int[chunkCount];
subChunkMasks = new int[chunkCount];
subChunkMSBMasks = new int[chunkCount];
datas = new byte[chunkCount][];
while (!LockHelper.bufferLockS26PacketMapChunkBulk.tryLock()) {
Thread.yield();
}
byte[] buf;
try {
if (inflaterBuffer.length < deflatedSize) {
inflaterBuffer = new byte[deflatedSize];
}
data.readBytes(inflaterBuffer, 0, deflatedSize);
buf = new byte[S21PacketChunkData.func_149275_c() * chunkCount];
Inflater inflater = new Inflater();
inflater.setInput(inflaterBuffer, 0, deflatedSize);
try {
inflater.inflate(buf);
} catch (DataFormatException dataformatexception) {
throw new IOException("Bad compressed data format");
} finally {
inflater.end();
}
} finally {
LockHelper.bufferLockS26PacketMapChunkBulk.unlock();
}
int pos = 0;
for (int i = 0; i < chunkCount; ++i) {
val size = sizes[i];
xPositions[i] = data.readInt();
zPositions[i] = data.readInt();
subChunkMasks[i] = data.readUnsignedShort();
datas[i] = new byte[size];
System.arraycopy(buf, pos, datas[i], 0, size);
pos += size;
}
}
/**
* @author FalsePattern
@@ -22,17 +22,26 @@
package com.falsepattern.chunk.internal.mixin.mixins.common.vanilla;
import com.falsepattern.chunk.internal.mixin.helpers.LockHelper;
import lombok.val;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.play.server.S21PacketChunkData;
import net.minecraft.network.play.server.S26PacketMapChunkBulk;
import java.io.IOException;
import java.util.concurrent.Semaphore;
import java.util.zip.DataFormatException;
import java.util.zip.Inflater;
@Mixin(S26PacketMapChunkBulk.class)
public abstract class S26PacketMapChunkBulkMixin {
@Shadow(aliases = "field_149268_i",
remap = false)
private static byte[] inflaterBuffer;
@Shadow(aliases = "field_149263_e",
remap = false)
private byte[] deflatedData;
@@ -47,6 +56,9 @@ public abstract class S26PacketMapChunkBulkMixin {
@Shadow(aliases = "field_149265_c",
remap = false)
private int[] subChunkMasks;
@Shadow(aliases = "field_149262_d",
remap = false)
private int[] subChunkMSBMasks;
@Shadow(aliases = "field_149261_g",
remap = false)
private int deflatedSize;
@@ -60,6 +72,64 @@ public abstract class S26PacketMapChunkBulkMixin {
@Shadow(remap = false)
protected abstract void deflate();
/**
* @author FalsePattern
* @reason Replace functionality
*/
@Overwrite
public void readPacketData(PacketBuffer data) throws IOException {
short chunkCount = data.readShort();
val sizes = new int[chunkCount];
for (int i = 0; i < chunkCount; i++) {
sizes[i] = data.readInt();
}
deflatedSize = data.readInt();
skylight = data.readBoolean();
xPositions = new int[chunkCount];
zPositions = new int[chunkCount];
subChunkMasks = new int[chunkCount];
subChunkMSBMasks = new int[chunkCount];
datas = new byte[chunkCount][];
while (!LockHelper.bufferLockS26PacketMapChunkBulk.tryLock()) {
Thread.yield();
}
byte[] buf;
try {
if (inflaterBuffer.length < deflatedSize) {
inflaterBuffer = new byte[deflatedSize];
}
data.readBytes(inflaterBuffer, 0, deflatedSize);
buf = new byte[S21PacketChunkData.func_149275_c() * chunkCount];
Inflater inflater = new Inflater();
inflater.setInput(inflaterBuffer, 0, deflatedSize);
try {
inflater.inflate(buf);
} catch (DataFormatException dataformatexception) {
throw new IOException("Bad compressed data format");
} finally {
inflater.end();
}
} finally {
LockHelper.bufferLockS26PacketMapChunkBulk.unlock();
}
int pos = 0;
for (int i = 0; i < chunkCount; ++i) {
val size = sizes[i];
xPositions[i] = data.readInt();
zPositions[i] = data.readInt();
subChunkMasks[i] = data.readUnsignedShort();
datas[i] = new byte[size];
System.arraycopy(buf, pos, datas[i], 0, size);
pos += size;
}
}
/**
* @author FalsePattern
* @reason Replace functionality
@@ -122,7 +122,7 @@ public enum Mixin implements IMixins {
{
try
{
Class.forName("thermos.Thermos");
Class.forName("thermos.ThermosClassTransformer");
return true;
}
catch(ClassNotFoundException ignored) {
@@ -57,6 +57,20 @@ public class SkylightManager extends NibbleManager implements DataManager.SubChu
}
}
@Override
public void writeToBuffer(Chunk chunk, ExtendedBlockStorage blockStorage, ByteBuffer buffer) {
if (!chunk.worldObj.provider.hasNoSky) {
super.writeToBuffer(chunk, blockStorage, buffer);
}
}
@Override
public void readFromBuffer(Chunk chunk, ExtendedBlockStorage blockStorage, ByteBuffer buffer) {
if (!chunk.worldObj.provider.hasNoSky) {
super.readFromBuffer(chunk, blockStorage, buffer);
}
}
@Override
public boolean subChunkPrivilegedAccess() {
return true;