ironbarrels/src/main/java/cpw/mods/ironchest/OcelotsSitOnChestsHandler.java

27 lines
975 B
Java
Raw Normal View History

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;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
2016-03-21 17:44:27 +01:00
public class OcelotsSitOnChestsHandler
{
@SubscribeEvent
public void changeSittingTaskForOcelots(LivingEvent.LivingUpdateEvent evt)
{
2016-03-26 03:05:26 +01:00
if (evt.getEntityLiving().ticksExisted < 5 && evt.getEntityLiving() instanceof EntityOcelot)
{
2016-03-21 17:44:27 +01:00
// EntityOcelot ocelot = (EntityOcelot) evt.entityLiving;
// Set<EntityAITasks.EntityAITaskEntry> tasks = ocelot.tasks.taskEntries;
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-12-02 21:25:03 +01:00
}