mirror of
https://github.com/GTNewHorizons/Postea.git
synced 2026-11-24 05:54:31 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
361c851706 | ||
|
|
ebb2517488 | ||
|
|
ff97e8841c | ||
|
|
b60e19b434 | ||
|
|
cb9de2d290 | ||
|
|
ec2b6a9007 | ||
|
|
d9ceee01b5 | ||
|
|
d1817ea4c2 | ||
|
|
d168177c1d |
No files matched your search
+1
-1
@@ -1,4 +1,4 @@
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:NotEnoughIds:1.5.4-pre:dev')
|
||||
api('com.github.GTNewHorizons:NotEnoughIds:2.1.0:dev')
|
||||
}
|
||||
+17
-5
@@ -33,7 +33,7 @@ channel = stable
|
||||
mappingsVersion = 12
|
||||
|
||||
# Defines other MCP mappings for dependency deobfuscation.
|
||||
remoteMappings = https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
|
||||
remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
|
||||
|
||||
# Select a default username for testing your mod. You can always override this per-run by running
|
||||
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
|
||||
@@ -61,6 +61,9 @@ gradleTokenModId = MODID
|
||||
# [DEPRECATED] Mod name replacement token.
|
||||
gradleTokenModName = MODNAME
|
||||
|
||||
# [DEPRECATED] Mod Group replacement token.
|
||||
gradleTokenGroupName = GROUPNAME
|
||||
|
||||
# [DEPRECATED]
|
||||
# Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java
|
||||
# public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||
@@ -82,6 +85,11 @@ accessTransformersFile =
|
||||
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||
usesMixins = true
|
||||
|
||||
# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main.
|
||||
# This can speed up compile times thanks to not running the mixin annotation processor on all input sources.
|
||||
# Mixin classes will have access to "main" classes, but not the other way around.
|
||||
separateMixinSourceSet =
|
||||
|
||||
# Adds some debug arguments like verbose output and class export.
|
||||
usesMixinDebug = true
|
||||
|
||||
@@ -114,16 +122,22 @@ minimizeShadowedDependencies = true
|
||||
# If disabled, won't rename the shadowed classes.
|
||||
relocateShadowedDependencies = true
|
||||
|
||||
# Adds the GTNH maven, CurseMaven, IC2/Player maven, and some more well-known 1.7.10 repositories.
|
||||
# Adds CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
|
||||
includeWellKnownRepositories = true
|
||||
|
||||
# A list of repositories to exclude from the includeWellKnownRepositories setting. Should be a space separated
|
||||
# list of strings, with the acceptable keys being(case does not matter):
|
||||
# cursemaven
|
||||
# modrinth
|
||||
excludeWellKnownRepositories =
|
||||
|
||||
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
|
||||
# Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables.
|
||||
# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle.
|
||||
usesMavenPublishing = true
|
||||
|
||||
# Maven repository to publish the mod to.
|
||||
# mavenPublishUrl = https://nexus.gtnewhorizons.com/repository/releases/
|
||||
# mavenPublishUrl = https\://nexus.gtnewhorizons.com/repository/releases/
|
||||
|
||||
# Publishing to Modrinth requires you to set the MODRINTH_TOKEN environment variable to your current Modrinth API token.
|
||||
#
|
||||
@@ -187,5 +201,3 @@ curseForgeRelations =
|
||||
# This is meant to be set in $HOME/.gradle/gradle.properties.
|
||||
# ideaCheckSpotlessOnBuild = true
|
||||
|
||||
# Non-GTNH properties
|
||||
gradleTokenGroupName = GROUPNAME
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@@ -55,7 +57,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/.
|
||||
@@ -84,7 +86,8 @@ done
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||
' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
Vendored
+2
@@ -13,6 +13,8 @@
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.8'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.27'
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,12 @@ import com.gtnewhorizons.postea.utility.ChunkFixerUtility;
|
||||
@Mixin(AnvilChunkLoader.class)
|
||||
public abstract class MixinAnvilChunkLoader {
|
||||
|
||||
@Inject(method = "checkedReadChunkFromNBT__Async", at = @At("HEAD"), remap = false)
|
||||
@Inject(
|
||||
method = "checkedReadChunkFromNBT__Async",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/chunk/storage/AnvilChunkLoader;readChunkFromNBT(Lnet/minecraft/world/World;Lnet/minecraft/nbt/NBTTagCompound;)Lnet/minecraft/world/chunk/Chunk;"),
|
||||
remap = false)
|
||||
private void onCheckedReadChunkFromNBT__Async(World world, int x, int z, NBTTagCompound compound,
|
||||
CallbackInfoReturnable<Object[]> cir) {
|
||||
ChunkFixerUtility.processChunkNBT(compound, world);
|
||||
|
||||
@@ -60,6 +60,15 @@ public class ChunkFixerUtility {
|
||||
// Blocks16 and Data16 exist only because of NEID.
|
||||
byte[] blockArray = section.getByteArray("Blocks16");
|
||||
byte[] metadataArray = section.getByteArray("Data16");
|
||||
// If metadata array is empty, it was all zeroes. We create a new array to write our new values to,
|
||||
// and only save this when a nonzero value was written
|
||||
boolean wasAllZero = false;
|
||||
if (metadataArray.length == 0) {
|
||||
wasAllZero = true;
|
||||
metadataArray = new byte[8192];
|
||||
}
|
||||
// Keep track of if we write a nonzero element to the metadata array
|
||||
boolean hasWrittenNonZero = false;
|
||||
|
||||
byte sectionY = section.getByte("Y");
|
||||
|
||||
@@ -84,6 +93,11 @@ public class ChunkFixerUtility {
|
||||
blockConversionInfo.blockName = blockName;
|
||||
blockConversionInfo.blockID = blockId;
|
||||
blockConversionInfo.metadata = (byte) metadata; // Updated
|
||||
// If we wrote a nonzero metadata, keep track of this because it means the
|
||||
// new array needs to be written back to NBT
|
||||
if (metadata != 0) {
|
||||
hasWrittenNonZero = true;
|
||||
}
|
||||
blockConversionInfo.world = world;
|
||||
|
||||
int x = index % 16;
|
||||
@@ -107,6 +121,12 @@ public class ChunkFixerUtility {
|
||||
metadataArray[index * 2 + 1] = (byte) (newMetadata & 0xFF);
|
||||
}
|
||||
}
|
||||
|
||||
// After processing all replacements, if we made a new metadata array and wrote a nonzero value to it,
|
||||
// write it back to world NBT to save
|
||||
if (wasAllZero && hasWrittenNonZero) {
|
||||
section.setByteArray("Data16", metadataArray);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,6 +156,17 @@ public class ChunkFixerUtility {
|
||||
int chunkZPos) {
|
||||
byte[] blockArray = section.getByteArray("Blocks16");
|
||||
byte[] metadataArray = section.getByteArray("Data16"); // Updated to use Data16
|
||||
|
||||
// If metadata array is empty, it was all zeroes. We create a new array to write our new values to,
|
||||
// and only save this when a nonzero value was written
|
||||
boolean wasAllZero = false;
|
||||
if (metadataArray.length == 0) {
|
||||
wasAllZero = true;
|
||||
metadataArray = new byte[8192];
|
||||
}
|
||||
// Keep track of if we write a nonzero element to the metadata array
|
||||
boolean hasWrittenNonZero = false;
|
||||
|
||||
byte y = section.getByte("Y");
|
||||
|
||||
List<ConversionInfo> filteredList = filterConversionInfosByY(conversionInfoList, y);
|
||||
@@ -145,6 +176,13 @@ public class ChunkFixerUtility {
|
||||
int index = computeBlockIndex(localCoords);
|
||||
setBlockInfo(info.blockInfo.block, index, blockArray);
|
||||
setMetadata(info.blockInfo.metadata, index, metadataArray); // This uses the updated setMetadata
|
||||
if (info.blockInfo.metadata != 0) hasWrittenNonZero = true;
|
||||
}
|
||||
|
||||
// After processing all replacements, if we made a new metadata array and wrote a nonzero value to it,
|
||||
// write it back to world NBT to save
|
||||
if (wasAllZero && hasWrittenNonZero) {
|
||||
section.setByteArray("Data16", metadataArray);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user