Implement mounts and remove legacy horse dismount code

This commit is contained in:
AlexTheCoder 2017-04-15 16:53:38 -04:00
parent 8c27c4349d
commit 264b7f86cf

View File

@ -104,6 +104,7 @@ import mineplex.game.clans.clans.gui.ClanShop;
import mineplex.game.clans.clans.invsee.InvseeManager;
import mineplex.game.clans.clans.loot.LootManager;
import mineplex.game.clans.clans.map.ItemMapManager;
import mineplex.game.clans.clans.mounts.MountManager;
import mineplex.game.clans.clans.nameblacklist.ClansBlacklist;
import mineplex.game.clans.clans.nether.NetherManager;
import mineplex.game.clans.clans.observer.ObserverManager;
@ -472,6 +473,8 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
_netherManager = new NetherManager(this);
_amplifierManager = new AmplifierManager(plugin);
new MountManager(plugin, clientManager, donationManager);
_restartManager = new RestartManager(plugin);
}
@ -1387,29 +1390,6 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
}
}
@EventHandler
public void damageHorse(EntityDamageEvent event)
{
if (event.getEntity() instanceof Horse)
{
if (event.getEntity().getPassenger() != null && event.getEntity().getPassenger() instanceof Player)
{
event.getEntity().getPassenger().eject();
Recharge.Instance.use((Player) event.getEntity().getPassenger(), "Ride Horse", 2 * 20L, false, false);
}
event.getEntity().eject();
}
else if(event.getEntity() instanceof Player)
{
if(event.getEntity().getVehicle() != null && event.getEntity().getVehicle() instanceof Horse)
{
Recharge.Instance.use((Player) event.getEntity(), "Ride Horse", 2 * 20L, false, false);
event.getEntity().getVehicle().eject();
}
}
}
public Pair<ClanInfo, Long> leftRecently(UUID uniqueId, long time)
{
if (_clanMemberLeftMap.containsKey(uniqueId) && (System.currentTimeMillis() - _clanMemberLeftMap.get(uniqueId).getRight()) <= time)