54 lines
6.8 KiB
Markdown
54 lines
6.8 KiB
Markdown
# QoL-tweaks
|
||
|
||
A quality-of-life SMP plugin for Paper/Folia.
|
||
|
||
## Features
|
||
|
||
- **Join messages** — a "Welcome to the SMP" title on every join, friendly welcome messages (including a first-join message that lists the server's plugins and a warning that `/nopvp` abuse is bannable and that combat logging is a bad idea), and a special announcement when the owner logs in.
|
||
- **`/nopvp`** — toggle no-PvP mode. **New players start with no-PvP on.** While active you cannot damage other players and other players cannot damage you (direct hits, projectiles, pets, lingering potions, and player-deployed explosives such as TNT, TNT minecarts, end crystals and bed bombs). A floating **totem of undying** (glowing green) appears above your head while no-PvP is on; with no-PvP off you instead show your personal symbol (glowing red) — a **wither skeleton skull** (shown 2× larger) or a **netherite axe** (axe by default) — chosen with `/team symbol` (no team required) and remembered per player. Team members glow in their team's colour whenever the team glow is on (independent of no-PvP). To stop the immunity being used offensively, protected players (and anyone within **25 blocks** of one) are also blocked from placing, priming or detonating PvP explosives — including redstone-primed TNT whose placer is remembered, and dispensers near a protected player firing TNT/lava/fire charges. Flint & steel is restricted by proximity too: a protected player can't ignite anything within 25 blocks of another player, and a non-protected player can't ignite anything within 25 blocks of a protected player (lighting portals while alone still works). No-PvP also can't be switched on while you're in combat. Turning no-PvP *off* starts a **5-minute cooldown** before you can enable it again, and the state persists across restarts so relogging can't bypass it.
|
||
- **Anti-combat-logging** — whenever you hit another player or get hit by one, you're tagged as being in combat for **15 seconds** with a chat warning. Logging off while tagged kills you on the spot and announces it to the server.
|
||
- **TNT punching** — punch primed TNT to knock it around: each hit shoves it away from you (with a little lift) and adds **1 second** to its fuse, up to a **10-second** cap, so you can juggle it. Players with no-PvP on can't knock TNT around.
|
||
- **Cosmetic teams** — `/team create/delete/invite/leave/join/color/admin/glow/chat/symbol`. Teams are purely cosmetic (friendly fire stays on). A team name is its tag and is limited to **4 characters**. The owner runs the show and can promote **admins** who may also invite players and change the colour; membership is request-based rather than open — `/team invite` sends a clickable **"JOIN THEIR TEAM"** button and a join request sends admins a clickable **"ALLOW <player> INTO THE TEAM"** button, so joining takes one click. A team's colour drives the glowing outline of members whose personal glow is on (each member toggles their own with `/team glow`, **off by default**, remembered across restarts). Each member (or anyone, even without a team) also picks their own head symbol with `/team symbol <wither|axe>`. Members show a coloured `[TAG]` **after** their name in chat, the tab list and above their head (the name itself stays white); `/team chat` gives the team a private chat channel. Stored in `plugins/qol-tweaks/teams.yml`. Coloured glow is delivered through scoreboard-team packets, since Folia blocks the normal scoreboard API at runtime.
|
||
- **Tip broadcasts** — a rotating helpful tip is broadcast to everyone every two hours (e.g. how to turn `/nopvp` off, how team glow works, `/team chat`, and switching symbols).
|
||
- **Woodcutting** — wood works in the stonecutter. A log/wood block (including stripped and stem/hyphae variants) cuts into **4 planks**; planks cut into stairs, slabs, fences, fence gates, buttons, signs and hanging signs; and — because a stonecutter can only ever consume one item — the pricier blocks are cut from a whole log instead: 1 log → 2 doors or 2 pressure plates (2 planks each), 1 trapdoor (~4 planks) and 1 boat (bamboo gives a raft; crimson/warped have none). The cutter also strips bark one-for-one: log/wood/stem/hyphae (and bamboo block) → its stripped form. Covers every wood family. No resource pack needed.
|
||
|
||
## Commands
|
||
|
||
| Command | Description | Permission |
|
||
|--------------------------------|----------------------------------------------------------------------|-------------------|
|
||
| `/nopvp` | Toggle no-PvP mode (totem above head while on + optional team-coloured glow). | `qoltweaks.nopvp` |
|
||
| `/team create <name>` | Create a team; the name (max 4 chars) is the tag. | `qoltweaks.team` |
|
||
| `/team invite <p>` | Invite an online player, or accept their join request (owner/admin). | `qoltweaks.team` |
|
||
| `/team join <team>` | Accept an invite, or send a join request to the team. | `qoltweaks.team` |
|
||
| `/team color <clr>` | Set the team glow colour, or `none` to clear (owner/admin). | `qoltweaks.team` |
|
||
| `/team admin <add\|remove> <p>`| Promote/demote a member to admin (owner only). | `qoltweaks.team` |
|
||
| `/team glow` | Toggle your **own** team glow (default off, remembered). | `qoltweaks.team` |
|
||
| `/team symbol <wither\|axe>` | Pick **your own** head symbol shown while no-PvP is off (default axe). | `qoltweaks.team` |
|
||
| `/team chat [message]` | Send a team-only message, or toggle team chat mode. | `qoltweaks.team` |
|
||
| `/team leave` | Leave your team (owners must delete instead). | `qoltweaks.team` |
|
||
| `/team delete` | Disband the whole team (owner only). | `qoltweaks.team` |
|
||
|
||
All permissions default to `true`. Note `/team` takes over the vanilla scoreboard-team command.
|
||
|
||
## Data
|
||
|
||
Player no-PvP state and cooldown timestamps are stored in `plugins/qol-tweaks/nopvp.yml` so they survive restarts and reloads. Teams, ownership, admins, members, colours, each player's glow preference and each player's chosen head symbol are stored in `plugins/qol-tweaks/teams.yml`.
|
||
|
||
## Compatibility
|
||
|
||
- Built against the Paper API and marked `folia-supported: true`, so it runs on both Paper and Folia. Region-aware scheduling is used for persistence writes.
|
||
- Java 25 toolchain.
|
||
|
||
## Building
|
||
|
||
```bash
|
||
./build.sh
|
||
```
|
||
|
||
This just runs `./gradlew build`, but if the pinned Java toolchain isn't installed it will automatically fall back to whatever JDK you do have (keeping the jar's bytecode compatible). You can also pass extra Gradle args, e.g. `./build.sh clean build`.
|
||
|
||
The plugin jar is output to `build/libs/`.
|
||
|
||
## License
|
||
|
||
See [LICENSE](LICENSE).
|