Skip to content

Conversation

eclipseisoffline
Copy link
Contributor

@eclipseisoffline eclipseisoffline commented Sep 23, 2025

This PR updates the mod to 1.21.9. It also performs major refactors to texts used in the mod, lock flags, and the mod's configuration file.

Full list of changes:

Build/project

  • Updated Gradle wrapper to 9.1.0.
  • Updated Fabric Loom to 1.11.
  • Updated Fabric loader to 0.17.2, FAPI to 0.133.14+1.21.9, server translation API to 2.5.2+1.21.9-pre3, and permissions API to 0.4.1.
  • Version has been bumped to 1.2.0.
    • A small breaking change has been made to reading config files (further explained below), although I doubt this will affect many people, if anyone at all. I also consider this update significant enough for a minor version bump.
  • Cleaned up and improved build scripts and CI workflows as they have become very outdated over time.

LockType

  • Removed LockType class, replacing it with a Type enum in the Lock interface, which does the same things, but simpler.

Mod configuration

  • The HTMConfig class has been refactored into a immutable record, using a codec for reading and writing.
  • As per convention, serialised fields in the configuration file have been turned into snake_case:
    • canTrustedPlayersBreakChests -> can_trusted_players_break_chests
    • defaultFlags -> default_flags
    • autolockingContainers -> auto_locking_containers
  • The codec used has an alternative fallback for reading legacy configuration files. Configuration files are automatically written in the new format after reading.
  • A new SingleBlockSelector record has been created for reading auto-locking containers. This selector can either be a single block identifier, or a block tag.
  • Default flags can now be specified with more detail. They are read by BlockFlagSet.
    • Default flags can still be specified, but per-block overrides for these default flags can also be specified. These also use a SingleBlockSelector, meaning you can use a block identifier or a block tag.
  • Reading configuration files written before version 1.1.4 (released almost 4 years ago) is no longer supported.

Flags

  • Flags are no longer kept in a simple map in the HTMContainerLock record, instead a dedicated FlagSet class has been created, which uses an EnumMap internally.
    • Whilst this is a mutable map, the FlagSet class itself has been designed to be immutable, and has no methods for modifying the map directly.
  • Locked containers no longer store values for all available flags, instead only specifying overridden values. Values not specified are defaulted to those specified in the configuration.
    • Because all values for all flags used to be stored in older mod versions, this only applies to new flags (like the COPPER_GOLEMS flag) and newly placed locked containers.
    • This can be useful to adjust flags for all locked containers in a world at once, by changing the default flag value in the configuration.
  • The COPPER_GOLEMS flag has been added, used to control whether copper golems can open a locked container or not.

Commands

  • /htm flag now displays values for any flag, even when not set on a locked container.
  • /htm flag <type> has been added to reset a flag on a locked container to its default value (specified in the configuration).

Texts

  • All in-line uses of Text.translatable have been replaced with constants in HTMTexts.
  • Legacy formatting codes have been removed from translation files, and replaced with proper text formatting in the aforementioned class.
  • A new translation has been added for Dutch (nl_nl).

Other things

  • Various small cleanups have been performed to the codebase, to start moving to a consistent code style.
  • The README has been update to accommodate for all changes made. The CI badge has also been fixed, and all the badges now appear on one line.

An example new configuration file is as follows:

{
  "can_trusted_players_break_chests": false,
  "default_flags": {
    "overrides": {
      "chest": {
        "copper_golems": true
      },
      "#copper_chests": {
        "copper_golems": true
      }
    },
    "default": {
      "hoppers": true,
      "copper_golems": false
    }
  },
  "auto_locking_containers": [
    "minecraft:chest",
    "minecraft:trapped_chest",
    "minecraft:barrel",
    "minecraft:furnace",
    "minecraft:blast_furnace",
    "minecraft:smoker",
    "#minecraft:shulker_boxes",
    "#minecraft:copper_chests"
  ]
}

The file above disables copper golem access to all locked containers except copper chests and normal chests.

@eclipseisoffline
Copy link
Contributor Author

eclipseisoffline commented Oct 1, 2025

PR should be ready to review now, there have been a few major refactors, as well as improvements to the mod's config file, a new COPPER_GOLEMS flag, and default flag overrides per-block (fixing #63), among other things.

Will update PR description in a bit. Re-running the actions will probably fix them.

@eclipseisoffline eclipseisoffline marked this pull request as ready for review October 1, 2025 08:50
@eclipseisoffline
Copy link
Contributor Author

I've cleaned up/improved the CI workflows as well to make them more reliable, and fixed the CI badge in the README too :)

Copy link
Member

@PotatoPresident PotatoPresident left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@PotatoPresident PotatoPresident merged commit f286b6a into QuiltServerTools:master Oct 9, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants