Updating from 1.6.9 - Zedd7/ZHorse GitHub Wiki

If you are updating ZHorse from version 1.6.9, please read this carefully !


What you need to know

Update 1.6.9 contained a bug which prevented horses from being properly cleared from database (when using /zh free, /zh kill, zh admin clear or when the horse died). Note that the bug only occurred if you had ZHorse installed in a previous version (1.6.8-). If you started using ZHorse or have reset it under 1.6.9, you can forget about this warning.

The result of the bug is that any horse which should have been removed from database under this version now has its database files corrupted. In practice, other horses are still functional and protected by ZHorse but commands reading the statistics of a corrupted horse (such as /zh list) will crash.

If you want to find which horse has been corrupted, you must either:

  • execute /zh list -p <player name> for each player and find out which execution crashes.
  • or look in the database for a horse which has no entry in the table horse_stats for a given entry in the table horse.

What changes with 1.7+

The plugin now contains a SQL patch which removes the abandoned table inventory_item. The later will no longer make ZHorse commands crash halfway due to a foreign key constraint violation.

How to fix corrupted horses

First, update to either 1.7.0 (Spigot 1.12.2) or 1.7.1+ (Spigot 1.13). At this point, you have three options:

  1. Perform a proper (re-)install of ZHorse (this includes clearing the database). Only do this if you recently added the plugin and/or your players won't suffer from a reset. It will not make previously claimed horses disappear but players will have to claim, rename, etc. them again. Note that custom names of horses will not disappear either.
  2. Execute /zh admin clear <player name> for players who cannot execute /zh list or for whom there are inconsistencies in the database. Only do this if you have access to your database and know how to look up for corrupted horses. It will free all the player's horses and he will have to claim them again (they still do not disappear).
  3. Ask players to do /zh free themselves if /zh list is not working for them. They can either spam /zh free until /zh list works again or target specific horses which they know are corrupted.