|
8 | 8 | All versions can be found at [Nyaa CI server](https://ci.nyaacat.com/job/LockettePro/) |
9 | 9 | For the newest build on main branch, click [here](https://ci.nyaacat.com/job/LockettePro/job/main/lastSuccessfulBuild/) |
10 | 10 |
|
11 | | -### LockettePro - A much better Lockette plugin for Bukkit |
| 11 | +### Version history |
| 12 | +- 2.9.15 : Minecraft 1.21, downloadable from [github actions](https://github.com/NyaaCat/LockettePro/actions/workflows/autobuild.yml) |
| 13 | +- 2.9.x-1.15.1: Minecraft 1.15.1, since build 10 |
| 14 | +- 2.9.x-1.14.4: Minecraft 1.14.4, until build 9 |
12 | 15 |
|
13 | | -LockettePro is a block-protection plugin based on Lockette (https://github.com/Acru/Lockette), the code base is entirely re-written. It is 100% compatable with original Lockette, and the plugin behaviors are also 100% same. |
| 16 | +English documentation: `README.md` |
| 17 | +中文说明: `README.zh.md` |
14 | 18 |
|
15 | | -### LockettePro has a lot of enhancements compared to Lockette: |
| 19 | +## What LockettePro does |
| 20 | +LockettePro protects blocks by validating ownership and access before players, hoppers, mobs, explosions, and redstone can interact with them. |
16 | 21 |
|
17 | | -1. Much better codebase and performance, fixed a lot of issues and glitches. |
18 | | -2. Real UUID support. |
19 | | -3. All blocks can be set to lockable or not. You can even prevent players from locking a chest. |
20 | | -4. Unlimited [Private], [More Users], [Timer:x] signs format. |
21 | | -5. Alert messages are editable, and UTF-8 characters are supported. |
22 | | -6. Lock expircy feature, locks can expire after a certain amount of time. |
| 22 | +It supports two lock models: |
23 | 23 |
|
24 | | -### Links |
25 | | -Spigot release page: https://www.spigotmc.org/resources/lockettepro.20427/ |
26 | | -Bukkit release page: http://dev.bukkit.org/bukkit-plugins/lockettepro/ |
27 | | -MCBBS release page: http://www.mcbbs.net/thread-567962-1-1.html |
28 | | -MC 1.6~1.7 Port: https://github.com/connection-lost/LockettePro/releases/tag/v1.9.4 |
| 24 | +- Sign lock (classic Lockette behavior): a wall sign near the protected block defines owner/users/tags. |
| 25 | +- PDC lock (container-only): lock data is stored inside the container PersistentDataContainer (no visible sign required). |
29 | 26 |
|
30 | | -### Version history |
31 | | -- 2.9.15 : Minecraft 1.21, downloadable from [github actions](https://github.com/NyaaCat/LockettePro/actions/workflows/autobuild.yml) |
32 | | -- 2.9.x-1.15.1: Minecraft 1.15.1, since build 10 |
33 | | -- 2.9.x-1.14.4: Minecraft 1.14.4, until build 9 |
| 27 | +Both models are available at the same time. |
| 28 | + |
| 29 | +## Core runtime logic |
| 30 | +For containers (chest, barrel, hopper, furnace, etc.): |
| 31 | + |
| 32 | +1. If LockettePro PDC lock data exists, LockettePro uses PDC permissions directly. |
| 33 | +2. If no PDC lock data exists, LockettePro falls back to sign scanning. |
| 34 | +3. Effective container lock state is mirrored to a configurable key (`locked-container-pdc-key`, default `lockettepro:locked_container`) for plugin/server integration. |
| 35 | + |
| 36 | +For non-container lockables (for example doors or decorative lockables such as `DIAMOND_BLOCK`), protection remains sign-based. |
| 37 | + |
| 38 | +This means: |
| 39 | + |
| 40 | +- PDC locks are fast and do not require nearby signs. |
| 41 | +- Sign locks still work for every configured lockable, including non-container blocks. |
| 42 | +- Containers with PDC lock data skip sign lookup for permission checks. |
| 43 | + |
| 44 | +## Installation (Admin) |
| 45 | +1. Download the plugin jar. |
| 46 | +2. Put it in `plugins/`. |
| 47 | +3. Start or restart the server. |
| 48 | +4. Edit `plugins/LockettePro/config.yml` as needed. |
| 49 | +5. Run `/lock reload` after changes. |
| 50 | + |
| 51 | +Optional integrations (soft-depend): |
| 52 | + |
| 53 | +- Vault |
| 54 | +- WorldGuard |
| 55 | +- ProtocolLib |
| 56 | +- CoreProtect |
| 57 | + |
| 58 | +## Configuration guide (Admin) |
| 59 | +Main options in `config.yml`: |
| 60 | + |
| 61 | +- `enable-quick-protect`: quick-lock mode (`true`, `false`, `sneak`). |
| 62 | +- `lockables`: what can be protected. |
| 63 | +- `lockables` supports both material names and block tags such as `minecraft:doors`. |
| 64 | +- Prefix with `-` in `lockables` to exclude a material/tag from the current set. |
| 65 | +- `block-item-transfer-in` / `block-item-transfer-out`: block hopper-like transfer into/out of locked containers. |
| 66 | +- `block-item-transfer-cooldown-ticks`: cooldown added to blocked hoppers to reduce retry spam. |
| 67 | +- `container-bypass-sign-tags`: tags (for example `[hopper]`) that make container transfer restrictions bypassable. |
| 68 | +- `everyone-signs`: tags that make access open to everyone (for example `[everyone]`). |
| 69 | +- `locked-container-pdc-key`: PDC key used as an external "effectively locked container" marker. |
| 70 | +- `permission-groups-file`: persistent file for permission groups (default `permission-groups.json`). |
| 71 | +- `permission-groups-autosave-seconds`: autosave interval for permission groups. |
| 72 | + |
| 73 | +## Player usage |
| 74 | +### Sign lock workflow |
| 75 | +- Quick protect: right-click a lockable block with a sign item (if enabled by config). |
| 76 | +- Manual protect: place a wall sign with `[Private]` on line 1. |
| 77 | +- Add extra users/tags: use `[More Users]` sign. |
| 78 | +- Common tags: `[everyone]` (everyone can use), `[hopper]` (container transfer bypass tag). |
| 79 | +- Edit lock sign text: right-click a lock sign to select it, then run `/lock <1|2|3|4> <text>`. |
| 80 | + |
| 81 | +### PDC lock workflow (container only) |
| 82 | +- `/lock on` |
| 83 | +Lock the targeted container and set yourself as owner. |
| 84 | +- If the container is currently sign-locked and you are owner, this creates PDC lock data and future access checks prefer PDC data. |
| 85 | +- Existing sign text is not auto-imported into PDC permissions. |
| 86 | + |
| 87 | +- `/lock info` |
| 88 | +Show current owners, permission entries, and `locked_container` state of targeted container. |
| 89 | + |
| 90 | +- `/lock rename <new name>` |
| 91 | +Rename targeted PDC-locked container (owner only). Supports color format such as `&#rrggbb`. |
| 92 | + |
| 93 | +- `/lock permission <node>` |
| 94 | +Edit targeted container permissions (owner only). |
| 95 | + |
| 96 | +Permission node format: |
| 97 | + |
| 98 | +- `<mode>:<subject>` |
| 99 | +- modes: `xx` (owner), `rw` (read/write), `ro` (read-only), `--` (remove) |
| 100 | +- subjects: player UUID or player name (online names normalize to UUID), `[tag]`, `#entity`, or `[g:GroupName]` |
| 101 | +- tag examples: `[everyone]`, permission group tags, scoreboard team tags |
| 102 | +- entity example: `#hopper` |
| 103 | + |
| 104 | +Examples: |
| 105 | + |
| 106 | +- `xx:AdminPlayer` |
| 107 | +- `rw:FriendA` |
| 108 | +- `ro:[everyone]` |
| 109 | +- `rw:#hopper` |
| 110 | +- `rw:[g:BaseMembers]` |
| 111 | +- `--:FriendA` |
| 112 | + |
| 113 | +### Permission clone tool |
| 114 | +- `/lock clone` gives a special item containing current container permissions (+ custom name). |
| 115 | +- Right-click another container with that item to copy permissions quickly. |
| 116 | +- Target rules: unlocked container (allowed), PDC-locked container (owner required), sign-locked container (owner required) |
| 117 | + |
| 118 | +## Permission groups (Player-owned) |
| 119 | +Permission groups reduce long permission lists in PDC locks. |
| 120 | + |
| 121 | +- Each player can own one group. |
| 122 | +- Group name must be unique server-wide. |
| 123 | +- Only the owner can edit/delete the group. |
| 124 | +- Group file is loaded on startup and autosaved periodically. |
| 125 | + |
| 126 | +Commands: |
| 127 | + |
| 128 | +- `/lock group create <groupName>` |
| 129 | +- `/lock group delete <groupName>` |
| 130 | +- `/lock group add <groupName> <subject>` |
| 131 | +- `/lock group remove <groupName> <subject>` |
| 132 | +- `/lock group info <groupName>` |
| 133 | +- `/lock group list` |
| 134 | + |
| 135 | +Use group in container permission: |
| 136 | + |
| 137 | +- `/lock permission rw:[g:<groupName>]` |
| 138 | + |
| 139 | +## Permissions |
| 140 | +Common permission nodes: |
| 141 | + |
| 142 | +- `lockettepro.command`: use `/lock` base command |
| 143 | +- `lockettepro.lock`: create sign locks / quick lock |
| 144 | +- `lockettepro.edit`: sign edit workflow (`/lock 1..4`) |
| 145 | +- `lockettepro.pdc.on` |
| 146 | +- `lockettepro.pdc.info` |
| 147 | +- `lockettepro.pdc.rename` |
| 148 | +- `lockettepro.pdc.permission` |
| 149 | +- `lockettepro.pdc.clone` |
| 150 | +- `lockettepro.pdc.group` |
| 151 | +- `lockettepro.pdc.*`: includes all PDC/group sub-permissions |
| 152 | +- `lockettepro.reload`: reload config |
| 153 | +- `lockettepro.version`: view plugin version |
| 154 | + |
| 155 | +Additional admin/legacy nodes used by runtime checks: |
| 156 | + |
| 157 | +- `lockettepro.lockothers` |
| 158 | +- `lockettepro.noexpire` |
| 159 | +- `lockettepro.admin.edit` |
| 160 | +- `lockettepro.edit.admin` |
| 161 | +- `lockettepro.admin.break` |
| 162 | +- `lockettepro.admin.use` |
| 163 | +- `lockettepro.admin.interfere` |
| 164 | + |
| 165 | +For survival/RPG/adventure setups, explicitly grant PDC permissions only to roles that are allowed to create and manage virtual locks. |
| 166 | + |
| 167 | +## Notes and compatibility |
| 168 | +- Quick-lock sign placement now fires placement event checks, so region/anti-grief plugins can block it consistently. |
| 169 | +- Blocked hopper transfers apply a cooldown to reduce repeated checks. |
| 170 | +- PDC lock currently applies to containers only. |
| 171 | +- Non-container lockables remain sign-only by design. |
| 172 | +- Sign lock and PDC lock can coexist in the same server; container access checks prefer PDC when present. |
0 commit comments