Fixed horse

This commit is contained in:
LCastr0 2017-03-13 19:39:14 -03:00
parent c54cd066ef
commit 2b988a02d8

View File

@ -12,6 +12,7 @@ import org.bukkit.entity.Horse;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.HorseJumpEvent;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.inventory.ItemStack;
@ -22,6 +23,7 @@ import mineplex.core.mount.HorseMount;
import mineplex.core.mount.MountManager;
import mineplex.core.mount.SingleEntityMountData;
import mineplex.core.particleeffects.RainbowTrailEffect;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
@ -65,6 +67,21 @@ public class MountStPatricksHorse extends HorseMount
}
}
@EventHandler
public void horseJump(HorseJumpEvent event)
{
for (SingleEntityMountData<Horse> horseData : _trailMap.keySet())
{
if (horseData.getEntity().equals(event.getEntity()))
{
if (Recharge.Instance.use(horseData.getOwner(), getName(), 2500, false, false, "Cosmetics"))
{
_trailMap.get(horseData).setJumping(true);
}
}
}
}
@EventHandler
public void onItemPickup(PlayerPickupItemEvent event)
{