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
Players are no longer silently kicked out of their team if they try to join
a non-existant team with /join. Fix an inconsistency with the format of the
team join notification message.
War now logs kills and deaths to a MySQL database. Records are created for
every player at the end of each round with the current date and amount of
times the player killed and was killed for the entire round. It has built
in support for automatic & configurable log clearing past a certain date
(default is 1 week).
Killstreak rewards can be configured in the set.war.killstreak section of
war.yml. Rewards will only be applied to players if the team/warzone has
KILLSTREAK set to true.
The configuration section will get populated on generation of war.yml, or
may be manually added to older configurations.
Currently the system supports messaging the entire warzone and just the
attacker. It only supports rewards of items and health at the moment; more
are expected to arrive.
This commit also moves XPKILLMETER into the team-specific section of the
config.
The killstreak counter shows a message if the player has more than 5
kills. I have also added an example reward system with points, but did not
enable it yet (needs discussion).
Through the warzone option xpkillmeter the XP level will get updated with
your current kill streak amount. This gets reset every time you die and
is added to every time you kill a player. If this option is enabled,
players cannot gain XP in the warzone.
With the new warzone configuration property "scoreboard", zone makers can
set the type of scoreboard to be used. This may be "none", "points", or
"lifepool". If the scoreboard type is not "none", then a scoreboard will
be shown on the right side of the screen in the warzone. The shown
scoreboard will display the configured option.
Also, 3-year-old feature request COMPLETED! Use the command
/zone <warzone-name> scoreboard to view a scoreboard from anywhere.
If a zone has the property autojoin & autoassign set to true, then
players will be directly assigned to a team when they go through the
Warhub portal for the zone and brought back to the Warhub when they
leave the zone.
TeamKind has been changed to store colors in a DyeColor object instead
of using a byte value store. This improves readability and makes the
code future-proof.
All listeners are now unregistered when the plugin gets unloaded. This
removes the need for listeners to check if War is loaded and prevents
duplicate registration. I would prefer if the ability to unload and load
the War plugin was completely removed, however, as there are plugins out
there such as PlugMan that are dedicated to cleanly reloading plugins.
The main purpose of this was to clean up all issues and problems
reported by the eclipse java IDE. 0 warnings are shown by the IDE now.
/setteam <color> now will add an additional spawn point if the team already
exists.
When a player joins a team in a warzone, they will be sent to any one of
their teams spawn points, picked at random.
This change required major modifications to the underlying teams subsystem
in order to support multiple spawn points for the team.
This test task is incompatible with additions to War regarding teams.
This method of preventing players of receiving spawn protection is
currently extremely buggy and there has to be a better way to fix the issue
at hand.
@taoneill please email me if there is any serious reason this task is
needed, otherwise it just deteoriates from the War experience. Numerous
times I have played War, I have been bumped out of a warzone even due to
this. There seems to be no need for it. I can revert this commit if needed.
One possible solution could be disabling all protections for anyone who
returns to their spawn, such as like how loadout switching is prevented
after leaving spawn. Another solution could be preventing multiple teams
from taking a flag while another flag is on the run.
Please leave your ideas in the comments or email me.
Update health references to use double-precision floating point numbers instead
of integers due to minecraft spec change. Update Java to 1.6. Update bukkit
version.
The WorldEdit API is utilized to allow the use of WorldEdit selections
when creating or modifying a warzone. If the current player has a
WorldEdit selection when the /setzone command is used, this selection will
be used for the zone's corners.
War saved a player's state before they were teleported into the warzone.
This causes issues if the lobby is in another world and the server is
using plugins to manage per-world inventories. Essentially, the player is
getting their inventory from world A saved, teleported to warzone in world
B, their state being restored in B, then teleported to A. Per-world
inventory plugins save and restore inventories on every
cross-world-teleport. This causes blank inventories when a player joins a
warzone and the player gets the items from the zone when they leave.
This issue is easily fixed by teleporting players to the warzone's world
before saving their state. This is merely a standardization of state
save/restore order.
permission specific loadouts.
Loadouts can be defined with a permission which can limit who can access
the loadout, in mostly the same manner as I did in the zone-permissions
commits. The permission can be used to only allow say VIP and above to get
a certain loadout (for donation benefits) or to allow the server's lower
ranks a class only (to allow lower ranks to survive faced with the server's
experienced players).
This is controlled by an additional argument to /zonecfg.
Example: /zonecfg loadout:vip:server.ranks.VIP - allow only VIP players
access to the vip loadout.
To remove the permission, re-make the loadout without the permission
parameter.
Example: /zonecfg loadout:vip - remove the permission requirement for the
vip loadout.
To allow a lower rank access to a loadout only, you can use your permission
manager's feature of negating a permission (if supported by the plugin).
Example: /pex group recruit add server.loadout.noob, /pex group builder add
-server.loadout.noob - allow only recruits to have access to a loadout
which requires the permission "server.loadout.noob" (with PermissionsEX).