mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-12 16:57:32 -04:00
Should fix tablet disassembly ignoring upgrade container, closes #1838.
This commit is contained in:
parent
ce77d77baf
commit
9acb5eb26f
@ -166,9 +166,17 @@ public final class IMC {
|
|||||||
* Signature of callbacks must be:
|
* Signature of callbacks must be:
|
||||||
* <pre>
|
* <pre>
|
||||||
* boolean select(ItemStack stack)
|
* boolean select(ItemStack stack)
|
||||||
* ItemStack[] disassemble(ItemStack stack, ItemStack[] ingredients)
|
* Object disassemble(ItemStack stack, ItemStack[] ingredients)
|
||||||
* </pre>
|
* </pre>
|
||||||
* <p/>
|
* <p/>
|
||||||
|
* Where the <code>Object</code> returned from the <code>disassemble</code>
|
||||||
|
* method must be one of the following:
|
||||||
|
* <ul>
|
||||||
|
* <li><code>ItemStack[]</code>: list of resulting items, subject to random failure.</li>
|
||||||
|
* <li><code>Object[]{ItemStack[],ItemStack[]}</code>: two lists of resulting items, the first being subject to
|
||||||
|
* random failure, the second being guaranteed drops (e.g. for item inventory contents).</li>
|
||||||
|
* </ul>
|
||||||
|
* <p/>
|
||||||
* Callbacks must be declared as <tt>packagePath.className.methodName</tt>.
|
* Callbacks must be declared as <tt>packagePath.className.methodName</tt>.
|
||||||
* For example: <tt>com.example.Integration.callbackMethod</tt>.
|
* For example: <tt>com.example.Integration.callbackMethod</tt>.
|
||||||
*
|
*
|
||||||
|
@ -57,9 +57,9 @@ object TabletTemplate extends Template {
|
|||||||
def disassemble(stack: ItemStack, ingredients: Array[ItemStack]) = {
|
def disassemble(stack: ItemStack, ingredients: Array[ItemStack]) = {
|
||||||
val info = new TabletData(stack)
|
val info = new TabletData(stack)
|
||||||
val itemName = Constants.ItemName.TabletCase(info.tier)
|
val itemName = Constants.ItemName.TabletCase(info.tier)
|
||||||
Array(api.Items.get(itemName).createItemStack(1)) ++ info.items.collect {
|
(Array(api.Items.get(itemName).createItemStack(1), info.container.orNull) ++ info.items.collect {
|
||||||
case Some(item) => item
|
case Some(item) => item
|
||||||
}.drop(1) // Screen.
|
}.drop(1) /* Screen */).filter(_ != null)
|
||||||
}
|
}
|
||||||
|
|
||||||
def register() {
|
def register() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user