Runes used for recipes in the Runic Altar are now given back upon the recipe's completion.

This commit is contained in:
Vasco Lavos committed 2015-12-04 19:43:28 +00:00
1 parent 7124c5acaf
commit 0e0ab83cf3
4 files changed
+18 -11

No files matched your search

@@ -142,7 +142,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I
ItemStack stack = getStackInSlot(i);
if(stack == null)
break;
lastRecipe.add(stack);
lastRecipe.add(stack.copy());
}
recipeKeepTicks = 400;
}
@@ -173,7 +173,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
ItemStack stack = getStackInSlot(i);
if(stack == null)
break;
lastRecipe.add(stack);
lastRecipe.add(stack.copy());
}
recipeKeepTicks = 400;
}
@@ -225,8 +225,17 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
}
saveLastRecipe();
for(int i = 0; i < getSizeInventory(); i++)
setInventorySlotContents(i, null);
for(int i = 0; i < getSizeInventory(); i++) {
ItemStack stack = getStackInSlot(i);
if(stack != null) {
if(stack.getItem() == ModItems.rune && (player == null || !player.capabilities.isCreativeMode)) {
EntityItem outputItem = new EntityItem(worldObj, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, stack.copy());
worldObj.spawnEntityInWorld(outputItem);
}
setInventorySlotContents(i, null);
}
}
if(!worldObj.isRemote) {
ItemStack livingrockItem = livingrock.getEntityItem();
@@ -141,13 +141,11 @@ public class ItemMagnetRing extends ItemBauble {
if(BotaniaAPI.isBlockBlacklistedFromMagnet(block, meta))
return false;
if(item.worldObj.isRemote) {
block = item.worldObj.getBlock(x, y - 1, z);
meta = item.worldObj.getBlockMetadata(x, y - 1, z);
block = item.worldObj.getBlock(x, y - 1, z);
meta = item.worldObj.getBlockMetadata(x, y - 1, z);
if(BotaniaAPI.isBlockBlacklistedFromMagnet(block, meta))
return false;
}
if(BotaniaAPI.isBlockBlacklistedFromMagnet(block, meta))
return false;
return true;
}