Skip to content

poggit-orphanage/WorldProtect

 
 

Repository files navigation

NO LONGER MAINTAINED! -> Please use WorldDefend by @Taylor-pm-pl

THIS PLUGIN IS OUTDATED AND NO LONGER MAINTAINED!






WorldProtect

  • Summary: protect worlds from griefers, pvp, limits and borders
  • PocketMine-MP version: 4.0.0
  • DependencyPlugins: N/A
  • OptionalPlugins: SimpleAuth, BasicHUD
  • Categories: Anti-Griefing
  • Plugin Access: Commands, Data Saving, World Editing
  • Website: https://github.com/poggit-orphanage/WorldProtect

Overview

DO NOT POST QUESTIONS/BUG-REPORTS/REQUESTS IN THE REVIEWS

It is difficult to carry a conversation in the reviews. If you have a question/bug-report/request please use the Issue Tracker for that. You are more likely to get a response and help that way.

NOTE:

This documentation was last updated for version 3.0.0.

Please go to github for the most up-to-date documentation.

You can also download this plugin from this page.

A fully featured World protection plugin.

Features:

  • Ban commands on a per world basis
  • Per world game modes
  • Limit the number of players in a world
  • Control explosions per world
  • Unbreakable blocks
  • World borders
  • Automatically displayed/per world MOTD
  • Protect worlds from building/block breaking
  • Per World PvP
  • Ban specific items in a world

All commands require a world name to be given, otherwise a default is selected. If in-game, the default world is the world the player is currently in. On the console the default is the default-world as specified in the server.properties file.

Basic Usage

Main Commands

  • /motd: Shows the world's motd text
  • /worldprotect: Main WorldProtect command

Sub Commands

  • add: Add player to the authorized list
  • bancmd|unbancmd: Prevents commands to be used in worlds
  • banitem|unbanitem: Control items that can/cannot be used
  • border: defines a border for a world
  • gm: Configures per world game modes
  • lock: Locks world, not even Op can use.
  • ls: List info on world protection.
  • max: Limits the number of players per world
  • motd: Modifies the world's motd text.
  • noexplode: Stops explosions in a world
  • protect: Protects world, only certain players can build.
  • pvp: Controls PvP in a world
  • rm: Removes player from the authorized list
  • unbreakable|breakable: Control blocks that can/cannot be broken
  • unlock: Removes protection

Modules

  • gm-save-inv: Will save inventory contents when switching gamemodes.

Documentation

This plugin allows you limit what happens in a world.

It is possible to create limits in your limitless worlds. So players are not able to go beyond a preset border. This is useful if you want to avoid overloading the server by generating new Terrain.

Show a text file when players enter a world. To explain players what is allowed (or not allowed) in specific worlds. For example, you could warn players when they are entering a PvP world.

This plugin protects worlds from griefers by restricing placing and breaking blocks. Worlds have three protection levels:

  • unlock - anybody can place/break blocks
  • protect - players in the authorized list or, if the list is empty, players with worldprotect.cmd.protect.auth permission can place/break blocks.
  • lock - nobody (even ops) is allowed to place/break blocks.

Some items are able to modify a world by being consumed (i.e. do not need to be placed). For example, bonemeal, water or lava buckets. To prevent this type of griefing, you can use the banitem feature.

Command Reference

The following commands are available:

  • /motd: Shows the world's motd text
    usage: /motd [world]

    Shows the motd text of a world. This can be used to show rules around a world.

  • /worldprotect: Main WorldProtect command
    usage: /worldprotect [world] <subcmd> [options]

  • add: Add player to the authorized list
    usage: /worldprotect [world] add <player>

  • bancmd|unbancmd: Prevents commands to be used in worlds
    usage: /worldprotect [world] bancmd|unbancmd [command]

    If no commands are given it will show a list of banned commands. The command will be added/removed from the ban list otherwise.

  • banitem|unbanitem: Control itmes that can/cannot be used
    usage: /worldprotect [world] banitem|unbanitem [Item-ids]

    Manages which Items can or can not be used in a given world. You can get a list of items currently banned if you do not specify any [item-ids]. These are added or removed from the list otherwise.

  • border: defines a border for a world
    usage: /worldprotect [world] border [range|none|x1 z1 x2 z2]

    Defines a border for an otherwise infinite world. Usage:

    • /worldprotect [world] border
      • will show the current borders for [world].
    • /worldprotect [world] border x1 z1 x2 z2
      • define the border as the region defined by x1,z1 and x2,z2.
    • /worldprotect [world] border range
      • define the border as being range blocks in x and z axis away from the spawn point.
    • /worldprotect [world] border none
      • Remove borders
  • gm: Configures per world game modes
    usage: /worldprotect [world] gm [value]

    Options:

    • /worldprotect [world] gm
      • show current gamemode
    • /worldprotect [world] gm <mode>
      • Sets the world gamemode to mode
    • /worldprotect [world] gm none
      • Removes per world game mode
  • lock: Locks world, not even Op can use.
    usage: /worldprotect [world] lock

  • ls: List info on world protection.
    usage: /worldprotect ls [world]

    • /worldprotect ls
      • shows an overview of protections applied to all loaded worlds
    • /worldprotect ls [world]
      • lists details of a specific world
  • max: Limits the number of players per world
    usage : /worldprotect [world] max [value]

    • /worldprotect [world] max
      • shows the current limit
    • /worldprotect [world] max value
      • Sets limit value to value.
    • /worldprotect [world] max 0
      • Removes world limits
  • motd: Modifies the world's motd text.
    usage: /worldprotect [world] motd <text>

    Allows you to modify the world's motd text. The command only supports a single line, however you can modify the motd text by editing the wpcfg.yml file that is stored in the world folder. For example:

    • [CODE]
      • motd:
        • line 1
        • line 2
        • line 3
        • line 4... etc
    • [/CODE]
  • noexplode: Stops explosions in a world
    usage: /worldprotect [world] noexplode [off|world|spawn]

    • /worldprotect [world] noexplode off
      • no-explode feature is off, so explosions are allowed.
    • /worldprotect [world] noexplode world
      • no explosions allowed in the whole world.
    • /worldprotect [world] noexplode spawn
      • no explosions allowed in the world's spawn area.
  • protect: Protects world, only certain players can build.
    usage: /worldprotect [world] protect

    When in this mode, only players in the authorized list can build. If there is no authorized list, it will use worldprotect.cmd.protect.auth permission instead.

  • pvp: Controls PvP in a world
    usage: /worldprotect [world] pvp [on|off|spawn-off]

    • /worldprotect [world] pvp off
      • no PvP is allowed.
    • /worldprotect [world] pvp on
      • PvP is allowed
    • /worldprotect [world] pvp spawn-off
      • PvP is allowed except if inside the spawn area.
  • rm: Removes player from the authorized list
    usage: /worldprotect [world] rm <player>

  • unbreakable|breakable: Control blocks that can/cannot be broken
    usage: /worldprotect [world] breakable|unbreakable [block-ids]

    Manages which blocks can or can not be broken in a given world. You can get a list of blocks currently set to unbreakable if you do not specify any [block-ids]. Otherwise these are added or removed from the list.

  • unlock: Removes protection
    usage: /worldprotect [world] unlock

Module reference

gm-save-inv

Will save inventory contents when switching gamemodes.

This is useful for when you have per world game modes so that players going from a survival world to a creative world and back do not loose their inventory.

Configuration

Configuration is through the config.yml file. The following sections are defined.

features

This section you can enable/disable modules. You do this in order to avoid conflicts between different PocketMine-MP plugins. It has one line per feature:

feature: true|false

If true the feature is enabled. if false the feature is disabled.

motd

  • ticks: line delay when showing multi-line motd texts.
  • auto-motd: Automatically shows motd when entering world

Permission Nodes

  • worldprotect.motd: Display MOTD
  • worldprotect.cmd.all (op): Allow access to protect command
  • worldprotect.cmd.protect (op): Change protect mode
  • worldprotect.cmd.protect.auth (op): Permit place/destroy in protected worlds
  • worldprotect.cmd.border (op): Allow contfol of border functionality
  • worldprotect.cmd.pvp (op): Allow PvP controls
  • worldprotect.cmd.noexplode (op): Allow NoExplode controls
  • worldprotect.cmd.limit (op): Allow control to limit functionality
  • worldprotect.cmd.wpmotd (op): Allow editing the motd
  • worldprotect.cmd.addrm (op): Allow modifying the auth list
  • worldprotect.cmd.unbreakable (op): Modify unbreakable block list
  • worldprotect.cmd.bancmd (op): Ban/unban commands
  • worldprotect.cmd.banitem (op): Ban/unban items
  • worldprotect.banitem.exempt (disabled): it is able to use banned items
  • worldprotect.cmd.info: Show WP config info
  • worldprotect.cmd.gm (op): Allow setting a per-world gamemode
  • worldprotect.cmd.gm.exempt (disabled): Users with this permissions will ignore per world gm

Translations

This plugin will honour the server language configuration. The languages currently available are:

  • English
  • Spanish

You can provide your own message file by creating a file called messages.ini in the plugin config directory. Check github for sample files. Alternatively, if you have GrabBag v2.3 installed, you can create an empty messages.ini using the command:

 pm dumpmsgs WorldProtect [lang]

API

There is a minimal API to determine the max number of players per world:

$this->getServer()->getPluginManager()->getPlugin("WorldProtect")->getMaxPlayers($world);

Where:

  • $this - plugin pointer
  • $world - either a world name or an instance of World.

Returns an integer or null.

FAQ

  • Q: How do I keep my inventory so that it does not get clear when I switch gamemodes?
  • A: Enable gm-save-inv module.

Changes

  • 3.0.0: Update to API 4.0.0
    • Fixed inventory saving when switching gamemodes
    • Typehinted and return typed all methods
  • 2.3.0: Updated to API 2.0.0
    • Added banitem exempted permissions (@BobbyTowers)
    • Closes #47 (@SleepSpace9)
  • 2.2.0: minor Update
    • Implemented banned commands (@Tolo)
    • Documentation update
  • 2.1.2: bug fix
    • Load/Unload events were not being registered (Bug reported by @GuddaJ)
  • 2.1.1: minor Update
    • updated to libcommon 1.2.0dev2
      • Upgraded to ItemName module
      • permissions defined in plugin.yml are applied properly which means most sub commands are now OP only.
  • 2.1.0: API
    • Added API to determine max players
  • 2.0.3: Minor bug fix
    • Fixed bug: Configuration is not applied when reloading
  • 2.0.2: Feature request
    • Feature Request(@Nifo2000): Option to control if MOTD is shown automatically
  • 2.0.1: critical bug fix
    • Fixed a crash
    • Can now add to auth list when players are off-line
  • 2.0.0: Complete re-write
    • Refactor so it is now more modular
    • Added per world gamemode and gamemode inventory save
    • Added banitem functionality
    • Added translation: Spanish
  • 1.2.4: CallbackTask
    • Removed CallbackTask deprecation warnings
  • 1.2.3: Suggested change
    • Simpler border setting using a single "range" number
  • 1.2.2: protection overview (un-published)
    • Added an overview of protected worlds
  • 1.2.1: BugFix
    • Positions are not configured correctly.
  • 1.2.0: Update
    • Bugfix in sending motd text
    • Bugfixes WpProtect
    • wp ls/ld - will call ManyWorlds. Needs ManyWorlds v1.3.2.
    • Fixed Signs Tiles being left all over...
    • Added stop PvP in spawn areas
    • Added Unbreakable blocks
    • Max players per world should now work without ManyWorlds.
  • 1.1.1 : bugfix
  • 1.1.0: no-explode
    • Added NoExplode functionality
    • Fixed stupid typo about /mw subcommands
  • 1.0.0 : Initial release

Copyright

WorldProtect
Copyright (C) 2015 Alejandro Liu
All Rights Reserved.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

Packages

No packages published

Languages

  • PHP 100.0%