AxisAlignedBB.expand -> .grow

This commit is contained in:
Bartek Bok 2017-12-10 15:32:05 +01:00
parent 38608e2cc2
commit feae6c1479
No known key found for this signature in database
GPG Key ID: D4AB7344B821F0B5
12 changed files with 12 additions and 13 deletions

View File

@ -176,7 +176,7 @@ public class StencilModelTransformer {
} }
if (layersToRender.renderCovers) if (layersToRender.renderCovers)
builder.addGeneralQuads(addStencilCovers(innerModel.bounds.expand(COVER_DELTA, COVER_DELTA, COVER_DELTA), canvasState.sideStates)); builder.addGeneralQuads(addStencilCovers(innerModel.bounds.grow(COVER_DELTA), canvasState.sideStates));
return builder.build(); return builder.build();
} }

View File

@ -277,7 +277,7 @@ public class EntityMagnet extends EntitySmoothMove implements IEntityAdditionalS
} }
protected List<Entity> detectEntityTargets() { protected List<Entity> detectEntityTargets() {
AxisAlignedBB aabb = getEntityBoundingBox().expand(0.25, 0, 0.25).offset(0, -1, 0); AxisAlignedBB aabb = getEntityBoundingBox().grow(0.25, 0, 0.25).offset(0, -1, 0);
return world.getEntitiesInAABBexcluding(this, aabb, createPickTargetPredicate()); return world.getEntitiesInAABBexcluding(this, aabb, createPickTargetPredicate());
} }

View File

@ -162,8 +162,7 @@ public class TileEntityCannon extends SyncedTileEntity implements IPointable, IS
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
AxisAlignedBB box = super.getRenderBoundingBox(); return super.getRenderBoundingBox().grow(32);
return box.expand(32.0, 32.0, 32.0);
} }
private Vec3d calcMotionFromAngles() { private Vec3d calcMotionFromAngles() {

View File

@ -117,7 +117,7 @@ public class TileEntityFan extends SyncedTileEntity implements IPlaceAwareTile,
private AxisAlignedBB getEntitySearchBoundingBox() { private AxisAlignedBB getEntitySearchBoundingBox() {
AxisAlignedBB boundingBox = BlockUtils.aabbOffset(pos, 0, -2, 0, +1, +3, 1); AxisAlignedBB boundingBox = BlockUtils.aabbOffset(pos, 0, -2, 0, +1, +3, 1);
return boundingBox.expand(Config.fanRange, Config.fanRange, Config.fanRange); return boundingBox.grow(Config.fanRange);
} }
private static boolean isLyingInSphericalCone(Vec3d coneAxis, Vec3d originToTarget, double halfAperture) { private static boolean isLyingInSphericalCone(Vec3d coneAxis, Vec3d originToTarget, double halfAperture) {

View File

@ -69,7 +69,7 @@ public class TileEntityGrave extends SyncedTileEntity implements IPlaceAwareTile
if (!world.isRemote) { if (!world.isRemote) {
if (Config.spawnSkeletons && world.getDifficulty() != EnumDifficulty.PEACEFUL && world.rand.nextDouble() < Config.skeletonSpawnRate) { if (Config.spawnSkeletons && world.getDifficulty() != EnumDifficulty.PEACEFUL && world.rand.nextDouble() < Config.skeletonSpawnRate) {
List<EntityLiving> mobs = world.getEntitiesWithinAABB(EntityLiving.class, getBB().expand(7, 7, 7), IS_MOB); List<EntityLiving> mobs = world.getEntitiesWithinAABB(EntityLiving.class, getBB().grow(7), IS_MOB);
if (mobs.size() < 5) { if (mobs.size() < 5) {
double chance = world.rand.nextDouble(); double chance = world.rand.nextDouble();

View File

@ -58,7 +58,7 @@ public class TileEntityTarget extends OpenTileEntity implements ISurfaceAttachme
} }
private void predictOtherProjectiles() { private void predictOtherProjectiles() {
final List<Entity> projectiles = world.getEntitiesWithinAABB(Entity.class, getBB().expand(10, 10, 10), PROJECTILE_SELECTOR); final List<Entity> projectiles = world.getEntitiesWithinAABB(Entity.class, getBB().grow(10), PROJECTILE_SELECTOR);
IBlockState state = null; IBlockState state = null;

View File

@ -183,7 +183,7 @@ public class TileEntityVacuumHopper extends SyncedTileEntity implements IInvento
spawnParticle(EnumParticleTypes.PORTAL, world.rand.nextDouble() - 0.5, world.rand.nextDouble() - 1.0, world.rand.nextDouble() - 0.5); spawnParticle(EnumParticleTypes.PORTAL, world.rand.nextDouble() - 0.5, world.rand.nextDouble() - 1.0, world.rand.nextDouble() - 0.5);
} }
List<Entity> interestingItems = world.getEntitiesWithinAABB(Entity.class, getBB().expand(3, 3, 3), entitySelector); List<Entity> interestingItems = world.getEntitiesWithinAABB(Entity.class, getBB().grow(3), entitySelector);
boolean needsSync = false; boolean needsSync = false;

View File

@ -71,7 +71,7 @@ public class TileEntityVillageHighlighter extends SyncedTileEntity implements IT
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
return super.getRenderBoundingBox().expand(200, 200, 200); return super.getRenderBoundingBox().grow(200);
} }
@Override @Override

View File

@ -20,7 +20,7 @@ public class InvisibleMobsFlimFlam implements IFlimFlamAction {
public boolean execute(EntityPlayerMP target) { public boolean execute(EntityPlayerMP target) {
final World world = target.world; final World world = target.world;
AxisAlignedBB around = target.getEntityBoundingBox().expand(20, 20, 20); AxisAlignedBB around = target.getEntityBoundingBox().grow(20);
List<EntityLiving> mobs = world.getEntitiesWithinAABB(EntityLiving.class, around, WorldUtils.NON_PLAYER); List<EntityLiving> mobs = world.getEntitiesWithinAABB(EntityLiving.class, around, WorldUtils.NON_PLAYER);
if (mobs.isEmpty()) return false; if (mobs.isEmpty()) return false;

View File

@ -24,7 +24,7 @@ public class MountFlimFlam implements IFlimFlamAction {
public boolean execute(EntityPlayerMP target) { public boolean execute(EntityPlayerMP target) {
final World world = target.world; final World world = target.world;
AxisAlignedBB around = target.getEntityBoundingBox().expand(40, 40, 40); AxisAlignedBB around = target.getEntityBoundingBox().grow(40);
List<EntityLiving> mobs = world.getEntitiesWithinAABB(EntityLiving.class, around, SAFE_SELECTOR); List<EntityLiving> mobs = world.getEntitiesWithinAABB(EntityLiving.class, around, SAFE_SELECTOR);
if (mobs.isEmpty()) return false; if (mobs.isEmpty()) return false;
EntityLiving selected = CollectionUtils.getRandom(mobs); EntityLiving selected = CollectionUtils.getRandom(mobs);

View File

@ -17,7 +17,7 @@ public class RenameFlimFlam implements IFlimFlamAction {
@Override @Override
public boolean execute(EntityPlayerMP target) { public boolean execute(EntityPlayerMP target) {
World world = target.world; World world = target.world;
AxisAlignedBB around = target.getEntityBoundingBox().expand(20, 20, 20); AxisAlignedBB around = target.getEntityBoundingBox().grow(20);
List<EntityLiving> living = world.getEntitiesWithinAABB(EntityLiving.class, around, WorldUtils.NON_PLAYER); List<EntityLiving> living = world.getEntitiesWithinAABB(EntityLiving.class, around, WorldUtils.NON_PLAYER);
Collections.shuffle(living); Collections.shuffle(living);

View File

@ -18,7 +18,7 @@ public class SheepDyeFlimFlam implements IFlimFlamAction {
@Override @Override
public boolean execute(EntityPlayerMP target) { public boolean execute(EntityPlayerMP target) {
World world = target.world; World world = target.world;
AxisAlignedBB around = target.getEntityBoundingBox().expand(20, 20, 20); AxisAlignedBB around = target.getEntityBoundingBox().grow(20);
List<EntitySheep> sheeps = world.getEntitiesWithinAABB(EntitySheep.class, around); List<EntitySheep> sheeps = world.getEntitiesWithinAABB(EntitySheep.class, around);
if (sheeps.isEmpty()) return false; if (sheeps.isEmpty()) return false;