Skip to content

Commit

Permalink
Update to Unimined 1.2.4 and gradle 8.7
Browse files Browse the repository at this point in the history
  • Loading branch information
thecatcore committed May 1, 2024
1 parent 9d87740 commit 9fd1b4e
Show file tree
Hide file tree
Showing 18 changed files with 93 additions and 133 deletions.
65 changes: 11 additions & 54 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,36 +1,17 @@
plugins {
id 'java'
id 'xyz.wagyourtail.unimined' version "0.4.10-SNAPSHOT"
id 'xyz.wagyourtail.unimined' version "1.2.4-SNAPSHOT"
id 'maven-publish'
}

archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group

repositories {
mavenCentral()

maven {
name = 'Fabric'
url = "https://maven.fabricmc.net/"
}
maven {
name = "Legacy Fabric"
url = "https://maven.legacyfabric.net/"
}
// WagYourTail Mavens
maven { url "https://maven.wagyourtail.xyz/releases" }
maven { url "https://maven.wagyourtail.xyz/snapshots" }

maven {
url "https://maven.minecraftforge.net/"
metadataSources {
artifact()
mavenPom()
}
}
base {
archivesName = project.archives_base_name
}

repositories {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
Expand All @@ -40,48 +21,24 @@ repositories {
}
}

//sourceSets {
// main
// debug {
// compileClasspath += main.compileClasspath
// }
//}

unimined {
useGlobalCache = false
}
unimined.minecraft {
version project.minecraft_version

minecraft {
legacyFabric {
loader project.loader_version
accessWidener = file("src/main/resources/fabricated-rift.accesswidener")
}

mcRemapper.tinyRemapperConf = {
// most mcp mappings (except older format) dont include field desc
ignoreFieldDesc(true)
// this also fixes some issues with them, as it tells tiny remapper to try harder to resolve conflicts
ignoreConflicts(true)
mappings {
searge()
mcp(project.mcp_channel, "${project.mcp_version}-${project.minecraft_version}")
}
}

dependencies {
minecraft "net.minecraft:minecraft:${project.minecraft_version}"

mappings "de.oceanlabs.mcp:mcp_config:${project.minecraft_version}@zip"
mappings "de.oceanlabs.mcp:mcp_${project.mcp_channel}:${project.mcp_version}-${project.minecraft_version}@zip"

mappings "net.legacyfabric:intermediary:${project.minecraft_version}:v2"
//mappings "net.legacyfabric.v2:yarn:${project.yarn_mappings}:v2"

fabric "net.fabricmc:fabric-loader:${project.loader_version}"

modImplementation("maven.modrinth:mod-remapping-api:${project.mod_remapping_api}")
}

base {
archivesName = project.archives_base_name
}

processResources {
inputs.property "version", project.version

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
29 changes: 17 additions & 12 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# 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

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,26 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
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

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
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

Expand Down
24 changes: 12 additions & 12 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
pluginManagement {
repositories {
mavenCentral()
maven {
name = 'WagYourMaven'
url = 'https://maven.wagyourtail.xyz/snapshots'
url = "https://maven.neoforged.net/releases"
}
maven {
name = 'ForgeMaven'
url = 'https://maven.minecraftforge.net/'
url = "https://maven.minecraftforge.net/"
}
maven {
name = 'FabricMaven'
url = 'https://maven.fabricmc.net/'
url = "https://maven.fabricmc.net/"
}
maven {
name = "legacy-fabric"
url = "https://repo.legacyfabric.net/repository/legacyfabric/"
url = "https://maven.wagyourtail.xyz/releases"
}
gradlePluginPortal()
maven {
name = 'Jitpack'
url = 'https://jitpack.io'
maven {
url = "https://maven.wagyourtail.xyz/snapshots"
}
gradlePluginPortal() {
content {
excludeGroup("org.apache.logging.log4j")
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import net.minecraft.world.gen.ChunkGeneratorType;
import net.minecraft.world.gen.IChunkGenSettings;
import net.minecraft.world.gen.IChunkGenerator;
import org.jetbrains.annotations.Nullable;

import javax.annotation.Nullable;
import java.util.function.Supplier;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import net.minecraft.resources.ResourcePackType;
import net.minecraft.resources.VanillaPack;
import net.minecraft.util.ResourceLocation;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;

import javax.annotation.Nullable;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
Expand All @@ -25,7 +25,7 @@ public class MixinVanillaPack {
*/
@Nullable
@Overwrite(constraints = "OPTIFINE(0-1)")
protected @org.jetbrains.annotations.Nullable InputStream getInputStreamVanilla(ResourcePackType type, ResourceLocation location) {
protected InputStream getInputStreamVanilla(ResourcePackType type, ResourceLocation location) {
String pathString = type.getDirectoryName() + "/" + location.getNamespace() + "/" + location.getPath();

if (basePath != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@Mixin(BlockFluidRenderer.class)
public abstract class MixinBlockFluidRenderer {
@Shadow private static boolean isAdjacentFluidSameAs(IBlockReader world, BlockPos pos, EnumFacing side, IFluidState state) { return false; }
@Shadow private static boolean method_19190(IBlockReader world, BlockPos pos, EnumFacing side, float height) { return false; }
@Shadow private static boolean func_209556_a(IBlockReader world, BlockPos pos, EnumFacing side, float height) { return false; }
@Shadow protected abstract float getFluidHeight(IWorldReaderBase world, BlockPos pos, Fluid fluid);
@Shadow protected abstract int getCombinedLightUpMax(IWorldReader world, BlockPos pos);
@Shadow private TextureAtlasSprite atlasSpriteWaterOverlay;
Expand Down Expand Up @@ -55,12 +55,12 @@ public boolean render(IWorldReader world, BlockPos pos, BufferBuilder buffer, IF
float greenMultiplier = (colorMultiplier >> 8 & 255) / 255F;
float blueMultiplier = (colorMultiplier & 255) / 255F;

boolean renderTop = !isAdjacentFluidSameAs(world, pos, EnumFacing.field_5201, state);
boolean renderBottom = !isAdjacentFluidSameAs(world, pos, EnumFacing.field_5200, state) && !method_19190(world, pos, EnumFacing.field_5200, 0.8888889F);
boolean renderNorth = !isAdjacentFluidSameAs(world, pos, EnumFacing.field_5202, state);
boolean renderSouth = !isAdjacentFluidSameAs(world, pos, EnumFacing.field_5203, state);
boolean renderWest = !isAdjacentFluidSameAs(world, pos, EnumFacing.field_5205, state);
boolean renderEast = !isAdjacentFluidSameAs(world, pos, EnumFacing.field_5204, state);
boolean renderTop = !isAdjacentFluidSameAs(world, pos, EnumFacing.UP, state);
boolean renderBottom = !isAdjacentFluidSameAs(world, pos, EnumFacing.DOWN, state) && !func_209556_a(world, pos, EnumFacing.DOWN, 0.8888889F);
boolean renderNorth = !isAdjacentFluidSameAs(world, pos, EnumFacing.NORTH, state);
boolean renderSouth = !isAdjacentFluidSameAs(world, pos, EnumFacing.SOUTH, state);
boolean renderWest = !isAdjacentFluidSameAs(world, pos, EnumFacing.WEST, state);
boolean renderEast = !isAdjacentFluidSameAs(world, pos, EnumFacing.EAST, state);

if (!renderTop && !renderBottom && !renderEast && !renderWest && !renderNorth && !renderSouth) {
return false;
Expand All @@ -82,7 +82,7 @@ public boolean render(IWorldReader world, BlockPos pos, BufferBuilder buffer, IF
float minV;
float maxV;

if (renderTop && !method_19190(world, pos, EnumFacing.field_5201, Math.min(Math.min(var17, var18), Math.min(var19, var20)))) {
if (renderTop && !func_209556_a(world, pos, EnumFacing.UP, Math.min(Math.min(var17, var18), Math.min(var19, var20)))) {
rendered = true;
var17 -= 0.001F;
var18 -= 0.001F;
Expand Down Expand Up @@ -171,7 +171,7 @@ public boolean render(IWorldReader world, BlockPos pos, BufferBuilder buffer, IF
x2 = x + 1;
z1 = z + 0.001;
z2 = z + 0.001;
side = EnumFacing.field_5202;
side = EnumFacing.NORTH;
render = renderNorth;
} else if (direction == 1) {
maxU = var19;
Expand All @@ -180,7 +180,7 @@ public boolean render(IWorldReader world, BlockPos pos, BufferBuilder buffer, IF
x2 = x;
z1 = z + 1 - 0.001;
z2 = z + 1 - 0.001;
side = EnumFacing.field_5203;
side = EnumFacing.SOUTH;
render = renderSouth;
} else if (direction == 2) {
maxU = var18;
Expand All @@ -189,7 +189,7 @@ public boolean render(IWorldReader world, BlockPos pos, BufferBuilder buffer, IF
x2 = x + 0.001;
z1 = z + 1;
z2 = z;
side = EnumFacing.field_5205;
side = EnumFacing.WEST;
render = renderWest;
} else {
maxU = var20;
Expand All @@ -198,11 +198,11 @@ public boolean render(IWorldReader world, BlockPos pos, BufferBuilder buffer, IF
x2 = x + 1 - 0.001;
z1 = z;
z2 = z + 1;
side = EnumFacing.field_5204;
side = EnumFacing.EAST;
render = renderEast;
}

if (render && !method_19190(world, pos, side, Math.max(maxU, minV))) {
if (render && !func_209556_a(world, pos, side, Math.max(maxU, minV))) {
rendered = true;
BlockPos var55 = pos.offset(side);
TextureAtlasSprite texture = flowingTexture;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import net.minecraft.world.chunk.storage.IChunkLoader;
import net.minecraft.world.dimension.Dimension;
import net.minecraft.world.storage.SaveHandler;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;

import javax.annotation.Nullable;
import java.io.File;

@Mixin(AnvilSaveHandler.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ private void onTick(CallbackInfo ci) {
profiler.endSection();
}

@Inject(method = "method_20316", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/management/PlayerList;method_21387(Lnet/minecraft/world/WorldServer;)V"))
@Inject(method = "func_212369_a", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/management/PlayerList;func_212504_a(Lnet/minecraft/world/WorldServer;)V"))
private void onWorldLoad(ISaveHandler saveHandler, WorldSavedDataStorage savedDataStorage, WorldInfo info, WorldSettings settings, CallbackInfo ci) {
WorldServer overworld = getWorld(DimensionType.field_18954);
WorldServer overworld = getWorld(DimensionType.OVERWORLD);

for (DimensionType type : DimensionType.getAll()) {
//Skip around existing types (the Overworld, Nether and End)
Expand Down
Loading

0 comments on commit 9fd1b4e

Please sign in to comment.