Commit Graph

535 Commits

Author SHA1 Message Date
graywolf336
5273a973a1 Merge pull request #65 from stevoh6/patch-3
Use the pretty time format for the the jail check command.
2015-05-07 12:32:54 -05:00
graywolf336
41717678c5 Git shows these files as changed
I assume this is due to line endings not being the same across all files
due to them being created on different operating systems.
2015-05-07 11:27:18 -05:00
stevoh6
e263463215 Update JailCheckCommand.java
- show pretty time format
2015-04-30 23:40:49 +02:00
graywolf336
97191a3f7d Register the respawn listener with a higher priority, for #55
Since another plugin might interfere and teleport someone elsewhere
which isn't inside the Jail.
2015-03-12 23:37:01 -05:00
graywolf336
550c7d5368 Pass the jail name and cell name to the broadcast messages, fixes #53 2015-02-25 10:13:32 -06:00
graywolf336
566c596f07 Add the reason why someone was jailed to the broadcast message, #53 2015-02-24 16:26:02 -06:00
graywolf336
88cc080f60 Add set to the jail time command and unit test it. 2015-02-20 23:10:05 -06:00
graywolf336
1c3ad5b75a Add some tests on the jail api 2015-02-20 22:26:41 -06:00
graywolf336
1bb36ec66d Change the creation of jail method in the tests. 2015-02-17 09:54:46 -06:00
graywolf336
0d9ed022f3 Only try to jail in a cell if that jail has cells, resolves #51 2015-02-16 15:00:14 -06:00
graywolf336
b9188ee2ba Add a way to get the jail stick manager in the JailAPI 2015-02-13 14:36:42 -06:00
graywolf336
3570a4b0ee Protect some of the constructors since we don't need more than one. 2015-02-13 14:34:38 -06:00
graywolf336
9ecfb92252 Add a method to jail someone forever, resolves #49.
Include -i in the command and the player will be jailed forever.
2015-02-13 01:29:18 -06:00
graywolf336
64f6ce8a64 Don't allow jail vote for people not online and players with permission
which disallows them being jailed.
2015-02-12 23:37:05 -06:00
graywolf336
d205a35d0a Add the Jail Vote feature back in, with lots of unit testing. Closes #8 2015-02-12 21:29:09 -06:00
graywolf336
b23bdaa89b Sign updates are done via the event listeners. 2015-02-10 12:16:45 -06:00
graywolf336
0cb6d7ca84 Don't get a location from a null value, fixes #46 2015-02-09 23:38:30 -06:00
graywolf336
f56ed7068d Fix capital letters in Jail Names in creating cells working, fixes #47 2015-02-09 22:15:06 -06:00
graywolf336
2232b4dfa8 Merge branch 'master' of git@github.com:graywolf336/Jail.git 2015-02-09 22:09:12 -06:00
graywolf336
d819bd7d37 Reimplment automatically jailing in cells, fixes #42.
New config option if you want to disable this option.
2015-02-09 22:08:59 -06:00
graywolf336
3a09144b52 Attempt to get valid connections when doing operations, should help with
reconnecting to the database after an error has occured.
2015-01-29 00:51:01 -06:00
graywolf336
9473928d5f Messed aroung with tests, adding back in the ability for craftbukkit. 2015-01-28 00:04:25 -06:00
graywolf336
112895c3e3 New unit test to ensure the managers are the same, work for #7 2015-01-27 22:48:30 -06:00
graywolf336
87acaf1538 Implement %prettytime% on signs, time in a pretty format. Adds #35
The variable of %prettytime% will be replaced on signs and also a nice
format on the status message will be added.
2015-01-27 19:21:42 -06:00
graywolf336
72c29bb4ea Don't resave the cells if we're saving and using flatfile. 2015-01-27 18:37:04 -06:00
graywolf336
ad57ed767b Use our simple location object when loading a jail, finally resolves #41 2015-01-27 18:08:44 -06:00
graywolf336
d94b12ac40 Load the jails even if the world is not loaded, fixes #41
Also, load the plugin after multiverse.
2015-01-27 17:53:01 -06:00
graywolf336
e4a3eb80c4 Don't load a jail if the world is empty, warn them about it. #41 2015-01-27 17:37:55 -06:00
graywolf336
fdfd0bb2c9 Make the world not existing message to be more user friendly. 2015-01-27 17:27:23 -06:00
graywolf336
b780f4a483 Debug some when loading a jail, for #41 2015-01-27 17:23:13 -06:00
graywolf336
309e4da6a5 Inline the health setting for loading jail sticks. 2015-01-26 02:06:08 -06:00
graywolf336
7fd0a8ddc7 Fix the race condition when protecting blocks, fixes #34 2015-01-26 02:00:49 -06:00
graywolf336
2c85300e3b Remove the duplicate loaded Delete command, done in commit 4567a71 2015-01-26 01:30:16 -06:00
graywolf336
78a6fc7cf9 We wasn't loading the JailHelpCommand, do so. 2015-01-26 01:28:27 -06:00
graywolf336
727ff30d8b Save everything when someone stops creating something. 2015-01-26 01:24:32 -06:00
graywolf336
6653ccfb79 Log a severe message to the console when a jail's world is not defined.
This should help warn to warn people when their server starts and
something is wrong with the definition of their jail in the data.yml,
thanks to #40 for raising this issue even though the real issue hasn't
been found.
2015-01-26 00:27:49 -06:00
graywolf336
14b55a81f5 Fix the teleport free not sending them to the correct world. 2015-01-26 00:00:46 -06:00
graywolf336
c65ca2b0ff Fix the permissions not being added to the jail.command.*, fixes #38 2015-01-25 23:38:46 -06:00
graywolf336
cabec7791e Add the missing s on the permissions for JailListCells, fixes #39. 2015-01-25 23:15:51 -06:00
graywolf336
db46e7c036 Fix the error when either of the command handlers are null, fixes #40
These errors only happen when the plugin didn't load successfully,
you'll need to check further up in the console/server log to see what
actually caused this error.
2015-01-25 23:09:25 -06:00
graywolf336
84b6505ae3 Don't edit the jail signs async, as that is bad and causes #36.
This should fix the Asynchronous entity world add exception being thrown
2015-01-13 01:13:22 -06:00
graywolf336
e84452bfd8 Change the jail stick event to lowest priority, so it gets called first. 2015-01-10 14:55:44 -06:00
graywolf336
4567a713ec Add a temporary help command, will be my next thing to add. 2015-01-07 02:01:17 -06:00
graywolf336
a23062d890 Add the permission to the debugging when a sender doesn't have
permission.
2015-01-03 21:26:57 -06:00
graywolf336
830cf5cebb Use the Google IO library to move the files. 2014-12-28 17:46:26 -06:00
graywolf336
bb8cdd229a Don't depend on craftbukkit, only bukkit. 2014-12-08 20:19:41 -06:00
graywolf336
4b77e61c7b Update the pom to build with 1.8 api and remove the 1.7 related things
in the unit tests.
2014-12-08 18:20:28 -06:00
graywolf336
59003f503d Merge branch 'master' of git@github.com:graywolf336/Jail.git 2014-08-25 23:00:56 -05:00
graywolf336
0dff116634 Add the reason the prisoner was jailed to the events. 2014-08-25 23:00:46 -05:00
graywolf336
b7adc28a8c Only save a jail that is enabled. 2014-08-20 11:45:45 -05:00
graywolf336
5734eeec4c If a world is not loaded, then don't load cells and dont enable the jail 2014-08-20 11:36:36 -05:00
graywolf336
794905ee93 Add the new jailtime command permission. 2014-08-19 20:37:54 -05:00
graywolf336
68584639ba Add support for sqlite storage. 2014-08-19 16:54:14 -05:00
graywolf336
33528aee56 Fix the removing prisoner setting the wrong thing to null. 2014-08-19 15:04:39 -05:00
graywolf336
3405ab100f Update the signs on jailing, this closes #31. 2014-08-19 14:53:35 -05:00
graywolf336
6ddabe39ad Fix the failing tests. 2014-08-19 14:43:03 -05:00
graywolf336
85e1106b42 Fix some spacing issues introduced by the last commit. 2014-08-19 14:34:02 -05:00
graywolf336
81da8ddb59 First attempt at getting the signs of cells to display information #31
The variables possible are:
* %player% - the player's last known name
* %uuid% - the player's uuid, or what can fit on a sign
* %reason% - the reason the player was jailed
* %jailer% - the person/thing who jailed this player
* %afktime% - the amount of time the player has been afk
* %timeinminutes% - the amount of remaining time the player has in
minutes

If the player is jailed forever, then it pulls from the language file
`jailedforeversign` property.
2014-08-19 14:19:30 -05:00
graywolf336
24c6d31742 Fix the jail pay calculation.
There was a problem where if someone was fixing to get released, aka 0
milliseconds remaining, then we would charge them for infinite jailing.
2014-08-19 13:54:13 -05:00
graywolf336
196b7c33ed Throw an event when we change a prisoner's time. 2014-08-19 13:30:46 -05:00
graywolf336
96cb530add No need to send block break and place events to everyone, that's spammy. 2014-08-19 12:18:25 -05:00
graywolf336
676b22967b Remove the old commands from the plugin.yml 2014-08-19 11:19:18 -05:00
graywolf336
9f48cd6d0b Kick players on the main thread, in a sync task. Closes #32 2014-08-15 08:36:54 -05:00
graywolf336
71a60e6ee3 Fix the spacing and clean it up. 2014-07-27 14:46:25 -05:00
graywolf336
f89de50d75 Implement an option to jail in the first open cell, -a. Closes #29
This feature adds a new option to the jail command `-a` which can be
used in place of `-c` if you don't want a specific cell. This option
will jail the player in the first open cell in the jail, thus
eliminating the need to know cell names.
2014-07-27 14:37:46 -05:00
graywolf336
57e304f7c4 Only interaction with the jail stick manager when enabled. Closes #30 2014-07-27 12:42:50 -05:00
graywolf336
34acf4bbaa Work on the commands help and usage, sync with the wiki pages. 2014-07-25 00:10:26 -05:00
graywolf336
cac81f0420 Move clearforce into clear and use -f (-force) to forcefully do it.
It does still require the permission `jail.command.jailclearforce` and
if it isn't provided then it will fall back to regular clearing.
2014-07-24 23:29:53 -05:00
graywolf336
1ea60ca106 Fix the confirmation never expiring. 2014-07-24 23:17:20 -05:00
graywolf336
d3a7ef0e9d Add a debug message for the development builds 2014-07-24 23:05:20 -05:00
graywolf336
7b3a085edb Debug how long it took for the entire plugin to enable all the way. 2014-07-24 23:01:10 -05:00
graywolf336
0362dac92d Test the new language system. 2014-07-24 21:17:23 -05:00
graywolf336
1898121643 Simplify the language system and the language calls, also fix the
language system not copying over the new values when new values were
added.
2014-07-24 21:16:57 -05:00
graywolf336
709a06f330 Add an API class and also add some testing for it. 2014-07-23 16:39:45 -05:00
graywolf336
59c583e8b3 Rename the TestJailStuff to TestJailDefaultConfig 2014-07-23 14:48:39 -05:00
graywolf336
47fd0d7632 Tiny stuff on the benchmark test. 2014-07-23 14:35:53 -05:00
graywolf336
413abf7244 Test the new util method. 2014-07-23 13:20:21 -05:00
graywolf336
4829a75785 Move the time parsing tests into the util tests, as that's what it
really is testing.
2014-07-22 21:39:26 -05:00
graywolf336
b5b79b9704 Move the three jewel unit tests into the rest of the command tests. 2014-07-22 21:35:08 -05:00
graywolf336
6b8dec6c7b Work on some unit tests for #7 and reorganize part of the config. 2014-07-22 20:58:05 -05:00
graywolf336
b63773c7a9 Move the timer to be async if we're using bukkit's timer.
This should improve the performance of the plugin even more, because it
won't do any database calls while inside the loop which is what was
usually the hang up time.

This is completely untested and possibly could throw tons of errors.
2014-07-21 19:11:12 -05:00
graywolf336
e4f32559b6 Clean up the formatting of the copied code in the update. 2014-07-21 18:30:39 -05:00
graywolf336
a2d46b8e26 Forgot part of the JavaDoc, whoops. 2014-07-21 18:28:56 -05:00
graywolf336
8b547ed748 Add more jail stick JavaDoc and fix the OBE from previous version of
jail sticks being used.
2014-07-21 18:27:40 -05:00
graywolf336
bfd786f650 When we reload the update checking, cancel the previous task. 2014-07-21 18:23:31 -05:00
graywolf336
70b2fbe1e1 Cancel all the tasks for this plugin when shutting down. 2014-07-21 18:20:04 -05:00
graywolf336
1c92f90ccc Update notifications! For dev, stable-dev, and bukkit channels! :) 2014-07-21 18:17:30 -05:00
graywolf336
6fe5eeb346 Move some items around for organization 2014-07-21 15:54:16 -05:00
graywolf336
1181f33693 It is jail createcells not jail cellcreate 2014-07-15 20:19:35 -05:00
graywolf336
fec2fddb26 Remove the default blacklist items..those are precious blocks. 2014-07-15 01:39:04 -05:00
graywolf336
8a7a9cefef Make the jail stick manager/creation smarter and fix jailing via jail
sticks, as it wasn't working at all.
2014-07-15 01:05:46 -05:00
graywolf336
d034a0f1ed Fix the error when trying to measure difference between two worlds. 2014-07-15 00:19:13 -05:00
graywolf336
86082e2f63 Allow resisting arrests via the jail stick. 2014-07-15 00:11:36 -05:00
graywolf336
c9b0fc8480 Fix the blacklist not working or sometimes erroring out. 2014-07-14 23:47:36 -05:00
graywolf336
9e0722c218 Remove all of the types from a player's inventory when jailed and an
item is in their inventory.
2014-07-14 23:30:37 -05:00
graywolf336
3226515107 Don't allow players to keep their inventory from jail. 2014-07-14 23:28:01 -05:00
graywolf336
720d4c1608 Fix the tests failing. 2014-07-14 23:20:21 -05:00
graywolf336
9ca8e14e29 Add a black list to storing the player's inventory. 2014-07-14 23:16:05 -05:00
graywolf336
a5bf89b07e Don't allow jailing in unloaded worlds and don't allow joining while
jailed in unloaded worlds.
2014-07-14 22:53:48 -05:00
graywolf336
5c4122ee92 Fix the unjailing not working, was messed up when we switch to UUIDs 2014-07-14 21:55:01 -05:00
graywolf336
b83d1245f8 Simplify one of our checks on getPrisoner 2014-07-14 21:40:21 -05:00
graywolf336
ce1231da39 Add some debugging code. 2014-07-14 21:38:15 -05:00
graywolf336
27b557991e Add some debugging to the jailing of a player. 2014-07-14 21:19:12 -05:00
graywolf336
049ea63102 Send a message to the unjailer when they unjail someone. 2014-07-14 21:11:46 -05:00
graywolf336
9e1b75c602 Remove the cache object before we release the prisoner. 2014-07-14 21:01:43 -05:00
graywolf336
ba3bbe095b Bukkit likes to be backwards it seems.
Instead of RGB they do BGR...like seriously!?!?
2014-07-14 20:45:50 -05:00
graywolf336
0aeaa26d1e Rofl the helmet is called helmet...not boots :p 2014-07-14 20:42:17 -05:00
graywolf336
36be8a89a0 Let's try another color for orange... 2014-07-14 20:38:00 -05:00
graywolf336
978994300d Capitalize the values we get, so we can try to get the data. 2014-07-14 19:28:49 -05:00
graywolf336
2c336527a5 Fix the config containing tabs instead of spaces. 2014-07-14 19:10:44 -05:00
graywolf336
8fe7dea3ae Add limited inmate clothing! Closes Ticket #22 2014-07-14 19:05:28 -05:00
graywolf336
a38ae137ee Add a prisoner death event, closes #28 2014-07-14 18:39:38 -05:00
graywolf336
3912dbfabc Only save the prisoners if they were changed, add that flag. 2014-07-14 18:23:29 -05:00
graywolf336
f3c2772a87 Use BIGINT for the time 2014-07-14 18:07:13 -05:00
graywolf336
f042af4731 Fix the time not being converted correctly. 2014-07-14 18:03:17 -05:00
graywolf336
c7de4364b1 If the world is null, don't return a string of the location. 2014-07-14 17:09:06 -05:00
graywolf336
34ebc5bc08 Update readme and convert the old positions. 2014-07-14 17:01:34 -05:00
graywolf336
48972e9523 Schedule the time decrease for every ten seconds 2014-07-14 16:52:32 -05:00
graywolf336
fe7aabc6ea Very using the new api, some older versions are still used. 2014-07-14 16:39:01 -05:00
graywolf336
88817fb9a2 If the data passed is empty, return an empty inventory. Try to fix the
latest issue reported in #26
2014-07-07 14:56:25 -05:00
graywolf336
f2cf051b4e Run the save every minute, instead of every 10 seconds.
Next up: making mysql async.
2014-06-12 11:13:55 -05:00
graywolf336
2c971eb9bc Add some JavaDoc explaining what the CacheListener is for. 2014-06-12 11:00:01 -05:00
graywolf336
c6cdd5499e Add a comment to the test. 2014-06-12 10:56:49 -05:00
graywolf336
d535b758d4 Add .gitattributes 2014-06-12 10:50:53 -05:00
graywolf336
a77e0cc472 Performance changes to get better performance on the move protection.
We now get the cache object inside the move event and get all the other
objects from that. The reason for this is so that we don't have to then
loop through all the prisoners in a jail again to get one prisoner, just
get it from the cache object.
2014-06-12 10:30:00 -05:00
graywolf336
a442887b36 Telling me something changed but I don't know what. Will revert if it is
something breaking.
2014-06-12 10:15:11 -05:00
graywolf336
7ad5fedfd1 Work on the tests and change up some performance issues.
1. In the player move event we looped through the jailed players more
than once which really is an issue when you have several hundred jailed
and since the move event is called several times a second, that was a
huge performance hit.
2. Don't save the prisoner data as soon as they are jailed, we take care
of that else where with the shutting down and counting down time.
2014-05-30 15:54:11 -05:00
graywolf336
45bd4ac8c1 Reference the plugin and not Bukkit 2014-05-30 14:28:04 -05:00
graywolf336
74e62be46c Use InputStreamReader when reading the default en.yml from the plugin. 2014-05-30 14:03:20 -05:00
graywolf336
af1fa37470 Add a cache for prisoners online only, this should help performance #26
The cache listens to a lot of events and custom events to ensure the
cache is up to date, this way we don't have to loop through all the
prisoners in a jail every single time they move or something but instead
just check the cache.
2014-05-30 12:23:32 -05:00
graywolf336
82f17f3a4b Merge branch 'master' of git@github.com:graywolf336/Jail.git 2014-05-30 11:12:30 -05:00
graywolf336
c5720ec84d Move the handcuffing to store data per uuid. 2014-05-30 11:12:08 -05:00
graywolf336
8cb7a76eeb Fix #27, all scoreboards are managed by UUIDs and no longer names. 2014-05-24 14:20:37 -05:00
graywolf336
3e54d79dd3 Try to lower the amount of time spent on each move event as mentioned in
issue #26
2014-05-08 19:30:20 -05:00
graywolf336
0bb679329d Fix the error when saving a cell that has a prisoner. This should fix
and close #26.
2014-05-03 09:52:45 -05:00
graywolf336
7db5fe9da5 Attempt to fix the NPE error when loading the old JailPayCurrency 2014-05-03 01:15:00 -05:00
graywolf336
ef5dfe3815 If we have converted data, save everything after JailIO is loaded.
This might solve #26 but I'm not closing it yet as this is untested.
2014-05-03 01:12:26 -05:00
graywolf336
42d0e7983f Convert the jailpay settings over. 2014-05-02 01:43:30 -05:00
graywolf336
b3033913c7 Properly output how many cells were loaded, hopefully this has something
to do with #26 displaying incorrect information.
2014-05-02 01:35:04 -05:00
graywolf336
b8dc15decb We use player instead of name for the player's last known name.
Good catch by @dewick on issue #26.
2014-05-02 01:31:04 -05:00
graywolf336
084e8bea01 Warn when a cell doesn't have a teleport location or cell. Also, don't
double store a prisoner when they get put in a cell from a jail after
being converted.
2014-05-01 17:39:48 -05:00
graywolf336
f1dadaaae0 Lookup the records by username and get the UUID ourself. 2014-04-30 13:18:56 -05:00
graywolf336
a7798c9d62 Fix the javadoc on one method in JailIO being incorrect. 2014-04-29 13:24:26 -05:00
graywolf336
4d4f609b82 Finish using the UUID, we are still using blocking methods.
I want to get fully away from blocking methods and instead make the
user/player/prisoner/whatever wait to get an answer while we retrieve
the uuid information asynchronously.
2014-04-29 13:20:33 -05:00
graywolf336
ad9c70cbbf Readd the method I removed and also change the cells to uuid. 2014-04-29 10:53:36 -05:00
graywolf336
63e117ac72 Build will fail. Started work on converting to using uuid's internally.
While doing this I deleted one method that I shouldn't have, so going to
revert that. Next I have to build a method or two which will allow me to
do last known names lookups, etc. Might switch to using a library to
handle getting names async so we don't block the server up, doing this
will result in us having to recode some of the commands internally.

If you have any suggestions or questions, I'm open.
2014-04-28 23:52:52 -05:00
graywolf336
0981fe659f Correctly log how many prisoners were loaded. 2014-04-28 22:46:41 -05:00
graywolf336
998c7bd824 If we couldn't find a jail from the prisoner, get the first jail.
Also, don't try to load prisoners if there are no jails.
2014-04-28 22:27:41 -05:00
graywolf336
cb88948c29 Merge branch 'master' of git@github.com:graywolf336/Jail.git 2014-04-28 20:11:58 -05:00
graywolf336
581a826524 Output out type of storage is selected when not in debugging mode. 2014-04-28 20:11:39 -05:00