2014-09-24 14:32:58 +02:00
|
|
|
package cpw.mods.ironchest;
|
|
|
|
|
|
|
|
import net.minecraft.entity.passive.EntityOcelot;
|
2014-12-02 21:25:03 +01:00
|
|
|
import net.minecraftforge.event.entity.living.LivingEvent;
|
2014-09-24 14:32:58 +02:00
|
|
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
|
|
|
2016-03-21 17:44:27 +01:00
|
|
|
public class OcelotsSitOnChestsHandler
|
|
|
|
{
|
2014-09-24 14:32:58 +02:00
|
|
|
@SubscribeEvent
|
|
|
|
public void changeSittingTaskForOcelots(LivingEvent.LivingUpdateEvent evt)
|
|
|
|
{
|
2016-03-26 03:05:26 +01:00
|
|
|
if (evt.getEntityLiving().ticksExisted < 5 && evt.getEntityLiving() instanceof EntityOcelot)
|
2014-09-24 14:32:58 +02:00
|
|
|
{
|
2016-03-21 17:44:27 +01:00
|
|
|
// EntityOcelot ocelot = (EntityOcelot) evt.entityLiving;
|
|
|
|
// Set<EntityAITasks.EntityAITaskEntry> tasks = ocelot.tasks.taskEntries;
|
2014-09-24 14:32:58 +02:00
|
|
|
|
2016-03-21 17:44:27 +01:00
|
|
|
// for (EntityAITasks.EntityAITaskEntry task : tasks)
|
|
|
|
// {
|
|
|
|
// if (task.priority == 6 && (task.action instanceof EntityAIOcelotSit) && !(task.action instanceof IronChestAIOcelotSit))
|
|
|
|
// {
|
|
|
|
// task.action = new IronChestAIOcelotSit(ocelot, 0.4F);
|
|
|
|
// }
|
|
|
|
// }
|
2014-09-24 14:32:58 +02:00
|
|
|
}
|
|
|
|
}
|
2014-12-02 21:25:03 +01:00
|
|
|
}
|