GriefPrevention for Minecraft

in #utopian-io3 years ago (edited)

Automatically prevent all types of grief!

GriefPrevention is a Minecraft plugin designed to protect servers from grief.

History

Before I begin explaining the history of this project, it is important to understand some keywords.

  • Forge: a community driven minecraft modding platform focused on both client and server.

  • Sponge : a community driven minecraft modding platform currently focused on servers.

  • SpongeForge: part of the Sponge ecosystem designed as a coremod for Forge. It essentially gives Forge servers the ability to run Sponge plugins as well as use all the enhancements that Sponge adds such as performance.

  • SpongeVanilla: part of the Sponge ecosystem designed as a vanilla server replacement in order to run Sponge plugins.

  • SpongeAPI: a minecraft API designed from the ground up with mods in mind. It is different from Bukkit API in that it doesn't have hooks for vanilla only features but rather generic hooks to allow for mod support.

  • Bukkit : a minecraft API that allows developers to expand the functionality via plugins.

  • WorldGuard: a Bukkit plugin designed to protect regions.

  • MCPC/Cauldron: a minecraft server replacement that hooked into both Forge and CraftBukkit in order to allow both mods and bukkit plugins to run together. This project ended at the same time of CraftBukkit back in 2014.

GriefPrevention was originally created by BigScary for the Bukkit platform and is currently being maintained on a fork located here.

Back in October 2015, I reached out to BigScary to see if he would port his project to the Sponge platform. He explained how he had no time to take on another project but had no problem if I was able to port it. Sponge is another project I originally started with sk89q. It's essentially the replacement for what MCPC/Cauldron used to be but far better due to all the talented developers we have acquired over the years. As one of the Sponge leads, we desperately needed a plugin to protect sponge servers from grief so I decided to take on the task of porting GriefPrevention.

The Sponge version of GriefPrevention is now mostly rewritten due to the need of supporting mods and all the extra features I have added along the years. However, it does attempt at keeping the original look/feel intact for Bukkit users that come to Sponge.

Introduction

GriefPrevention, for Sponge, is a plugin that provides self-service region protection functionality, giving you additional options to fine tune aspects such as door, chest, and build permissions for users or groups of users! Below are some basic instructions for claim management.

Claim

A claim represents an area or volume of blocks for protection. You create claims by using a golden shovel (configurable) or using WorldEdit and using the /claim command. Once created a user can setup flags, trust, permissions, options, and more to protect their claim.

There are 5 Types of claim's :

  • Admin - A claim designed for admins that can be created around any other type of player claim. Creating an admin claim around another claim allows the admin to force protection settings to all claims within it. Admin claims have no size limitations and are immune to expirations.
  • Basic - The default claim used by players. It supports subdivisions.
  • Subdivision - A subdivision is a claim within
  • Town - A claim designed for players to manage other basic claims. It currently supports any type of player claim within it. With town claims, players inside the town gain the Town Chat feature which allows everyone within town to chat with eachother. The town owner controls all claims within except for admin claims.
  • Wilderness - A global claim that covers all land not claimed by players. There is only 1 wilderness claim per world that cannot be deleted. It is used to manage protection in all unclaimed land. It is also used for global bans that affect all claims.

There are 2 different claim creation modes which define how the claim is shaped :

  • 2D - Claims the area from bedrock to sky.

2D default
2D

2D WECUI
2D w/ WECUI

  • 3D(Cuboid) - In 3D mode the Y-level is set depending on where exactly you clicked allowing for more control over your exact claim size.

3D default
3D

3D WECUI
3D w/ WECUI

To switch between modes use /cuboidclaims

For a player to claim an area or volume, they need the permissions and enough claim blocks for the size of their claim which can be configured with Options.

Golden Shovel

You create claims with a golden shovel (configurable), which can also change claim size and position.

  • Creating a new claim: Right click at two points to mark the corners
  • Resizing a claim: Right click once in an existing claim to see the markers. Right click on a corner block and then again on a different position to move that corner.
  • Cancelling operations: Putting away a golden shovel without completing an operation cancels all actions

Wooden stick

Basic tool, you can use it to indicate the position of claims, and identify who the owners of the claims are.

  • Right clicking shows existing claim locations
  • Shift right clicking searches for all claims in a 100 block radius and shows their location
  • Left clicking hides the markers

Trust

The trust system is designed for basic protection management. Trust can be given to a specific player or group of players.
There are four different types of trust: Accessors, Builders, Containers, and Managers.

Accessor

Access trust allows a player to interact with any other non-inventory block.

Example: Lever, Door, Piston

Container

Container trust includes access with the addition of inventory blocks.

Builder

Build trust includes container with the addition of allowing the player to place and break blocks.

Manager

Manager trust includes builder with the addition of editing the claim such as resizes. It does not allow the player to delete a claim. Only the owner can do this.

For more information, see Trust System

Flags

Flag Preview

The flag system is designed for advanced protection. Flags can be applied to players, groups, or claims directly.

A list of all current flags can be found here :
API Flags

The flag system is similar to WorldGuard but more advanced as it is more generic in order to support mods. The biggest change is the ability to define sources. Sources allow a player to control protection based on the source of the event. For example, a player can prevent enderman from placing blocks by specifying minecraft:enderman as a source. This makes the system more efficient as it avoids having to add a new flag just to handle a specific source.

To make it easier to manage flags, I created a clickable chat interface to quickly modify flags as well as check current settings.

Here is a screenshot showing the /cf command screen

Chat Interface

For more information, see Flags

Options

Options are a way to configure plugins using player/group contexts through your permission system, this gives you the benefit of being able to set different settings for different players, groups, worlds etc.

GriefPrevention makes use of this permissions feature by giving the player the ability to apply claim options to a player, group, or specific claim.

For example, the option griefprevention.blocks-accrued-per-hour controls how many blocks a player accumulates as they play. An admin could adjust this option for their VIP rank providing a greater incentive to become a VIP.

For a full list of options, see Advanced Options

Bans

GriefPrevention supports global bans with the addition of showing a player the reason why the ban is in place.
Below is a screenshot showing an active ban.

Ban Preview

API

GriefPrevention provides a near complete API for developers to create plugins that extend functionality or hook into GP for server specific needs.

API source

One GP plugin that extends functionality for sky claiming is SkyClaims.

Config

GriefPrevention's default config offers extended customization for your server. An admin can override specific config settings for a specific world or dimension such as default claim flags, user allowed flags, and protection modules.

Modular Configuration

GriefPrevention allows for admins to control each protection module on their server. The protection modules can be broken down into the following categories :

  • Block-Changes: block-break, block-place
  • Collisions: collide-block, collide-entity
  • Commands: command-execute, command-execute-pvp
  • Movements: enter-claim, exit-claim
  • Entity: entity-damage, entity-riding, entity-spawn, entity-teleport-from, entity-teleport-to
  • Explosions: explosion, explosion-surface
  • Fire-Spread: fire-spread
  • Interacts: interact-block-primary, interact-block-secondary, interact-entity-primary, interact-entity-secondary, interact-inventory, interact-inventory-click, interact-item-primary, interact-item-secondary
  • Item: item-drop, item-pickup, item-spawn, item-use
  • Liquids: liquid-flow
  • Portals: portal-use
  • Projectiles: projectile-impact-block, projectile-impact-entity

Here is how it looks in configuration

Config Preview

For more information, see Global Config

WECUI

WorldEdit CUI is a client-side mod that provides enhanced visuals for WorldEdit. GriefPrevention worked closely with Mumfrey to be able to use the same visuals for claims. When it is installed onto the client, it will replace the default visuals as shown below.

WECUI Preview

Note: In order for WECUI to work properly, the server must be running WorldEdit and the client must be using the liteloader version of WECUI.

For more information, see WECUI Improved Visuals

Debugging

GriefPrevention comes equipped with its own debugging tool. You simply use the /gpdebug record [playername] command to record actions for a specific user or all. When done, you simply type /gpdebug paste which will generate a gist output as shown below.

Debug Output

Technical

GriefPrevention for Sponge was created in October 2015 and is still being maintained today. It only works on the Sponge platform. If you are using the Bukkit platform, check the Original Plugin link below.

Download
Source
Wiki
Original Plugin
Original Video
Discord
Support Me

Requires Java 8+ , LuckPerms, SpongeForge or SpongeVanilla

Note: If using SpongeForge, it will also require Forge.
For more information on how to install, see Getting Started

Roadmap

The next big feature will be schematic support. Schematics will allow admins to backup and restore claim states for things like server events. It also will be used to restore a claim to its natural state after it has expired.

How to contribute?

If you want to contribute to the project, you can one of two things :

  • Create a PR on github.
  • Contact me on Discord to discuss your ideas.



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

Great post that explains your project. Minecraft is of course a great breading ground for developers.

I see plenty of development in the past two week, and I would encourage you to write your future posts on specific contributions that were done within the past two week as well.

Please add a README.md file for the repo with the purpose and how to build the project and how to contribute. (Most of that is in this post!)

You can contact us on Discord.
[utopian-moderator]

Hey @helo, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!

Thank you for the support! I have added a README.md file as you requested. I will make sure to include recent contributions in future posts. Please let me know if there is anything else you need.

Great job with that and welcome on Steemit =)
Let's ignore cheetah on this one since the original wiki has been written by you anyway and it wouldn't make any sense to rewrite it with different words.

Thanks! I spent a lot of time on it. Correct, I took a few things from my wiki so I didn't have to rewrite it. I also link the wiki under Technical in case readers need more in-depth information.

Glad to have you on here and looking forward to seeing more MC devs on steem!

Thanks! Glad to be on here.

We need more mod developer :>

Cheetah bite you

Dont worry, Need help?

Read the article

You should know about cheetah



Congratulations, this post was rewarded with a SteemGC Upvote!

Want to meet fellow Steemit gamers and earn upvotes yourself? Join the SteemGC Discord channel!
Or interested in competing in our first community CS:GO tournament!?

Hey @bloodmc I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • This is your first accepted contribution here in Utopian. Welcome!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x