Vec3 and AABB factory to plain ctor

This commit is contained in:
Vincent Lee committed 2015-11-13 19:51:23 -06:00
1 parent 5a11a58346
commit f6cfeedd1d
82 files changed
+116 -116

No files matched your search

@@ -245,7 +245,7 @@ public final class CorporeaHelper {
* in are for the block that the spark will be on, not the coords of the spark itself.
*/
public static ICorporeaSpark getSparkForBlock(World world, int x, int y, int z) {
List<ICorporeaSpark> sparks = world.getEntitiesWithinAABB(ICorporeaSpark.class, AxisAlignedBB.getBoundingBox(x, y + 1, z, x + 1, y + 2, z + 1));
List<ICorporeaSpark> sparks = world.getEntitiesWithinAABB(ICorporeaSpark.class, new AxisAlignedBB(x, y + 1, z, x + 1, y + 2, z + 1));
return sparks.isEmpty() ? null : sparks.get(0);
}
@@ -40,7 +40,7 @@ public interface ISparkAttachable extends IManaReceiver {
* Gets the Spark that is attached to this block. A common implementation is
* to check for Spark entities above:
*
List<ISparkEntity> sparks = worldObj.getEntitiesWithinAABB(ISparkEntity.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord + 1, zCoord, xCoord + 1, yCoord + 2, zCoord + 1));
List<ISparkEntity> sparks = worldObj.getEntitiesWithinAABB(ISparkEntity.class, new AxisAlignedBB(xCoord, yCoord + 1, zCoord, xCoord + 1, yCoord + 2, zCoord + 1));
if(sparks.size() == 1) {
Entity e = (Entity) sparks.get(0);
return (ISparkEntity) e;
@@ -25,7 +25,7 @@ public final class SparkHelper {
public static <T> List<T> getEntitiesAround(Class<? extends T> clazz, World world, double x, double y, double z) {
int r = SPARK_SCAN_RANGE;
List<T> entities = world.getEntitiesWithinAABB(clazz, AxisAlignedBB.getBoundingBox(x - r, y - r, z - r, x + r, y + r, z + r));
List<T> entities = world.getEntitiesWithinAABB(clazz, new AxisAlignedBB(x - r, y - r, z - r, x + r, y + r, z + r));
return entities;
}
@@ -81,7 +81,7 @@ public class RadiusDescriptor {
public static class Square extends Rectangle {
public Square(ChunkCoordinates subtileCoords, int expand) {
super(subtileCoords, AxisAlignedBB.getBoundingBox(subtileCoords.posX - expand, subtileCoords.posY, subtileCoords.posZ - expand, subtileCoords.posX + 1 + expand, subtileCoords.posY, subtileCoords.posZ + 1 + expand));
super(subtileCoords, new AxisAlignedBB(subtileCoords.posX - expand, subtileCoords.posY, subtileCoords.posZ - expand, subtileCoords.posX + 1 + expand, subtileCoords.posY, subtileCoords.posZ + 1 + expand));
}
}
@@ -323,8 +323,8 @@ public class LightningHandler {
particleMaxAge = fadetime + rand.nextInt(fadetime) - fadetime / 2;
particleAge = -(int) (length * speed);
boundingBox = AxisAlignedBB.getBoundingBox(0, 0, 0, 0, 0, 0);
boundingBox.setBB(AxisAlignedBB.getBoundingBox(Math.min(start.x, end.x), Math.min(start.y, end.y), Math.min(start.z, end.z), Math.max(start.x, end.x), Math.max(start.y, end.y), Math.max(start.z, end.z)).expand(length / 2, length / 2, length / 2));
boundingBox = new AxisAlignedBB(0, 0, 0, 0, 0, 0);
boundingBox.setBB(new AxisAlignedBB(Math.min(start.x, end.x), Math.min(start.y, end.y), Math.min(start.z, end.z), Math.max(start.x, end.x), Math.max(start.y, end.y), Math.max(start.z, end.z)).expand(length / 2, length / 2, length / 2));
segments.add(new Segment(start, end));
}
@@ -82,7 +82,7 @@ public class BlockLightLauncher extends BlockMod implements ILexiconable {
}
if(!relays.isEmpty()) {
AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1);
AxisAlignedBB aabb = new AxisAlignedBB(x, y, z, x + 1, y + 1, z + 1);
List<Entity> entities = world.getEntitiesWithinAABB(EntityLivingBase.class, aabb);
entities.addAll(world.getEntitiesWithinAABB(EntityItem.class, aabb));
@@ -41,7 +41,7 @@ public class BlockSolidVines extends BlockVine implements ILexiconable {
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World w, int x, int y, int z) {
setBlockBoundsBasedOnState(w, x, y, z);
return AxisAlignedBB.getBoundingBox(x + minX, y + minY, z + minZ, x + maxX, y + maxY, z + maxZ);
return new AxisAlignedBB(x + minX, y + minY, z + minZ, x + maxX, y + maxY, z + maxZ);
}
@Override
@@ -77,7 +77,7 @@ public class BlockDirtPath extends BlockMod implements ILexiconable {
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
return AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1);
return new AxisAlignedBB(x, y, z, x + 1, y + 1, z + 1);
}
@Override
@@ -117,7 +117,7 @@ public class BlockForestDrum extends BlockMod implements IManaTrigger, ILexicona
ItemGrassHorn.breakGrass(world, null, 1, x, y, z);
else if(!world.isRemote) {
int range = 10;
List<EntityLiving> entities = world.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox(x - range, y - range, z - range, x + range + 1, y + range + 1, z + range + 1));
List<EntityLiving> entities = world.getEntitiesWithinAABB(EntityLiving.class, new AxisAlignedBB(x - range, y - range, z - range, x + range + 1, y + range + 1, z + range + 1));
List<EntityLiving> shearables = new ArrayList();
ItemStack stack = new ItemStack(this, 1, 1);
@@ -125,7 +125,7 @@ public class BlockForestDrum extends BlockMod implements IManaTrigger, ILexicona
if(entity instanceof IShearable && ((IShearable) entity).isShearable(stack, world, (int) entity.posX, (int) entity.posY, (int) entity.posZ)) {
shearables.add(entity);
} else if(entity instanceof EntityCow) {
List<EntityItem> items = world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(entity.posX, entity.posY, entity.posZ, entity.posX + entity.width, entity.posY + entity.height, entity.posZ + entity.width));
List<EntityItem> items = world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(entity.posX, entity.posY, entity.posZ, entity.posX + entity.width, entity.posY + entity.height, entity.posZ + entity.width));
for(EntityItem item : items) {
ItemStack itemstack = item.getEntityItem();
if(itemstack != null && itemstack.getItem() == Items.bucket && !world.isRemote) {
@@ -247,7 +247,7 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand
@Override
public AxisAlignedBB getWireframeAABB(World world, int x, int y, int z) {
float f = 1F / 16F;
return AxisAlignedBB.getBoundingBox(x + f, y + f, z + f, x + 1 - f, y + 1 - f, z + 1 - f);
return new AxisAlignedBB(x + f, y + f, z + f, x + 1 - f, y + 1 - f, z + 1 - f);
}
}
@@ -49,7 +49,7 @@ public class SubTileBellethorn extends SubTileFunctional {
if(ticksExisted % 5 == 0) {
int range = getRange();
List<EntityLivingBase> entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord, supertile.zCoord - range, supertile.xCoord + range + 1, supertile.yCoord + 1, supertile.zCoord + range + 1));
List<EntityLivingBase> entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(supertile.xCoord - range, supertile.yCoord, supertile.zCoord - range, supertile.xCoord + range + 1, supertile.yCoord + 1, supertile.zCoord + range + 1));
IEntitySelector selector = getSelector();
for(EntityLivingBase entity : entities) {
@@ -72,16 +72,16 @@ public class SubTileDaffomill extends SubTileFunctional {
AxisAlignedBB axis = null;
switch(orientation) {
case 0 :
axis = AxisAlignedBB.getBoundingBox(x - w, y - h, z - l, x + w + 1, y + h, z);
axis = new AxisAlignedBB(x - w, y - h, z - l, x + w + 1, y + h, z);
break;
case 1 :
axis = AxisAlignedBB.getBoundingBox(x - w, y - h, z + 1, x + w + 1, y + h, z + l + 1);
axis = new AxisAlignedBB(x - w, y - h, z + 1, x + w + 1, y + h, z + l + 1);
break;
case 2 :
axis = AxisAlignedBB.getBoundingBox(x - l, y - h, z - w, x, y + h, z + w + 1);
axis = new AxisAlignedBB(x - l, y - h, z - w, x, y + h, z + w + 1);
break;
case 3 :
axis = AxisAlignedBB.getBoundingBox(x + 1, y - h, z - w, x + l + 1, y + h, z + w + 1);
axis = new AxisAlignedBB(x + 1, y - h, z - w, x + l + 1, y + h, z + w + 1);
}
return axis;
}
@@ -32,7 +32,7 @@ public class SubTileFallenKanade extends SubTileFunctional {
final int cost = 120;
if(!supertile.getWorldObj().isRemote && supertile.getWorldObj().provider.dimensionId != 1) {
List<EntityPlayer> players = supertile.getWorldObj().getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1));
List<EntityPlayer> players = supertile.getWorldObj().getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1));
for(EntityPlayer player : players) {
if(player.getActivePotionEffect(Potion.regeneration) == null && mana >= cost ) {
player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 60, 2));
@@ -37,7 +37,7 @@ public class SubTileHeiseiDream extends SubTileFunctional {
final int cost = 100;
List<IMob> mobs = supertile.getWorldObj().getEntitiesWithinAABB(IMob.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1));
List<IMob> mobs = supertile.getWorldObj().getEntitiesWithinAABB(IMob.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1));
if(mobs.size() > 1 && mana >= cost)
for(IMob mob : mobs) {
if(mob instanceof EntityLiving) {
@@ -63,7 +63,7 @@ public class SubTileHopperhock extends SubTileFunctional {
int y = supertile.yCoord;
int z = supertile.zCoord;
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - range, y - range, z - range, x + range + 1, y + range + 1, z + range + 1));
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(x - range, y - range, z - range, x + range + 1, y + range + 1, z + range + 1));
for(EntityItem item : items) {
if(item.age < 60 || item.age >= 105 && item.age < 110 || item.isDead)
continue;
@@ -168,7 +168,7 @@ public class SubTileHopperhock extends SubTileFunctional {
};
for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) {
AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, x + dir.offsetX + 1, y + dir.offsetY + 1, z + dir.offsetZ + 1);
AxisAlignedBB aabb = new AxisAlignedBB(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, x + dir.offsetX + 1, y + dir.offsetY + 1, z + dir.offsetZ + 1);
List<EntityItemFrame> frames = supertile.getWorldObj().getEntitiesWithinAABB(EntityItemFrame.class, aabb);
for(EntityItemFrame frame : frames) {
int orientation = frame.hangingDirection;
@@ -36,7 +36,7 @@ public class SubTileHyacidus extends SubTileFunctional {
final int cost = 20;
List<EntityLivingBase> entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1));
List<EntityLivingBase> entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1));
for(EntityLivingBase entity : entities) {
if(!(entity instanceof EntityPlayer) && entity.getActivePotionEffect(Potion.poison) == null && mana >= cost && !entity.worldObj.isRemote && entity.getCreatureAttribute() != EnumCreatureAttribute.UNDEAD) {
entity.addPotionEffect(new PotionEffect(Potion.poison.id, 60, 0));
@@ -31,7 +31,7 @@ public class SubTileMedumone extends SubTileFunctional {
super.onUpdate();
if(mana > 0) {
List<EntityLivingBase> entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + 1, supertile.zCoord + RANGE + 1));
List<EntityLivingBase> entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + 1, supertile.zCoord + RANGE + 1));
for(EntityLivingBase entity : entities)
if(!(entity instanceof EntityPlayer)) {
@@ -34,8 +34,8 @@ public class SubTilePollidisiac extends SubTileFunctional {
if(!supertile.getWorldObj().isRemote) {
int manaCost = 12;
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + 1 + RANGE, supertile.yCoord + 1, supertile.zCoord + 1 +RANGE));
List<EntityAnimal> animals = supertile.getWorldObj().getEntitiesWithinAABB(EntityAnimal.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + 1 +RANGE, supertile.yCoord + 1, supertile.zCoord + 1 +RANGE));
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + 1 + RANGE, supertile.yCoord + 1, supertile.zCoord + 1 +RANGE));
List<EntityAnimal> animals = supertile.getWorldObj().getEntitiesWithinAABB(EntityAnimal.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + 1 +RANGE, supertile.yCoord + 1, supertile.zCoord + 1 +RANGE));
for(EntityAnimal animal : animals) {
if(mana < manaCost)
break;
@@ -76,7 +76,7 @@ public class SubTileRannuncarpus extends SubTileFunctional {
int y = supertile.yCoord;
int z = supertile.zCoord;
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - RANGE, y - RANGE_Y, z - RANGE, x + RANGE + 1, y + RANGE_Y, z + RANGE + 1));
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(x - RANGE, y - RANGE_Y, z - RANGE, x + RANGE + 1, y + RANGE_Y, z + RANGE + 1));
for(EntityItem item : items) {
if(item.age < 60 || item.isDead)
continue;
@@ -53,7 +53,7 @@ public class SubTileSpectranthemum extends SubTileFunctional {
int z = supertile.zCoord;
boolean did = false;
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - RANGE, y - RANGE, z - RANGE, x + RANGE + 1, y + RANGE, z + RANGE + 1));
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(x - RANGE, y - RANGE, z - RANGE, x + RANGE + 1, y + RANGE, z + RANGE + 1));
for(EntityItem item : items) {
if(item.age < 60 || item.isDead || item.getEntityData().getBoolean(TAG_TELEPORTED))
continue;
@@ -38,7 +38,7 @@ public class SubTileTangleberrie extends SubTileFunctional {
double maxDist = getMaxDistance();
double range = getRange();
AxisAlignedBB boundingBox = AxisAlignedBB.getBoundingBox(x1 - range, y1 - range, z1 - range, x1 + range + 1, y1 + range + 1, z1 + range + 1);
AxisAlignedBB boundingBox = new AxisAlignedBB(x1 - range, y1 - range, z1 - range, x1 + range + 1, y1 + range + 1, z1 + range + 1);
List<EntityLivingBase> entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, boundingBox);
for(EntityLivingBase entity : entities) {
@@ -41,7 +41,7 @@ public class SubTileTigerseye extends SubTileFunctional {
boolean shouldAfffect = mana >= cost;
List<EntityLiving> entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE_Y, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE_Y + 1, supertile.zCoord + RANGE + 1));
List<EntityLiving> entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLiving.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE_Y, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE_Y + 1, supertile.zCoord + RANGE + 1));
for(EntityLiving entity : entities) {
List<EntityAITaskEntry> entries = new ArrayList(entity.tasks.taskEntries);
@@ -31,7 +31,7 @@ public class SubTileArcaneRose extends SubTileGenerating {
if(mana >= getMaxMana())
return;
List<EntityPlayer> players = supertile.getWorldObj().getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + 1, supertile.zCoord + RANGE + 1));
List<EntityPlayer> players = supertile.getWorldObj().getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + 1, supertile.zCoord + RANGE + 1));
for(EntityPlayer player : players)
if(ExperienceHelper.getPlayerXP(player) >= 1 && player.onGround) {
ExperienceHelper.drainPlayerXP(player, 1);
@@ -42,7 +42,7 @@ public class SubTileEndoflame extends SubTileGenerating {
if(mana < getMaxMana() && !supertile.getWorldObj().isRemote) {
boolean didSomething = false;
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1));
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1));
for(EntityItem item : items) {
if(item.age >= 59 && !item.isDead) {
ItemStack stack = item.getEntityItem();
@@ -30,7 +30,7 @@ public class SubTileEntropinnyum extends SubTileGenerating {
super.onUpdate();
if(mana == 0) {
List<EntityTNTPrimed> tnts = supertile.getWorldObj().getEntitiesWithinAABB(EntityTNTPrimed.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1));
List<EntityTNTPrimed> tnts = supertile.getWorldObj().getEntitiesWithinAABB(EntityTNTPrimed.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1));
for(EntityTNTPrimed tnt : tnts) {
if(tnt.fuse == 1 && !tnt.isDead && !supertile.getWorldObj().getBlock(MathHelper.floor_double(tnt.posX), MathHelper.floor_double(tnt.posY), MathHelper.floor_double(tnt.posZ)).getMaterial().isLiquid()) {
if(!supertile.getWorldObj().isRemote) {
@@ -43,7 +43,7 @@ public class SubTileGourmaryllis extends SubTileGenerating {
}
if(!supertile.getWorldObj().isRemote) {
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1));
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1));
for(EntityItem item : items) {
ItemStack stack = item.getEntityItem();
if(stack != null && stack.getItem() instanceof ItemFood && !item.isDead) {
@@ -36,7 +36,7 @@ public class SubTileNarslimmus extends SubTileGenerating {
super.onUpdate();
if(ticksExisted % 5 == 0) {
List<EntitySlime> slimes = supertile.getWorldObj().getEntitiesWithinAABB(EntitySlime.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE, supertile.zCoord + RANGE + 1));
List<EntitySlime> slimes = supertile.getWorldObj().getEntitiesWithinAABB(EntitySlime.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE, supertile.zCoord + RANGE + 1));
for(EntitySlime slime : slimes) {
if(slime.getEntityData().getBoolean(TAG_WORLD_SPAWNED) && !slime.isDead) {
int size = slime.getSlimeSize();
@@ -45,7 +45,7 @@ public class SubTileSpectrolus extends SubTileGenerating {
if(!supertile.getWorldObj().isRemote) {
Item wool = Item.getItemFromBlock(Blocks.wool);
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1));
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1));
for(EntityItem item : items) {
ItemStack stack = item.getEntityItem();
if(stack != null && stack.getItem() == wool) {
@@ -195,9 +195,9 @@ public class TileAlfPortal extends TileMod {
}
AxisAlignedBB getPortalAABB() {
AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(xCoord - 1, yCoord + 1, zCoord, xCoord + 2, yCoord + 4, zCoord + 1);
AxisAlignedBB aabb = new AxisAlignedBB(xCoord - 1, yCoord + 1, zCoord, xCoord + 2, yCoord + 4, zCoord + 1);
if(getBlockMetadata() == 2)
aabb = AxisAlignedBB.getBoundingBox(xCoord, yCoord + 1, zCoord - 1, xCoord + 1, yCoord + 4, zCoord + 2);
aabb = new AxisAlignedBB(xCoord, yCoord + 1, zCoord - 1, xCoord + 1, yCoord + 4, zCoord + 2);
return aabb;
}
@@ -210,7 +210,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I
@Override
public void updateEntity() {
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord + 1D / 16D * 20D, zCoord, xCoord + 1, yCoord + 1D / 16D * 21D, zCoord + 1));
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(xCoord, yCoord + 1D / 16D * 20D, zCoord, xCoord + 1, yCoord + 1D / 16D * 21D, zCoord + 1));
boolean didChange = false;
@@ -94,7 +94,7 @@ public class TileBrewery extends TileSimpleInventory implements ISidedInventory,
recieveMana(0);
if(!worldObj.isRemote && recipe == null) {
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1));
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1));
for(EntityItem item : items)
if(!item.isDead && item.getEntityItem() != null) {
ItemStack stack = item.getEntityItem();
@@ -102,7 +102,7 @@ public class TileEnchanter extends TileMod implements ISparkAttachable {
if(stage != 0 || itemToEnchant == null || !itemToEnchant.isItemEnchantable())
return;
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord - 2, yCoord, zCoord - 2, xCoord + 3, yCoord + 1, zCoord + 3));
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(xCoord - 2, yCoord, zCoord - 2, xCoord + 3, yCoord + 1, zCoord + 3));
int count = items.size();
if(count > 0 && !worldObj.isRemote) {
@@ -147,7 +147,7 @@ public class TileEnchanter extends TileMod implements ISparkAttachable {
switch(stage) {
case 1 : { // Get books
if(stageTicks % 20 == 0) {
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord - 2, yCoord, zCoord - 2, xCoord + 3, yCoord + 1, zCoord + 3));
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(xCoord - 2, yCoord, zCoord - 2, xCoord + 3, yCoord + 1, zCoord + 3));
int count = items.size();
boolean addedEnch = false;
@@ -391,7 +391,7 @@ public class TileEnchanter extends TileMod implements ISparkAttachable {
@Override
public ISparkEntity getAttachedSpark() {
List<ISparkEntity> sparks = worldObj.getEntitiesWithinAABB(ISparkEntity.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord + 1, zCoord, xCoord + 1, yCoord + 2, zCoord + 1));
List<ISparkEntity> sparks = worldObj.getEntitiesWithinAABB(ISparkEntity.class, new AxisAlignedBB(xCoord, yCoord + 1, zCoord, xCoord + 1, yCoord + 2, zCoord + 1));
if(sparks.size() == 1) {
Entity e = (Entity) sparks.get(0);
return (ISparkEntity) e;
@@ -29,7 +29,7 @@ public class TileEnderEye extends TileMod {
int meta = getBlockMetadata();
int range = 80;
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(xCoord - range, yCoord - range, zCoord - range, xCoord + range, yCoord + range, zCoord + range));
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(xCoord - range, yCoord - range, zCoord - range, xCoord + range, yCoord + range, zCoord + range));
boolean looking = false;
for(EntityPlayer player : players) {
@@ -20,7 +20,7 @@ public class TileForestEye extends TileMod {
@Override
public void updateEntity() {
int range = 6;
int entityCount = worldObj.getEntitiesWithinAABB(EntityAnimal.class, AxisAlignedBB.getBoundingBox(xCoord - range, yCoord - range, zCoord - range, xCoord + range + 1, yCoord + range + 1, zCoord + range + 1)).size();
int entityCount = worldObj.getEntitiesWithinAABB(EntityAnimal.class, new AxisAlignedBB(xCoord - range, yCoord - range, zCoord - range, xCoord + range + 1, yCoord + range + 1, zCoord + range + 1)).size();
if(entityCount != entities) {
entities = entityCount;
worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord));
@@ -48,7 +48,7 @@ public class TileIncensePlate extends TileSimpleInventory implements ISidedInven
if(timeLeft > 0) {
timeLeft--;
if(!worldObj.isRemote) {
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(xCoord + 0.5 - RANGE, yCoord + 0.5 - RANGE, zCoord + 0.5 - RANGE, xCoord + 0.5 + RANGE, yCoord + 0.5 + RANGE, zCoord + 0.5 + RANGE));
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(xCoord + 0.5 - RANGE, yCoord + 0.5 - RANGE, zCoord + 0.5 - RANGE, xCoord + 0.5 + RANGE, yCoord + 0.5 + RANGE, zCoord + 0.5 + RANGE));
for(EntityPlayer player : players) {
PotionEffect currentEffect = player.getActivePotionEffect(Potion.potionTypes[effect.getPotionID()]);
boolean nightVision = effect.getPotionID() == Potion.nightVision.id;
@@ -88,7 +88,7 @@ public class TileLightRelay extends TileMod implements IWandBindable {
ChunkCoordinates endpoint = getEndpoint();
if(endpoint != null && !worldObj.isRemote) {
float range = 0.5F;
List<EntityEnderPearl> enderPearls = worldObj.getEntitiesWithinAABB(EntityEnderPearl.class, AxisAlignedBB.getBoundingBox(xCoord - range, yCoord - range, zCoord - range, xCoord + 1 + range, yCoord + 1 + range, zCoord + 1 + range));
List<EntityEnderPearl> enderPearls = worldObj.getEntitiesWithinAABB(EntityEnderPearl.class, new AxisAlignedBB(xCoord - range, yCoord - range, zCoord - range, xCoord + 1 + range, yCoord + 1 + range, zCoord + 1 + range));
for(EntityEnderPearl pearl : enderPearls) {
pearl.posX = endpoint.posX + pearl.posX - xCoord;
pearl.posY = endpoint.posY + pearl.posY - yCoord;
@@ -82,7 +82,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
recieveMana(0);
if(!worldObj.isRemote && manaToGet == 0) {
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1));
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1));
for(EntityItem item : items)
if(!item.isDead && item.getEntityItem() != null && item.getEntityItem().getItem() != Item.getItemFromBlock(ModBlocks.livingrock)) {
ItemStack stack = item.getEntityItem();
@@ -178,7 +178,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
}
if(manaToGet > 0 && mana >= manaToGet && !worldObj.isRemote) {
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1));
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1));
EntityItem livingrock = null;
for(EntityItem item : items)
if(!item.isDead && item.getEntityItem() != null && item.getEntityItem().getItem() == Item.getItemFromBlock(ModBlocks.livingrock)) {
@@ -72,7 +72,7 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver {
if (entity == null)
return;
int j = logic.getSpawnerWorld().getEntitiesWithinAABB(entity.getClass(), AxisAlignedBB.getBoundingBox(logic.getSpawnerX(), logic.getSpawnerY(), logic.getSpawnerZ(), logic.getSpawnerX() + 1, logic.getSpawnerY() + 1, logic.getSpawnerZ() + 1).expand(spawnRange * 2, 4.0D, spawnRange * 2)).size();
int j = logic.getSpawnerWorld().getEntitiesWithinAABB(entity.getClass(), new AxisAlignedBB(logic.getSpawnerX(), logic.getSpawnerY(), logic.getSpawnerZ(), logic.getSpawnerX() + 1, logic.getSpawnerY() + 1, logic.getSpawnerZ() + 1).expand(spawnRange * 2, 4.0D, spawnRange * 2)).size();
if (j >= maxNearbyEntities) {
resetTimer(logic);
@@ -133,7 +133,7 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable {
}
List<EntityItem> getItems() {
return worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1));
return worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1));
}
boolean areItemsValid(List<EntityItem> items) {
@@ -222,7 +222,7 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable {
@Override
public ISparkEntity getAttachedSpark() {
List<ISparkEntity> sparks = worldObj.getEntitiesWithinAABB(ISparkEntity.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord + 1, zCoord, xCoord + 1, yCoord + 2, zCoord + 1));
List<ISparkEntity> sparks = worldObj.getEntitiesWithinAABB(ISparkEntity.class, new AxisAlignedBB(xCoord, yCoord + 1, zCoord, xCoord + 1, yCoord + 2, zCoord + 1));
if(sparks.size() == 1) {
Entity e = (Entity) sparks.get(0);
return (ISparkEntity) e;
@@ -52,7 +52,7 @@ public class TileCorporeaFunnel extends TileCorporeaBase implements ICorporeaReq
};
for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) {
List<EntityItemFrame> frames = worldObj.getEntitiesWithinAABB(EntityItemFrame.class, AxisAlignedBB.getBoundingBox(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, xCoord + dir.offsetX + 1, yCoord + dir.offsetY + 1, zCoord + dir.offsetZ + 1));
List<EntityItemFrame> frames = worldObj.getEntitiesWithinAABB(EntityItemFrame.class, new AxisAlignedBB(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, xCoord + dir.offsetX + 1, yCoord + dir.offsetY + 1, zCoord + dir.offsetZ + 1));
for(EntityItemFrame frame : frames) {
int orientation = frame.hangingDirection;
if(orientationToDir[orientation] == dir.ordinal()) {
@@ -158,7 +158,7 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ
double y = yCoord + 0.5;
double z = zCoord + 0.5;
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(x - RADIUS, y - RADIUS, z - RADIUS, x + RADIUS, y + RADIUS, z + RADIUS));
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(x - RADIUS, y - RADIUS, z - RADIUS, x + RADIUS, y + RADIUS, z + RADIUS));
hasCloseby = false;
for(EntityPlayer player : players)
if(isInRangeOfIndex(player, this)) {
@@ -94,7 +94,7 @@ public class TileCorporeaInterceptor extends TileCorporeaBase implements ICorpor
};
for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) {
List<EntityItemFrame> frames = worldObj.getEntitiesWithinAABB(EntityItemFrame.class, AxisAlignedBB.getBoundingBox(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, xCoord + dir.offsetX + 1, yCoord + dir.offsetY + 1, zCoord + dir.offsetZ + 1));
List<EntityItemFrame> frames = worldObj.getEntitiesWithinAABB(EntityItemFrame.class, new AxisAlignedBB(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, xCoord + dir.offsetX + 1, yCoord + dir.offsetY + 1, zCoord + dir.offsetZ + 1));
for(EntityItemFrame frame : frames) {
int orientation = frame.hangingDirection;
if(orientationToDir[orientation] == dir.ordinal())
@@ -22,7 +22,7 @@ public class TileManaDetector extends TileMod implements IManaCollisionGhost {
public void updateEntity() {
if(!worldObj.isRemote) {
int meta = getBlockMetadata();
int expectedMeta = worldObj.getEntitiesWithinAABB(IManaBurst.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1)).size() != 0 ? 1 : 0;
int expectedMeta = worldObj.getEntitiesWithinAABB(IManaBurst.class, new AxisAlignedBB(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1)).size() != 0 ? 1 : 0;
if(meta != expectedMeta)
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, expectedMeta, 1 | 2);
@@ -215,7 +215,7 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc
conjuration = worldObj.getBlock(xCoord, yCoord - 1, zCoord) == ModBlocks.conjurationCatalyst;
catalystsRegistered = true;
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1));
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1));
for(EntityItem item : items) {
if(item.isDead)
continue;
@@ -406,7 +406,7 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc
@Override
public ISparkEntity getAttachedSpark() {
List<ISparkEntity> sparks = worldObj.getEntitiesWithinAABB(ISparkEntity.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord + 1, zCoord, xCoord + 1, yCoord + 2, zCoord + 1));
List<ISparkEntity> sparks = worldObj.getEntitiesWithinAABB(ISparkEntity.class, new AxisAlignedBB(xCoord, yCoord + 1, zCoord, xCoord + 1, yCoord + 2, zCoord + 1));
if(sparks.size() == 1) {
Entity e = (Entity) sparks.get(0);
return (ISparkEntity) e;
@@ -205,7 +205,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
double x = lastPingbackX;
double y = lastPingbackY;
double z = lastPingbackZ;
AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(x, y, z, x, y, z).expand(PINGBACK_EXPIRED_SEARCH_DISTANCE, PINGBACK_EXPIRED_SEARCH_DISTANCE, PINGBACK_EXPIRED_SEARCH_DISTANCE);
AxisAlignedBB aabb = new AxisAlignedBB(x, y, z, x, y, z).expand(PINGBACK_EXPIRED_SEARCH_DISTANCE, PINGBACK_EXPIRED_SEARCH_DISTANCE, PINGBACK_EXPIRED_SEARCH_DISTANCE);
List<IManaBurst> bursts = worldObj.getEntitiesWithinAABB(IManaBurst.class, aabb);
IManaBurst found = null;
UUID identity = getIdentifier();
@@ -495,7 +495,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
if (!world.isRemote && player instanceof EntityPlayer)
d1 += 1.62D;
double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * f;
Vec3 vec3 = Vec3.createVectorHelper(d0, d1, d2);
Vec3 vec3 = new Vec3(d0, d1, d2);
float f3 = MathHelper.cos(-f2 * 0.017453292F - (float) Math.PI);
float f4 = MathHelper.sin(-f2 * 0.017453292F - (float) Math.PI);
float f5 = -MathHelper.cos(-f1 * 0.017453292F);
@@ -630,7 +630,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
AxisAlignedBB axis = player.worldObj.getBlock(x, y, z).getCollisionBoundingBoxFromPool(player.worldObj, x, y, z);
if(axis == null)
axis = AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1);
axis = new AxisAlignedBB(x, y, z, x + 1, y + 1, z + 1);
if(!blockVec.isInside(axis))
blockVec = new Vector3(axis.minX + (axis.maxX - axis.minX) / 2, axis.minY + (axis.maxY - axis.minY) / 2, axis.minZ + (axis.maxZ - axis.minZ) / 2);
@@ -35,7 +35,7 @@ public class PotionBloodthirst extends PotionMod {
@SubscribeEvent
public void onSpawn(LivingSpawnEvent.CheckSpawn event) {
if(event.getResult() != Result.ALLOW && event.entityLiving instanceof IMob) {
List<EntityPlayer> players = event.world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(event.x - RANGE, event.y - RANGE, event.z - RANGE, event.x + RANGE, event.y + RANGE, event.z + RANGE));
List<EntityPlayer> players = event.world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(event.x - RANGE, event.y - RANGE, event.z - RANGE, event.x + RANGE, event.y + RANGE, event.z + RANGE));
for(EntityPlayer player : players)
if(hasEffect(player) && !hasEffect(player, ModPotions.emptiness)) {
event.setResult(Result.ALLOW);
@@ -34,7 +34,7 @@ public class PotionEmptiness extends PotionMod {
@SubscribeEvent
public void onSpawn(LivingSpawnEvent.CheckSpawn event) {
if(event.getResult() != Result.ALLOW && event.entityLiving instanceof IMob) {
List<EntityPlayer> players = event.world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(event.x - RANGE, event.y - RANGE, event.z - RANGE, event.x + RANGE, event.y + RANGE, event.z + RANGE));
List<EntityPlayer> players = event.world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(event.x - RANGE, event.y - RANGE, event.z - RANGE, event.x + RANGE, event.y + RANGE, event.z + RANGE));
for(EntityPlayer player : players)
if(hasEffect(player)) {
event.setResult(Result.DENY);
@@ -86,7 +86,7 @@ public final class TerrasteelCraftingHandler {
if(beacon.getLevels() <= 0)
return -1;
List<EntityItem> items = item.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1));
List<EntityItem> items = item.worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(x, y, z, x + 1, y + 1, z + 1));
EntityItem diamond = null;
EntityItem pearl = null;
@@ -178,7 +178,7 @@ public final class TerrasteelCraftingHandler {
int y = MathHelper.floor_double(item.posY);
int z = MathHelper.floor_double(item.posZ);
List<EntityItem> items = item.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1));
List<EntityItem> items = item.worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(x, y, z, x + 1, y + 1, z + 1));
for(EntityItem otherItem : items)
if(otherItem != item)
otherItem.setDead();
@@ -229,7 +229,7 @@ public class Vector3
}
public Vec3 toVec3D() {
return Vec3.createVectorHelper(x, y, z);
return new Vec3(x, y, z);
}
public double angle(Vector3 vec) {
@@ -121,7 +121,7 @@ public class EntityBabylonWeapon extends EntityThrowableCopy {
setLiveTicks(liveTime + 1);
if(!worldObj.isRemote) {
AxisAlignedBB axis = AxisAlignedBB.getBoundingBox(posX, posY, posZ, lastTickPosX, lastTickPosY, lastTickPosZ).expand(2, 2, 2);
AxisAlignedBB axis = new AxisAlignedBB(posX, posY, posZ, lastTickPosX, lastTickPosY, lastTickPosZ).expand(2, 2, 2);
List<EntityLivingBase> entities = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axis);
for(EntityLivingBase living : entities) {
if(living == thrower)
@@ -127,7 +127,7 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark {
}
List<ICorporeaSpark> getNearbySparks() {
return worldObj.getEntitiesWithinAABB(ICorporeaSpark.class, AxisAlignedBB.getBoundingBox(posX - SCAN_RANGE, posY - SCAN_RANGE, posZ - SCAN_RANGE, posX + SCAN_RANGE, posY + SCAN_RANGE, posZ + SCAN_RANGE));
return worldObj.getEntitiesWithinAABB(ICorporeaSpark.class, new AxisAlignedBB(posX - SCAN_RANGE, posY - SCAN_RANGE, posZ - SCAN_RANGE, posX + SCAN_RANGE, posY + SCAN_RANGE, posZ + SCAN_RANGE));
}
void restartNetwork() {
@@ -483,7 +483,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
public List<EntityPlayer> getPlayersAround() {
ChunkCoordinates source = getSource();
float range = 15F;
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(source.posX + 0.5 - range, source.posY + 0.5 - range, source.posZ + 0.5 - range, source.posX + 0.5 + range, source.posY + 0.5 + range, source.posZ + 0.5 + range));
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(source.posX + 0.5 - range, source.posY + 0.5 - range, source.posZ + 0.5 - range, source.posX + 0.5 + range, source.posY + 0.5 + range, source.posZ + 0.5 + range));
return players;
}
@@ -695,7 +695,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
spawnMissile();
} else {
range = 3F;
players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(posX - range, posY - range, posZ - range, posX + range, posY + range, posZ + range));
players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(posX - range, posY - range, posZ - range, posX + range, posY + range, posZ + range));
if(!players.isEmpty())
damageEntity(DamageSource.causePlayerDamage(players.get(0)), 0);
}
@@ -48,7 +48,7 @@ public class EntityFallingStar extends EntityThrowableCopy {
EntityLivingBase thrower = getThrower();
if(!worldObj.isRemote && thrower != null) {
AxisAlignedBB axis = AxisAlignedBB.getBoundingBox(posX, posY, posZ, lastTickPosX, lastTickPosY, lastTickPosZ).expand(2, 2, 2);
AxisAlignedBB axis = new AxisAlignedBB(posX, posY, posZ, lastTickPosX, lastTickPosY, lastTickPosZ).expand(2, 2, 2);
List<EntityLivingBase> entities = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axis);
for(EntityLivingBase living : entities) {
if(living == thrower)
@@ -73,7 +73,7 @@ public class EntityFlameRing extends Entity {
}
if(ticksExisted > 45) {
AxisAlignedBB boundingBox = AxisAlignedBB.getBoundingBox(posX, posY, posZ, posX, posY, posZ).expand(radius, radius, radius);
AxisAlignedBB boundingBox = new AxisAlignedBB(posX, posY, posZ, posX, posY, posZ).expand(radius, radius, radius);
List<EntityLivingBase> entities = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, boundingBox);
if(entities.isEmpty())
@@ -57,7 +57,7 @@ public class EntityMagicLandmine extends Entity {
Botania.proxy.wispFX(worldObj, posX, posY + 1, posZ, r, g, b, 0.5F, (float) (Math.random() - 0.5F) * m, (float) (Math.random() - 0.5F) * m, (float) (Math.random() - 0.5F) * m);
if(!worldObj.isRemote) {
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(posX - range, posY - range, posZ - range, posX + range, posY + range, posZ + range));
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(posX - range, posY - range, posZ - range, posX + range, posY + range, posZ + range));
for(EntityPlayer player : players) {
player.attackEntityFrom(summoner == null ? DamageSource.generic : DamageSource.causeMobDamage(summoner), 10);
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 25, 0));
@@ -123,7 +123,7 @@ public class EntityMagicMissile extends EntityThrowable {
motionY = Math.abs(motionY);
motionZ = motionVec.z;
List<EntityLivingBase> targetList = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(posX - 0.5, posY - 0.5, posZ - 0.5, posX + 0.5, posY + 0.5, posZ + 0.5));
List<EntityLivingBase> targetList = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(posX - 0.5, posY - 0.5, posZ - 0.5, posX + 0.5, posY + 0.5, posZ + 0.5));
if(targetList.contains(target) && target != null) {
EntityLivingBase thrower = getThrower();
EntityPlayer player = thrower instanceof EntityPlayer ? (EntityPlayer) thrower : null;
@@ -159,7 +159,7 @@ public class EntityMagicMissile extends EntityThrowable {
setTarget(null);
double range = 12;
List entities = worldObj.getEntitiesWithinAABB(isEvil() ? EntityPlayer.class : IMob.class, AxisAlignedBB.getBoundingBox(posX - range, posY - range, posZ - range, posX + range, posY + range, posZ + range));
List entities = worldObj.getEntitiesWithinAABB(isEvil() ? EntityPlayer.class : IMob.class, new AxisAlignedBB(posX - range, posY - range, posZ - range, posX + range, posY + range, posZ + range));
while(entities.size() > 0) {
Entity e = (Entity) entities.get(worldObj.rand.nextInt(entities.size()));
if(!(e instanceof EntityLivingBase) || e.isDead) { // Just in case...
@@ -187,15 +187,15 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile
++ticksInAir;
}
Vec3 vec3 = Vec3.createVectorHelper(posX, posY, posZ);
Vec3 vec31 = Vec3.createVectorHelper(posX + motionX, posY + motionY, posZ + motionZ);
Vec3 vec3 = new Vec3(posX, posY, posZ);
Vec3 vec31 = new Vec3(posX + motionX, posY + motionY, posZ + motionZ);
MovingObjectPosition movingobjectposition = worldObj.rayTraceBlocks(vec3, vec31);
vec3 = Vec3.createVectorHelper(posX, posY, posZ);
vec31 = Vec3.createVectorHelper(posX + motionX, posY + motionY, posZ + motionZ);
vec3 = new Vec3(posX, posY, posZ);
vec31 = new Vec3(posX + motionX, posY + motionY, posZ + motionZ);
if (movingobjectposition != null)
{
vec31 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
vec31 = new Vec3(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
}
if (!worldObj.isRemote)
@@ -47,8 +47,8 @@ public class EntityThrownItem extends EntityItem {
@Override
public void onUpdate() {
super.onUpdate();
Vec3 vec3 = Vec3.createVectorHelper(posX, posY, posZ);
Vec3 vec31 = Vec3.createVectorHelper(posX + motionX, posY + motionY, posZ + motionZ);
Vec3 vec3 = new Vec3(posX, posY, posZ);
Vec3 vec31 = new Vec3(posX + motionX, posY + motionY, posZ + motionZ);
MovingObjectPosition movingobjectposition = worldObj.rayTraceBlocks(vec3, vec31);
@@ -34,7 +34,7 @@ public class TriggerManaDetector extends StatementBase implements ITriggerIntern
World world = source.getTile().getWorldObj();
int x = source.getTile().xCoord, y = source.getTile().yCoord, z = source.getTile().zCoord;
boolean output = world.getEntitiesWithinAABB(IManaBurst.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1)).size() != 0;
boolean output = world.getEntitiesWithinAABB(IManaBurst.class, new AxisAlignedBB(x, y, z, x + 1, y + 1, z + 1)).size() != 0;
if(output) for(int i = 0; i < 4; i++)
Botania.proxy.sparkleFX(world, x + Math.random(), y + Math.random(), z + Math.random(), 1F, 0.2F, 0.2F, 0.7F + 0.5F * (float) Math.random(), 5);
@@ -110,7 +110,7 @@ public class ItemBlackHoleTalisman extends ItemMod implements IBlockProvider {
}
} else {
ForgeDirection dir = ForgeDirection.getOrientation(par7);
int entities = par3World.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(par4 + dir.offsetX, par5 + dir.offsetY, par6 + dir.offsetZ, par4 + dir.offsetX + 1, par5 + dir.offsetY + 1, par6 + dir.offsetZ + 1)).size();
int entities = par3World.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(par4 + dir.offsetX, par5 + dir.offsetY, par6 + dir.offsetZ, par4 + dir.offsetX + 1, par5 + dir.offsetY + 1, par6 + dir.offsetZ + 1)).size();
if(entities == 0) {
int remove = par2EntityPlayer.capabilities.isCreativeMode ? 1 : remove(par1ItemStack, 1);
@@ -145,7 +145,7 @@ public class ItemBottledMana extends ItemMod {
player.worldObj.spawnEntityInWorld(flare);
int range = 5;
List<EntityLivingBase> entities = player.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range));
List<EntityLivingBase> entities = player.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range));
for(EntityLivingBase entity : entities)
if(entity != player && (!(entity instanceof EntityPlayer) || MinecraftServer.getServer() == null || MinecraftServer.getServer().isPVPEnabled()))
entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 50, 5));
@@ -72,7 +72,7 @@ public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem {
return true;
}
} else if(par3World.isRemote) {
MovingObjectPosition pos = new MovingObjectPosition(par4, par5, par6, par7, Vec3.createVectorHelper(par8, par9, par10));
MovingObjectPosition pos = new MovingObjectPosition(par4, par5, par6, par7, new Vec3(par8, par9, par10));
return Botania.proxy.openWikiPage(par3World, block, pos);
}
}
@@ -33,7 +33,7 @@ public class ItemPinkinator extends ItemMod {
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
int range = 16;
List<EntityWither> withers = world.getEntitiesWithinAABB(EntityWither.class, AxisAlignedBB.getBoundingBox(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range));
List<EntityWither> withers = world.getEntitiesWithinAABB(EntityWither.class, new AxisAlignedBB(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range));
for(EntityWither wither : withers)
if(!wither.isDead && !(wither instanceof EntityPinkWither)) {
if(!world.isRemote) {
@@ -68,7 +68,7 @@ public class ItemSignalFlare extends ItemMod {
int stunned = 0;
int range = 5;
List<EntityLivingBase> entities = par2World.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(par3EntityPlayer.posX - range, par3EntityPlayer.posY - range, par3EntityPlayer.posZ - range, par3EntityPlayer.posX + range, par3EntityPlayer.posY + range, par3EntityPlayer.posZ + range));
List<EntityLivingBase> entities = par2World.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(par3EntityPlayer.posX - range, par3EntityPlayer.posY - range, par3EntityPlayer.posZ - range, par3EntityPlayer.posX + range, par3EntityPlayer.posY + range, par3EntityPlayer.posZ + range));
for(EntityLivingBase entity : entities)
if(entity != par3EntityPlayer && (!(entity instanceof EntityPlayer) || MinecraftServer.getServer() == null || MinecraftServer.getServer().isPVPEnabled())) {
entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 50, 5));
@@ -59,7 +59,7 @@ public class ItemDivaCharm extends ItemBauble implements IManaUsingItem, IBauble
if(ManaItemHandler.requestManaExact(amulet, player, cost, false)) {
final int range = 20;
List<IMob> mobs = player.worldObj.getEntitiesWithinAABB(IMob.class, AxisAlignedBB.getBoundingBox(event.entity.posX - range, event.entity.posY - range, event.entity.posZ - range, event.entity.posX + range, event.entity.posY + range, event.entity.posZ + range));
List<IMob> mobs = player.worldObj.getEntitiesWithinAABB(IMob.class, new AxisAlignedBB(event.entity.posX - range, event.entity.posY - range, event.entity.posZ - range, event.entity.posX + range, event.entity.posY + range, event.entity.posZ + range));
if(mobs.size() > 1) {
if(SubTileHeiseiDream.brainwashEntity((EntityLiving) event.entityLiving, mobs)) {
if(event.entityLiving instanceof EntityCreeper)
@@ -118,7 +118,7 @@ public class ItemItemFinder extends ItemBauble implements IBaubleRender {
if(pstack != null || player.isSneaking()) {
int range = 24;
List<Entity> entities = player.worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range));
List<Entity> entities = player.worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range));
for(Entity e : entities) {
if(e == player)
continue;
@@ -104,7 +104,7 @@ public class ItemMagnetRing extends ItemBauble {
double y = player.posY -(player.worldObj.isRemote ? 1.62 : 0) + 0.75;
double z = player.posZ;
List<EntityItem> items = player.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - range, y - range, z - range, x + range, y + range, z + range));
List<EntityItem> items = player.worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(x - range, y - range, z - range, x + range, y + range, z + range));
int pulled = 0;
for(EntityItem item : items)
if(canPullItem(item)) {
@@ -61,7 +61,7 @@ public class ItemTinyPlanet extends ItemBauble implements IBaubleRender {
public static void applyEffect(World world, double x, double y, double z) {
int range = 8;
List<Entity> entities = world.getEntitiesWithinAABB(IManaBurst.class, AxisAlignedBB.getBoundingBox(x - range, y - range, z - range, x + range, y + range, z + range));
List<Entity> entities = world.getEntitiesWithinAABB(IManaBurst.class, new AxisAlignedBB(x - range, y - range, z - range, x + range, y + range, z + range));
for(Entity entity : entities) {
IManaBurst burst = (IManaBurst) entity;
ItemStack lens = burst.getSourceLens();
@@ -36,7 +36,7 @@ public class ItemUnholyCloak extends ItemHolyCloak {
public boolean effectOnDamage(LivingHurtEvent event, EntityPlayer player, ItemStack stack) {
if(!event.source.isUnblockable()) {
int range = 6;
List<IMob> mobs = player.worldObj.getEntitiesWithinAABB(IMob.class, AxisAlignedBB.getBoundingBox(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range));
List<IMob> mobs = player.worldObj.getEntitiesWithinAABB(IMob.class, new AxisAlignedBB(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range));
for(IMob mob : mobs)
if(mob instanceof EntityLivingBase) {
EntityLivingBase entity = (EntityLivingBase) mob;
@@ -61,7 +61,7 @@ public class ItemThunderSword extends ItemManasteelSword implements ICraftAchiev
Random rand = new Random(lightningSeed);
EntityLivingBase lightningSource = entity;
for(int i = 0; i < 4; i++) {
List<EntityLivingBase> entities = entity.worldObj.getEntitiesWithinAABBExcludingEntity(lightningSource, AxisAlignedBB.getBoundingBox(lightningSource.posX - range, lightningSource.posY - range, lightningSource.posZ - range, lightningSource.posX + range, lightningSource.posY + range, lightningSource.posZ + range), selector);
List<EntityLivingBase> entities = entity.worldObj.getEntitiesWithinAABBExcludingEntity(lightningSource, new AxisAlignedBB(lightningSource.posX - range, lightningSource.posY - range, lightningSource.posZ - range, lightningSource.posX + range, lightningSource.posY + range, lightningSource.posZ + range), selector);
if(entities.isEmpty())
break;
@@ -139,7 +139,7 @@ public final class ToolCommons {
if (!world.isRemote && player instanceof EntityPlayer)
d1 += 1.62D;
double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * f;
Vec3 vec3 = Vec3.createVectorHelper(d0, d1, d2);
Vec3 vec3 = new Vec3(d0, d1, d2);
float f3 = MathHelper.cos(-f2 * 0.017453292F - (float) Math.PI);
float f4 = MathHelper.sin(-f2 * 0.017453292F - (float) Math.PI);
float f5 = -MathHelper.cos(-f1 * 0.017453292F);
@@ -66,7 +66,7 @@ public class ItemElementiumShears extends ItemManasteelShears {
if(count != getMaxItemUseDuration(stack) && count % 5 == 0) {
int range = 12;
List<IShearable> sheep = player.worldObj.getEntitiesWithinAABB(IShearable.class, AxisAlignedBB.getBoundingBox(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range));
List<IShearable> sheep = player.worldObj.getEntitiesWithinAABB(IShearable.class, new AxisAlignedBB(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range));
if(sheep.size() > 0) {
for(IShearable target : sheep) {
Entity entity = (Entity) target;
@@ -103,7 +103,7 @@ public class ItemTerraSword extends ItemManasteelSword implements ILensEffect, I
@Override
public void updateBurst(IManaBurst burst, ItemStack stack) {
EntityThrowable entity = (EntityThrowable) burst;
AxisAlignedBB axis = AxisAlignedBB.getBoundingBox(entity.posX, entity.posY, entity.posZ, entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).expand(1, 1, 1);
AxisAlignedBB axis = new AxisAlignedBB(entity.posX, entity.posY, entity.posZ, entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).expand(1, 1, 1);
List<EntityLivingBase> entities = entity.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axis);
String attacker = ItemNBTHelper.getString(burst.getSourceLens(), TAG_ATTACKER_USERNAME, "");
@@ -24,7 +24,7 @@ public class LensDamage extends Lens {
@Override
public void updateBurst(IManaBurst burst, EntityThrowable entity, ItemStack stack) {
AxisAlignedBB axis = AxisAlignedBB.getBoundingBox(entity.posX, entity.posY, entity.posZ, entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).expand(1, 1, 1);
AxisAlignedBB axis = new AxisAlignedBB(entity.posX, entity.posY, entity.posZ, entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).expand(1, 1, 1);
List<EntityLivingBase> entities = entity.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axis);
for(EntityLivingBase living : entities) {
if(living instanceof EntityPlayer)
@@ -29,11 +29,11 @@ public class LensInfluence extends Lens {
public void updateBurst(IManaBurst burst, EntityThrowable entity, ItemStack stack) {
if(!burst.isFake()) {
double range = 3.5;
List<Entity> movables = entity.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range));
movables.addAll(entity.worldObj.getEntitiesWithinAABB(EntityXPOrb.class, AxisAlignedBB.getBoundingBox(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range)));
movables.addAll(entity.worldObj.getEntitiesWithinAABB(EntityArrow.class, AxisAlignedBB.getBoundingBox(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range)));
movables.addAll(entity.worldObj.getEntitiesWithinAABB(EntityFallingBlock.class, AxisAlignedBB.getBoundingBox(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range)));
movables.addAll(entity.worldObj.getEntitiesWithinAABB(IManaBurst.class, AxisAlignedBB.getBoundingBox(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range)));
List<Entity> movables = entity.worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range));
movables.addAll(entity.worldObj.getEntitiesWithinAABB(EntityXPOrb.class, new AxisAlignedBB(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range)));
movables.addAll(entity.worldObj.getEntitiesWithinAABB(EntityArrow.class, new AxisAlignedBB(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range)));
movables.addAll(entity.worldObj.getEntitiesWithinAABB(EntityFallingBlock.class, new AxisAlignedBB(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range)));
movables.addAll(entity.worldObj.getEntitiesWithinAABB(IManaBurst.class, new AxisAlignedBB(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range)));
for(Entity movable : movables) {
if(movable == burst)
@@ -34,7 +34,7 @@ public class LensPaint extends Lens {
if(pos.entityHit != null && pos.entityHit instanceof EntitySheep) {
int r = 20;
int sheepColor = ((EntitySheep) pos.entityHit).getFleeceColor();
List<EntitySheep> sheepList = entity.worldObj.getEntitiesWithinAABB(EntitySheep.class, AxisAlignedBB.getBoundingBox(pos.entityHit.posX - r, pos.entityHit.posY - r, pos.entityHit.posZ - r, pos.entityHit.posX + r, pos.entityHit.posY + r, pos.entityHit.posZ + r));
List<EntitySheep> sheepList = entity.worldObj.getEntitiesWithinAABB(EntitySheep.class, new AxisAlignedBB(pos.entityHit.posX - r, pos.entityHit.posY - r, pos.entityHit.posZ - r, pos.entityHit.posX + r, pos.entityHit.posY + r, pos.entityHit.posZ + r));
for(EntitySheep sheep : sheepList) {
if(sheep.getFleeceColor() == sheepColor)
sheep.setFleeceColor(storedColor == 16 ? sheep.worldObj.rand.nextInt(16) : storedColor);
@@ -156,12 +156,12 @@ public class ItemExcaliber extends ItemManasteelSword implements IRelic, ILensEf
@Override
public void updateBurst(IManaBurst burst, ItemStack stack) {
EntityThrowable entity = (EntityThrowable) burst;
AxisAlignedBB axis = AxisAlignedBB.getBoundingBox(entity.posX, entity.posY, entity.posZ, entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).expand(1, 1, 1);
AxisAlignedBB axis = new AxisAlignedBB(entity.posX, entity.posY, entity.posZ, entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).expand(1, 1, 1);
String attacker = ItemNBTHelper.getString(burst.getSourceLens(), TAG_ATTACKER_USERNAME, "");
int homeID = ItemNBTHelper.getInt(stack, TAG_HOME_ID, -1);
if(homeID == -1) {
AxisAlignedBB axis1 = AxisAlignedBB.getBoundingBox(entity.posX, entity.posY, entity.posZ, entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).expand(5, 5, 5);
AxisAlignedBB axis1 = new AxisAlignedBB(entity.posX, entity.posY, entity.posZ, entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).expand(5, 5, 5);
List<EntityLivingBase> entities = entity.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axis1);
for(EntityLivingBase living : entities) {
if(living instanceof EntityPlayer || living instanceof IBossDisplayData || !(living instanceof IMob) || living.hurtTime != 0)
@@ -51,7 +51,7 @@ public class ItemDirtRod extends ItemMod implements IManaUsingItem, ICraftAchiev
public static boolean place(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10, Block block, int cost, float r, float g, float b) {
if(ManaItemHandler.requestManaExactForTool(par1ItemStack, par2EntityPlayer, cost, false)) {
ForgeDirection dir = ForgeDirection.getOrientation(par7);
int entities = par3World.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(par4 + dir.offsetX, par5 + dir.offsetY, par6 + dir.offsetZ, par4 + dir.offsetX + 1, par5 + dir.offsetY + 1, par6 + dir.offsetZ + 1)).size();
int entities = par3World.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(par4 + dir.offsetX, par5 + dir.offsetY, par6 + dir.offsetZ, par4 + dir.offsetX + 1, par5 + dir.offsetY + 1, par6 + dir.offsetZ + 1)).size();
if(entities == 0) {
ItemStack stackToPlace = new ItemStack(block);
@@ -93,7 +93,7 @@ public class ItemGravityRod extends ItemMod implements IManaUsingItem {
target.add(new Vector3(player.getLookVec()).multiply(distance));
target.y += 0.5;
entities = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, AxisAlignedBB.getBoundingBox(target.x - RANGE, target.y - RANGE, target.z - RANGE, target.x + RANGE, target.y + RANGE, target.z + RANGE));
entities = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, new AxisAlignedBB(target.x - RANGE, target.y - RANGE, target.z - RANGE, target.x + RANGE, target.y + RANGE, target.z + RANGE));
distance++;
if(entities.contains(taritem))
found = true;
@@ -111,7 +111,7 @@ public class ItemGravityRod extends ItemMod implements IManaUsingItem {
target.add(new Vector3(player.getLookVec()).multiply(distance));
target.y += 0.5;
entities = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, AxisAlignedBB.getBoundingBox(target.x - RANGE, target.y - RANGE, target.z - RANGE, target.x + RANGE, target.y + RANGE, target.z + RANGE));
entities = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, new AxisAlignedBB(target.x - RANGE, target.y - RANGE, target.z - RANGE, target.x + RANGE, target.y + RANGE, target.z + RANGE));
distance++;
}
@@ -197,7 +197,7 @@ public class ItemGravityRod extends ItemMod implements IManaUsingItem {
target.add(new Vector3(player.getLookVec()).multiply(distance));
target.y += 0.5;
entities = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, AxisAlignedBB.getBoundingBox(target.x - RANGE, target.y - RANGE, target.z - RANGE, target.x + RANGE, target.y + RANGE, target.z + RANGE));
entities = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, new AxisAlignedBB(target.x - RANGE, target.y - RANGE, target.z - RANGE, target.x + RANGE, target.y + RANGE, target.z + RANGE));
distance++;
if(entities.contains(taritem))
found = true;
@@ -153,16 +153,16 @@ public class ItemRainbowRod extends ItemMod implements IManaUsingItem, IAvatarWi
AxisAlignedBB axis = null;
switch(te.getBlockMetadata() - 2) {
case 0 :
axis = AxisAlignedBB.getBoundingBox(x - w, y - h, z - l, x + w + 1, y + h, z);
axis = new AxisAlignedBB(x - w, y - h, z - l, x + w + 1, y + h, z);
break;
case 1 :
axis = AxisAlignedBB.getBoundingBox(x - w, y - h, z + 1, x + w + 1, y + h, z + l + 1);
axis = new AxisAlignedBB(x - w, y - h, z + 1, x + w + 1, y + h, z + l + 1);
break;
case 2 :
axis = AxisAlignedBB.getBoundingBox(x - l, y - h, z - w, x, y + h, z + w + 1);
axis = new AxisAlignedBB(x - l, y - h, z - w, x, y + h, z + w + 1);
break;
case 3 :
axis = AxisAlignedBB.getBoundingBox(x + 1, y - h, z - w, x + l + 1, y + h, z + w + 1);
axis = new AxisAlignedBB(x + 1, y - h, z - w, x + l + 1, y + h, z + w + 1);
}
List<EntityPlayer> players = world.getEntitiesWithinAABB(EntityPlayer.class, axis);
@@ -178,7 +178,7 @@ public class ItemRainbowRod extends ItemMod implements IManaUsingItem, IAvatarWi
int ex = px + i - diff;
int ez = pz + j - diff;
if(!axis.isVecInside(Vec3.createVectorHelper(ex + 0.5, py + 1, ez + 0.5)))
if(!axis.isVecInside(new Vec3(ex + 0.5, py + 1, ez + 0.5)))
continue;
Block block = world.getBlock(ex, py, ez);
@@ -39,7 +39,7 @@ public class ItemSkyDirtRod extends ItemDirtRod {
int y = MathHelper.floor_double(placeVec.y) + 1;
int z = MathHelper.floor_double(placeVec.z);
int entities = world.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1)).size();
int entities = world.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(x, y, z, x + 1, y + 1, z + 1)).size();
if(entities == 0) {
ItemStack stackToPlace = new ItemStack(Blocks.dirt);
@@ -159,7 +159,7 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi
if(tile.getCurrentMana() >= COST && tile.isEnabled()) {
int range = 5;
int rangeY = 3;
List<EntityPlayer> players = world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(te.xCoord + 0.5 - range, te.yCoord + 0.5 - rangeY, te.zCoord + 0.5 - range, te.xCoord + 0.5 + range, te.yCoord + 0.5 + rangeY, te.zCoord + 0.5 + range));
List<EntityPlayer> players = world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(te.xCoord + 0.5 - range, te.yCoord + 0.5 - rangeY, te.zCoord + 0.5 - range, te.xCoord + 0.5 + range, te.yCoord + 0.5 + rangeY, te.zCoord + 0.5 + range));
for(EntityPlayer p : players) {
if(p.motionY > 0.3 && p.motionY < 2 && !p.isSneaking()) {
p.motionY = 2.8;