A fork of GriefPrevention that adds 3D subdivisions
GriefPrevention3D v18.3.0
Wiki: https://github.com/castledking/GriefPrevention3D/wiki
Overview
GP3D originally followed upstream GriefPrevention's master branch. That branch became the
development line for v20 and removed several long-standing systems with the expectation that they
would move into addons. GP3D still intends to ship those systems in core, so this release audits the
fork against upstream's legacy/v16 branch and restores the remaining functionality which was lost
through those merges.
This is a source-level port, not a rollback. The restored behavior has been fitted around GP3D's 3D claims, shaped claims, current event API, universal 1.8-to-current JAR, and Folia/Canvas region scheduling.
Features restored from legacy/v16
Siege is functional again
/siege <player> and /claim siege <player> were still advertised, but the state machine and
event rules behind them had been removed upstream. Both commands now start a real siege.
A siege may begin when the feature is enabled in the current world, the attacker is close enough, the defender is protected by a player-owned claim, neither player is already fighting or PvP immune, and the player/claim cooldown permits it. Administrative claims cannot be sieged.
While the siege is active:
- both players must remain near the besieged claim or near one another while giving chase;
- logging out, dying, or abandoning the fight forfeits it;
- participants cannot drop items, use containers, use the claim shovel, modify claims, or run restricted teleport actions;
- outsiders cannot build in or use containers in a besieged claim;
- the attacker may break only the configured siege materials;
- a claim the defender enters may join the siege when the defender has access there; and
- an attacker victory temporarily unlocks buttons and levers, then re-locks the claim and ejects the attacker when the looting window ends.
The periodic checkup, unlock/re-lock tasks, player state reads, and ejection are dispatched through the appropriate entity or region scheduler rather than assuming one global server thread.
Siege is deliberately disabled by default. Add world names before exposing the command:
GriefPrevention:
Siege:
Worlds: []
BreakableBlocks:
- DIRT
- GRASS_BLOCK
- COBBLESTONE
- GRAVEL
- SAND
- GLASS
- GLASS_PANE
- OAK_PLANKS
- WHITE_WOOL
- SNOW
DoorsOpenDelayInSeconds: 300
CooldownEndInMinutes: 60
The generated BreakableBlocks list contains the complete legacy-compatible material set,
including old and current names for grass, wood, planks, and wool.
New permissions:
| Permission | Default | Purpose |
|---|---|---|
griefprevention.siege |
everyone | Start a siege |
griefprevention.siegeimmune |
operators | Prevent other players from sieging this player |
griefprevention.siegeteleport |
operators | Bypass siege teleport restrictions |
When at least one siege world is configured and the three
PvP.ProtectPlayersInLandClaims settings are absent, their generated defaults become false, as
they did in legacy GP. Values already present in an existing config remain authoritative. Review
those settings before enabling siege on a production world.
Creative-world entity and active-block controls are back
Creative claims once scaled resource limits with their footprint. Those limits and the recurring cleanup pass are restored:
- one non-player entity is allowed per 50 claim blocks;
- one active block is allowed per 100 claim blocks;
- hoppers, beacons, and spawners count as active blocks;
- minecarts, armor stands, item frames, hanging entities, spawn eggs, and other entity-producing placements are checked before they are allowed; and
- creature spawns are rejected in creative wilderness or when the destination claim is already at its limit.
Administrative claims and player claims over 10,000 blocks are exempt from the entity cap. The limits use the top-level claim's 2D footprint, including for 3D subdivisions.
The cleanup task starts two minutes after boot, processes ten percent of each creative world's currently loaded chunks per minute, and therefore completes a pass in about ten minutes. It does not intentionally load unloaded chunks. It removes empty boats, invalid minecarts, and non-player entities left in creative wilderness, then trims claims which are already above their entity limit. Each chunk is handled on its owning region.
This is an intentionally visible behavior change for creative servers. Wilderness entity displays or mobs which were allowed to accumulate while the upstream code was absent may be removed after upgrading.
Small unused creative claims expire again
The legacy low-investment cleanup path is restored with:
GriefPrevention:
Claims:
Expiration:
UnusedClaimDays: 14
It considers only non-administrative creative claims no more than 25 blocks wide or deep and with an investment score below 400. Once the owner has been inactive for the configured number of days, the normal expiration event is fired, the claim is deleted with pet release, and the land is restored to nature.
As in legacy GP, this is the fallback after whole-account inactivity expiration. It runs only when
Expiration.AllClaims.DaysInactive is 0; a non-zero all-claims policy takes precedence.
AFK-aware claim-block accrual is back
Claim-block delivery once distinguished active play from players standing still, sitting in a
vehicle, or moving in liquid. That check is restored and still passes through the newer
AccrueClaimBlocksEvent, so addons may inspect, modify, or cancel the result.
GriefPrevention:
Claims:
Accrued Idle Threshold: 0
AccruedIdlePercent: 0
Accrued Idle Threshold is the minimum movement distance between accrual checks. The old
AccruedIdleThreshold spelling is also read for compatibility, but the spaced name is written
back. AccruedIdlePercent controls the percentage of the normal rate awarded when idle; 0
awards none. Players with griefprevention.accruals.afkbypass bypass the idle reduction.
Permission trust is a separate trust level again
/managetrust—and its legacy /permissiontrust alias—now stores ClaimPermission.Manage instead
of translating it into ordinary gameplay trust. A manager may edit a claim's trust list but does
not implicitly receive build, container, or access permission. Owners and full-edit trustees retain
all lower permissions.
A trustee may grant only a permission they possess themselves. For example, a player with access
trust cannot grant build trust, and only an owner/full editor can grant manage trust. Denied grants
use the new CantGrantThatPermission message.
Deleted claims release their owner's pets again
The releasePets argument survived upstream's cleanup but no longer did anything. When a
top-level player claim is deleted through a path which requests pet release, GP3D now finds the
owner's tamed animals inside the claim, makes them wild, clears inventories on inventory-bearing
pets, and makes sittable pets stand. Work is partitioned by chunk for region-threaded servers.
WorldGuard-aware claim creation is back
When WorldGuard is installed, rectangular and shaped claims may no longer cover an area where the
creator lacks WorldGuard's BUILD permission:
GriefPrevention:
Claims:
CreationRequiresWorldGuardBuildPermission: true
WorldGuard and WorldEdit are soft dependencies. GP3D still loads without either plugin, and the
integration uses reflection so WorldGuard is not pulled into the universal JAR's class-loading
surface. A WorldGuard API failure is logged to GP debug output and fails open, allowing claim
creation instead of taking the claim system offline.
Economy purchase limits and provider lifecycle are restored
Servers may cap purchased bonus claim blocks independently of accrued blocks:
GriefPrevention:
Economy:
ClaimBlocksMaxBonus: 0
0 means unlimited. A positive value rejects /buyclaimblocks or /claim buyblocks when the
requested purchase would put the player's bonus total over the cap. The Vault economy provider is
now resolved live for each transaction, so enabling, disabling, or replacing an economy provider
does not leave GP3D holding a stale service instance.
Administrator diagnostics and legacy command access are back
/gpblockinforeports the material in the player's main hand and the material of the targeted block. It requiresgriefprevention.gpblockinfo, which defaults to operators./deletealladminclaimsis usable by an authorized player again, not only from the console. A player must pass the command'sgriefprevention.adminclaimspermission and the destructive action'sgriefprevention.deleteclaimscheck. The deletion is written to the admin log.
Legacy fire interaction protection is back
On older clients fire has no selectable hitbox, so a left-click arrives as a click on the supporting block. GP3D now checks the adjacent fire block, enforces build trust at the claim, cancels denied interaction, and re-sends the fire block to prevent a client-side disappearance. This path avoids introducing a compile-time dependency on newer Bukkit APIs.
Configuration summary
| Setting | Default | Upgrade effect |
|---|---|---|
Claims.Expiration.UnusedClaimDays |
14 |
Only active when AllClaims.DaysInactive is 0; creative claims only |
Claims.Accrued Idle Threshold |
0 |
Any unchanged position is idle; vehicles and liquid also count as idle |
Claims.AccruedIdlePercent |
0 |
Idle players receive no accrued blocks |
Claims.CreationRequiresWorldGuardBuildPermission |
true |
Effective only when WorldGuard is installed and hooked |
Economy.ClaimBlocksMaxBonus |
0 |
Unlimited purchased bonus blocks |
Siege.Worlds |
[] |
Siege disabled everywhere |
Siege.DoorsOpenDelayInSeconds |
300 |
Five-minute attacker looting window |
Siege.CooldownEndInMinutes |
60 |
Per-opponent/per-claim cooldown |
There is no claim-data migration. New settings are written into the normal generated config on startup. Twenty-seven message keys were added for siege and the two other new denial messages, with bundled translations for every supported locale. Custom locale files which omit a key still use the enum's English fallback.
Compatibility notes
- The restored systems remain compatible with the universal 1.8-to-current build. Newer API types used for pet state and WorldGuard are reached reflectively where loading them directly would break an older server.
- Creative cleanup, pet release, claim expiration restoration, and siege movement are routed through GP3D's scheduler utilities for Folia and Canvas.
- Creative cleanup scans only loaded chunks. Excess entities in an unloaded chunk are handled by a later pass after that chunk has been loaded; the recurring task does not force-load it merely to scan.
- Siege state is transient. An active siege is not persisted across a server restart.
Tests
The full ./gradlew check --no-daemon pipeline passes: 227 tests, 0 failures, 0 errors. This
also includes the legacy class-loading audit, universal JAR verification, and Fabric boot smoke
test.
New regression coverage verifies the creative entity limits and that Manage trust no longer implicitly grants Build, Container, or Access permission. The integration-heavy paths—WorldGuard, live-world cleanup, pet mutation, legacy fire interaction, and the multi-player siege lifecycle—are compiled and class-loaded by the compatibility/build checks but still require live-server validation of their runtime behavior.
Files Changed
M src/main/java/com/griefprevention/commands/UnifiedClaimCommand.java
M src/main/java/me/ryanhamshire/GriefPrevention/BlockEventHandler.java
M src/main/java/me/ryanhamshire/GriefPrevention/Claim.java
M src/main/java/me/ryanhamshire/GriefPrevention/ClaimPermission.java
M src/main/java/me/ryanhamshire/GriefPrevention/CleanupUnusedClaimPreTask.java
M src/main/java/me/ryanhamshire/GriefPrevention/CleanupUnusedClaimTask.java
M src/main/java/me/ryanhamshire/GriefPrevention/DataStore.java
M src/main/java/me/ryanhamshire/GriefPrevention/DeliverClaimBlocksTask.java
M src/main/java/me/ryanhamshire/GriefPrevention/EntityEventHandler.java
M src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java
M src/main/java/me/ryanhamshire/GriefPrevention/Messages.java
M src/main/java/me/ryanhamshire/GriefPrevention/PlayerData.java
M src/main/java/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java
M src/main/resources/messages.yml
M src/main/resources/messages_cs_CZ.yml
M src/main/resources/messages_de_DE.yml
M src/main/resources/messages_en.yml
M src/main/resources/messages_en_PT.yml
M src/main/resources/messages_es.yml
M src/main/resources/messages_fr_FR.yml
M src/main/resources/messages_ja_JP.yml
M src/main/resources/messages_ms_MY.yml
M src/main/resources/messages_pl_PL.yml
M src/main/resources/messages_pt_BR.yml
M src/main/resources/messages_ru_RU.yml
M src/main/resources/messages_tr_TR.yml
M src/main/resources/messages_uk_UA.yml
M src/main/resources/messages_zh_CN.yml
M src/main/resources/plugin.yml
M src/test/java/me/ryanhamshire/GriefPrevention/ClaimPermissionTest.java
A src/main/java/me/ryanhamshire/GriefPrevention/EntityCleanupTask.java
A src/main/java/me/ryanhamshire/GriefPrevention/SecureClaimTask.java
A src/main/java/me/ryanhamshire/GriefPrevention/SiegeCheckupTask.java
A src/main/java/me/ryanhamshire/GriefPrevention/SiegeData.java
A src/main/java/me/ryanhamshire/GriefPrevention/SiegeEventHandler.java
A src/main/java/me/ryanhamshire/GriefPrevention/WorldGuardWrapper.java
A src/test/java/me/ryanhamshire/GriefPrevention/CreativeEntityLimitTest.java