Added an event for Forstride
This commit is contained in:
parent
3d294d5e88
commit
3861cc6cb4
1 changed files with 20 additions and 0 deletions
|
@ -25,6 +25,7 @@ import net.minecraft.util.MathHelper;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.Event.Result;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
import net.minecraftforge.event.entity.EntityEvent;
|
||||
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingSpawnEvent.CheckSpawn;
|
||||
|
@ -100,6 +101,25 @@ public class EntityEventHandler
|
|||
}
|
||||
}
|
||||
|
||||
@ForgeSubscribe
|
||||
public void chunkEntered(EntityEvent.EnteringChunk event)
|
||||
{
|
||||
if (event.entity != null)
|
||||
{
|
||||
if (event.entity instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer)event.entity;
|
||||
World world = player.worldObj;
|
||||
|
||||
int x = MathHelper.floor_double(player.posX);
|
||||
int y = MathHelper.floor_double(player.boundingBox.minY);
|
||||
int z = MathHelper.floor_double(player.posZ);
|
||||
|
||||
int biomeID = world.getBiomeGenForCoords(x, z).biomeID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ForgeSubscribe
|
||||
public void entityInteract(EntityInteractEvent event)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue