|
| 1 | +<div align="center"> |
| 2 | +<h1>WorldUtils</h1> |
| 3 | + |
| 4 | +[](https://github.com/StarCodeClub/WorldUtils) [](https://github.com/StarCodeClub/WorldUtils/releases) [](https://www.spigotmc.org/) [](https://papermc.io/downloads/folia) [](LICENSE) |
| 5 | + |
| 6 | +<h4>A plugin for high-version Paper, Folia Minecraft servers, providing many practical world-related features and settings</h4> |
| 7 | +</div> |
| 8 | + |
| 9 | +> [!WARNING] |
| 10 | +> |
| 11 | +> This plugin does not yet support multiple languages and currently only has a Simplified Chinese version. |
| 12 | +> If you are a user of other languages, please wait for further updates. |
| 13 | +
|
| 14 | +## ✨ Features |
| 15 | + |
| 16 | +- **🔧 Flexible**: Hierarchical configuration system with support for configuration inheritance, making feature settings simple and clear |
| 17 | +- **🔒 World Protection**: Provides 9 types of world protection |
| 18 | +- **🌍 Independent World Properties**: Set separate GameMode for each world |
| 19 | +- **💬 Messages**: Supports next-generation MiniMessage format, ActionBar notifications for players are more elegant, optimized for frequent triggers |
| 20 | +- **⚡ High Performance**: Extremely lightweight, no redundant code, plugin size only 65KB |
| 21 | +- **🎯 Permission System**: Fine-grained permission control, supports using permissions to bypass specific protections |
| 22 | + |
| 23 | +## 🚀 Quick Start |
| 24 | + |
| 25 | +### 1. Using Pre-compiled Binaries |
| 26 | +**Visit [Releases](https://github.com/StarCodeClub/WorldUtils/releases) to get the latest pre-compiled version** |
| 27 | + |
| 28 | +### 2. Build Yourself |
| 29 | + |
| 30 | +- **Java 21** or higher |
| 31 | +- **Maven 3.6+** (only required for compilation) |
| 32 | + |
| 33 | +1. Clone the repository: |
| 34 | +```bash |
| 35 | +git clone https://github.com/StarCodeClub/WorldUtils.git |
| 36 | +cd WorldUtils |
| 37 | +``` |
| 38 | + |
| 39 | +2. Compile the plugin: |
| 40 | +```bash |
| 41 | +mvn clean package |
| 42 | +``` |
| 43 | + |
| 44 | +3. After compilation, find `WorldUtils-1.3.0-SNAPSHOT.jar` in the `target/` directory |
| 45 | + |
| 46 | +## 📖 Usage |
| 47 | + |
| 48 | +### Configuration File Structure |
| 49 | + |
| 50 | +```yaml |
| 51 | +# Plugin prefix (MiniMessage format) |
| 52 | +plugin-prefix: "<shadow:#000000FF><gradient:#ff7300:#ff3c00><b>[WU]</b></gradient></shadow>" |
| 53 | + |
| 54 | +# World configuration files |
| 55 | +configs: |
| 56 | + # The configuration file must include the default node, please do not delete!!! |
| 57 | + default: |
| 58 | + # Prevent players from modifying the world (placing blocks, filling with water/lava, placing paintings, modifying item frames and flower pots...) |
| 59 | + anti-world-edit: false |
| 60 | + # Prevent players from PVP (players damaging each other) |
| 61 | + anti-pvp: false |
| 62 | + # Prevent players from entering the world (cannot be intercepted immediately on Folia, but will be teleported to Fallback World within 2s) |
| 63 | + anti-player-enter: false |
| 64 | + # If a player is found in a world where entry is prohibited, the player will be teleported to that world's spawn point |
| 65 | + world-enter-fallback: "world" |
| 66 | + # Make explosions not destroy blocks in this world (EntityExplodeEvent) |
| 67 | + anti-explosion: false |
| 68 | + # Prevent players from interacting with blocks in this world (opening containers, using workbenches, etc.) (PlayerInteractEvent) |
| 69 | + anti-block-interaction: false |
| 70 | + # Prevent players from using items in this world (throwing snowballs, eggs, shooting arrows, using spawn eggs, etc.) |
| 71 | + anti-use-item: false |
| 72 | + # Prevent players from attacking entities in this world (does not include player vs player damage) |
| 73 | + anti-attack-entity: false |
| 74 | + # Prevent players from interacting with entities in this world (riding mounts, trading with villagers, etc.) (onPlayerInteractEntity) |
| 75 | + anti-entity-interaction: false |
| 76 | + # Prevent players from picking up or dropping items in this world (PlayerPickupItemEvent, PlayerDropItemEvent) |
| 77 | + anti-pickup-drop-items: false |
| 78 | + |
| 79 | + # Set separate game mode for each world, leave empty to not change |
| 80 | + world-gamemode: "" |
| 81 | + # Force maintain player's game mode in this world |
| 82 | + # Requires world-gamemode to be set to take effect |
| 83 | + force-world-gamemode: false |
| 84 | + |
| 85 | + # ActionBar notification displayed when player lacks permission (MiniMessage format) |
| 86 | + # Optimized for frequent triggers, will only send once within 1s, fill with empty string "" to not send to player |
| 87 | + message: |
| 88 | + anti-world-edit: "{plugin-prefix} <red>You don't have permission to modify this world.</red>" |
| 89 | + anti-pvp: "{plugin-prefix} <red>PVP is disabled in this world.</red>" |
| 90 | + # ... other messages |
| 91 | + |
| 92 | + # Inheritance configuration example |
| 93 | + common: |
| 94 | + parent: default # Inherit default configuration |
| 95 | + anti-world-edit: true |
| 96 | + anti-explosion: true |
| 97 | + |
| 98 | + hub-config: |
| 99 | + parent: common # Inherit common configuration |
| 100 | + anti-block-interaction: true |
| 101 | + anti-attack-entity: true |
| 102 | + |
| 103 | +# Specify which worlds use which configuration |
| 104 | +world-config: |
| 105 | + "world": common # world world uses common configuration |
| 106 | + "hub": hub-config # hub world uses hub-config configuration |
| 107 | + "world_the_end": disable # Disable WorldUtils in this world |
| 108 | +``` |
| 109 | +
|
| 110 | +### Feature Description |
| 111 | +
|
| 112 | +| Protection Type | Description | Covered Events | Folia Support | |
| 113 | +|---------------------------|--------------------------|--------------------------------------------------|----------------------------------------| |
| 114 | +| `anti-world-edit` | Prevent world modification| Prevent block placement/destruction, bucket operations, painting/item frame interaction | Full support✅ | |
| 115 | +| `anti-pvp` | Prevent player combat | Cancel damage between players | Full support✅ | |
| 116 | +| `anti-player-enter` | Prevent world entry | Intercept world switching teleportation | Cannot intercept immediately, but can teleport to fallback world within 2s | |
| 117 | +| `anti-explosion` | Prevent explosion block damage | Prevent TNT, creeper, fireball explosions (non-entity damage) | Full support✅ | |
| 118 | +| `anti-block-interaction` | Prevent block interaction | Intercept opening containers, using workbenches, etc. | Full support✅ | |
| 119 | +| `anti-attack-entity` | Prevent entity attack | Prevent attacking or killing non-player entities | Full support✅ | |
| 120 | +| `anti-entity-interaction` | Prevent entity interaction| Intercept riding mounts, using leads, trading with villagers, etc. | Full support✅ | |
| 121 | +| `anti-pickup-drop-items` | Prevent item pickup/drop | Prevent players from picking up or dropping items in this world | Full support✅ | |
| 122 | +| `anti-use-item` | Prevent item usage | Intercept throwing snowballs, eggs, shooting arrows, using spawn eggs, etc. | Full support✅ | |
| 123 | +| `world-gamemode` | Independent world game mode| Change game mode when switching worlds | Full support✅ | |
| 124 | + |
| 125 | +## 🎮 Commands & Permissions |
| 126 | + |
| 127 | +### Command List |
| 128 | + |
| 129 | +| Command | Description | Permission | |
| 130 | +|---------------------------------------------------|----------------------------|--------------| |
| 131 | +| `/wu help` | Show help information | `wu.admin` | |
| 132 | +| `/wu status` | View protection settings overview | `wu.admin` | |
| 133 | +| `/wu status <world>` | View specified world protection settings | `wu.admin` | |
| 134 | +| `/wu set-config <world> <protect_config/disable>` | Switch world protection configuration | `wu.admin` | |
| 135 | +| `/wu reload` | Reload configuration file | `wu.admin` | |
| 136 | +| `/wu version` | Show plugin version | `wu.admin` | |
| 137 | + |
| 138 | +### Permission System |
| 139 | +This plugin has no default permissions |
| 140 | +#### Admin Permissions |
| 141 | +- `wu.admin` - Use all /wu commands (default: OP) |
| 142 | + |
| 143 | +#### Bypass Permissions |
| 144 | +- `wu.bypass.*` - Bypass all world protections (default: OP) |
| 145 | +- `wu.bypass.<world>.anti-world-edit` - Bypass world edit protection in specified world |
| 146 | +- `wu.bypass.<world>.anti-pvp` - Bypass PVP protection in specified world |
| 147 | +- `wu.bypass.<world>.anti-player-enter` - Bypass entry protection in specified world |
| 148 | +- `wu.bypass.<world>.anti-block-interaction` - Bypass block interaction protection in specified world |
| 149 | +- `wu.bypass.<world>.anti-attack-entity` - Bypass entity attack protection in specified world |
| 150 | +- `wu.bypass.<world>.anti-entity-interaction` - Bypass entity interaction protection in specified world |
| 151 | +- `wu.bypass.<world>.anti-pickup-drop-items` - Bypass item pickup/drop protection in specified world |
| 152 | +- `wu.bypass.<world>.anti-use-item` - Bypass item usage protection in specified world |
| 153 | +- `wu.bypass.change-gamemode` - With this permission, WU will not modify your game mode |
| 154 | +--- |
| 155 | + |
| 156 | +If you encounter problems or have feature suggestions, please submit them at [GitHub Issues](https://github.com/StarCodeClub/WorldUtils/issues). |
| 157 | +This project is licensed under the MIT License, see [LICENSE](LICENSE) file for details. |
0 commit comments