Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ publishMods {

modrinth {
accessToken = providers.gradleProperty("secrets.modrinth_token")
projectId = modrinthProject
projectId = "MZQyESDC"
minecraftVersions.add(libs.versions.minecraft.get())

projectDescription = providers.fileContents(layout.projectDirectory.file("README.md")).asText
Expand Down
12 changes: 6 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
fabric_loom = "1.15-SNAPSHOT"
modpublish = "1.1.0"

minecraft = "1.21.10"
parchment = "2025.10.12"
minecraft = "1.21.11"
parchment = "2025.12.20"

fabric_loader = "0.18.1"
fabric_api = "0.138.3+1.21.10"
fabric_api = "0.141.3+1.21.11"

greenhouse_config = "3.0.0-beta.4+1.21.10"
modmenu = "16.0.0"
greenhouse_config = "3.0.0-beta.4+1.21.11"
modmenu = "17.0.0-beta.2"

objc_bridge = "1.0.0"

Expand All @@ -19,7 +19,7 @@ modpublish = { id = "me.modmuss50.mod-publish-plugin", version.ref = "modpublish

[libraries]
minecraft = { group = "mojang", name = "minecraft", version.ref = "minecraft" }
parchment = { group = "org.parchmentmc.data", name = "parchment-1.21.10", version.ref = "parchment" }
parchment = { group = "org.parchmentmc.data", name = "parchment-1.21.11", version.ref = "parchment" }

fabric_loader = { group = "net.fabricmc", name = "fabric-loader", version.ref = "fabric_loader" }
fabric_api = { group = "net.fabricmc.fabric-api", name = "fabric-api", version.ref = "fabric_api" }
Expand Down
6 changes: 3 additions & 3 deletions src/client/java/dev/spiritstudios/snapper/Snapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import dev.spiritstudios.snapper.util.uploading.ScreenshotUploading;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.resources.Identifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -18,7 +18,7 @@ public void onInitializeClient() {
ClientLifecycleEvents.CLIENT_STOPPING.register(client -> ScreenshotUploading.close());
}

public static ResourceLocation id(String path) {
return ResourceLocation.fromNamespaceAndPath(MOD_ID, path);
public static Identifier id(String path) {
return Identifier.fromNamespaceAndPath(MOD_ID, path);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import lgbt.greenhouse.config.api.v3.dfu.fix.GreenhouseConfigRelocateFieldsFix;
import lgbt.greenhouse.config.api.v3.lang.GreenhouseConfigJsonCLang;
import lgbt.greenhouse.config.api.v3.lang.GreenhouseConfigJsonLang;
import net.minecraft.Util;
import net.minecraft.util.Util;

import java.nio.file.Path;
import java.util.concurrent.CompletableFuture;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
import net.minecraft.client.gui.screens.Overlay;
import net.minecraft.client.renderer.RenderPipelines;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.resources.Identifier;
import net.minecraft.util.CommonColors;

public class ExternalDialogOverlay extends Overlay {
private final Minecraft client = Minecraft.getInstance();

public static final ResourceLocation MENU_BACKGROUND_TEXTURE = ResourceLocation.withDefaultNamespace("textures/gui/menu_background.png");
private static final ResourceLocation INWORLD_MENU_BACKGROUND_TEXTURE = ResourceLocation.withDefaultNamespace("textures/gui/inworld_menu_background.png");
public static final Identifier MENU_BACKGROUND_TEXTURE = Identifier.withDefaultNamespace("textures/gui/menu_background.png");
private static final Identifier INWORLD_MENU_BACKGROUND_TEXTURE = Identifier.withDefaultNamespace("textures/gui/inworld_menu_background.png");

@Override
public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTick) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ protected void repositionElements() {
private AbstractWidget booleanButton(String name, Consumer<Boolean> setter, boolean currentValue) {
Tooltip tooltip = getTooltip(name);

return CycleButton.<Boolean>builder(
return CycleButton.builder(
boolean_ -> boolean_
? CommonComponents.OPTION_ON
: CommonComponents.OPTION_OFF
: CommonComponents.OPTION_OFF,
currentValue
)
.withValues(List.of(Boolean.TRUE, Boolean.FALSE))
.withTooltip(b -> tooltip)
.withInitialValue(currentValue)
.create(
0, 0,
150, 20,
Expand All @@ -163,12 +163,12 @@ private <T extends Enum<T>> AbstractWidget enumButton(
) {
Tooltip tooltip = getTooltip(name);

return CycleButton.<T>builder(
t -> Component.translatable("config.snapper." + name + "." + t.toString().toLowerCase())
return CycleButton.builder(
t -> Component.translatable("config.snapper." + name + "." + t.toString().toLowerCase()),
currentValue
)
.withValues(Arrays.asList(clazz.getEnumConstants()))
.withTooltip(b -> tooltip)
.withInitialValue(currentValue)
.create(
0, 0,
150, 20,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import dev.spiritstudios.snapper.util.DynamicCubemapTexture;
import dev.spiritstudios.snapper.util.SafeFiles;
import dev.spiritstudios.snapper.util.SnapperUtil;
import net.minecraft.Util;
import net.minecraft.util.Util;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.Button;
Expand All @@ -13,7 +13,7 @@
import net.minecraft.client.renderer.PanoramaRenderer;
import net.minecraft.network.chat.CommonComponents;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.resources.Identifier;
import net.minecraft.util.CommonColors;
import org.jetbrains.annotations.Nullable;

Expand All @@ -23,7 +23,7 @@
import java.util.stream.Stream;

public class PanoramaViewerScreen extends Screen {
protected static final ResourceLocation ID = Snapper.id("screenshots/panorama");
protected static final Identifier ID = Snapper.id("screenshots/panorama");
protected static final CubeMap PANORAMA_RENDERER = new CubeMap(ID);

private final PanoramaRenderer rotatingPanoramaRenderer = new PanoramaRenderer(PANORAMA_RENDERER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@

import dev.spiritstudios.snapper.SnapperConfig;
import dev.spiritstudios.snapper.util.uploading.AxolotlClientApi;
import net.minecraft.Util;
import net.minecraft.client.gui.TextAlignment;
import net.minecraft.util.Util;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.Button;
Expand Down Expand Up @@ -59,10 +60,16 @@ public PrivacyNoticeScreen(Screen parent, Consumer<Boolean> accepted) {
}

@Override
public void render(GuiGraphics context, int mouseX, int mouseY, float delta) {
super.render(context, mouseX, mouseY, delta);
context.drawCenteredString(this.font, this.title, this.width / 2, getTitleY(), CommonColors.WHITE);
message.render(context, MultiLineLabel.Align.CENTER, width / 2, getMessageY(), 10, true, CommonColors.WHITE);
public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
super.render(graphics, mouseX, mouseY, delta);
graphics.drawCenteredString(this.font, this.title, this.width / 2, getTitleY(), CommonColors.WHITE);

message.visitLines(
TextAlignment.CENTER,
width / 2, getMessageY(),
10,
graphics.textRenderer()
);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import dev.spiritstudios.snapper.util.ScreenshotActions;
import dev.spiritstudios.snapper.util.SnapperUtil;
import dev.spiritstudios.snapper.util.uploading.ScreenshotUploading;
import net.minecraft.Util;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.components.SpriteIconButton;
Expand All @@ -23,23 +22,24 @@
import net.minecraft.client.input.KeyEvent;
import net.minecraft.network.chat.CommonComponents;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.resources.Identifier;
import net.minecraft.util.CommonColors;
import net.minecraft.util.StringRepresentable;
import net.minecraft.util.Util;
import org.jetbrains.annotations.Nullable;
import org.jspecify.annotations.NonNull;

import java.nio.file.Path;

public class ScreenshotListScreen extends Screen {
private static final ResourceLocation PANORAMA_BUTTON_ICON = Snapper.id("screenshots/panorama");
private static final ResourceLocation PANORAMA_BUTTON_DISABLED_ICON = Snapper.id("screenshots/panorama_disabled");
private static final Identifier PANORAMA_BUTTON_ICON = Snapper.id("screenshots/panorama");
private static final Identifier PANORAMA_BUTTON_DISABLED_ICON = Snapper.id("screenshots/panorama_disabled");

private static final ResourceLocation SETTINGS_ICON = Snapper.id("screenshots/settings");
private static final Identifier SETTINGS_ICON = Snapper.id("screenshots/settings");

private static final ResourceLocation VIEW_MODE_ICON_LIST = Snapper.id("screenshots/show_list");
private static final Identifier VIEW_MODE_ICON_LIST = Snapper.id("screenshots/show_list");

private static final ResourceLocation VIEW_MODE_ICON_GRID = Snapper.id("screenshots/show_grid");
private static final Identifier VIEW_MODE_ICON_GRID = Snapper.id("screenshots/show_grid");

private final Screen parent;
private final boolean isOffline;
Expand Down Expand Up @@ -96,8 +96,6 @@ private void recreateViewModeButton() {

@Override
protected void init() {
assert minecraft != null;

recreateList();

int secondRowButtonWidth = 100;
Expand Down Expand Up @@ -254,8 +252,6 @@ public void toggleGrid() {

@Override
public boolean keyPressed(KeyEvent input) {
assert minecraft != null;

if (super.keyPressed(input)) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import dev.spiritstudios.snapper.util.SnapperUtil;
import dev.spiritstudios.snapper.util.uploading.ScreenshotUploading;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.Util;
import net.minecraft.util.Util;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.Button;
Expand All @@ -20,7 +20,7 @@
import net.minecraft.client.renderer.RenderPipelines;
import net.minecraft.network.chat.CommonComponents;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.resources.Identifier;
import net.minecraft.util.CommonColors;
import org.jetbrains.annotations.Nullable;

Expand All @@ -34,8 +34,8 @@
import java.util.List;

public class ScreenshotViewerScreen extends Screen {
private static final ResourceLocation MENU_DECOR_BACKGROUND_TEXTURE = ResourceLocation.withDefaultNamespace("textures/gui/menu_list_background.png");
private static final ResourceLocation INWORLD_MENU_DECOR_BACKGROUND_TEXTURE = ResourceLocation.withDefaultNamespace("textures/gui/inworld_menu_list_background.png");
private static final Identifier MENU_DECOR_BACKGROUND_TEXTURE = Identifier.withDefaultNamespace("textures/gui/menu_list_background.png");
private static final Identifier INWORLD_MENU_DECOR_BACKGROUND_TEXTURE = Identifier.withDefaultNamespace("textures/gui/inworld_menu_list_background.png");

private final Minecraft client = Minecraft.getInstance();
private final ScreenshotTexture image;
Expand Down Expand Up @@ -196,7 +196,7 @@ public void render(GuiGraphics context, int mouseX, int mouseY, float delta) {

context.blit(
RenderPipelines.GUI_TEXTURED,
this.image.getTextureId(),
this.image.textureLocation(),
(this.width / 2) - (finalWidth / 2), this.height - 70 - finalHeight,
0, 0,
finalWidth, finalHeight,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
import net.minecraft.client.gui.components.toasts.ToastManager;
import net.minecraft.client.renderer.RenderPipelines;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.resources.Identifier;
import net.minecraft.util.CommonColors;
import net.minecraft.util.FormattedCharSequence;
import org.jspecify.annotations.NonNull;

import java.util.List;

public class SnapperToast implements Toast {
private static final ResourceLocation TEXTURE = Snapper.id("toast/snapper");
private static final ResourceLocation SCREENSHOT_ICON = Snapper.id("icon/image");
private static final ResourceLocation PANORAMA_ICON = Snapper.id("icon/panorama");
private static final ResourceLocation UPLOAD_ICON = Snapper.id("icon/upload");
private static final ResourceLocation DENY_ICON = Snapper.id("icon/nuh_uh");
private static final Identifier TEXTURE = Snapper.id("toast/snapper");
private static final Identifier SCREENSHOT_ICON = Snapper.id("icon/image");
private static final Identifier PANORAMA_ICON = Snapper.id("icon/panorama");
private static final Identifier UPLOAD_ICON = Snapper.id("icon/upload");
private static final Identifier DENY_ICON = Snapper.id("icon/nuh_uh");
private static final int VISIBILITY_DURATION = 5000;
private static final int WIDTH = 256;
private static final int LINE_HEIGHT = 12;
Expand Down Expand Up @@ -85,7 +85,7 @@ public int height() {
return PADDING * 2 + Math.max(this.lines.size(), 1) * LINE_HEIGHT;
}

private ResourceLocation getCurrentComponenture() {
private Identifier getCurrentComponenture() {
return switch (type) {
case UPLOAD -> UPLOAD_ICON;
case PANORAMA -> PANORAMA_ICON;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import net.minecraft.client.input.MouseButtonEvent;
import net.minecraft.network.chat.CommonComponents;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.resources.Identifier;
import net.minecraft.util.CommonColors;
import org.jetbrains.annotations.Nullable;
import org.jspecify.annotations.NonNull;
Expand All @@ -24,8 +24,8 @@
import java.util.function.Consumer;

public class FolderSelectWidget extends AbstractContainerWidget implements ContainerEventHandler {
private static final ResourceLocation FOLDER_ICON = Snapper.id("screenshots/folder");
private static final ResourceLocation RESET_ICON = Snapper.id("screenshots/reset");
private static final Identifier FOLDER_ICON = Snapper.id("screenshots/folder");
private static final Identifier RESET_ICON = Snapper.id("screenshots/reset");

private static final int BUTTON_WIDTH = 25; // Includes padding

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import dev.spiritstudios.snapper.util.ScreenshotTexture;
import dev.spiritstudios.snapper.util.SnapperUtil;
import net.minecraft.Util;
import net.minecraft.util.Util;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.navigation.ScreenDirection;
Expand Down Expand Up @@ -141,7 +141,7 @@ public void renderContent(GuiGraphics graphics, int mouseX, int mouseY, boolean
if (this.icon.loaded()) {
graphics.blit(
RenderPipelines.GUI_TEXTURED,
this.icon.getTextureId(),
this.icon.textureLocation(),
getContentX(), getContentY(),
0, 0,
getContentWidth(), getContentHeight(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,17 @@

import dev.spiritstudios.snapper.util.ScreenshotTexture;
import dev.spiritstudios.snapper.util.SnapperUtil;
import net.minecraft.Util;
import net.minecraft.network.chat.Component;
import net.minecraft.util.FormattedCharSequence;
import net.minecraft.util.Util;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.input.MouseButtonEvent;
import net.minecraft.client.renderer.RenderPipelines;
import net.minecraft.network.chat.Component;
import net.minecraft.util.CommonColors;
import net.minecraft.util.StringUtil;
import org.jetbrains.annotations.Nullable;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.attribute.BasicFileAttributes;
import java.time.Instant;

public class ScreenshotListWidget extends ScreenshotsWidget {
public ScreenshotListWidget(
Minecraft client,
Expand Down Expand Up @@ -64,7 +59,10 @@ public void renderContent(GuiGraphics graphics, int mouseX, int mouseY, boolean

graphics.drawString(
minecraft.font,
creation,
FormattedCharSequence.composite(
Component.translatable("text.snapper.created").getVisualOrderText(),
creation.getVisualOrderText()
),
getContentX() + 35, getContentY() + 12,
CommonColors.GRAY,
false
Expand All @@ -73,7 +71,7 @@ public void renderContent(GuiGraphics graphics, int mouseX, int mouseY, boolean
if (icon.loaded()) {
graphics.blit(
RenderPipelines.GUI_TEXTURED,
this.icon.getTextureId(),
this.icon.textureLocation(),
getContentX(), getContentY(),
(icon.getHeight()) / 3.0f + 32, 0,
getContentHeight(), getContentHeight(),
Expand Down
Loading
Loading