diff --git a/src/main/java/xd/arkosammy/publicenderchest/mixin/ServerPlayerEntityMixin.java b/src/main/java/xd/arkosammy/publicenderchest/mixin/ServerPlayerEntityMixin.java index 1456464..4846ee0 100644 --- a/src/main/java/xd/arkosammy/publicenderchest/mixin/ServerPlayerEntityMixin.java +++ b/src/main/java/xd/arkosammy/publicenderchest/mixin/ServerPlayerEntityMixin.java @@ -6,10 +6,7 @@ import net.minecraft.screen.*; import net.minecraft.server.MinecraftServer; import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.text.ClickEvent; -import net.minecraft.text.MutableText; -import net.minecraft.text.Style; -import net.minecraft.text.Text; +import net.minecraft.text.*; import net.minecraft.util.Formatting; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; @@ -98,12 +95,12 @@ public ServerPlayerEntityMixin(World world, BlockPos pos, float yaw, GameProfile MutableText footerPrefix = Text.literal("--- ") .formatted(Formatting.DARK_AQUA); MutableText footerPreviousPage = Text.literal("<< ") - .setStyle(Style.EMPTY.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, String.format("/%s database query page %d", PublicEnderChest.MOD_ID, this.pageIndex)))) + .setStyle(Style.EMPTY.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, String.format("/%s database query page %d", PublicEnderChest.MOD_ID, this.pageIndex))).withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.literal("Turn to previous page")))) .formatted(Formatting.BLUE); MutableText footerMiddle = Text.literal(String.format("Showing page [%d of %d] ", pageIndex + 1, this.cachedLogs.size())) .formatted(Formatting.AQUA); MutableText footerNextPage = Text.literal(">> ") - .setStyle(Style.EMPTY.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, String.format("/%s database query page %d", PublicEnderChest.MOD_ID, this.pageIndex + 2)))) + .setStyle(Style.EMPTY.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, String.format("/%s database query page %d", PublicEnderChest.MOD_ID, this.pageIndex + 2))).withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.literal("Turn to next page")))) .formatted(Formatting.BLUE); MutableText footerSuffix = Text.literal("---") .formatted(Formatting.DARK_AQUA); diff --git a/src/main/kotlin/xd/arkosammy/publicenderchest/inventory/PublicInventory.kt b/src/main/kotlin/xd/arkosammy/publicenderchest/inventory/PublicInventory.kt index dc404ca..17dcfd8 100644 --- a/src/main/kotlin/xd/arkosammy/publicenderchest/inventory/PublicInventory.kt +++ b/src/main/kotlin/xd/arkosammy/publicenderchest/inventory/PublicInventory.kt @@ -15,7 +15,7 @@ import xd.arkosammy.publicenderchest.PublicEnderChest import xd.arkosammy.publicenderchest.config.ConfigSettings import xd.arkosammy.publicenderchest.logging.InventoryInteractionLog import xd.arkosammy.publicenderchest.logging.InventoryInteractionType -import xd.arkosammy.publicenderchest.util.SerializedItemStack +import xd.arkosammy.publicenderchest.serialization.SerializedItemStack class PublicInventory(private val itemStacks: DefaultedList = DefaultedList.ofSize(SLOT_SIZE, ItemStack.EMPTY)) : Inventory { diff --git a/src/main/kotlin/xd/arkosammy/publicenderchest/logging/ItemInsertLog.kt b/src/main/kotlin/xd/arkosammy/publicenderchest/logging/ItemInsertLog.kt index 574136e..f8a8b0c 100644 --- a/src/main/kotlin/xd/arkosammy/publicenderchest/logging/ItemInsertLog.kt +++ b/src/main/kotlin/xd/arkosammy/publicenderchest/logging/ItemInsertLog.kt @@ -22,7 +22,7 @@ class ItemInsertLog( .setStyle(Style.EMPTY.withHoverEvent(HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.literal(timestamp.format(InventoryInteractionLog.DTF))))) .formatted(Formatting.DARK_AQUA) val playerNameText: MutableText = Text.literal("$playerName ") - .setStyle(Style.EMPTY.withHoverEvent(HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.literal(uuid))).withClickEvent(ClickEvent(ClickEvent.Action.COPY_TO_CLIPBOARD, uuid))) + .setStyle(Style.EMPTY.withHoverEvent(HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.literal("$uuid (Click to copy to clipboard)"))).withClickEvent(ClickEvent(ClickEvent.Action.COPY_TO_CLIPBOARD, uuid))) .formatted(Formatting.AQUA) val interactedInventoryText: MutableText = Text.literal("inserted ") .formatted(Formatting.GOLD) diff --git a/src/main/kotlin/xd/arkosammy/publicenderchest/logging/ItemRemoveLog.kt b/src/main/kotlin/xd/arkosammy/publicenderchest/logging/ItemRemoveLog.kt index c9f689e..d10240a 100644 --- a/src/main/kotlin/xd/arkosammy/publicenderchest/logging/ItemRemoveLog.kt +++ b/src/main/kotlin/xd/arkosammy/publicenderchest/logging/ItemRemoveLog.kt @@ -22,7 +22,7 @@ class ItemRemoveLog( .setStyle(Style.EMPTY.withHoverEvent(HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.literal(timestamp.format(InventoryInteractionLog.DTF))))) .formatted(Formatting.DARK_AQUA) val playerNameText: MutableText = Text.literal("$playerName ") - .setStyle(Style.EMPTY.withHoverEvent(HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.literal(uuid))).withClickEvent(ClickEvent(ClickEvent.Action.COPY_TO_CLIPBOARD, uuid))) + .setStyle(Style.EMPTY.withHoverEvent(HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.literal("$uuid (Click to copy to clipboard)"))).withClickEvent(ClickEvent(ClickEvent.Action.COPY_TO_CLIPBOARD, uuid))) .formatted(Formatting.AQUA) val interactedInventoryText: MutableText = Text.literal("removed ") .formatted(Formatting.YELLOW) diff --git a/src/main/kotlin/xd/arkosammy/publicenderchest/logging/QueryContext.kt b/src/main/kotlin/xd/arkosammy/publicenderchest/logging/QueryContext.kt index ed69144..5bc988a 100644 --- a/src/main/kotlin/xd/arkosammy/publicenderchest/logging/QueryContext.kt +++ b/src/main/kotlin/xd/arkosammy/publicenderchest/logging/QueryContext.kt @@ -1,3 +1,9 @@ package xd.arkosammy.publicenderchest.logging -data class QueryContext @JvmOverloads constructor(val timeQueryType: TimeQueryType, val days: Int, val hours: Int = 0, val minutes: Int = 0, val seconds: Int = 0) +data class QueryContext @JvmOverloads constructor( + val timeQueryType: TimeQueryType, + val days: Int, + val hours: Int = 0, + val minutes: Int = 0, + val seconds: Int = 0 +) diff --git a/src/main/kotlin/xd/arkosammy/publicenderchest/util/SerializedItemStack.kt b/src/main/kotlin/xd/arkosammy/publicenderchest/serialization/SerializedItemStack.kt similarity index 94% rename from src/main/kotlin/xd/arkosammy/publicenderchest/util/SerializedItemStack.kt rename to src/main/kotlin/xd/arkosammy/publicenderchest/serialization/SerializedItemStack.kt index d61336d..42e92c0 100644 --- a/src/main/kotlin/xd/arkosammy/publicenderchest/util/SerializedItemStack.kt +++ b/src/main/kotlin/xd/arkosammy/publicenderchest/serialization/SerializedItemStack.kt @@ -1,4 +1,4 @@ -package xd.arkosammy.publicenderchest.util +package xd.arkosammy.publicenderchest.serialization import com.mojang.serialization.Codec import com.mojang.serialization.codecs.RecordCodecBuilder diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 351ff52..9f17f20 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -3,7 +3,7 @@ "id": "publicenderchest", "version": "${version}", "name": "Public Ender Chest", - "description": "This is an example description! Tell everyone what your mod is about!", + "description": "A Minecraft server-side mod that adds a public inventory accessible via an Ender Chest.", "authors": [ "ArkoSammy12" ], @@ -37,9 +37,10 @@ ], "depends": { "fabricloader": ">=0.15.11", - "minecraft": "~1.21", + "minecraft": ">=1.21", "java": ">=21", "fabric-api": "*", - "fabric-language-kotlin": "*" + "fabric-language-kotlin": "*", + "monkeyconfig" : "*" } } \ No newline at end of file