mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 03:36:47 -04:00
Merge git://github.com/Kilobyte22/OpenComputers
This commit is contained in:
commit
df4b1feddb
@ -13,6 +13,7 @@ Vexatos
|
|||||||
Wobbo
|
Wobbo
|
||||||
YuRaNnNzZZ
|
YuRaNnNzZZ
|
||||||
Kodos
|
Kodos
|
||||||
|
Kilobyte
|
||||||
|
|
||||||
# Names of more or less famous robots, as a bit of filler material. Feel free
|
# Names of more or less famous robots, as a bit of filler material. Feel free
|
||||||
# to add more via pull requests. Let's hope this won't get us sued...
|
# to add more via pull requests. Let's hope this won't get us sued...
|
||||||
|
@ -68,12 +68,26 @@ class DiskDrive(val parent: SimpleDelegator) extends SimpleDelegate {
|
|||||||
|
|
||||||
override def rightClick(world: World, x: Int, y: Int, z: Int, player: EntityPlayer,
|
override def rightClick(world: World, x: Int, y: Int, z: Int, player: EntityPlayer,
|
||||||
side: ForgeDirection, hitX: Float, hitY: Float, hitZ: Float) = {
|
side: ForgeDirection, hitX: Float, hitY: Float, hitZ: Float) = {
|
||||||
|
val te = world.getBlockTileEntity(x, y, z).asInstanceOf[tileentity.DiskDrive]
|
||||||
if (!player.isSneaking) {
|
if (!player.isSneaking) {
|
||||||
if (!world.isRemote) {
|
if (te.isItemValidForSlot(0, player.getCurrentEquippedItem)) {
|
||||||
player.openGui(OpenComputers, GuiType.DiskDrive.id, world, x, y, z)
|
if (te.getStackInSlot(0) != null) {
|
||||||
|
// if there is stuff inside ...
|
||||||
|
if (!world.isRemote) te.dropSlot(0, 1, te.facing) // drop it
|
||||||
|
}
|
||||||
|
te.setInventorySlotContents(0, player.getCurrentEquippedItem.splitStack(1)) // insert the disk
|
||||||
|
} else {
|
||||||
|
if (!world.isRemote) {
|
||||||
|
player.openGui(OpenComputers, GuiType.DiskDrive.id, world, x, y, z)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
|
} else {
|
||||||
|
if (te.getStackInSlot(0) != null) {
|
||||||
|
if (!world.isRemote) te.dropSlot(0, 1, te.facing)
|
||||||
|
true
|
||||||
|
}
|
||||||
|
else false
|
||||||
}
|
}
|
||||||
else false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user