rename expand to grow, changes in mcp

closes #2498
This commit is contained in:
payonel 2017-10-11 22:13:43 -07:00
parent 43b11c6b91
commit 9cd09a0f46
12 changed files with 16 additions and 12 deletions

4
.gitignore vendored
View File

@ -25,3 +25,7 @@
# OS X
.DS_Store
/run
# VS Code
/.vscode

View File

@ -11,6 +11,6 @@ hwyla.version=1.8.20-B35_1.12
ic2.version=2.8.26-ex112
jei.version=4.7.5.87
mcmp.version=2.2.2_38
tis3d.version=1.2.2.4
tis3d.version=1.3.0.12
maven.url=file:///home/www/maven.cil.li/web

View File

@ -124,7 +124,7 @@ object HighlightRenderer {
for (shape <- print.shapes) {
val bounds = shape.bounds.rotateTowards(print.facing)
RenderGlobal.drawSelectionBoundingBox(bounds.expand(expansion, expansion, expansion)
RenderGlobal.drawSelectionBoundingBox(bounds.grow(expansion, expansion, expansion)
.offset(blockPos.x, blockPos.y, blockPos.z)
.offset(-pos.x, -pos.y, -pos.z), 0, 0, 0, 0x66/0xFFf.toFloat)
}

View File

@ -29,7 +29,7 @@ object MFUTargetRenderer {
if (player.getEntityWorld.provider.getDimension != dimension) return
if (player.getDistance(x, y, z) > 64) return
val bounds = BlockPosition(x, y, z).bounds.expand(0.1, 0.1, 0.1)
val bounds = BlockPosition(x, y, z).bounds.grow(0.1, 0.1, 0.1)
val px = player.lastTickPosX + (player.posX - player.lastTickPosX) * e.getPartialTicks
val py = player.lastTickPosY + (player.posY - player.lastTickPosY) * e.getPartialTicks

View File

@ -22,7 +22,7 @@ object MagnetProvider extends ScalaProvider("9324d5ec-71f1-41c2-b51c-406e527668f
val world = player.getEntityWorld
if (!world.isRemote) {
val actualRange = Settings.get.nanomachineMagnetRange * api.Nanomachines.getController(player).getInputCount(this)
val items = world.getEntitiesWithinAABB(classOf[EntityItem], player.getEntityBoundingBox.expand(actualRange, actualRange, actualRange))
val items = world.getEntitiesWithinAABB(classOf[EntityItem], player.getEntityBoundingBox.grow(actualRange, actualRange, actualRange))
items.collect {
case item: EntityItem if !item.cannotPickup && !item.getItem.isEmpty && player.inventory.mainInventory.exists(stack => stack.isEmpty || stack.getCount < stack.getMaxStackSize && stack.isItemEqual(item.getItem)) =>
val dx = player.posX - item.posX

View File

@ -228,7 +228,7 @@ class Charger extends traits.Environment with traits.PowerAcceptor with traits.R
}).collect {
case Some(t: RobotProxy) => new RobotChargeable(t.robot)
}
val bounds = BlockPosition(this).bounds.expand(1, 1, 1)
val bounds = BlockPosition(this).bounds.grow(1, 1, 1)
val drones = getWorld.getEntitiesWithinAABB(classOf[Drone], bounds).collect {
case drone: Drone => new DroneChargeable(drone)
}

View File

@ -330,7 +330,7 @@ class Robot extends traits.Computer with traits.PowerInformation with traits.Rot
override def getRenderBoundingBox: AxisAlignedBB =
if (getBlockType != null && getWorld != null)
getBlockType.getCollisionBoundingBox(getWorld.getBlockState(getPos), getWorld, getPos).expand(0.5, 0.5, 0.5).offset(getPos)
getBlockType.getCollisionBoundingBox(getWorld.getBlockState(getPos), getWorld, getPos).grow(0.5, 0.5, 0.5).offset(getPos)
else
new AxisAlignedBB(0, 0, 0, 1, 1, 1).offset(getPos)

View File

@ -132,7 +132,7 @@ class Player(val agent: internal.Agent) extends FakePlayer(agent.world.asInstanc
}
private def adjacentItems = {
world.getEntitiesWithinAABB(classOf[EntityItem], BlockPosition(agent).bounds.expand(2, 2, 2))
world.getEntitiesWithinAABB(classOf[EntityItem], BlockPosition(agent).bounds.grow(2, 2, 2))
}
private def collectDroppedItems(itemsBefore: Iterable[EntityItem]) {

View File

@ -82,7 +82,7 @@ class UpgradeLeash(val host: Entity) extends AbstractManagedEnvironment with tra
}
private def unleashAll() {
entitiesInBounds(classOf[EntityLiving], position.bounds.expand(5, 5, 5)).foreach(entity => {
entitiesInBounds(classOf[EntityLiving], position.bounds.grow(5, 5, 5)).foreach(entity => {
if (leashedEntities.contains(entity.getUniqueID) && entity.getLeashedToEntity == host) {
entity.clearLeashed(true, false)
}
@ -100,7 +100,7 @@ class UpgradeLeash(val host: Entity) extends AbstractManagedEnvironment with tra
// entities only remember their leashee if it's an EntityLivingBase...
EventHandler.scheduleServer(() => {
val foundEntities = mutable.Set.empty[UUID]
entitiesInBounds(classOf[EntityLiving], position.bounds.expand(5, 5, 5)).foreach(entity => {
entitiesInBounds(classOf[EntityLiving], position.bounds.grow(5, 5, 5)).foreach(entity => {
if (leashedEntities.contains(entity.getUniqueID)) {
entity.setLeashedToEntity(host, true)
foundEntities += entity.getUniqueID

View File

@ -51,7 +51,7 @@ object UpgradeTractorBeam {
@Callback(doc = """function():boolean -- Tries to pick up a random item in the robots' vicinity.""")
def suck(context: Context, args: Arguments): Array[AnyRef] = {
val items = world.getEntitiesWithinAABB(classOf[EntityItem], position.bounds.expand(pickupRadius, pickupRadius, pickupRadius))
val items = world.getEntitiesWithinAABB(classOf[EntityItem], position.bounds.grow(pickupRadius, pickupRadius, pickupRadius))
.filter(item => item.isEntityAlive && !item.cannotPickup)
if (items.nonEmpty) {
val item = items(world.rand.nextInt(items.size))

View File

@ -45,7 +45,7 @@ class UpgradeTrading(val host: EnvironmentHost) extends AbstractManagedEnvironme
@Callback(doc = "function():table -- Returns a table of trades in range as userdata objects.")
def getTrades(context: Context, args: Arguments): Array[AnyRef] = {
result(entitiesInBounds[Entity](classOf[Entity], position.bounds.expand(maxRange, maxRange, maxRange)).
result(entitiesInBounds[Entity](classOf[Entity], position.bounds.grow(maxRange, maxRange, maxRange)).
filter(isInRange).
collect { case merchant: IMerchant => merchant }.
flatMap(merchant => merchant.getRecipes(null).indices.map(new Trade(this, merchant, _))))

View File

@ -51,7 +51,7 @@ object Waypoints {
def findWaypoints(pos: BlockPosition, range: Double): Iterable[Waypoint] = {
dimensions.get(pos.world.get.provider.getDimension) match {
case Some(set) =>
val bounds = pos.bounds.expand(range * 0.5, range * 0.5, range * 0.5)
val bounds = pos.bounds.grow(range * 0.5, range * 0.5, range * 0.5)
set.query((bounds.minX, bounds.minY, bounds.minZ), (bounds.maxX, bounds.maxY, bounds.maxZ))
case _ => Iterable.empty
}