mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 11:15:12 -04:00
Fix #2368.
This commit is contained in:
parent
41599b0c10
commit
ed21dafb7b
@ -54,7 +54,7 @@ class Cable(protected implicit val tileTag: ClassTag[tileentity.Cable]) extends
|
|||||||
override def getPickBlock(state: IBlockState, target: RayTraceResult, world: World, pos: BlockPos, player: EntityPlayer) =
|
override def getPickBlock(state: IBlockState, target: RayTraceResult, world: World, pos: BlockPos, player: EntityPlayer) =
|
||||||
world.getTileEntity(pos) match {
|
world.getTileEntity(pos) match {
|
||||||
case t: tileentity.Cable => t.createItemStack()
|
case t: tileentity.Cable => t.createItemStack()
|
||||||
case _ => ItemStack.EMPTY
|
case _ => createItemStack()
|
||||||
}
|
}
|
||||||
|
|
||||||
override def getBoundingBox(state: IBlockState, world: IBlockAccess, pos: BlockPos): AxisAlignedBB = Cable.bounds(world, pos)
|
override def getBoundingBox(state: IBlockState, world: IBlockAccess, pos: BlockPos): AxisAlignedBB = Cable.bounds(world, pos)
|
||||||
|
@ -63,6 +63,17 @@ class Item(value: Block) extends ItemBlock(value) {
|
|||||||
else super.getDamage(stack)
|
else super.getDamage(stack)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override def setDamage(stack: ItemStack, damage: Int): Unit = {
|
||||||
|
if (api.Items.get(stack) == api.Items.get(Constants.BlockName.Cable)) {
|
||||||
|
if(damage != Color.rgbValues(EnumDyeColor.SILVER)) {
|
||||||
|
ItemColorizer.setColor(stack, damage)
|
||||||
|
} else {
|
||||||
|
ItemColorizer.removeColor(stack)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else super.setDamage(stack, damage)
|
||||||
|
}
|
||||||
|
|
||||||
override def isBookEnchantable(a: ItemStack, b: ItemStack) = false
|
override def isBookEnchantable(a: ItemStack, b: ItemStack) = false
|
||||||
|
|
||||||
override def placeBlockAt(stack: ItemStack, player: EntityPlayer, world: World, pos: BlockPos, side: EnumFacing, hitX: Float, hitY: Float, hitZ: Float, newState: IBlockState): Boolean = {
|
override def placeBlockAt(stack: ItemStack, player: EntityPlayer, world: World, pos: BlockPos, side: EnumFacing, hitX: Float, hitY: Float, hitZ: Float, newState: IBlockState): Boolean = {
|
||||||
@ -91,4 +102,4 @@ class Item(value: Block) extends ItemBlock(value) {
|
|||||||
}
|
}
|
||||||
else false
|
else false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user