AutoMod
Description
This plugin attempts to do the work of the server admins and moderators automatically allowing them more time to play the game and protecting the server when no staff can be online. Like all of my plugins this was made for use of my public server, and is being release as it seems that there is nothing else that does this.
When a player joins they are watched for a while, more details of what is watched is given below but put basically their play style is analysed to see if it matches that of the common greifer. If they are found to be in violation of one or more of the checks the build permissions are removed, this means that they cannot break or place blocks or in fact interact with anything. It's possible that legit players will be detected, to prevent this being too much of a pain for new players they are offered the chance to use the /build command to ask for their permissions back, this allows the other users on the server to vote if they think the user should have their permissions back. A 100% yes vote means that all of the checks are reset. Permissions can be used to create a trusted group of players that are watched and who can vote.
Bug Reports / Suggestions
If you find a bug, encounter a problem or have a suggestion, please fill out a ticket via the Tickets link above. I do not have the time to read through the comments section, any comment that fits the previous three categories will be ignored.
Does it Work ?
The short answer is that it works on the dumb people, and they happen to be the most irritating. Anyone that has the sense to look a the plugin list will know they just have to dig a large amount of dirt to avoid being detected. Others may try to use alternate account after working out that can break a few blocks per account, hopefully they will get bored.
Checks
Block Types
The main check that is performed is related to the blocks that the player breaks, if they break any unnatural blocks before they become trusted they are given a block place violation. More than 8 of these violations means that they blocked. It's likely that any block that is not generated naturally in the world will be part of a building.
LogBlock
This goes with the above, if the players breaks more than 8 blocks that were placed by another player before becoming trusted they get blocked.
NoCheat
If the player appears to be using some of the common hacks included in griefing clients when breaking a block they are instantly blocked. Data from the plugin NoCheat is used for this check.
Chest Access
If the players removes items from a chest before they are trusted they are blocked.
Permissions
automod.watch.all - Players with this permissions will have all of the available checks performed. Defaults to false.
automod.watch.build - Players with this permission will have the type of blocks that they break analysed. Defaults to false.
automod.watch.logblock - Players with this permission will have the owner of the blocks they break checked. Defaults to false.
automod.watch.nocheat - Players with this permission will have their data from NoCheat analysed. Defaults to false.
automod.watch.chests - Players with this permission will have their chest access watched, if they take items from chests too early on they are blocked. Defaults to false.
automod.admin.vote - Players with this permission will be given the opportunity to vote to give a player their build permission back. (recommended for members or trusted players) Defaults to ops only.
automod.admin.data - Players with this permission can use the /data command to view the data that caused the player to be blocked. This should be given to the players with the vote permission and also defaults to ops only.
automod.admin.lists.all - Allows the player to modify all lists, defaults to ops only.
automod.admin.lists.blocked - Allows the player to modify the blocked player list, defaults to false as it's covered by the above.
automod.admin.lists.trusted - Allows the player to modify the trusted player list, defaults to false as it's covered by the above.
Commands
/build - Used by players to ask for their permissions back.
/vote - Used by trusted players to vote, usage information given in game.
/data - Shows the data that caused the given player to be blocked, useful when voting.
/list - Used to add or remove players from the trusted or blocked list.
/trustallplayers - Adds all players that have ever been on the server to the trusted list, can be useful if you have an established and trusted player base already.
Contributing
Contributions to the project are very much welcome, if you have a feature that you want implemented and know a nice way to do it then consider forking the repo and submitting a pull request. These will be accepted as long as the following simple guidelines are followed.
- Do not edit the structure of the pom.xml file, feel free to add a dependency if you need it but the formatting and structure should not be changed.
- If you are exposing a new API method, add a JavaDoc comment to it, but don't over-comment internal code.
- Follow the existing code style, don't antagonise over every space though !
All dependencies that are used are now available from a public Maven repo, so you don't have to worry about building several other projects just to add a simple change any more.
Source Code
Dev Builds
Changes Since Last Release
Download
Development builds of this project can be acquired at the provided continuous integration server. These builds have not been approved by the BukkitDev staff. Use them at your own risk.
http://bukkit.jacekk.co.uk:8000/job/AutoMod/
@xXSshadowXx
Create a ticket and answer the questions it asks you.
I get the following error spammed in console. If you need further info let me know. I looked for a tickets section but couldn't find it.
00:40:25 [SEVERE] Could not pass event org.bukkit.event.block.BlockBreakEvent to AutoMod java.lang.NullPointerException at uk.co.jacekk.bukkit.automod.tracker.PlayerViolationTracker.getLogBlockViolation(PlayerViolationTracker.java:101) at uk.co.jacekk.bukkit.automod.listener.BlockListener.onBlockBreak(BlockListener.java:140) at org.bukkit.plugin.java.JavaPluginLoader$40.execute(JavaPluginLoader.java:549) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:57) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:327) at net.minecraft.server.ItemInWorldManager.breakBlock(ItemInWorldManager.java:207) at net.minecraft.server.ItemInWorldManager.dig(ItemInWorldManager.java:102) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:507) at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:204) at net.minecraft.server.Packet14BlockDig.handle(SourceFile:43) at net.minecraft.server.NetworkManager.b(NetworkManager.java:226) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:100) at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:587) at net.minecraft.server.NetworkListenThread.a(SourceFile:108) at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:536) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:434) at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)
@wide_load
Thanks!
@CoolOppo
40, a combination of broken and placed.
@wide_load
What is the new amount of blocks? I saw there was an update.
@CoolOppo
64 was picked pretty much at random, it does seem a bit high I guess. Everything will be configurable eventually :)
@wide_load
Oh good! I would love a config to edit it to something like 32, etc. 64 natural blocks before getting to be somewhat trusted seems like a lot.
@CoolOppo
At the moment it is until they have broken a total of 64 blocks, in the future it will be configurable and default to a random (but still sensible) value.
"When a player joins they are watched for a while" How long is a while? Is it just until you do /trustplayer? Or is it an automatic time?
@HuntermHaxx
No.
Could you add HawkEye support?
Sorry, I didn't get notifications abotu all of these comments. Here are some replies :D
@micdoodle8
No, that would be too risky since it sometimes detects legit players. The aim is only damage limitation.
@xRufiSx
That is planned, I have a few more checks to add and then I will make them all configurable.
@Hoot215
Sounds like a sensible command to add so sure :) NoCheat can get the noswing check a bit wrong if the server is lagging or the player has a bad connection. I have never had anyone blocked for that on my server, when I add the config options you will be able to raise the violation level threshold.
@CoolOppo
There is no need to enable logging since it uses the NoCheat API, you will need to make sure that the appropriate checks are enabled in NoCheat's config file though.
There is no Ticket link and I have a report to make :(
This plugin is great, but could you add a command to trust individual players?
EDIT: Also, many players seem to be getting their build rights revoked because of the NoSwing hack, even though I'm sure they're not using it.
Excellent plugin!! Works very well. Looking forward to configuration options
Will this auto-rollback if they are denied build rights after a vote?
@wide_load
Awesome! Another question, do I have to have NoCheat logging active for the NoCheat portion to work?
@CoolOppo
It will only work for new players, I sort of assumed that everyone would have a members group that they would just not give the watch permission too.
I can add a command to trust all players that have been on the server which should help. :)
Also, I have a question. Does this check players that have been on the server before you install this plugin? Because it would be really hard to have to /setbuild all of my pre-existing users when I install this. If it doesn't, could it take the players from the world folder and do that maybe?
@CoolOppo
Yeah that should be possible, I hacked this together in a few hours after my server's IP got posted on a greifing forum and every time I went online the map was destroyed.
I'm not sure I like the idea of banning people fully since it does sometimes detect legit players as greifing, usually when someone invites their friend on and they give them blocks or start working on the same building.
If it's configurable though this would be up to the server admin :)
To sum up, a config file is a planned addition and making a configurable command be executed when a player is detected seems like a good idea :)