Skip to content

Commit df4d593

Browse files
backend: Re-add stonecutter and support for 1.21.8
1 parent ba2f263 commit df4d593

28 files changed

+399
-114
lines changed

build.gradle.kts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ base {
1919
loom {
2020
accessWidenerPath = project.file("src/main/resources/skyblocktweaks.accesswidener")
2121

22-
// runConfigs.all {
23-
// ideConfigGenerated(stonecutter.current.isActive)
24-
// }
22+
runConfigs.all {
23+
ideConfigGenerated(stonecutter.current.isActive)
24+
}
2525

2626
runConfigs.remove(runConfigs["server"])
2727
}
@@ -62,8 +62,8 @@ dependencies {
6262
// })
6363
mappings(loom.layered {
6464
officialMojangMappings()
65-
parchment("org.parchmentmc.data:parchment-${property("minecraft_version")}:${property("parchment_version")}@zip")
66-
//mappings("dev.lambdaurora:yalmm-mojbackward:1.21.8+build.${property("yalmm_version")}")
65+
parchment("org.parchmentmc.data:parchment-${property("parchment_version")}@zip")
66+
mappings("dev.lambdaurora:yalmm-mojbackward:${property("minecraft_version")}+build.${property("yalmm_version")}")
6767
// ^ Disabled as of 1/11 due to causing issues with decomp
6868
})
6969
modImplementation ("net.fabricmc:fabric-loader:${property("loader_version")}")

gradle.properties

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@ modapi_version=1.0.1
1010
mod_version=0.1.0-Alpha.18
1111
#mod_version=Unstable
1212

13-
# Fix YALMM
13+
## Fix YALMM
1414
fabric.loom.dropNonIntermediateRootMethods=true
1515

16-
minecraft_version=1.21.10
17-
parchment_version=2025.10.12
18-
yalmm_version=3
19-
fabric_version=0.138.4+1.21.10
20-
21-
modapi_fabric_version=1.0.1+build.1+mc1.21
22-
modmenu_version=16.0.0
23-
yacl_version=3.8.2+1.21.10-fabric
24-
rei_version=21.9.812
25-
support_range=1.21.10

settings.gradle.kts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ pluginManagement {
66
}
77
mavenCentral()
88
gradlePluginPortal()
9-
// maven("https://maven.kikugie.dev/releases")
10-
// maven("https://maven.kikugie.dev/snapshots")
9+
maven("https://maven.kikugie.dev/releases")
10+
maven("https://maven.kikugie.dev/snapshots")
1111
}
1212
}
1313

14-
//plugins {
15-
// id("dev.kikugie.stonecutter") version "0.7.10"
16-
//}
14+
plugins {
15+
id("dev.kikugie.stonecutter") version "0.8.2"
16+
}
17+
18+
stonecutter {
19+
kotlinController = true
20+
centralScript = "build.gradle.kts"
1721

18-
//stonecutter {
19-
// kotlinController = true
20-
// centralScript = "build.gradle.kts"
21-
//
22-
// create(rootProject) {
23-
// versions("1.21.8")
24-
// vcsVersion = "1.21.8"
25-
// }
26-
//}
22+
create(rootProject) {
23+
versions("1.21.8", "1.21.10")
24+
vcsVersion = "1.21.10"
25+
}
26+
}

src/main/java/wtf/cheeze/sbt/config/SBTConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import net.fabricmc.loader.api.FabricLoader;
2828
import net.minecraft.client.gui.screens.Screen;
2929
import net.minecraft.network.chat.Component;
30-
import net.minecraft.resources.ResourceLocation;
30+
import net.minecraft.resources.Identifier;
3131
import wtf.cheeze.sbt.config.categories.*;
3232
import wtf.cheeze.sbt.config.migration.BarColorTransformation;
3333
import wtf.cheeze.sbt.config.migration.MigrationManager;
@@ -43,7 +43,7 @@ public class SBTConfig {
4343
public static final Path PATH = FabricLoader.getInstance().getConfigDir().resolve("skyblocktweaks-config.json");
4444

4545
private static final ConfigClassHandler<ConfigImpl> HANDLER = ConfigClassHandler.createBuilder(ConfigImpl.class)
46-
.id(ResourceLocation.fromNamespaceAndPath("skyblocktweaks", "config"))
46+
.id(Identifier.fromNamespaceAndPath("skyblocktweaks", "config"))
4747
.serializer(config -> GsonConfigSerializerBuilder.create(config).appendGsonBuilder(builder -> builder.setFieldNamingPolicy(FieldNamingPolicy.IDENTITY))
4848
.setPath(PATH)
4949
.build())

src/main/java/wtf/cheeze/sbt/config/SkyblockTweaksScreenMain.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
import net.minecraft.client.gui.components.Tooltip;
2626
import net.minecraft.client.gui.components.Button;
2727
import net.minecraft.network.chat.Component;
28-
import net.minecraft.resources.ResourceLocation;
28+
import net.minecraft.resources.Identifier;
2929
import wtf.cheeze.sbt.SkyblockTweaks;
3030
import wtf.cheeze.sbt.hud.HudManager;
3131
import wtf.cheeze.sbt.utils.render.Colors;
3232
import wtf.cheeze.sbt.utils.render.RenderUtils;
3333
import wtf.cheeze.sbt.hud.screen.HudScreen;
3434

3535
public class SkyblockTweaksScreenMain extends Screen {
36-
public static final ResourceLocation ICON = ResourceLocation.fromNamespaceAndPath("skyblocktweaks", "icon.png");
36+
public static final Identifier ICON = Identifier.fromNamespaceAndPath("skyblocktweaks", "icon.png");
3737
private final Screen parent;
3838

3939
public SkyblockTweaksScreenMain(Screen parent) {

src/main/java/wtf/cheeze/sbt/config/migration/BarColorTransformation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package wtf.cheeze.sbt.config.migration;
22

33
import com.mojang.blaze3d.pipeline.RenderPipeline;
4-
import net.minecraft.resources.ResourceLocation;
4+
import net.minecraft.resources.Identifier;
55
import wtf.cheeze.sbt.config.ConfigImpl;
66
import wtf.cheeze.sbt.utils.render.Colors;
77

88
/**
99
* In mod versions prior to 0.1.0-Alpha.8, bar colors (all colors actually), defaulted to RGB ints.
1010
* This was fine pre 1.21.2 since the shader system was used, which was fine with RGB ints
11-
* However, in 1.21.2, the shader system was tweaked, and we moved to the color parameter in {@link net.minecraft.client.gui.GuiGraphics#blit(RenderPipeline, ResourceLocation, int, int, float, float, int, int, int, int)}
11+
* However, in 1.21.2, the shader system was tweaked, and we moved to the color parameter in {@link net.minecraft.client.gui.GuiGraphics#blit(RenderPipeline, Identifier, int, int, float, float, int, int, int, int)}
1212
* This method interprets ints as ARGB, not RGB, which resulted in the bars not rendering with default settings due to the alpha value being 0.
1313
* YACL always treated the color as ARGB, so this issue only affects users who never modified the settings.
1414
* This transformation checks for the old defaults and updates them to the new defaults.

src/main/java/wtf/cheeze/sbt/config/persistent/PersistentData.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
2626
import net.fabricmc.loader.api.FabricLoader;
2727
import net.minecraft.client.gui.screens.ChatScreen;
28-
import net.minecraft.resources.ResourceLocation;
28+
import net.minecraft.resources.Identifier;
2929
import wtf.cheeze.sbt.utils.skyblock.SkyblockData;
3030

3131
import java.nio.file.Path;
@@ -45,7 +45,7 @@ public ProfileData currentProfile() {
4545

4646
private static final Path pdPath = FabricLoader.getInstance().getConfigDir().resolve("skyblocktweaks-persistent.json");
4747
private static final ConfigClassHandler<PersistentData> HANDLER = ConfigClassHandler.createBuilder(PersistentData.class)
48-
.id(ResourceLocation.fromNamespaceAndPath("skyblocktweaks", "persistent"))
48+
.id(Identifier.fromNamespaceAndPath("skyblocktweaks", "persistent"))
4949
.serializer(config -> GsonConfigSerializerBuilder.create(config).appendGsonBuilder(builder -> builder.setFieldNamingPolicy(FieldNamingPolicy.IDENTITY))
5050
.setPath(pdPath)
5151
.build())

src/main/java/wtf/cheeze/sbt/events/HudRenderEvents.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import net.fabricmc.fabric.api.event.EventFactory;
2525
import net.minecraft.client.gui.GuiGraphics;
2626
import net.minecraft.client.DeltaTracker;
27-
import net.minecraft.resources.ResourceLocation;
27+
import net.minecraft.resources.Identifier;
2828

2929

3030
/**
@@ -59,9 +59,9 @@ private static Event<HudRenderStage> createEventForStage() {
5959

6060
public static void registerEvents() {
6161
// TODO: skyblocker doesnt have this issue of rendering breaking if the vanilla hud element is missing
62-
HudElementRegistry.attachElementBefore(VanillaHudElements.HOTBAR, ResourceLocation.fromNamespaceAndPath("skyblocktweaks", "after_main_hud"), AFTER_MAIN_HUD.invoker()::onRender);
63-
HudElementRegistry.attachElementBefore(VanillaHudElements.CHAT, ResourceLocation.fromNamespaceAndPath("skyblocktweaks", "before_chat"), BEFORE_CHAT.invoker()::onRender);
64-
HudElementRegistry.addLast(ResourceLocation.fromNamespaceAndPath("skyblocktweaks", "last"), LAST.invoker()::onRender);
62+
HudElementRegistry.attachElementBefore(VanillaHudElements.HOTBAR, Identifier.fromNamespaceAndPath("skyblocktweaks", "after_main_hud"), AFTER_MAIN_HUD.invoker()::onRender);
63+
HudElementRegistry.attachElementBefore(VanillaHudElements.CHAT, Identifier.fromNamespaceAndPath("skyblocktweaks", "before_chat"), BEFORE_CHAT.invoker()::onRender);
64+
HudElementRegistry.addLast(Identifier.fromNamespaceAndPath("skyblocktweaks", "last"), LAST.invoker()::onRender);
6565
}
6666

6767
/**

src/main/java/wtf/cheeze/sbt/features/overlay/ReforgeOverlay.java

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
2929
import net.minecraft.client.gui.components.AbstractWidget;
3030
import net.minecraft.client.gui.components.EditBox;
31-
import net.minecraft.client.input.KeyEvent;
3231
import net.minecraft.sounds.SoundEvents;
3332
import net.minecraft.network.chat.Component;
3433
import org.lwjgl.glfw.GLFW;
@@ -45,6 +44,8 @@
4544
import wtf.cheeze.sbt.utils.render.RenderUtils;
4645
import wtf.cheeze.sbt.utils.skyblock.ItemUtils;
4746
import wtf.cheeze.sbt.utils.text.TextUtils;
47+
//? if >1.21.8
48+
import net.minecraft.client.input.KeyEvent;
4849

4950
import java.util.List;
5051
import java.util.stream.Stream;
@@ -199,9 +200,22 @@ public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
199200
matchWidget.setFocused(false);
200201
return true;
201202
}
202-
if (!inv) return matchWidget.keyPressed(new KeyEvent(keyCode, scanCode, modifiers));
203+
if (!inv) return matchWidget.keyPressed(
204+
//?if >1.21.8
205+
new KeyEvent(
206+
keyCode, scanCode, modifiers
207+
208+
//?if >1.21.8
209+
)
210+
);
203211
else {
204-
matchWidget.keyPressed(new KeyEvent(keyCode, scanCode, modifiers));
212+
matchWidget.keyPressed(
213+
//?if >1.21.8
214+
new KeyEvent(
215+
keyCode, scanCode, modifiers
216+
//?if >1.21.8
217+
)
218+
);
205219
return true;
206220
}
207221
}
@@ -210,9 +224,21 @@ public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
210224
exclusionWidget.setFocused(false);
211225
return true;
212226
}
213-
if (!inv) return exclusionWidget.keyPressed(new KeyEvent(keyCode, scanCode, modifiers));
227+
if (!inv) return exclusionWidget.keyPressed(
228+
//?if >1.21.8
229+
new KeyEvent(
230+
keyCode, scanCode, modifiers
231+
//?if >1.21.8
232+
)
233+
);
214234
else {
215-
exclusionWidget.keyPressed(new KeyEvent(keyCode, scanCode, modifiers));
235+
exclusionWidget.keyPressed(
236+
//?if >1.21.8
237+
new KeyEvent(
238+
keyCode, scanCode, modifiers
239+
//?if >1.21.8
240+
)
241+
);
216242
return true;
217243
}
218244
}

src/main/java/wtf/cheeze/sbt/hud/bases/AbstractTickerHud.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
package wtf.cheeze.sbt.hud.bases;
2020

2121
import net.minecraft.client.gui.GuiGraphics;
22-
import net.minecraft.resources.ResourceLocation;
22+
import net.minecraft.resources.Identifier;
2323
import org.jetbrains.annotations.NotNull;
2424
import wtf.cheeze.sbt.features.huds.TickerHud;
2525
import wtf.cheeze.sbt.hud.bounds.Bounds;
@@ -31,8 +31,8 @@
3131
* The abstract representation of the ticker HUD, for the implementation, see {@link TickerHud}
3232
*/
3333
public abstract class AbstractTickerHud extends HUD {
34-
private static final ResourceLocation FULL = ResourceLocation.fromNamespaceAndPath("skyblocktweaks", "tickers/full.png");
35-
private static final ResourceLocation BLANK = ResourceLocation.fromNamespaceAndPath("skyblocktweaks", "tickers/blank.png");
34+
private static final Identifier FULL = Identifier.fromNamespaceAndPath("skyblocktweaks", "tickers/full.png");
35+
private static final Identifier BLANK = Identifier.fromNamespaceAndPath("skyblocktweaks", "tickers/blank.png");
3636
private static final int DIMENSION = 9;
3737

3838
/**

0 commit comments

Comments
 (0)