diff --git a/gradle.properties b/gradle.properties index c6b340a..5971ed7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ minecraft_version=1.20.1 yarn_mappings=1.20.1+build.10 loader_version=0.18.3 # Mod Properties -mod_version=26.2.17 +mod_version=26.2.18 maven_group=dev.tggamesyt archives_base_name=szar # Dependencies diff --git a/run/config/panodebugmode.txt b/run/config/panodebugmode.txt new file mode 100644 index 0000000..e69de29 diff --git a/run/screenshots/2026-02-11_08.41.35.png b/run/screenshots/2026-02-11_08.41.35.png new file mode 100644 index 0000000..a248adc Binary files /dev/null and b/run/screenshots/2026-02-11_08.41.35.png differ diff --git a/run/screenshots/2026-02-11_08.41.36.png b/run/screenshots/2026-02-11_08.41.36.png new file mode 100644 index 0000000..f8b35e9 Binary files /dev/null and b/run/screenshots/2026-02-11_08.41.36.png differ diff --git a/run/screenshots/2026-02-16_10.40.11.png b/run/screenshots/2026-02-16_10.40.11.png new file mode 100644 index 0000000..41415c0 Binary files /dev/null and b/run/screenshots/2026-02-16_10.40.11.png differ diff --git a/run/screenshots/2026-02-16_10.44.15.png b/run/screenshots/2026-02-16_10.44.15.png new file mode 100644 index 0000000..d9d0b11 Binary files /dev/null and b/run/screenshots/2026-02-16_10.44.15.png differ diff --git a/run/screenshots/2026-02-16_10.50.05.png b/run/screenshots/2026-02-16_10.50.05.png new file mode 100644 index 0000000..b46d7b0 Binary files /dev/null and b/run/screenshots/2026-02-16_10.50.05.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-19-17/screenshots/panorama_0.png b/run/screenshots/panorama-2026-02-18_08-19-17/screenshots/panorama_0.png new file mode 100644 index 0000000..8a1c3ea Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-19-17/screenshots/panorama_0.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-19-17/screenshots/panorama_1.png b/run/screenshots/panorama-2026-02-18_08-19-17/screenshots/panorama_1.png new file mode 100644 index 0000000..6bf999d Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-19-17/screenshots/panorama_1.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-19-17/screenshots/panorama_2.png b/run/screenshots/panorama-2026-02-18_08-19-17/screenshots/panorama_2.png new file mode 100644 index 0000000..163142a Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-19-17/screenshots/panorama_2.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-19-17/screenshots/panorama_3.png b/run/screenshots/panorama-2026-02-18_08-19-17/screenshots/panorama_3.png new file mode 100644 index 0000000..b2af172 Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-19-17/screenshots/panorama_3.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-19-17/screenshots/panorama_4.png b/run/screenshots/panorama-2026-02-18_08-19-17/screenshots/panorama_4.png new file mode 100644 index 0000000..6d3886a Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-19-17/screenshots/panorama_4.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-19-17/screenshots/panorama_5.png b/run/screenshots/panorama-2026-02-18_08-19-17/screenshots/panorama_5.png new file mode 100644 index 0000000..62cbfe9 Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-19-17/screenshots/panorama_5.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-21-00/screenshots/panorama_0.png b/run/screenshots/panorama-2026-02-18_08-21-00/screenshots/panorama_0.png new file mode 100644 index 0000000..cd78db8 Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-21-00/screenshots/panorama_0.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-21-00/screenshots/panorama_1.png b/run/screenshots/panorama-2026-02-18_08-21-00/screenshots/panorama_1.png new file mode 100644 index 0000000..736da08 Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-21-00/screenshots/panorama_1.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-21-00/screenshots/panorama_2.png b/run/screenshots/panorama-2026-02-18_08-21-00/screenshots/panorama_2.png new file mode 100644 index 0000000..4a850c8 Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-21-00/screenshots/panorama_2.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-21-00/screenshots/panorama_3.png b/run/screenshots/panorama-2026-02-18_08-21-00/screenshots/panorama_3.png new file mode 100644 index 0000000..886d217 Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-21-00/screenshots/panorama_3.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-21-00/screenshots/panorama_4.png b/run/screenshots/panorama-2026-02-18_08-21-00/screenshots/panorama_4.png new file mode 100644 index 0000000..cd92fe9 Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-21-00/screenshots/panorama_4.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-21-00/screenshots/panorama_5.png b/run/screenshots/panorama-2026-02-18_08-21-00/screenshots/panorama_5.png new file mode 100644 index 0000000..5232f46 Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-21-00/screenshots/panorama_5.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-38-21/screenshots/panorama_0.png b/run/screenshots/panorama-2026-02-18_08-38-21/screenshots/panorama_0.png new file mode 100644 index 0000000..a1c821b Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-38-21/screenshots/panorama_0.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-38-21/screenshots/panorama_1.png b/run/screenshots/panorama-2026-02-18_08-38-21/screenshots/panorama_1.png new file mode 100644 index 0000000..9a1a436 Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-38-21/screenshots/panorama_1.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-38-21/screenshots/panorama_2.png b/run/screenshots/panorama-2026-02-18_08-38-21/screenshots/panorama_2.png new file mode 100644 index 0000000..f23ab47 Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-38-21/screenshots/panorama_2.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-38-21/screenshots/panorama_3.png b/run/screenshots/panorama-2026-02-18_08-38-21/screenshots/panorama_3.png new file mode 100644 index 0000000..90e966d Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-38-21/screenshots/panorama_3.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-38-21/screenshots/panorama_4.png b/run/screenshots/panorama-2026-02-18_08-38-21/screenshots/panorama_4.png new file mode 100644 index 0000000..c2fdf49 Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-38-21/screenshots/panorama_4.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-38-21/screenshots/panorama_5.png b/run/screenshots/panorama-2026-02-18_08-38-21/screenshots/panorama_5.png new file mode 100644 index 0000000..94f7cd2 Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-38-21/screenshots/panorama_5.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-43-31/screenshots/panorama_0.png b/run/screenshots/panorama-2026-02-18_08-43-31/screenshots/panorama_0.png new file mode 100644 index 0000000..170d842 Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-43-31/screenshots/panorama_0.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-43-31/screenshots/panorama_1.png b/run/screenshots/panorama-2026-02-18_08-43-31/screenshots/panorama_1.png new file mode 100644 index 0000000..3da6ed0 Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-43-31/screenshots/panorama_1.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-43-31/screenshots/panorama_2.png b/run/screenshots/panorama-2026-02-18_08-43-31/screenshots/panorama_2.png new file mode 100644 index 0000000..5acaa21 Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-43-31/screenshots/panorama_2.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-43-31/screenshots/panorama_3.png b/run/screenshots/panorama-2026-02-18_08-43-31/screenshots/panorama_3.png new file mode 100644 index 0000000..33de702 Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-43-31/screenshots/panorama_3.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-43-31/screenshots/panorama_4.png b/run/screenshots/panorama-2026-02-18_08-43-31/screenshots/panorama_4.png new file mode 100644 index 0000000..279c7f1 Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-43-31/screenshots/panorama_4.png differ diff --git a/run/screenshots/panorama-2026-02-18_08-43-31/screenshots/panorama_5.png b/run/screenshots/panorama-2026-02-18_08-43-31/screenshots/panorama_5.png new file mode 100644 index 0000000..34b31d8 Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_08-43-31/screenshots/panorama_5.png differ diff --git a/run/screenshots/panorama-2026-02-18_09-00-41/panorama_0.png b/run/screenshots/panorama-2026-02-18_09-00-41/panorama_0.png new file mode 100644 index 0000000..212fca1 Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_09-00-41/panorama_0.png differ diff --git a/run/screenshots/panorama-2026-02-18_09-00-41/panorama_1.png b/run/screenshots/panorama-2026-02-18_09-00-41/panorama_1.png new file mode 100644 index 0000000..bf3f4fb Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_09-00-41/panorama_1.png differ diff --git a/run/screenshots/panorama-2026-02-18_09-00-41/panorama_2.png b/run/screenshots/panorama-2026-02-18_09-00-41/panorama_2.png new file mode 100644 index 0000000..24ea84e Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_09-00-41/panorama_2.png differ diff --git a/run/screenshots/panorama-2026-02-18_09-00-41/panorama_3.png b/run/screenshots/panorama-2026-02-18_09-00-41/panorama_3.png new file mode 100644 index 0000000..a28fd2e Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_09-00-41/panorama_3.png differ diff --git a/run/screenshots/panorama-2026-02-18_09-00-41/panorama_4.png b/run/screenshots/panorama-2026-02-18_09-00-41/panorama_4.png new file mode 100644 index 0000000..f55480a Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_09-00-41/panorama_4.png differ diff --git a/run/screenshots/panorama-2026-02-18_09-00-41/panorama_5.png b/run/screenshots/panorama-2026-02-18_09-00-41/panorama_5.png new file mode 100644 index 0000000..eacc4cc Binary files /dev/null and b/run/screenshots/panorama-2026-02-18_09-00-41/panorama_5.png differ diff --git a/src/client/java/dev/tggamesyt/szar/client/PanoramaClientCommand.java b/src/client/java/dev/tggamesyt/szar/client/PanoramaClientCommand.java new file mode 100644 index 0000000..dc79a46 --- /dev/null +++ b/src/client/java/dev/tggamesyt/szar/client/PanoramaClientCommand.java @@ -0,0 +1,83 @@ +package dev.tggamesyt.szar.client; + +import com.mojang.brigadier.CommandDispatcher; +import com.mojang.brigadier.context.CommandContext; + +import dev.tggamesyt.szar.Szar; +import net.fabricmc.api.ClientModInitializer; +import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; +import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; + +import net.minecraft.client.MinecraftClient; +import net.minecraft.text.Text; + +import java.io.File; +import java.nio.file.Files; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + +import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.literal; + +public class PanoramaClientCommand { + + static void register(CommandDispatcher dispatcher) { + dispatcher.register(literal("takepanorama") + .executes(PanoramaClientCommand::execute)); + } + + private static int execute(CommandContext context) { + + MinecraftClient client = MinecraftClient.getInstance(); + + if (client.world == null) { + context.getSource().sendError(Text.literal("Not in world.")); + return 0; + } + + client.execute(() -> { + try { + createPanorama(client, context); + } catch (Exception e) { + context.getSource().sendError(Text.literal("Failed: " + e.getMessage())); + e.printStackTrace(); + } + }); + + return 1; + } + + private static void createPanorama(MinecraftClient client, + CommandContext context) throws Exception { + + String timestamp = LocalDateTime.now() + .format(DateTimeFormatter.ofPattern("yyyy-MM-dd_HH-mm-ss")); + + File screenshotDir = new File(client.runDirectory, "screenshots"); + File panoramaDir = new File(screenshotDir, "panorama-" + timestamp); + + Files.createDirectories(panoramaDir.toPath()); + + // This creates: panoramaDir/screenshots/ + Text result = client.takePanorama(panoramaDir, 1024, 1024); + + // Move files up one folder + File innerScreenshotDir = new File(panoramaDir, "screenshots"); + + if (innerScreenshotDir.exists()) { + for (int i = 0; i < 6; i++) { + File src = new File(innerScreenshotDir, "panorama_" + i + ".png"); + File dst = new File(panoramaDir, "panorama_" + i + ".png"); + + if (src.exists()) { + Files.move(src.toPath(), dst.toPath()); + } + } + + // Delete the now-empty inner screenshots folder + innerScreenshotDir.delete(); + } + + context.getSource().sendFeedback(result); + } + +} diff --git a/src/client/java/dev/tggamesyt/szar/client/SzarClient.java b/src/client/java/dev/tggamesyt/szar/client/SzarClient.java index f3f0fe5..e699905 100644 --- a/src/client/java/dev/tggamesyt/szar/client/SzarClient.java +++ b/src/client/java/dev/tggamesyt/szar/client/SzarClient.java @@ -7,6 +7,7 @@ import dev.tggamesyt.szar.Szar; import dev.tggamesyt.szar.PlaneAnimation; import net.fabricmc.api.ClientModInitializer; import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; +import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; import net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry; @@ -36,6 +37,10 @@ import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.random.Random; +import java.io.File; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; import java.util.*; import static dev.tggamesyt.szar.Szar.*; @@ -324,8 +329,35 @@ public class SzarClient implements ClientModInitializer { (stack, world, entity, seed) -> { return entity != null && entity.getMainHandStack() == stack ? 1.0f : 0.0f; }); + if (isDebugEnabled()) { + ClientCommandRegistrationCallback.EVENT.register( + (dispatcher, registryAccess) -> PanoramaClientCommand.register(dispatcher) + ); + } } + private boolean isDebugEnabled() { + + MinecraftClient client = MinecraftClient.getInstance(); + + File configDir = new File(client.runDirectory, "config"); + File debugFile = new File(configDir, "panodebugmode.txt"); + + if (!debugFile.exists()) { + return false; + } + + try { + String content = Files.readString(debugFile.toPath(), StandardCharsets.UTF_8) + .trim(); + + return content.equals("true"); + + } catch (IOException e) { + e.printStackTrace(); + return false; + } + } private static void scrambleMovement(MinecraftClient client, float chance) { var options = client.options; long window = client.getWindow().getHandle(); diff --git a/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_0.png b/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_0.png new file mode 100644 index 0000000..170d842 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_0.png differ diff --git a/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_1.png b/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_1.png new file mode 100644 index 0000000..3da6ed0 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_1.png differ diff --git a/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_2.png b/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_2.png new file mode 100644 index 0000000..5acaa21 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_2.png differ diff --git a/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_3.png b/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_3.png new file mode 100644 index 0000000..33de702 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_3.png differ diff --git a/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_4.png b/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_4.png new file mode 100644 index 0000000..279c7f1 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_4.png differ diff --git a/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_5.png b/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_5.png new file mode 100644 index 0000000..34b31d8 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_5.png differ diff --git a/src/main/resources/assets/minecraft/textures/gui/title/edition.png b/src/main/resources/assets/minecraft/textures/gui/title/edition.png new file mode 100644 index 0000000..a82397f Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/title/edition.png differ diff --git a/src/main/resources/assets/minecraft/textures/gui/title/mojangstudios.png b/src/main/resources/assets/minecraft/textures/gui/title/mojangstudios.png new file mode 100644 index 0000000..2333f53 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/title/mojangstudios.png differ diff --git a/src/main/resources/data/minecraft/tags/blocks/beacon_base_blocks.json b/src/main/resources/data/minecraft/tags/blocks/beacon_base_blocks.json new file mode 100644 index 0000000..63f275a --- /dev/null +++ b/src/main/resources/data/minecraft/tags/blocks/beacon_base_blocks.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "szar:niggerite_block" + ] + } + \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json index eade6dc..4732ef6 100644 --- a/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json +++ b/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json @@ -1,6 +1,7 @@ { "replace": false, "values": [ - "szar:uranium_ore" + "szar:uranium_ore", + "szar:niggerite_block" ] } diff --git a/src/main/resources/data/szar/loot_tables/blocks/niggerite_block.json b/src/main/resources/data/szar/loot_tables/blocks/niggerite_block.json new file mode 100644 index 0000000..30c687a --- /dev/null +++ b/src/main/resources/data/szar/loot_tables/blocks/niggerite_block.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "szar:niggerite_block" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +}