Skip to content

Commit

Permalink
Miscellaneous tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ArkoSammy12 committed Jul 25, 2024
1 parent 0f70420 commit 3d55d06
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ItemStack> = DefaultedList.ofSize(SLOT_SIZE, ItemStack.EMPTY)) : Inventory {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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
)
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 4 additions & 3 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
],
Expand Down Expand Up @@ -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" : "*"
}
}

0 comments on commit 3d55d06

Please sign in to comment.