War now skips over saving Air blocks. Instead, the plugin loads all solid blocks back into the world and then sets each block to air that was not changed.
Benchmarks:
Warzone molecule
Block count 2,487,555
Speed 50,000 blocks per tick
Intel Core i7 @ 3.6 GHz * 8
Before:
File size 70 MB
Reset 23 seconds
Save 16 seconds
After:
File size 54 MB
Save 5 seconds
(no changes)
Reset 4.9 seconds
(set to air)
Reset 31.17 seconds
(set to stone)
Reset 18.23 seconds
- Container, sign, skulls, and more are not just a single column
- Compacting each warzone database after migration from schema v1 to v2 (to get disk space savings, but might take a while for large zones)
- Showing a few decimals on time value in zone reset messages instead of just showing "Reset in 0 seconds" all the time
This war config option, MAXSIZE, can be used to change the limit on war zone size. Some reasons for using this could be to have a very long war zone or to limit the size from being abused by your zone makers. Thanks to @Delgado804 for the idea.
Warzone now contains a few new methods to make adding and removing players from the zone easier. This was made in response to every join mechanism having to rewrite the same ~25 lines of code to handle adding players to a team. This was also done to replace the even more bulky code used to return stolen structures.
This also removes a few unused jobs as I am trying to transition away from them, as they don't really help if they are not being used for async tasks, batches, or timers.
A better way of managing teleports at the end of a game or when leaving normally has been added.
Nimitz file format. Support for custom blocks. Old warzone volume files get converted to .sl3 when you first run your server with these changes - this may take a while if you have many warzones.
Thanks @cmastudios for all the hard work on these changes.
This fixes some issues found during @taoneill's review of the code. It
also adds a few features with blocks, such as a modify block whitelist.
KDR updates are now stored at the end of each battle in a warzone.
Closes#681, closes#672, closes#682, closes#683, closes#689, ping
#688.
Found you could still get the raw data value by converting to an ItemStack, so I am using that now to reduce the lag caused by reading the serialized form of the metadata class.
War zone blocks are now loaded from the database at a configurable speed of blocks per tick. This prevents an entire server from hanging whenever a war zone is reset. The speed can be increased or decreased based on your server's performance.
Block items are stored as their Material name. Block data is stored with the bukkit configuration serializer. This supports custom blocks. Tested with MCPC-Plus server.
Currently supports saving some tile entity data, such as sign text, all containers, note blocks, juke boxes, skulls/heads, command blocks, and basic mob spawners. The database is easily extensible for future blocks.
BlockInfo kept making me cringe every time I had to look at the code. More importantly it only had support for storing item IDs and no data. It was way obsolete versus new API.
Most player-interfaced features such as event responders, signs, and
some player commands now have their messages stored externally in a
resource bundle. This allows for easy localization of the plugin by
copying the main messages.properties file and translating all the
messages into the language of choice.
Also thanks to @AlexMerser21 for the partial russian localization of the
plugin. This means that War servers can now show messages in the russian
language simply by starting the minecraft server with the flag
-Duser.language=ru.
Item/damage/anything ID's have now become deprecated in bukkit presumedly
in preparation for any sort of official server modding API. This switches
war from using IDs in most cases to bukkit-provided classes such as
ItemStack.
I changed some of the new event API code from @BenMenking to use more
Bukkit provided frameworks like Player and use basic java structures
instead of checking integers.
Added the following events for other plugins to hook into:
WarPlayerDeathEvent, WarPlayerKillEvent, WarPlayerLeaveEvent,
WarPlayerThiefEvent, WarScoreCapEvent, WarTeamWinEvent,
WarThiefDeathEvent