コード例 #1
0
 @Override
 public CraftItemStack getItem(int index) {
   if (index == 0) {
     if (this.result.getItem(index) != null) {
       return CraftItemStack.asCraftMirror(this.result.getItem(index));
     }
     return CraftItemStack.asCraftCopy(new ItemStack(0, 1, (short) 0));
   } else if (this.inventory.getItem(index - this.result.getSize()) != null) {
     return CraftItemStack.asCraftMirror(this.inventory.getItem(index - this.result.getSize()));
   }
   return CraftItemStack.asCraftCopy(new ItemStack(0, 1, (short) 0));
 }
コード例 #2
0
  @Override
  public CraftItemStack[] getContents() {
    CraftItemStack[] items = new CraftItemStack[getSize()];
    net.minecraft.server.v1_6_R3.ItemStack[] mcResultItems = this.result.getContents();

    int i = 0;
    for (i = 0; i < mcResultItems.length; i++) {
      items[i] = CraftItemStack.asCraftMirror(mcResultItems[i]);
    }

    net.minecraft.server.v1_6_R3.ItemStack[] mcItems = this.inventory.getContents();

    for (int j = 0; j < mcItems.length; j++) {
      items[i + j] = CraftItemStack.asCraftMirror(mcItems[j]);
    }

    return items;
  }
コード例 #3
0
  @Override
  public CraftItemStack[] getMatrix() {
    CraftItemStack[] items = new CraftItemStack[getSize()];
    // net.minecraft.server.ItemStack[] matrix = this.inventory.getContents();

    for (int i = 0; i < getSize(); i++) {
      items[i] = CraftItemStack.asCraftMirror(this.inventory.getItem(i));
    }

    return items;
  }
コード例 #4
0
 @Override
 public CraftItemStack getResult() {
   net.minecraft.server.v1_6_R3.ItemStack item = this.result.getItem(0);
   return CraftItemStack.asCraftMirror(item);
 }