Skip to content

Commit 8e136c1

Browse files
committed
Switch to Stonecutter
1 parent 1639e01 commit 8e136c1

25 files changed

+973
-854
lines changed

gradle-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version: '0.0.2'
2-
source: "https://github.com/tr7zw/ProcessedModTemplate/tree/master"
2+
source: "https://github.com/tr7zw/ProcessedModTemplate/tree/stonecutter"
33
replacements:
44
name: "3d-Skin-Layers"
55
id: "skinlayers3d"
Lines changed: 48 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,48 @@
1-
//#if FORGE
2-
//$$package dev.tr7zw.skinlayers;
3-
//$$
4-
//$$import net.minecraftforge.api.distmarker.Dist;
5-
//$$import net.minecraftforge.fml.DistExecutor;
6-
//$$import net.minecraftforge.fml.common.Mod;
7-
//$$import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
8-
//$$import dev.tr7zw.transition.loader.ModLoaderUtil;
9-
//$$
10-
//$$@Mod("skinlayers3d")
11-
//$$public class SkinLayersBootstrap {
12-
//$$
13-
//$$ public SkinLayersBootstrap(FMLJavaModLoadingContext context) {
14-
//$$ ModLoaderUtil.setModLoadingContext(context);
15-
//$$ DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> new SkinLayersMod().onInitialize());
16-
//$$ }
17-
//$$ public SkinLayersBootstrap() {
18-
//$$ this(FMLJavaModLoadingContext.get());
19-
//$$ }
20-
//$$
21-
//$$}
22-
//#elseif NEOFORGE
23-
//$$package dev.tr7zw.skinlayers;
24-
//$$
25-
//$$import net.neoforged.fml.common.Mod;
26-
//$$import net.neoforged.fml.loading.FMLEnvironment;
27-
//$$import dev.tr7zw.transition.loader.ModLoaderEventUtil;
28-
//$$import net.neoforged.api.distmarker.Dist;
29-
//$$
30-
//$$@Mod("skinlayers3d")
31-
//$$public class SkinLayersBootstrap {
32-
//$$
33-
//$$ public SkinLayersBootstrap() {
34-
//#if MC < 12109
35-
//$$ if(FMLEnvironment.dist == Dist.CLIENT) {
36-
//#else
37-
//$$ if(FMLEnvironment.getDist() == Dist.CLIENT) {
38-
//#endif
39-
//$$ ModLoaderEventUtil.registerClientSetupListener(() -> new SkinLayersMod().onInitialize());
40-
//$$ }
41-
//$$ }
42-
//$$
43-
//$$}
44-
//#endif
1+
//? if forge {
2+
/*
3+
package dev.tr7zw.skinlayers;
4+
5+
import net.minecraftforge.api.distmarker.Dist;
6+
import net.minecraftforge.fml.DistExecutor;
7+
import net.minecraftforge.fml.common.Mod;
8+
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
9+
import dev.tr7zw.transition.loader.ModLoaderUtil;
10+
11+
@Mod("skinlayers3d")
12+
public class SkinLayersBootstrap {
13+
14+
public SkinLayersBootstrap(FMLJavaModLoadingContext context) {
15+
ModLoaderUtil.setModLoadingContext(context);
16+
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> new SkinLayersMod().onInitialize());
17+
}
18+
public SkinLayersBootstrap() {
19+
this(FMLJavaModLoadingContext.get());
20+
}
21+
22+
}
23+
*///? } else if neoforge {
24+
/*
25+
package dev.tr7zw.skinlayers;
26+
27+
import net.neoforged.fml.common.Mod;
28+
import net.neoforged.fml.loading.FMLEnvironment;
29+
import dev.tr7zw.transition.loader.ModLoaderEventUtil;
30+
import net.neoforged.api.distmarker.Dist;
31+
32+
@Mod("skinlayers3d")
33+
public class SkinLayersBootstrap {
34+
35+
public SkinLayersBootstrap() {
36+
//? if < 1.21.9 {
37+
/^
38+
if(FMLEnvironment.dist == Dist.CLIENT) {
39+
^///? } else {
40+
41+
if(FMLEnvironment.getDist() == Dist.CLIENT) {
42+
//? }
43+
ModLoaderEventUtil.registerClientSetupListener(() -> new SkinLayersMod().onInitialize());
44+
}
45+
}
46+
47+
}
48+
*///? }
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package dev.tr7zw.skinlayers;
22

3-
//#if FABRIC
3+
//? if fabric {
4+
45
import net.fabricmc.api.ClientModInitializer;
56

67
public class SkinLayersMod extends SkinLayersModBase implements ClientModInitializer {
@@ -10,12 +11,13 @@ public void onInitializeClient() {
1011
this.onInitialize();
1112
}
1213

13-
//#else
14-
//$$ import dev.tr7zw.transition.loader.ModLoaderUtil;
15-
//$$ public class SkinLayersMod extends SkinLayersModBase {
16-
//$$ public SkinLayersMod() {
17-
//$$ ModLoaderUtil.registerClientSetupListener(this::onInitialize);
18-
//$$ }
19-
//#endif
14+
//? } else {
15+
/*
16+
import dev.tr7zw.transition.loader.ModLoaderUtil;
17+
public class SkinLayersMod extends SkinLayersModBase {
18+
public SkinLayersMod() {
19+
ModLoaderUtil.registerClientSetupListener(this::onInitialize);
20+
}
21+
*///? }
2022

2123
}

src/main/java/dev/tr7zw/skinlayers/SkinUtil.java

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,18 @@ public static NativeImage getTexture(ResourceLocation resourceLocation, SkullSet
4343
return null;
4444
}
4545
try {
46-
//#if MC >= 11900
46+
//? if >= 1.19.0 {
47+
4748
Optional<Resource> optionalRes = Minecraft.getInstance().getResourceManager().getResource(resourceLocation);
4849
if (optionalRes.isPresent()) {
4950
Resource resource = optionalRes.get();
5051
NativeImage skin = NativeImage.read(resource.open());
51-
//#else
52-
//$$ if(Minecraft.getInstance().getResourceManager().hasResource(resourceLocation)) {
53-
//$$ Resource resource = Minecraft.getInstance().getResourceManager().getResource(resourceLocation);
54-
//$$ NativeImage skin = NativeImage.read(resource.getInputStream());
55-
//#endif
52+
//? } else {
53+
54+
// if(Minecraft.getInstance().getResourceManager().hasResource(resourceLocation)) {
55+
// Resource resource = Minecraft.getInstance().getResourceManager().getResource(resourceLocation);
56+
// NativeImage skin = NativeImage.read(resource.getInputStream());
57+
//? }
5658
return skin;
5759
}
5860
AbstractTexture texture = Minecraft.getInstance().getTextureManager().getTexture(resourceLocation);
@@ -112,11 +114,13 @@ public static NativeImage getTexture(ResourceLocation resourceLocation, SkullSet
112114
}
113115

114116
public static boolean setup3dLayers(
115-
//#if MC >= 12109
117+
//? if >= 1.21.9 {
118+
116119
net.minecraft.world.entity.Avatar abstractClientPlayerEntity,
117-
//#else
118-
//$$net.minecraft.client.player.AbstractClientPlayer abstractClientPlayerEntity,
119-
//#endif
120+
//? } else {
121+
/*
122+
net.minecraft.client.player.AbstractClientPlayer abstractClientPlayerEntity,
123+
*///? }
120124
PlayerSettings settings, boolean thinArms) {
121125
ResourceLocation skinLocation = PlayerUtil.getPlayerSkin(abstractClientPlayerEntity);
122126
if (skinLocation == null) {

src/main/java/dev/tr7zw/skinlayers/SkullRendererCache.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,25 @@
55
import dev.tr7zw.skinlayers.accessor.SkullSettings;
66
import dev.tr7zw.skinlayers.api.Mesh;
77
import net.minecraft.resources.ResourceLocation;
8-
//#if MC >= 12104
8+
//? if >= 1.21.4 {
9+
910
import com.mojang.authlib.GameProfile;
10-
//#else
11-
//$$import net.minecraft.world.item.ItemStack;
12-
//#endif
11+
//? } else {
12+
/*
13+
import net.minecraft.world.item.ItemStack;
14+
*///? }
1315

1416
public class SkullRendererCache {
1517

1618
public static boolean renderNext = false;
1719
public static SkullSettings lastSkull = null;
18-
//#if MC >= 12104
20+
//? if >= 1.21.4 {
21+
1922
public static WeakHashMap<GameProfile, SkullSettings> itemCache = new WeakHashMap<>();
20-
//#else
21-
//$$public static WeakHashMap<ItemStack, SkullSettings> itemCache = new WeakHashMap<>();
22-
//#endif
23+
//? } else {
24+
/*
25+
public static WeakHashMap<ItemStack, SkullSettings> itemCache = new WeakHashMap<>();
26+
*///? }
2327

2428
public static class ItemSettings implements SkullSettings {
2529

src/main/java/dev/tr7zw/skinlayers/accessor/PlayerEntityModelAccessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ public interface PlayerEntityModelAccessor {
88
public boolean hasThinArms();
99

1010
void setIgnored(boolean ignore);
11-
}
11+
}

src/main/java/dev/tr7zw/skinlayers/api/Mesh.java

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
import com.mojang.blaze3d.vertex.VertexConsumer;
55

66
import net.minecraft.client.model.geom.ModelPart;
7-
//#if MC >= 11700
7+
//? if >= 1.17.0 {
8+
89
import net.minecraft.client.model.geom.PartPose;
9-
//#endif
10+
//? }
1011

1112
public interface Mesh {
1213

@@ -30,11 +31,13 @@ public void render(ModelPart vanillaModel, PoseStack poseStack, VertexConsumer v
3031
}
3132

3233
@Override
33-
//#if MC >= 11700
34+
//? if >= 1.17.0 {
35+
3436
public void loadPose(PartPose partPose) {
35-
//#else
36-
//$$ public void loadPose(ModelPart partPose) {
37-
//#endif
37+
//? } else {
38+
39+
// public void loadPose(ModelPart partPose) {
40+
//? }
3841
}
3942

4043
@Override
@@ -78,11 +81,13 @@ public default void render(ModelPart vanillaModel, PoseStack poseStack, VertexCo
7881

7982
public void setRotation(float xRot, float yRot, float zRot);
8083

81-
//#if MC >= 11700
84+
//? if >= 1.17.0 {
85+
8286
public void loadPose(PartPose partPose);
83-
//#else
84-
//$$ public void loadPose(ModelPart partPose);
85-
//#endif
87+
//? } else {
88+
89+
// public void loadPose(ModelPart partPose);
90+
//? }
8691

8792
public void copyFrom(ModelPart modelPart);
8893

src/main/java/dev/tr7zw/skinlayers/api/MeshTransformer.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
package dev.tr7zw.skinlayers.api;
22

3-
//#if MC >= 11903
3+
//? if >= 1.19.3 {
4+
45
import org.joml.Vector3f;
56
import org.joml.Vector4f;
6-
//#else
7-
//$$ import com.mojang.math.Vector3f;
8-
//$$ import com.mojang.math.Vector4f;
9-
//#endif
7+
//? } else {
8+
9+
// import com.mojang.math.Vector3f;
10+
// import com.mojang.math.Vector4f;
11+
//? }
1012

1113
import net.minecraft.client.model.geom.ModelPart.Cube;
1214

src/main/java/dev/tr7zw/skinlayers/config/ConfigScreenProvider.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,18 @@ public CustomConfigScreen(Screen previous) {
112112
options = new ArrayList<>();
113113
options.add(getOnOffOption("text.skinlayers.fastrender.enable", () -> SkinLayersModBase.config.fastRender,
114114
(b) -> SkinLayersModBase.config.fastRender = b));
115-
//#if MC < 12102
116-
//$$ options.add(getOnOffOption("text.skinlayers.compatibilityMode.enable",
117-
//$$ () -> SkinLayersModBase.config.compatibilityMode,
118-
//$$ (b) -> SkinLayersModBase.config.compatibilityMode = b));
119-
//#endif
120-
//#if MC >= 12000
115+
//? if < 1.21.2 {
116+
/*
117+
options.add(getOnOffOption("text.skinlayers.compatibilityMode.enable",
118+
() -> SkinLayersModBase.config.compatibilityMode,
119+
(b) -> SkinLayersModBase.config.compatibilityMode = b));
120+
*///? }
121+
//? if >= 1.20.0 {
122+
121123
options.add(getOnOffOption("text.skinlayers.irisCompatibilityMode.enable",
122124
() -> SkinLayersModBase.config.irisCompatibilityMode,
123125
(b) -> SkinLayersModBase.config.irisCompatibilityMode = b));
124-
//#endif
126+
//? }
125127
options.add(getDoubleOption("text.skinlayers.firstperson.voxelsize", 1.02f, 1.3f, 0.001f,
126128
() -> (double) SkinLayersModBase.config.firstPersonPixelScaling, (i) -> {
127129
SkinLayersModBase.config.firstPersonPixelScaling = (float) i;

src/main/java/dev/tr7zw/skinlayers/config/SkinLayersModMenu.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
//#if FABRIC
1+
//? if fabric {
2+
23
package dev.tr7zw.skinlayers.config;
34

45
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
@@ -14,4 +15,4 @@ public ConfigScreenFactory<?> getModConfigScreenFactory() {
1415
}
1516

1617
}
17-
//#endif
18+
//? }

0 commit comments

Comments
 (0)