Bukkit/CraftBukkit — pull request #1204 by Black-Hole (2013-07-16 21:33:25+00:00)
Title: [C] Return the Horse for HorseInventory.getHolder(). Fixes BUKKIT-4466

The Issue:

While handling inventory events, the getHolder() of the horse inventory returns null instead of the horse.

Justification for this PR:

Inventory events carries the affected inventory. Those inventories have a getHolder() method. This is working fine for block inventories like chests or entity inventories like StorageMinecart. For InventoryHorse the getHolder() method returns null. So it's impossible the get the associated horse while handling an inventory event.

PR Breakdown:

This PR removes the unused field "player" in InventoryHorseChest and adds the new field "horse" for storing a reference to the associated Horse. This field is set while constructing the InventoryHorseChest within EntityHorse. Also the getOwner() method returns the horse field.

Testing Results and Materials:

Working fine. Detailed material on request.

Relevant PR(s):

none

JIRA Ticket:

BUKKIT-4466 - https://bukkit.atlassian.net/browse/BUKKIT-4466