Skip to content

Commit

Permalink
Merge branch '1.21.4'
Browse files Browse the repository at this point in the history
# Conflicts:
#	gradle.properties
#	src/main/java/org/samo_lego/fabrictailor/config/TailorConfig.java
  • Loading branch information
samolego committed Dec 2, 2024
2 parents 55ab8fd + 172ba57 commit 9a3a0cc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 26 deletions.
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
minecraft_version=1.21.2
yarn_mappings=1.21.2+build.1
loader_version=0.16.7
minecraft_version=1.21.4-rc3
yarn_mappings=1.21.4-rc3+build.3
loader_version=0.16.9

# Fabric API
fabric_version=0.106.1+1.21.2
fabric_version=0.110.3+1.21.4
# Mod Properties
mod_version=2.6.0
mod_version=2.6.1
maven_group=org.samo_lego
archives_base_name=fabrictailor
# Dependencies
Expand Down
21 changes: 5 additions & 16 deletions src/main/java/org/samo_lego/fabrictailor/config/TailorConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,28 +109,17 @@ public static class DefaultSkin {
* @return TaterzenLanguage object
*/
public static TailorConfig loadConfigFile(File file, boolean serverEnvironment) {
TailorConfig config = null;
if (file.exists()) {
try (BufferedReader fileReader = new BufferedReader(
new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8)
)) {
config = gson.fromJson(fileReader, TailorConfig.class);
} catch (IOException e) {
error(MOD_ID + " Problem occurred when trying to load config: " + e.getMessage());
}
}
if(config == null) {
return IBrigadierConfigurator.loadConfigFile(file, TailorConfig.class, () -> {
// Config doesn't exist yet
config = new TailorConfig();
if(serverEnvironment) {
var config = new TailorConfig();
if (serverEnvironment) {
// A bit different default config
config.skinChangeTimer = 60;
} else {
config.defaultSkin.applyToAll = true;
}
}
config.save();

return config;
return config;
});
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package org.samo_lego.fabrictailor.mixin.client;

import com.mojang.blaze3d.platform.NativeImage;
import net.minecraft.client.renderer.texture.HttpTexture;
import net.minecraft.client.renderer.texture.SkinTextureDownloader;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(HttpTexture.class)
@Mixin(SkinTextureDownloader.class)
public abstract class MHttpTexture_HDEnabler {

@Shadow
Expand All @@ -30,13 +30,13 @@ private static void doNotchTransparencyHack(NativeImage image, int x1, int y1, i
* @reason Enable HD textures
*/
@Inject(method = "processLegacySkin", at = @At("HEAD"), cancellable = true)
private void ft_enableHD(NativeImage skinImg, CallbackInfoReturnable<NativeImage> cir) {
cir.setReturnValue(this.ft_proccessSkin(skinImg));
private static void ft_enableHD(NativeImage skinImg, String string, CallbackInfoReturnable<NativeImage> cir) {
cir.setReturnValue(ft_proccessSkin(skinImg));
}


@Unique
private NativeImage ft_proccessSkin(NativeImage skinImg) {
private static NativeImage ft_proccessSkin(NativeImage skinImg) {
int height = skinImg.getHeight();
int width = skinImg.getWidth();

Expand Down

0 comments on commit 9a3a0cc

Please sign in to comment.