EasyRules
EASYRULES is a simple plugin with no Permissions and one easy command /rules. By using txt file rather than a yaml, server admins can make changes to the txt file upload and see the changes immediately. No need to reload or restart.
There is just one simple command /rules
Rules.txt
Within the folder /plugins/rules is the rules.txt file. There 2 settings you can adjust.
- Joinmessage, which will broadcast a quick message to all users when they join
- Prefix, this is what will appear before all messages.
- Both of these settings support Color.
Categories
Categories are added by creating a tag, like so [towns] The main category is ironically [main] and is the default /rules category show when you enter /rules
Here is an example WITHOUT color
[main]List of pages: (usage: /rules <page 1-X> ) [main]Page 1: General - Main rules of this server. [main]Page 2: Building - Do's and Dont's. [1]~~~~~General rules of the server. [1]- No griefing / stealing [2]~~~~~Rules about building [2]- Realistic building, no floating buildings etc.
Doing /rules will show the main section
[main]List of pages: (usage: /rules <page 1-X> ) [main]Page 1: General - Main rules of this server. [main]Page 2: Building - Do's and Dont's.
Doing /rules 1 will show the General Section I created.
[1]~~~~~General rules of the server. [1]- No griefing / stealing
Hidden Categories
You are NOT limited to using Numbers for your categories. You can use Words as well, and they DO NOT have to me in the [main] category to work.
For instance, if you use TOWNY, you might want to allow each town to have their own set of rules. I have a town called WhiteWater and a town named terra firma.
If a player does /rules terrafirma this is what why will see
[terrafirma]~~~~~~ Terra Firma Town Rules\\ [terrafirma]- &eOnly the Best Builders may join this town.\\ [terrafirma]- &2You can build anywhere you like, just dont destroy &cANYTHING\\ [terrafirma]- &eThere is no spawn point, so make sure you set a home.\\ [terrafirma]!!!! &4Do Not Spawn Items for Building &f(if you are a mod)\\
[whitewater] No cobblestone or dirt houses. Try best to stay away from building completely plank houses or 1 material houses. \\ [whitewater] No greifing or annoying other players of the town.\\ [whitewater] &2Vote, &eVote &rand &cVote. Vote for the server as much as possible, I will like you more.\\ [whitewater] Listen to rule 1 and 2\\
Colors
Adding color.
NEW
- &n Underline
- &l Bold text
- &m Strike-through
- &k Same as &k
- &o Italics
When to use &f and &r
If you make a rule that uses a color and a font edit together and you want to keep the font edit, but not the color, then you should use &f
&6 &l THIS TEXT will be gold and bold.&f NOW it will be bold and white.
You can use &r to turn off the font edits
&6 &l THIS TEXT will be gold and bold.&r NOW it will be JUST white.
An example Without colors
[main]List of pages: (usage: /rules <page 1-X>) [main]Page 1: General - Main rules of this server. [main]Page 2: Building - Do's and Dont's.
An example With colors
[main]List of pages: &c(usage: &b/rules <page 1-X> &c) [main]Page &b1: &bGeneral - &6Main rules of this server. [main]Page &b2: &bBuilding - &6Do's and Dont's.
Example Config
If you would like to see my Config and work with it, feel free.
Important
You do not need to reload the plugin for changes to the rules.txt file to take place.
Edit the file, upload the file and it will APPEAR!
Using With CommandBook V2.0
If you want to use this with Commandbook, you will need to disable the rules function in Commandbook.
Like so....
components: disabled: - stored-messages
Stored-messages is where Commandbook rules are enabled. So if you disable it, you can use EasyRules instead.
FAQ
Version 2.0 has a new file called info. This is used for basic server info. The ingame command is /faq to make sure there are no conflicts with commandbook or essentials
Here is an example, which also shows the new characters. Please note that you CAN combine color and font codes.
Changelog
V2.1
- Standardize Colors
- YOU WILL HAVE TO UPDATE YOUR RULES FILE IF YOU USE THIS VERSION V2.0
- text wrap works correctly
- added new font codes
- added info.txt and /faq command
Is there a way to remove the prefix?
A no-bullshit plugin to easily create a list of rules. Very nice.
@JerethKhan
sorry for the late reply but please do send it along when you do ;-)
@kwilson7770 @ColonelJohn @Markyroson
It was a bit confusing. The format he provides uses format codes that no longer work. Use this format and edit from there.
http://pastebin.com/bdeS1Jqq
I've looked into the code and it should work on any MC version so no one would need to take it over. I have 2.1 running on Spigot 1.8.1 with no errors.
I'm going to modifying it to also be able to also take over /warps, /help, and /pages but those are additions and not actually updates to the core code. I suppose if anyone wants it when I'm done I can e-mail the the jar file.
@Markyroson
Agree. This needs to be updated or someone needs to take over the development. There is no option to disable the welcome message and the info.txt is not documented on how to use
Please update this!
Can someone please give example coding for the faq page(info.txt)? I tried to use the same coding template as with the rules.txt but it didn't work. I am not sure how you expect people to do the faq page if you do not tell us how too.
Other than that, great plugin and I love it! Please keep up the good work! :-)
Hello, long time user and fan of your script. I'm getting the same error that Cosalert was getting.
But my rules.txt has proper: joinmessage=&cREAD THE &a/RULES&1! prefix=&6RULES
And such, Any idea on how to fix this?
@googlebuscus
ok, i disabled it, deopped myself and made me a default but it still brings up the CB rules
@jk1352412345
Read the plugin description, it tells you how to make ER compatible with CommandBook.
when i do /rules it brings up the normal CommandBook rules. how do i fix this?
What's the [main] tag for info.txt file? To change what pops up when a player just types, /faq..
Never mind, I figured it out. I needed to run the program as administrator since it was saved onto another account on my computer.
I get the error
6:57:31 PM [SEVERE] Could not load 'plugins\EasyRules.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException Invalid plugin.yml
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:255)
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:132)
at org.bukkit.craftbukkit.v1_5_R2.CraftServer.loadPlugins(CraftServer.java:239)
at org.bukkit.craftbukkit.v1_5_R2.CraftServer.<init>(CraftServer.java:217)
at net.minecraft.server.v1_5_R2.PlayerList.<init>(PlayerList.java:55)
at net.minecraft.server.v1_5_R2.DedicatedPlayerList.<init>(SourceFile:11)
at net.minecraft.server.v1_5_R2.DedicatedServer.init(DedicatedServer.java:105)
at net.minecraft.server.v1_5_R2.MinecraftServer.run(MinecraftServer.java:379)
at net.minecraft.server.v1_5_R2.ThreadServerApplication.run(SourceFile:573)
Caused by: java.io.FileNotFoundException plugins\EasyRules.jar (Access is denied)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:243)
... 8 more.
this is really annoying. I don't know if it matters but I am using bukkit gui.
That means you are missing one of two parts. Either it is the join message or prefix.
Please add this to the top of your rules file.
-Edit them as you please, but they need to be there.
having some error .Help ?
08:51:46 [SEVERE] Could not pass event PlayerJoinEvent to EasyRules v2.1 org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja va:427) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav a:62) at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j ava:477) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j ava:462) at net.minecraft.server.v1_5_R2.PlayerList.c(PlayerList.java:205) at net.minecraft.server.v1_5_R2.PlayerList.a(PlayerList.java:101) at net.minecraft.server.v1_5_R2.PendingConnection.d(PendingConnection.ja va:129) at net.minecraft.server.v1_5_R2.PendingConnection.c(PendingConnection.ja va:44) at net.minecraft.server.v1_5_R2.DedicatedServerConnectionThread.a(Dedica tedServerConnectionThread.java:41) at net.minecraft.server.v1_5_R2.DedicatedServerConnection.b(SourceFile:2 9) at net.minecraft.server.v1_5_R2.MinecraftServer.r(MinecraftServer.java:5 80) at net.minecraft.server.v1_5_R2.DedicatedServer.r(DedicatedServer.java:2 25) at net.minecraft.server.v1_5_R2.MinecraftServer.q(MinecraftServer.java:4 76) at net.minecraft.server.v1_5_R2.MinecraftServer.run(MinecraftServer.java :409) at net.minecraft.server.v1_5_R2.ThreadServerApplication.run(SourceFile:5 73) Caused by: java.lang.NullPointerException at me.fatmarley.easy.playerListener.onPlayerJoin(playerListener.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja va:425) ... 14 more
if you send me the modified jar, sure.
Hey fatarleys can i request the source code for this? im interested in modifying the code for a private server for my needs i wouldn't be posting it to the plugins page
email me at StrifeTamer@gmail.com if you can help me out
If you update to version 2.1 you will HAVE to change your rules and faq files. I have update the plugin to use the standardize color codes.
For instance:
[main]Page @aqua@1@@: @aqua@General@@ - @gold@Main rules of this server.@@
Should now be written as
[main]Page &b1&f: &bGeneral&f - &6Main rules of this server.
File should be approved within 24 hours.
Could you add support for this type of color codes? http://ess.khhq.net/mc/
They are shorter and easier to use.