promotional bannermobile promotional banner

ProtectionBlocks

ProtectionBlocks allows players to secure their builds with customizable protection blocks and manage permissions with ease.
Back to Files

protectionblocks-1.0.8.jar

File nameprotectionblocks-1.0.8.jar
Uploader
ReaperFtxReaperFtx
Uploaded
Jul 2, 2026
Downloads
21
Size
8.4 MB
Mod Loaders
Forge
File ID
8359643
Type
R
Release
Supported game versions
  • 1.20.1

Curse Maven Snippet

Forge

implementation fg.deobf("curse.maven:protection-blocks-1351203:8359643")

Learn more aboutย Curse Maven

What's new

๐Ÿš€ v1.0.8 โ€” Free time for new players & Currency polish

Post-launch polish on top of 1.0.7's currency system. Highlights: new players automatically get 24 h of free time on their first protection block (per-player, anti-cheat pool โ€” break & replace doesn't reset the timer). The whole "grace period" naming was renamed to "Free time" (Tiempo gratis / Freie Zeit / Temps gratuit / Tempo gratis) across the 5 mod languages. And several currency-flow bugs from 1.0.7 fixed.


๐ŸŽ Free time for new players โ€” first block bonus

When a brand-new player places their very first protection block, they get a configurable amount of free time (default 24 h) during which the block consumes no fuel. Intended to give newcomers a safe onboarding window before they have to worry about the economy.

  • Configurable duration: new admin option newPlayerGraceHours (0โ€“720 h, default 24). 0 disables the feature. Editable in-game from the ConfigScreen โ†’ Currency tab.
  • Once per player, forever: an anti-cheat pool tracks which players have ever received the bonus (persisted to config/protectionblocks/veterans.txt). A player who has been granted the bonus never gets it again, even if they break all their protection blocks and place new ones later.
  • Survives break & replace within the window: the free time is anchored to the player (their UUID), not to the block. If a new player places their first block, then decides to move it โ€” breaks it after 14 h and places another one in a better spot โ€” the remaining 10 h of free time transfer to the new block automatically. No punishment for repositioning.
  • Welcome message in chat on placement of the first block: "๐ŸŽ Welcome โ€” your first protection block has 24 h of free time." (5 langs, admin-configured duration substituted in).
  • Only applies when currency mode is enabled โ€” if the server never turned on the economy, the feature is silently a no-op.

๐Ÿท๏ธ Renamed to "Free time" everywhere

The "grace period" mechanic (both the admin-global one from 1.0.7 and the new per-player bonus) is now presented to players as "Free time" โ€” a friendlier, more accurate name.

  • UI labels, buttons, chat messages, badges โ€” all renamed in the 5 mod languages: ๐Ÿ‡ช๐Ÿ‡ธ Tiempo gratis ยท ๐Ÿ‡ฌ๐Ÿ‡ง Free time ยท ๐Ÿ‡ฉ๐Ÿ‡ช Freie Zeit ยท ๐Ÿ‡ซ๐Ÿ‡ท Temps gratuit ยท ๐Ÿ‡ฎ๐Ÿ‡น Tempo gratis.
  • The header in the ConfigScreen went from the long warning "โš  Grace period: pauses fuel consumption 24h on ALL blocks (useful after changing the currency item)." to the concise "Free time (Pause fuel consumption on all blocks)".
  • Color of the header changed from amber (warning) to blue accent (informational) โ€” it's no longer a red-flag concept, just a mechanic.
  • Java class names and NBT keys kept their grace_* prefix internally โ€” the rename is user-facing only, saves from 1.0.7 load without migration.

โš™๏ธ ConfigScreen โ€” Currency tab polish

  • Live per-tier cost breakdown: the old static line "Tier multiplier: Basic ร—1, Advanced ร—2, ..." was replaced by 5 live lines that reflect the actual current settings, updating as you type:
    โ€ข Basic:    1 Diamond ร— 10 min
    โ€ข Advanced: 2 Diamonds ร— 10 min
    โ€ข Superior: 3 Diamonds ร— 10 min
    โ€ข Elite:    5 Diamonds ร— 10 min
    โ€ข Master:   8 Diamonds ร— 10 min
        
    The currency item's localized display name is resolved from the registry โ€” fallback to raw id if invalid. Refreshes every frame with no debouncing.
  • Live free time countdown: while a global free time period is active, the Currency tab now shows a live countdown "โฑ Free time active ยท 23h 45m 12s remaining" below the H:/M:/S: inputs. Updates every frame. When there's no free time active, shows "No free time active" in muted gray. Grant / Cancel buttons update the countdown optimistically (before the server round-trip completes) so admins get instant feedback.
  • Save doesn't close the GUI anymore. Clicking Save used to close the whole ConfigScreen โ€” annoying if you wanted to tweak more values. Now Save just sends the update; the server responds with a fresh snapshot and the current tab is re-rendered with the actually-applied values (Forge can clamp out-of-range inputs), so the admin sees exactly what was accepted without reopening anything.
  • Int inputs no longer cover their labels. Numeric input boxes were 160 px wide, hardcoded โ€” long labels like "Mรกx. bloques por jugador (-1 = ilimitado)" overflowed and were clipped behind the box. Now they're 80 px (enough for the 8-char max length of any numeric field), shifted right to give the label 280 px of breathing room.

๐Ÿ›ก๏ธ Protection block cube is always inviolable

Reverting a decision from 1.0.7: the cube itself is now always inviolable to non-owners, even when its fuel has run out.

  • The zone still deactivates without fuel โ€” regular blocks inside can be broken and interacted with โ€” but the cube itself can never be broken by third parties. This means an owner who forgets to refuel can always come back later, refill the slot, and their zone is instantly restored. No more losing the whole base to a griefer during an offline weekend just because you were short on diamonds.
  • The cancel is applied on both LeftClickBlock (to prevent the block from taking damage) and BlockEvent.BreakEvent (belt-and-suspenders for creative mode / other break paths).
  • Admins (OP level โ‰ฅ 2) can still break any cube, unchanged.

๐Ÿ› Fixed

  • 4 legacy chat messages on right-click โ€” every time a player right-clicked their own protection block, four lines appeared in chat: "Protection Block Advanced", "Range: 15 blocks (area 31ร—31)", "Owner: reaperfxx", "Shift + Right click to toggle visualization". Cause: PlayerInteractEvent.RightClickBlock fires once per hand (MAIN_HAND + OFF_HAND); the early-return filter for MAIN_HAND was placed before the setCanceled(true), so the OFF_HAND event was never cancelled and vanilla ended up calling ProtectionBlock.use() (the legacy chat-print code path from before the modern GUI existed). Fixed by cancelling both hands and gating only the GUI-open logic on MAIN_HAND. The legacy use() was also nuked to a no-op.
  • Free time badge appearing top-left of the screen the first time a block's GUI was opened. Cause: uiFuelY was only set inside if (fs != null && fs.currencyEnabled()) โ€” but on first open of a block in a session, the SyncFuelStatePacket hasn't arrived yet (RequestSyncPacket is asynchronous), so fs is null, uiFuelY stays at its default 0, and when the packet finally arrives render() draws the "Free time active ยท Xh Ym Zs" label at (uiContentX, 0) โ€” the top-left corner. Second open worked because the cache was already populated. Fixed on two fronts: uiFuelY is now computed unconditionally in init(), and SyncFuelStatePacket.handle triggers a widget rebuild if the currently-open Screen is the management GUI for that block position (so the fuel input + refill/withdraw buttons also appear on first open).
  • Item disappearing from the hotbar when trying to place any block inside another player's protected zone. The block would visually vanish from the slot until the player put a different item there, at which point the original block came back. Cause: PlayerInteractEvent.RightClickBlock was cancelled server-side but the client had already predicted the item consumption ("optimistic prediction"). Since we cancel the RightClickBlock event and never let vanilla place the block, EntityPlaceEvent (which had the inventory resync) never fires, so the client stayed out of sync. Fixed: resyncInventoryAfterCancel(player) now also runs in the RightClickBlock cancel path.
  • No consumption during free time โ€” but now the countdown doesn't lie either. With 1.0.7, the fuel-time-remaining shown in the GUI would suddenly jump to 0 s the moment a free time window ended, because computeSecondsLeft used now โˆ’ lastConsumeMs, and during hours of free time lastConsumeMs stayed frozen while now ticked forward. The client saw an elapsed of "hours" for the current item and computed remainingCurrent = 0. Fixed by clamping effectiveNow = lastConsumeMs whenever the block is in a free time window โ€” the countdown now truthfully reflects that the fuel is fully preserved until the window closes.

๐ŸŒ Languages

All new labels, tooltips and chat messages translated to the 5 mod languages: ๐Ÿ‡ช๐Ÿ‡ธ Spanish ยท ๐Ÿ‡ฌ๐Ÿ‡ง English ยท ๐Ÿ‡ฉ๐Ÿ‡ช German ยท ๐Ÿ‡ซ๐Ÿ‡ท French ยท ๐Ÿ‡ฎ๐Ÿ‡น Italian.


๐Ÿ”ง Under the hood

  • New persistent store: config/protectionblocks/veterans.txt โ€” one line per player as uuid,graceEndMs. Auto-migrates lines from the older UUID-only format (treated as "already veteran, no time remaining").
  • Free time now lives with the player, not with the block. VeteranPlayerTracker.grantOnce(uuid, ms) is atomic (marks veteran + records timestamp in one op). ProtectionBlockEntity.getPersonalGraceUntilMs() is now a dynamic lookup on the owner's UUID โ€” so the same timer applies to whichever block the player currently has, and the field was dropped from NBT (legacy tag ignored silently on load).
  • ConfigSnapshot extended with two new fields: newPlayerGraceHours (int, applied to ServerConfig) and graceUntilMs (server-authoritative timestamp echoed to the admin client for the live countdown). GrantGracePeriodPacket.handle now sends a fresh SyncConfigPacket back to the sender after grant / cancel so the countdown updates without waiting for a manual refresh.
  • 3 SyncFuelStatePacket emit sites (cron tick / deposit / request-sync) all now send prot.getEffectiveGraceUntilMs() = max(globalGrace, personalGraceOfOwner), so the client-side countdown shows whichever expires later.
  • ProtectionEventHandler.onRightClickBlock re-ordered: setCanceled(true) now runs for both hands, MAIN_HAND filter gates only the message / GUI open logic. Prevents the OFF_HAND event from slipping through to vanilla use().

๐Ÿ“ฆ Compatibility

  • Minecraft 1.20.1
  • Forge 47.x (built against 47.4.8)
  • Fully compatible with 1.0.7 worlds โ€” no world reset or config wipe needed.

ยฉ 2026 vicxelcode โ€” MIT License

This mod has no related projects