Skip to content

Commit 61ed9cd

Browse files
committed
feat: natural textures
Merges: #17
2 parents abf92a8 + 4233cec commit 61ed9cd

File tree

20 files changed

+1169
-7
lines changed

20 files changed

+1169
-7
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* Right Proper MCPatcher
3+
*
4+
* Copyright (C) 2025 FalsePattern
5+
* All Rights Reserved
6+
*
7+
* The above copyright notice and this permission notice shall be included
8+
* in all copies or substantial portions of the Software.
9+
*
10+
* This program is free software: you can redistribute it and/or modify
11+
* it under the terms of the GNU Lesser General Public License as published by
12+
* the Free Software Foundation, only version 3 of the License.
13+
*
14+
* This program is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Lesser General Public License
20+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
21+
*/
22+
23+
package com.falsepattern.mcpatcher.internal.config;
24+
25+
import com.falsepattern.lib.config.Config;
26+
import com.falsepattern.lib.config.ConfigurationManager;
27+
import com.falsepattern.mcpatcher.Tags;
28+
import lombok.NoArgsConstructor;
29+
30+
@Config.Comment("Additional Runtime Configurations")
31+
@Config.LangKey
32+
@Config(modid = Tags.MOD_ID,
33+
category = "02_extras")
34+
@NoArgsConstructor
35+
public final class ExtraConfig {
36+
//@formatter:off
37+
@Config.Comment({"Disable this if you don't want Natural Textures configuration files from multiple resource packs to 'stack' on top of each other in order of priority.",
38+
"If true, the total set of Natural Textures will be created using all resource packs in the chain.",
39+
"If false, only the highest priority 'natural.properties' file will be used."})
40+
@Config.LangKey
41+
@Config.Name("naturalTexturesStack")
42+
@Config.DefaultBoolean(true)
43+
public static boolean naturalTexturesStack;
44+
//@formatter:on
45+
46+
// region Init
47+
static {
48+
ConfigurationManager.selfInit();
49+
ModuleConfig.init();
50+
}
51+
52+
/**
53+
* This is here to make the static initializer run
54+
*/
55+
public static void init() {
56+
57+
}
58+
// endregion
59+
}

src/main/java/com/falsepattern/mcpatcher/internal/config/MCPatcherGuiFactory.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ private static Class<?>[] getConfigClasses() {
4444
val result = new ArrayList<Class<?>>();
4545
result.add(ModuleConfig.class);
4646
result.add(MixinConfig.class);
47+
result.add(ExtraConfig.class);
4748
return result.toArray(new Class<?>[0]);
4849
}
4950

src/main/java/com/falsepattern/mcpatcher/internal/config/MixinConfig.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ public final class MixinConfig {
4949
@Config.DefaultBoolean(true)
5050
public static boolean connectedTexturesMixins;
5151

52+
@Config.Comment({"Disable this if you don't want natural texture mixins to land.",
53+
"This is required for naturalTextures."})
54+
@Config.LangKey
55+
@Config.Name("naturalTexturesMixins")
56+
@Config.DefaultBoolean(true)
57+
public static boolean naturalTexturesMixins;
58+
5259
@Config.Comment({"Disable this if you don't want better glass mixins to land.",
5360
"This is required for betterGlass."})
5461
@Config.LangKey

src/main/java/com/falsepattern/mcpatcher/internal/config/ModuleConfig.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ public final class ModuleConfig {
4141
@Config.DefaultBoolean(true)
4242
public static boolean connectedTextures;
4343

44+
@Config.Comment({"Runtime toggle for natural textures.",
45+
"Requires naturalTexturesMixins enabled."})
46+
@Config.LangKey
47+
@Config.Name("naturalTextures")
48+
@Config.DefaultBoolean(true)
49+
public static boolean naturalTextures;
50+
4451
@Config.Comment({"Allow regular glass blocks, glass panes, and beacon glass to have semi-transparent textures.",
4552
"Requires betterGlassMixins enabled."})
4653
@Config.LangKey
@@ -67,6 +74,10 @@ public static boolean isConnectedTexturesEnabled() {
6774
return MixinConfig.connectedTexturesMixins && connectedTextures;
6875
}
6976

77+
public static boolean isNaturalTexturesEnabled() {
78+
return MixinConfig.naturalTexturesMixins && naturalTextures;
79+
}
80+
7081
public static boolean isBetterGlassEnabled() {
7182
return MixinConfig.betterGlassMixins && betterGlass;
7283
}

src/main/java/com/falsepattern/mcpatcher/internal/mixin/Mixin.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ public enum Mixin implements IMixins {
5555
() -> MixinConfig.connectedTexturesMixins && MixinConfig.resourcePackOverlayMixins,
5656
client("ctm.TextureMapMixin_Overlay")),
5757

58+
NaturalTextures(Phase.EARLY,
59+
() -> MixinConfig.naturalTexturesMixins,
60+
client("natural.RenderBlocksMixin",
61+
"natural.TextureMapMixin")),
62+
5863
RandomMobs(Phase.EARLY,
5964
() -> MixinConfig.randomMobsMixins,
6065
client("mob.EntityMixin",

src/main/java/com/falsepattern/mcpatcher/internal/mixin/mixins/client/ctm/RenderBlocksMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import com.falsepattern.mcpatcher.internal.config.ModuleConfig;
2626
import com.falsepattern.mcpatcher.internal.modules.ctm.CTMEngine;
2727
import com.falsepattern.mcpatcher.internal.modules.ctm.PaneRenderHelper;
28-
import com.falsepattern.mcpatcher.internal.modules.ctm.Side;
28+
import com.falsepattern.mcpatcher.internal.modules.common.Side;
2929
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
3030
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
3131
import com.llamalad7.mixinextras.sugar.Local;

0 commit comments

Comments
 (0)