Skip to content

Commit e1bb954

Browse files
committed
Fix crash in prod + add ability to add waypoints in the seed map
1 parent aa3d00f commit e1bb954

File tree

8 files changed

+142
-86
lines changed

8 files changed

+142
-86
lines changed

build.gradle

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import dev.xpple.seedmapper.buildscript.CreateJavaBindingsTask
22
import dev.xpple.seedmapper.buildscript.GenerateBuildInfoTask
3+
import net.fabricmc.loom.task.prod.ClientProductionRunTask
34

45
plugins {
56
id 'fabric-loom' version "${fabric_loom_version}"
@@ -43,12 +44,16 @@ dependencies {
4344
modImplementation "net.fabricmc:fabric-loader:${project.fabric_loader_version}"
4445

4546
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
47+
productionRuntimeMods "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
4648

4749
include modImplementation("dev.xpple:clientarguments:${project.clientarguments_version}")
4850
include modImplementation("dev.xpple:betterconfig-fabric:${project.betterconfig_version}")
4951
include modImplementation("dev.xpple:simplewaypoints:${project.simplewaypoints_version}")
5052

51-
modRuntimeOnly('me.djtheredstoner:DevAuth-fabric:1.1.0') {
53+
modRuntimeOnly("me.djtheredstoner:DevAuth-fabric:${project.devauth_version}") {
54+
exclude group: 'net.fabricmc', module: 'fabric-loader'
55+
}
56+
productionRuntimeMods("me.djtheredstoner:DevAuth-fabric:${project.devauth_version}") {
5257
exclude group: 'net.fabricmc', module: 'fabric-loader'
5358
}
5459

@@ -64,6 +69,16 @@ tasks.register('generateBuildInfo', GenerateBuildInfoTask) {
6469
outputFile = new File(temporaryDir, "build_info.json")
6570
}
6671

72+
tasks.register("prodClient", ClientProductionRunTask) {
73+
runDir = file("run")
74+
75+
jvmArgs.add("-Ddevauth.enabled=true")
76+
77+
javaLauncher = javaToolchains.launcherFor {
78+
languageVersion = JavaLanguageVersion.of(23)
79+
}
80+
}
81+
6782
processResources {
6883
def props = [version: project.mod_version, minecraft_version_dependency: project.minecraft_version_dependency, loader_version: project.fabric_loader_version]
6984
inputs.properties props

gradle.properties

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ minecraft_version_dependency=>=1.21.6 <1.22
1616
# https://maven.parchmentmc.org/org/parchmentmc/data/
1717
fabric_api_version=0.131.0+1.21.8
1818
parchment_mappings=parchment-1.21.8:2025.07.20@zip
19-
fabric_loader_version=0.16.14
19+
fabric_loader_version=0.17.2
2020
fabric_loom_version=1.11-SNAPSHOT
2121

2222
# Library dependencies
2323
betterconfig_version=2.4.0
24-
clientarguments_version=1.11.3
25-
simplewaypoints_version=1.0.0-alpha.2
24+
clientarguments_version=1.11.4
25+
simplewaypoints_version=1.0.0-alpha.4
26+
27+
devauth_version=1.2.1
2628

2729
# Test dependencies
28-
junit_version=5.13.2
30+
junit_version=5.13.4

src/main/java/dev/xpple/seedmapper/SeedMapper.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import dev.xpple.seedmapper.render.RenderManager;
2020
import dev.xpple.seedmapper.seedmap.MapFeature;
2121
import dev.xpple.seedmapper.util.SeedDatabaseHelper;
22+
import dev.xpple.simplewaypoints.api.SimpleWaypointsAPI;
2223
import net.fabricmc.api.ClientModInitializer;
2324
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
2425
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
@@ -60,6 +61,8 @@ public void onInitializeClient() {
6061
.registerType(MapFeature.class, new MapFeatureAdapter(), MapFeatureArgument::mapFeature)
6162
.build();
6263

64+
SimpleWaypointsAPI.getInstance().registerCommandAlias("sm:waypoint");
65+
6366
SeedDatabaseHelper.fetchSeeds();
6467

6568
KeyMapping keyMapping = KeyBindingHelper.registerKeyBinding(new KeyMapping("key.seedMap", InputConstants.KEY_M, KeyMapping.CATEGORY_GAMEPLAY));

src/main/java/dev/xpple/seedmapper/mixin/simplewaypoints/WaypointCommandMixin.java

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/main/java/dev/xpple/seedmapper/seedmap/ChestLootWidget.java

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,15 @@ public class ChestLootWidget {
3232

3333
private static final int ITEM_SLOT_SIZE = 18;
3434

35-
private boolean active = false;
36-
37-
private int x = 0;
38-
private int y = 0;
35+
private final int x;
36+
private final int y;
3937

4038
private int chestIndex = 0;
41-
private List<ChestLootData> chestDataList = new ArrayList<>();
42-
43-
private List<List<ClientTooltipComponent>> extraChestInfo = new ArrayList<>();
39+
private final List<ChestLootData> chestDataList;
4440

45-
public void setContent(int x, int y, List<ChestLootData> chestDataList) {
46-
this.active = true;
41+
private final List<List<ClientTooltipComponent>> extraChestInfo = new ArrayList<>();
4742

43+
public ChestLootWidget(int x, int y, List<ChestLootData> chestDataList) {
4844
this.x = x;
4945
this.y = y;
5046

@@ -66,20 +62,7 @@ public void setContent(int x, int y, List<ChestLootData> chestDataList) {
6662
}
6763
}
6864

69-
public void clear() {
70-
this.active = false;
71-
72-
this.x = 0;
73-
this.y = 0;
74-
this.chestIndex = 0;
75-
this.chestDataList.clear();
76-
this.extraChestInfo.clear();
77-
}
78-
7965
public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, Font font) {
80-
if (!this.active) {
81-
return;
82-
}
8366
guiGraphics.blit(RenderPipelines.GUI_TEXTURED, CHEST_CONTAINER, this.x, this.y, 0, 0, CHEST_CONTAINER_WIDTH, CHEST_CONTAINER_HEIGHT, CHEST_CONTAINER_WIDTH, CHEST_CONTAINER_HEIGHT);
8467

8568
ChestLootData chestData = this.chestDataList.get(this.chestIndex);
@@ -118,9 +101,6 @@ public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, Font font) {
118101
}
119102

120103
public boolean mouseClicked(double mouseX, double mouseY, int button) {
121-
if (!this.active) {
122-
return false;
123-
}
124104
if (button != InputConstants.MOUSE_BUTTON_LEFT) {
125105
return false;
126106
}

0 commit comments

Comments
 (0)