List of usage examples for net.minecraftforge.event.world GetCollisionBoxesEvent getCollisionBoxesList
public List<AxisAlignedBB> getCollisionBoxesList()
From source file:de.sanandrew.mods.turretmod.client.event.CollisionEventHandler.java
License:Creative Commons License
@SubscribeEvent public void onCollision(GetCollisionBoxesEvent event) { Entity entityIn = event.getEntity(); AxisAlignedBB aabb = event.getAabb(); if (entityIn instanceof EntityPlayer) { List<EntityTurret> turrets = entityIn.world.getEntitiesWithinAABB(EntityTurret.class, aabb.grow(0.25D)); for (EntityTurret turret : turrets) { if (!entityIn.isRidingSameEntity(turret)) { AxisAlignedBB entityBB = turret.getEntityBoundingBox(); if (entityBB.intersects(aabb)) { event.getCollisionBoxesList().add(entityBB); }//from w ww . j a v a 2s . c o m } } } }
From source file:jayavery.geomastery.main.EntityEvents.java
License:Open Source License
/** Allows falling trunks to pass through leaves. */ @SubscribeEvent/*from w ww . j ava2 s.com*/ public void getCollisionBoxes(GetCollisionBoxesEvent event) { if (event.getEntity() instanceof FallingTreeBlock.Trunk) { ((FallingTreeBlock.Trunk) event.getEntity()).getCollisionBoxes(event.getWorld(), event.getAabb(), event.getCollisionBoxesList()); } }