Skip to content

Commit 5e15317

Browse files
committed
Update for 1.21.11 (1.3.1)
1 parent d888468 commit 5e15317

11 files changed

Lines changed: 74 additions & 65 deletions

File tree

TODO

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ COMMON
1818
- [x] Modifications
1919
- [x] Auto sync
2020
- [ ] Minecraft version and loader check
21+
- [ ] Auto SMS update
2122
- UI
2223
- [x] Update list of contents when schema parsed
2324
- [x] Content type icon

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
plugins {
2-
id 'fabric-loom' version '1.10-SNAPSHOT' apply false
3-
id 'net.neoforged.moddev' version '2.0.62-beta' apply false
2+
id 'fabric-loom' version "${fabric_loom}" apply false
3+
id 'net.neoforged.moddev' version "${neogradle_version}" apply false
44
}

common/src/main/java/dev/oxydien/simpleModSync/ui/ProgressHelper.java

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,27 @@
77
import dev.oxydien.simpleModSync.content.handler.ContentHandler;
88
import net.minecraft.client.gui.GuiGraphics;
99
import net.minecraft.client.renderer.RenderPipelines;
10-
import net.minecraft.resources.ResourceLocation;
10+
import net.minecraft.resources.Identifier;
11+
import net.minecraft.resources.Identifier;
1112

1213
import java.util.Iterator;
1314

1415
public class ProgressHelper {
15-
private static final ResourceLocation LOADING_ICON = ResourceLocation.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/loading.png");
16-
private static final ResourceLocation FINISHED_ICON = ResourceLocation.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/finished.png");
17-
private static final ResourceLocation PARSING_ICON = ResourceLocation.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/parsing.png");
18-
private static final ResourceLocation UNSYNCED_ICON = ResourceLocation.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/unsynced.png");
19-
private static final ResourceLocation ERROR_ICON = ResourceLocation.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/error.png");
20-
private static final ResourceLocation MODIFIED_ICON = ResourceLocation.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/modified.png");
21-
private static final ResourceLocation PREPARING_ICON = ResourceLocation.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/preparing.png");
22-
private static final ResourceLocation DOWNLOADING_ICON = ResourceLocation.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/downloading.png");
23-
24-
private static final ResourceLocation MOD_ICON = ResourceLocation.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/mod.png");
25-
private static final ResourceLocation RESOURCEPACK_ICON = ResourceLocation.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/resourcepack.png");
26-
private static final ResourceLocation SHADER_ICON = ResourceLocation.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/shader.png");
27-
private static final ResourceLocation DATAPACK_ICON = ResourceLocation.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/datapack.png");
28-
private static final ResourceLocation PACKED_ICON = ResourceLocation.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/packed.png");
29-
private static final ResourceLocation UNKNOWN_ICON = ResourceLocation.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/unknown.png");
16+
private static final Identifier LOADING_ICON = Identifier.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/loading.png");
17+
private static final Identifier FINISHED_ICON = Identifier.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/finished.png");
18+
private static final Identifier PARSING_ICON = Identifier.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/parsing.png");
19+
private static final Identifier UNSYNCED_ICON = Identifier.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/unsynced.png");
20+
private static final Identifier ERROR_ICON = Identifier.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/error.png");
21+
private static final Identifier MODIFIED_ICON = Identifier.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/modified.png");
22+
private static final Identifier PREPARING_ICON = Identifier.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/preparing.png");
23+
private static final Identifier DOWNLOADING_ICON = Identifier.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/downloading.png");
24+
25+
private static final Identifier MOD_ICON = Identifier.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/mod.png");
26+
private static final Identifier RESOURCEPACK_ICON = Identifier.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/resourcepack.png");
27+
private static final Identifier SHADER_ICON = Identifier.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/shader.png");
28+
private static final Identifier DATAPACK_ICON = Identifier.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/datapack.png");
29+
private static final Identifier PACKED_ICON = Identifier.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/packed.png");
30+
private static final Identifier UNKNOWN_ICON = Identifier.tryBuild(SimpleModSync.MOD_ID, "ui/textures/icons/unknown.png");
3031

3132
private final SimpleModSync plugin;
3233
private int frameCall = 0;
@@ -91,7 +92,7 @@ public void drawLoadingIcon(GuiGraphics guiGraphics, int x, int y) {
9192
guiGraphics.blit(RenderPipelines.GUI_TEXTURED, LOADING_ICON, x, y, 0, 16 * frameOffset, 16, 16, 16, 128);
9293
}
9394

94-
private ResourceLocation getStateIcon(SyncStatus syncStatus) {
95+
private Identifier getStateIcon(SyncStatus syncStatus) {
9596
return switch (syncStatus.getState()) {
9697
case UNSYNCED -> UNSYNCED_ICON;
9798
case FINISHED -> FINISHED_ICON;
@@ -103,7 +104,7 @@ private ResourceLocation getStateIcon(SyncStatus syncStatus) {
103104
};
104105
}
105106

106-
private ResourceLocation getContentTypeIcon(ContentType type) {
107+
private Identifier getContentTypeIcon(ContentType type) {
107108
return switch (type) {
108109
case ContentType.Mod -> MOD_ICON;
109110
case ResourcePack -> RESOURCEPACK_ICON;

common/src/main/java/dev/oxydien/simpleModSync/ui/screens/ContentSyncScreen.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
import net.minecraft.client.gui.narration.NarratableEntry;
2020
import net.minecraft.client.gui.narration.NarrationElementOutput;
2121
import net.minecraft.client.gui.screens.Screen;
22+
import net.minecraft.client.input.MouseButtonEvent;
2223
import net.minecraft.network.chat.Component;
2324
import net.minecraft.util.Mth;
25+
import org.jetbrains.annotations.NotNull;
2426
import org.jetbrains.annotations.Nullable;
2527

2628
import java.util.ArrayList;
@@ -61,10 +63,9 @@ protected void init() {
6163
(buttonWidget) -> Minecraft.getInstance().setScreen(this.parent)).pos(3, 5).size(60, 20).build());
6264

6365
// Title
64-
Component titleText = Component.translatable("simple_mod_sync.ui.content_screen.title");
66+
Component titleText = Component.translatable("simple_mod_sync.ui.content_screen.title").withColor(0xFF3DF6B4);
6567
this.addRenderableOnly(
66-
new MultiLineTextWidget(this.width / 2 - titleText.getString().length() - 30, 10, titleText, this.font)
67-
.setColor(0xFF3DF6B4));
68+
new MultiLineTextWidget(this.width / 2 - titleText.getString().length() - 30, 10, titleText, this.font));
6869

6970
// Url field
7071
EditBox urlField = new EditBox(this.font, this.width / 2 - 150, 24,
@@ -275,26 +276,26 @@ public boolean mouseScrolled(double mouseX, double mouseY, double scrollX, doubl
275276
}
276277

277278
@Override
278-
public boolean mouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY) {
279+
public boolean mouseDragged(@NotNull MouseButtonEvent event, double mouseX, double mouseY) {
279280
if (this.scrolling) {
280-
this.scrollAmount = Mth.clamp(this.scrollAmount - dragY, 0, this.getMaxScroll());
281+
this.scrollAmount = Mth.clamp(this.scrollAmount - event.x(), 0, this.getMaxScroll());
281282
return true;
282283
}
283-
return super.mouseDragged(mouseX, mouseY, button, dragX, dragY);
284+
return super.mouseDragged(event, mouseX, mouseY);
284285
}
285286

286287
@Override
287-
public boolean mouseClicked(double mouseX, double mouseY, int button) {
288-
this.scrolling = button == 0 && this.isMouseOverScrollbar(mouseX, mouseY);
289-
return super.mouseClicked(mouseX, mouseY, button);
288+
public boolean mouseClicked(@NotNull MouseButtonEvent event, boolean isDoubleClick) {
289+
this.scrolling = event.button() == 0 && this.isMouseOverScrollbar(event.x(), event.y());
290+
return super.mouseClicked(event, isDoubleClick);
290291
}
291292

292293
@Override
293-
public boolean mouseReleased(double mouseX, double mouseY, int button) {
294-
if (button == 0) {
294+
public boolean mouseReleased(@NotNull MouseButtonEvent event) {
295+
if (event.button() == 0) {
295296
this.scrolling = false;
296297
}
297-
return super.mouseReleased(mouseX, mouseY, button);
298+
return super.mouseReleased(event);
298299
}
299300

300301
@Override

common/src/main/java/dev/oxydien/simpleModSync/ui/screens/InitScreen.java

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,40 +36,35 @@ protected void init() {
3636
int currentY = contentStartY;
3737

3838
// Title widget
39-
this.addRenderableWidget(new StringWidget(centerX - CONTENT_WIDTH / 2, currentY,
40-
CONTENT_WIDTH, 20, this.title, this.font).alignCenter());
39+
this.addRenderableWidget(new StringWidget(this.getCenteredXFor(this.title), currentY,
40+
CONTENT_WIDTH, 20, this.title, this.font));
4141
currentY += 20 + SPACING;
4242

4343
// Sub-header widget
44-
Component subHeader = Component.translatable("simple_mod_sync.ui.init_screen.sub_header");
45-
StringWidget subHeaderWidget = new StringWidget(centerX - CONTENT_WIDTH / 2, currentY,
44+
Component subHeader = Component.translatable("simple_mod_sync.ui.init_screen.sub_header").withColor(0xAAAAAA);
45+
StringWidget subHeaderWidget = new StringWidget(this.getCenteredXFor(subHeader), currentY,
4646
CONTENT_WIDTH, 10, subHeader, this.font);
47-
subHeaderWidget.alignCenter();
48-
subHeaderWidget.setColor(0xAAAAAA);
4947
this.addRenderableWidget(subHeaderWidget);
5048
currentY += 10 + SPACING;
5149

5250
// Disclaimer line 1
53-
StringWidget disclaimer1 = new StringWidget(centerX - CONTENT_WIDTH / 2, currentY,
54-
CONTENT_WIDTH, 10, Component.literal("By entering a URL below, you acknowledge that you are"), this.font);
55-
disclaimer1.alignCenter();
56-
disclaimer1.setColor(0xAAAAAA);
51+
Component dis1 = Component.literal("By entering a URL below, you acknowledge that you are").withColor(0xAAAAAA);
52+
StringWidget disclaimer1 = new StringWidget(this.getCenteredXFor(dis1), currentY,
53+
CONTENT_WIDTH, 10, dis1, this.font);
5754
this.addRenderableWidget(disclaimer1);
5855
currentY += 10;
5956

6057
// Disclaimer line 2
61-
StringWidget disclaimer2 = new StringWidget(centerX - CONTENT_WIDTH / 2, currentY,
62-
CONTENT_WIDTH, 10, Component.literal("responsible for any content synced from that source."), this.font);
63-
disclaimer2.alignCenter();
64-
disclaimer2.setColor(0xAAAAAA);
58+
Component dis2 = Component.literal("responsible for any content synced from that source.").withColor(0xAAAAAA);
59+
StringWidget disclaimer2 = new StringWidget(this.getCenteredXFor(dis2), currentY,
60+
CONTENT_WIDTH, 10, dis2, this.font);
6561
this.addRenderableWidget(disclaimer2);
6662
currentY += 10;
6763

6864
// Disclaimer line 3
69-
StringWidget disclaimer3 = new StringWidget(centerX - CONTENT_WIDTH / 2, currentY,
70-
CONTENT_WIDTH, 10, Component.literal("Use trusted sources only."), this.font);
71-
disclaimer3.alignCenter();
72-
disclaimer3.setColor(0xAAAAAA);
65+
Component dis3 = Component.literal("Use trusted sources only.").withColor(0xAAAAAA);
66+
StringWidget disclaimer3 = new StringWidget(this.getCenteredXFor(dis3), currentY,
67+
CONTENT_WIDTH, 10, dis3, this.font);
7368
this.addRenderableWidget(disclaimer3);
7469
currentY += 10 + SPACING * 2;
7570

@@ -153,6 +148,12 @@ private void onSave() {
153148
this.minecraft.setScreen(new TitleScreen());
154149
}
155150

151+
private int getCenteredXFor(Component component) {
152+
int centerX = this.width / 2;
153+
int textWidth = this.font.width(component.getString());
154+
return centerX - CONTENT_WIDTH / 2 + (CONTENT_WIDTH - textWidth) / 2;
155+
}
156+
156157
@Override
157158
public void onClose() {
158159
this.minecraft.setScreen(new TitleScreen());

common/src/main/java/dev/oxydien/simpleModSync/ui/widgets/ContentProgressWidget.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ private void updateTooltip() {
6565
builder.append(this.getModName());
6666
builder.append(": ");
6767
if (this.status != null) {
68+
builder.append("\n");
6869
builder.append(SyncStatus.TranslatedState(this.status.getState()));
6970
}
7071
this.setTooltip(Tooltip.create(builder));

common/src/main/java/dev/oxydien/simpleModSync/ui/widgets/TotalSyncProgress.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package dev.oxydien.simpleModSync.ui.widgets;
22

3-
import dev.oxydien.simpleModSync.log.Log;
43
import dev.oxydien.simpleModSync.ui.ProgressHelper;
54
import net.minecraft.client.gui.GuiGraphics;
65
import net.minecraft.client.gui.components.AbstractWidget;

common/src/main/java/dev/oxydien/simpleModSync/ui/widgets/TotalSyncStatus.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
import net.minecraft.client.gui.components.Tooltip;
1212
import net.minecraft.client.gui.narration.NarratedElementType;
1313
import net.minecraft.client.gui.narration.NarrationElementOutput;
14+
import net.minecraft.client.input.MouseButtonEvent;
1415
import net.minecraft.client.renderer.RenderPipelines;
1516
import net.minecraft.network.chat.Component;
16-
import net.minecraft.resources.ResourceLocation;
17+
import net.minecraft.resources.Identifier;
1718
import org.jetbrains.annotations.NotNull;
1819

1920
import java.time.Duration;
@@ -28,7 +29,7 @@ public final class TotalSyncStatus extends AbstractWidget {
2829
private SyncWorker syncWorker;
2930
private boolean isFocused;
3031

31-
private static final ResourceLocation BACKGROUND = ResourceLocation.withDefaultNamespace("widget/button_disabled");
32+
private static final Identifier BACKGROUND = Identifier.withDefaultNamespace("widget/button_disabled");
3233

3334
public TotalSyncStatus(int x, int y, SyncWorker syncWorker,
3435
ProgressHelper progressHelper) {
@@ -67,8 +68,8 @@ public void renderWidget(@NotNull GuiGraphics guiGraphics, int mouseX, int mouse
6768
}
6869

6970
@Override
70-
public void onClick(double mouseX, double mouseY) {
71-
super.onClick(mouseX, mouseY);
71+
public void onClick(@NotNull MouseButtonEvent event, boolean isDoubleClick) {
72+
super.onClick(event, isDoubleClick);
7273
Minecraft.getInstance().setScreen(new ContentSyncScreen(Component.translatable("simple_mod_sync.ui.sync_full_view.title"), null));
7374
}
7475

gradle.properties

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,27 @@ group=dev.oxydien.simpleModSync
33
java_version=21
44

55
# Common
6-
minecraft_version=1.21.6
6+
minecraft_version=1.21.11
77
mod_name=SimpleModSync
88
mod_author=oxydien
99
mod_id=simplemodsync
1010
license=MIT
1111
credits=oxydien
1212
description=A simple way to share and sync mods, resource packs, shaders, and other Minecraft content with your friends or community.
13-
minecraft_version_range=[1.21.6, 1.22)
14-
neo_form_version=1.21.6-20250617.151856
15-
parchment_minecraft=1.21.6
16-
parchment_version=2025.06.29
13+
minecraft_version_range=[1.21.11, 1.22)
14+
neo_form_version=1.21.11-20251209.172050
15+
parchment_minecraft=1.21.11
16+
parchment_version=2025.12.20
1717

1818
# Fabric
19-
fabric_version=0.128.2+1.21.6
20-
fabric_loader_version=0.16.10
19+
fabric_version=0.141.3+1.21.11
20+
fabric_loader_version=0.18.4
21+
fabric_loom=1.15-SNAPSHOT
2122

2223
# NeoForge
23-
neoforge_version=21.6.20-beta
24+
neoforge_version=21.11.38-beta
2425
neoforge_loader_version_range=[4,)
26+
neogradle_version=2.0.140
2527

2628
# Gradle
2729
org.gradle.jvmargs=-Xmx3G

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)