ForgePatch/common/net/minecraftforge/event/entity/EntityEvent.java
Mithion 2a76f7740e Entity Extended Properties Changes
Adds IExtendedEntityProperties interface, which specifies three methods
that are needed:  Init, Save, and Load.

Adds the EntityConstructing event, which is called during the
constructor of Entity.  It is needed there so that the reference is in
place during the ReadNBT call.

Adds hooks into Entity that allow registration of
IExtendedEntityProperties classes, as well as saving and loading to NBT.
2013-03-22 15:04:00 -04:00

48 lines
1.1 KiB
Java

package net.minecraftforge.event.entity;
import net.minecraft.entity.Entity;
import net.minecraft.world.World;
import net.minecraftforge.event.Event;
public class EntityEvent extends Event
{
public final Entity entity;
public EntityEvent(Entity entity)
{
this.entity = entity;
}
public static class EntityConstructing extends EntityEvent
{
public EntityConstructing(Entity entity){
super(entity);
}
}
public static class CanUpdate extends EntityEvent
{
public boolean canUpdate = false;
public CanUpdate(Entity entity)
{
super(entity);
}
}
public static class EnteringChunk extends EntityEvent
{
public int newChunkX;
public int newChunkZ;
public int oldChunkX;
public int oldChunkZ;
public EnteringChunk(Entity entity, int newChunkX, int newChunkZ, int oldChunkX, int oldChunkZ)
{
super(entity);
this.newChunkX = newChunkX;
this.newChunkZ = newChunkZ;
this.oldChunkX = oldChunkX;
this.oldChunkZ = oldChunkZ;
}
}
}