Bukkit/CraftBukkit — pull request #1330 by ltcyx (2014-01-31 01:44:01+00:00)
Title: [B+C] Add special event for breeding. Adds BUKKIT-5357

The Issue:

It could be interesting to have a special even for when a new LivingEntity is spawned because of breeding. It should contain references to both parents so that, for example, wool colour from both can be used in detemining the colour for the offspring.

Justification for this PR:

This adds CreatureBreedSpawnEvent, which extends CreatureSpawnEvent and is fired when a new creature is spawned because of breeding. This new event contains references to both parents, which can then be examined to alter the offspring or modified themselves.

PR Breakdown:

This adds CreatureBreedSpawnEvent support in CraftBukkit. Minecraft files were altered, and those alterations were made directly here because the files in https://github.com/Bukkit/mc-dev are for version 1.6.

Testing Results and Materials:

A custom CraftBukkit server was built with this, and a plugin was created with the patched Bukkit lib. This plugin captures this new event and, if the new entity is a sheep, it colours the wool according to the colour of the parents, blending it sort of like you get when mixing dyes in a workbench

Relevant PR(s):

[B+C]-1020 - https://github.com/Bukkit/Bukkit/pull/1020 - adds Bukkit API event

JIRA Ticket:

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