mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-12 16:57:32 -04:00
Made printer easier to automate (piping out of it will now only extract "outputs", i.e. empty ink cartridges and prints).
This commit is contained in:
parent
1bfd54091a
commit
b6d20aa344
@ -15,12 +15,13 @@ import li.cil.oc.server.{PacketSender => ServerPacketSender}
|
||||
import li.cil.oc.util.ExtendedAABB._
|
||||
import li.cil.oc.util.ExtendedNBT._
|
||||
import li.cil.oc.util.ItemUtils
|
||||
import net.minecraft.inventory.ISidedInventory
|
||||
import net.minecraft.item.ItemStack
|
||||
import net.minecraft.nbt.NBTTagCompound
|
||||
import net.minecraft.util.AxisAlignedBB
|
||||
import net.minecraftforge.common.util.ForgeDirection
|
||||
|
||||
class Printer extends traits.Environment with traits.Inventory with traits.Rotatable with SidedEnvironment with traits.StateAware {
|
||||
class Printer extends traits.Environment with traits.Inventory with traits.Rotatable with SidedEnvironment with traits.StateAware with ISidedInventory {
|
||||
val node = api.Network.newNode(this, Visibility.Network).
|
||||
withComponent("printer3d").
|
||||
withConnector(Settings.get.bufferConverter).
|
||||
@ -314,4 +315,12 @@ class Printer extends traits.Environment with traits.Inventory with traits.Rotat
|
||||
else if (slot == 1)
|
||||
api.Items.get(stack) == api.Items.get("inkCartridge")
|
||||
else false
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
override def getAccessibleSlotsFromSide(side: Int): Array[Int] = Array(slotMaterial, slotInk, slotOutput)
|
||||
|
||||
override def canExtractItem(slot: Int, stack: ItemStack, side: Int): Boolean = !isItemValidForSlot(slot, stack)
|
||||
|
||||
override def canInsertItem(slot: Int, stack: ItemStack, side: Int): Boolean = slot != slotOutput
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user