SafeCity
General Information
Website: Here
Change Log: Here
Wiki: Here
Live Server: play.demicraft-mc.com
Required Mods
Description
SafeCity is a city-building plugin that allows people to create variable-sized areas of grief-prevented land.
Players are initially allowed to create a single 7x7 zone in which nobody can modify unless they are given permission. They can then buy more "blocks" to extend their zone if they wish. As the amount of "blocks" they purchase increases, the cost will also increase. Eventually, if the player wishes, they are able to declare the zone a "public city" (for a price, e.g. $15,000) and sell or rent sub-zones to start making money back. Sub-zones can be two-dimensional (from bedrock to sky) or three-dimensional (variable height).
Residents and owners can spawn to the zone at will using an in-game command "/z spawn <zoneName>". If the founder of the city wishes, they are able to purchase a "public spawn" (for a price, e.g. $7,500) and allow anybody to spawn to the city, regardless of whether they are a resident or not.
Please note: for pvp zones to work, you must enable pvp in your server.properties file!
All zone boundaries can be visualized by placing a stick in your hand, and re-sized at any time by using the appropriate tool (wood shovel for 2D zones, gold shovel for 3D zones). Blue zones indicate "no state", green colored zones indicate a plot is available to buy or rent, and a red colored zone indicates that a plot has been purchased or rented, allowing people to quickly determine whether or not they can buy a zone simply by placing a stick in their hand.
Signs can also be placed inside or on the edge of a sub-zone to display the state, and automatically changes when the state does.Simply place a sign and type [details] on it. Players can also right-click a sign to purchase or rent a sub-zone. Sub-zones can be placed anywhere from within the main zone, allowing them to place houses, shops, apartments or any other buildings anywhere, giving complete freedom on their city layout. In addition to selling or renting sub-zones, players can additionally give others permission to do certain things: Access, Build, Farmer, Landlord, Owner, Recruiter, Renter, Trader and Zoner.
In addition, sub-zones can be given a "pvp" flag, allowing PvP from within it, allowing cities to have their own PvP arenas, and a "mob-spawning" flag, allowing hostile mobs to spawn from within it, allowing spawners to be utilized for mob-grinding.
Installation
- Put this plugin (safecity) and c3p0Extension into your "/plugins/" folder.
- Start the server to generate the config files.
- Stop the server.
- edit the "config.yml" located in "/plugins/SafeCity" and enter your database details.
- Start the server!
Permission Nodes
- safecity.public.create - Allow the creation of a primary zone.
- safecity.public.delete - Allow deleting public zones with residents - generally only advised for staff.
- safecity.staff - Staff override node. Allows a player to add themselves as an owner of any primary zone and manipulate it at will.
Documentation
For more information, including all commands and verbose description, visit the wiki page.
Want to take a look before using it? Visit our live server.
More Information
Due to the nature of this plugin, additional features and settings will more than likely be added as time goes by. Please refer to the Official Safecity Changelog, which documents any fixed or changed data.
-
View User Profile
-
Send Message
Posted Jul 18, 2013Any idea when you'll get around to adding a "settings" part to the config file to allow us to change values, etc.? I want to change the default dollar values, to more accurately fit my server's economy.
Thanks.
-
View User Profile
-
Send Message
Posted Jul 17, 2013@jayfella
Here you go: http:pastebin.com/A8tmB9LL
-
View User Profile
-
Send Message
Posted Jul 17, 2013@unknownn47
Can you pastebin me the stacktrace by any chance from your server log - it would help a lot.
-
View User Profile
-
Send Message
Posted Jul 16, 2013@jayfella
Looks like all it took was adding an if statement in your onInventoryClose function around your player declaration and your visualizer update calls as follows:
According to the citizensAPI documentation, NPCs have that metadata set as true, so I went ahead and recompiled the ToolInHandListener class and tested it. It seems to be working flawlessly now!
Just felt like sharing, thanks for this plugin!
@Barnsey3017
My recommendation is to download XAMPP, it's free and supports both apache server and MySQL server. They also have all of the documentation you need to work through setting it up!
-
View User Profile
-
Send Message
Posted Jul 16, 2013@Barnsey3017
It requires a mysql database. All you have to do is run the plugin once, stop the server, and edit the config.yml file to add your database details. You do not need to paste the example code like you did. That is for plugin developers. Unfortunately flat-files are just too slow and offer no relationship system other than manual implementation, and it would just be horrid-slow - which is why databases were invented, and why we use them. There is no real work-around unfortunately.
@unknownn47
The citizens plugin documentation is either out-dated or updated for a version that isnt even released. I spent an hour trying to figure out to to make a basic trader and got nowhere. I have no idea how to use it i'm afraid, and have little time to figure it out by process of elimination and piecing bits of youtube and useless documentation together.
-
View User Profile
-
Send Message
Posted Jul 15, 2013@jayfella
I would love if, in the next update to this, you would throw in a couple of lines into the ToolInHandListener class file to verify that it's not a generated player (one created by the Citizens plugin, or really any other NPC plugin) before forcing a player object on the onInventoryClose function override.
It throws an error every time it tries to parse it as a SafeCityPlayer object on the onInventoryClose function. (Doesn't affect performance too much, just annoying to see the continuous errors popping up for the postal system I have running haha).
-
View User Profile
-
Send Message
Posted Jul 15, 2013just seen the youtube vid on the whole data base stuff ... this is not worth going tho all that to set this up....hope all goes well with this plug ... but just way to hard to set up
-
View User Profile
-
Send Message
Posted Jul 15, 2013My Config ...
database: type: MYSQL url: 127.0.0.1 port: 3306 databasename: safecity username: username password: password name: SafeCity main: me.jayfella.SafeCity.SafeCityPlugin version: 1.0.0 author: jayfella depend: [ Vault, c3p0Extension ] public final class DatabaseExample { private final C3p0ExtensionPlugin c3p0; private final DatabaseConnection databaseConnection;
public DatabaseExample(Plugin plugin) {
c3p0 = (C3p0ExtensionPlugin)plugin.getServer().getPluginManager().getPlugin("c3p0Extension");
databaseConnection = new DatabaseConnection( DatabaseType.valueOf("MYSQL"), "127.0.0.1", 3306, "nameOfDatabase", "username", "password");
if (!c3p0.createDataSource(databaseConnection)) { Bukkit.getPluginManager().disablePlugin(plugin); return; } }
public Connection getConnection() throws SQLException { return c3p0.getConnection(databaseConnection); }
private void doSomething() { Connection connection = null; PreparedStatement ps = null;
try { StringBuilder statement = new StringBuilder() .append("UPDATE nameOfDatabase SET ") .append("owner = ? ") .append("WHERE id = ?");
connection = this.getConnection(); ps = connection.prepareStatement(statement.toString());
ps.setString(1, "jayfella"); ps.setInt(2, 1337);
ps.executeUpdate(); } catch (SQLException ex) { Bukkit.getLogger().log(Level.SEVERE, ex.getMessage(), ex); return; } finally { try { if (ps != null) { ps.close(); } if (connection != null) { connection.close(); } } catch (SQLException ex) { context.getLogger().log(Level.SEVERE, ex.getMessage(), ex); return; } } }
}
general: min-zone-distance: 50 max-zones-per-player: 1
allowed-worlds: - world - world_nether
-
View User Profile
-
Send Message
Posted Jul 15, 2013can you help me setting it up i really dont get what you mean how to set up that plug ... i copy and pasted what it said on the c3p0Extension plug and dont work at all
-
View User Profile
-
Send Message
Posted Jul 15, 2013cant get the c3p0Extension to work all it says is this
trying to get the connection .. and it locks my sever ...
-
View User Profile
-
Send Message
Posted Jul 13, 2013@TerroristCreeper
Yes you can. It is not "version specific" - it will work on all versions for the forseeable future.
-
View User Profile
-
Send Message
Posted Jul 13, 2013@jayfella
@jayfella
So i can just use the c3p0Extension 1.5.2?
-
View User Profile
-
Send Message
Posted Jul 13, 2013@TerroristCreeper
Vault and c3p0Extension do not need updating.
-
View User Profile
-
Send Message
Posted Jul 13, 2013@unknownn47
But you need Vault and c3p0Extension
Butt those are 1.5.2?
-
View User Profile
-
Send Message
Posted Jul 13, 2013I've uploaded an update for 1.6.2 - pending approval.
-
View User Profile
-
Send Message
Posted Jul 12, 2013@TerroristCreeper
It works well for me on 1.6.1, I don't know about 1.6.2 though.
-
View User Profile
-
Send Message
Posted Jul 12, 2013I see a update of 1.6.1
Does it works?
-
View User Profile
-
Send Message
Posted Jul 10, 20131.6.2? :)
-
View User Profile
-
Send Message
Posted Jul 7, 2013@FarmerKaine
No, it will not work for 1.6 - I am waiting for bukkit to release a stable version of it. Its impossible for me to ensure it works, when the actual 1.6 release doesnt even work properly.
-
View User Profile
-
Send Message
Posted Jul 6, 20131.6.1?