use of net.minecraft.util.math.AxisAlignedBB in project Witchworks by Um-Mitternacht.
the class TileKettle method update.
@Override
public void update() {
if (!world.isRemote && ticks % 2 == 0) {
double x = getPos().getX();
double y = getPos().getY();
double z = getPos().getZ();
AxisAlignedBB box = new AxisAlignedBB(x, y, z, x + 1, y + 0.65D, z + 1);
final List<EntityItem> entityItemList = world.getEntitiesWithinAABB(EntityItem.class, box);
entityItemList.forEach(this::collideItem);
}
if (inv.hasFluid()) {
if (!inv.hasFluid(FluidRegistry.LAVA)) {
if (isBoiling()) {
handleParticles();
if (ticks % 5 == 0 && world.rand.nextInt(15) == 0) {
play(SoundEvents.BLOCK_LAVA_AMBIENT, 0.1F, 1F);
}
}
} else if (ticks % 5 == 0 && world.rand.nextInt(20) == 0) {
play(SoundEvents.BLOCK_LAVA_AMBIENT, 1F, 1F);
}
}
if (ticks % 20 == 0) {
handleHeat();
tryTurnLiquid();
}
if (!world.isRemote && mode == Mode.RITUAL && ritual != null) {
handleRitual();
}
++ticks;
}
use of net.minecraft.util.math.AxisAlignedBB in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class CoordTransformObject method updateParentAABB.
// TODO: FinishME
public void updateParentAABB() {
double mnX = 0, mnY = 0, mnZ = 0, mxX = 0, mxY = 0, mxZ = 0;
Vector currentLocation = new Vector();
mnX = mxX = parent.wrapper.posX;
mnY = mxY = parent.wrapper.posY;
mnZ = mxZ = parent.wrapper.posZ;
for (BlockPos pos : parent.blockPositions) {
currentLocation.X = pos.getX() + .5D;
currentLocation.Y = pos.getY() + .5D;
currentLocation.Z = pos.getZ() + .5D;
fromLocalToGlobal(currentLocation);
if (currentLocation.X < mnX) {
mnX = currentLocation.X;
}
if (currentLocation.X > mxX) {
mxX = currentLocation.X;
}
if (currentLocation.Y < mnY) {
mnY = currentLocation.Y;
}
if (currentLocation.Y > mxY) {
mxY = currentLocation.Y;
}
if (currentLocation.Z < mnZ) {
mnZ = currentLocation.Z;
}
if (currentLocation.Z > mxZ) {
mxZ = currentLocation.Z;
}
}
AxisAlignedBB enclosingBB = new AxisAlignedBB(mnX, mnY, mnZ, mxX, mxY, mxZ).expand(.6D, .6D, .6D);
parent.collisionBB = enclosingBB;
}
use of net.minecraft.util.math.AxisAlignedBB in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class WorldPhysObjectManager method getNearbyPhysObjects.
public List<PhysicsWrapperEntity> getNearbyPhysObjects(AxisAlignedBB toCheck) {
ArrayList<PhysicsWrapperEntity> ships = new ArrayList<PhysicsWrapperEntity>();
AxisAlignedBB expandedCheck = toCheck.expand(6, 6, 6);
for (PhysicsWrapperEntity wrapper : physicsEntities) {
if (wrapper.wrapping.collisionBB.intersectsWith(expandedCheck)) {
ships.add(wrapper);
}
}
return ships;
}
use of net.minecraft.util.math.AxisAlignedBB in project Realistic-Terrain-Generation by Team-RTG.
the class WorldUtil method isNotSolid.
/**
* Checks if the Block has a bounding box.
* @param world The world to check in
* @param pos The position to check
* @return True if the block has a bounding box, false otherwise.
*/
public static boolean isNotSolid(World world, BlockPos pos) {
IBlockState state = world.getBlockState(pos);
AxisAlignedBB boundingBox = state.getCollisionBoundingBox(world, pos);
return boundingBox == null || boundingBox.equals(Block.NULL_AABB);
}
use of net.minecraft.util.math.AxisAlignedBB in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class EntityCollisionInjector method setEntityPositionAndUpdateBB.
public static void setEntityPositionAndUpdateBB(Entity entity, double x, double y, double z) {
entity.posX = x;
entity.posY = y;
entity.posZ = z;
float f = entity.width / 2.0F;
float f1 = entity.height;
entity.boundingBox = new AxisAlignedBB(x - (double) f, y, z - (double) f, x + (double) f, y + (double) f1, z + (double) f);
}
Aggregations