Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.7-SNAPSHOT'
id 'fabric-loom' version '1.10-SNAPSHOT'
id 'maven-publish'
id "me.shedaniel.unified-publishing" version "0.1.+"
}
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.21.3
yarn_mappings=1.21.3+build.2
loader_version=0.16.9
minecraft_version=1.21.4
yarn_mappings=1.21.4+build.8
loader_version=0.16.10

# Mod Properties
mod_version = 2.3.0
Expand All @@ -17,5 +17,5 @@ org.gradle.jvmargs=-Xmx1G

# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.107.0+1.21.3
midnightlib_version=1.6.4-fabric
fabric_version=0.118.0+1.21.4
midnightlib_version=1.6.9+1.21.4-fabric
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.minecraft.client.resource.metadata.TextureResourceMetadata;
import net.minecraft.client.texture.NativeImage;
import net.minecraft.client.texture.ResourceTexture;
import net.minecraft.client.texture.TextureContents;
import net.minecraft.resource.ResourceManager;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.random.Random;
Expand All @@ -25,10 +26,12 @@ public ConfigTexture(Identifier location) {
super(location);
}

protected TextureData loadTextureData(ResourceManager resourceManager) {
@Override
public TextureContents loadContents(ResourceManager resourceManager) {
try {
InputStream input = new FileInputStream(CustomSplashScreenClient.CONFIG_PATH+"/"+this.location.getPath());
if (this.location.getPath().equals("background.png") && CustomSplashScreenClient.CONFIG_PATH.toPath().resolve("backgrounds").toFile().isDirectory()) {
Identifier location = getId();
InputStream input = new FileInputStream(CustomSplashScreenClient.CONFIG_PATH+"/"+location.getPath());
if (location.getPath().equals("background.png") && CustomSplashScreenClient.CONFIG_PATH.toPath().resolve("backgrounds").toFile().isDirectory()) {
if (CustomSplashScreenClient.CONFIG_PATH.toPath().resolve("backgrounds").toFile().listFiles() != null) {
File[] backgrounds = Arrays.stream(Objects.requireNonNull(CustomSplashScreenClient.CONFIG_PATH.toPath().resolve("backgrounds").toFile().listFiles())).filter(file -> file.toString().endsWith(".png") || file.toString().endsWith(".jpg") || file.toString().endsWith(".jpeg")).toList().toArray(new File[0]);
if (backgrounds.length > 0) {
Expand All @@ -39,17 +42,17 @@ protected TextureData loadTextureData(ResourceManager resourceManager) {
}
}

TextureData texture;
TextureContents texture;

try {
texture = new TextureData(new TextureResourceMetadata(shouldBlur, true), NativeImage.read(input));
texture = new TextureContents(NativeImage.read(input), new TextureResourceMetadata(shouldBlur, true));
} finally {
input.close();
}

return texture;
} catch (IOException var18) {
return new TextureData(var18);
return TextureContents.createMissing();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import net.minecraft.client.resource.metadata.TextureResourceMetadata;
import net.minecraft.client.texture.NativeImage;
import net.minecraft.client.texture.ResourceTexture;
import net.minecraft.client.texture.TextureContents;
import net.minecraft.resource.ResourceManager;
import net.minecraft.util.Identifier;

Expand All @@ -16,15 +17,16 @@ public EmptyTexture(Identifier location) {
super(location);
}

protected TextureData loadTextureData(ResourceManager resourceManager) {
@Override
public TextureContents loadContents(ResourceManager resourceManager) {
try {
InputStream input = Thread.currentThread().getContextClassLoader().getResourceAsStream("empty.png");
TextureData texture = null;
TextureContents texture = null;

if( input != null ) {

try {
texture = new TextureData(new TextureResourceMetadata(true, true), NativeImage.read(input));
texture = new TextureContents(NativeImage.read(input), new TextureResourceMetadata(true, true));
} finally {
input.close();
}
Expand All @@ -33,7 +35,7 @@ protected TextureData loadTextureData(ResourceManager resourceManager) {

return texture;
} catch (IOException var18) {
return new TextureData(var18);
return TextureContents.createMissing();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/customsplashscreen.mixins.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"required": true,
"package": "eu.midnightdust.customsplashscreen.mixin",
"compatibilityLevel": "JAVA_17",
"compatibilityLevel": "JAVA_21",
"client": [
"MixinSplashScreen",
"MixinMidnightConfig"
Expand Down