Exemplo n.º 1
0
 public void burn() {
   // Can't burn? Goodbye
   if (!canBurn()) {
     return;
   }
   ItemStack itemstack = getBurnResult(contents[0]);
   // Nothing in there? Then put something there.
   if (contents[2] == null) {
     contents[2] = itemstack.cloneItemStack();
   }
   // Burn ahead
   else if (contents[2].doMaterialsMatch(itemstack)) {
     contents[2].count += itemstack.count;
   }
   // And consume the ingredient item
   // Goddamn, you have container functions, use them! Notch!
   if (contents[0].getItem().u()) // Derpnote
   {
     contents[0] = new ItemStack(contents[0].getItem().t()); // Derpnote
   } else {
     contents[0].count--;
     // Let 0 be null
     if (contents[0].count <= 0) {
       contents[0] = null;
     }
   }
 }