mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 19:25:20 -04:00
fixed robots always dropping items forward into the world (even for dropUp and dropDown)
This commit is contained in:
parent
ceab755f72
commit
a042b71a15
@ -8,7 +8,9 @@ import li.cil.oc.api.network.{Node, Analyzable}
|
||||
import li.cil.oc.client.Sound
|
||||
import li.cil.oc.common.tileentity.RobotProxy
|
||||
import li.cil.oc.server.driver
|
||||
import li.cil.oc.server.{PacketSender => ServerPacketSender}
|
||||
import li.cil.oc.Settings
|
||||
import li.cil.oc.util.ExtendedNBT._
|
||||
import li.cil.oc.util.mods.Waila
|
||||
import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.nbt.{NBTTagString, NBTTagCompound}
|
||||
|
@ -54,11 +54,11 @@ trait Inventory extends TileEntity with inventory.Inventory {
|
||||
val rng = world.rand
|
||||
val (tx, ty, tz) = (
|
||||
0.1 * rng.nextGaussian + direction.offsetX * 0.45,
|
||||
0.1 * rng.nextGaussian + 0.1,
|
||||
0.1 * rng.nextGaussian + direction.offsetY * 0.65 + (direction.offsetX + direction.offsetZ) * 0.1,
|
||||
0.1 * rng.nextGaussian + direction.offsetZ * 0.45)
|
||||
val entity = new EntityItem(world, x + 0.5 + tx, y + 0.5 + ty, z + 0.5 + tz, stack.copy())
|
||||
entity.motionX = 0.0125 * rng.nextGaussian + direction.offsetX * 0.03
|
||||
entity.motionY = 0.0125 * rng.nextGaussian + 0.03
|
||||
entity.motionY = 0.0125 * rng.nextGaussian + direction.offsetY * 0.08 + (direction.offsetX + direction.offsetZ) * 0.03
|
||||
entity.motionZ = 0.0125 * rng.nextGaussian + direction.offsetZ * 0.03
|
||||
entity.delayBeforeCanPickup = 15
|
||||
world.spawnEntityInWorld(entity)
|
||||
|
@ -290,7 +290,7 @@ class Player(val robot: tileentity.Robot) extends EntityPlayer(robot.world, Sett
|
||||
}
|
||||
|
||||
override def dropPlayerItemWithRandomChoice(stack: ItemStack, inPlace: Boolean) =
|
||||
robot.spawnStackInWorld(stack, if (inPlace) ForgeDirection.UNKNOWN else robot.facing)
|
||||
robot.spawnStackInWorld(stack, if (inPlace) ForgeDirection.UNKNOWN else facing)
|
||||
|
||||
private def callUsingItemInSlot[T](slot: Int, f: (ItemStack) => T, repair: Boolean = true) = {
|
||||
val itemsBefore = adjacentItems
|
||||
|
@ -211,7 +211,6 @@ class Robot(val robot: tileentity.Robot) extends ManagedComponent {
|
||||
return result(true)
|
||||
}
|
||||
}
|
||||
// TODO Drop into the direction of the call (i.e. down if dropDown).
|
||||
player.dropPlayerItemWithRandomChoice(dropped, inPlace = false)
|
||||
context.pause(Settings.get.dropDelay)
|
||||
result(true)
|
||||
|
Loading…
x
Reference in New Issue
Block a user