From 0e0ab83cf35b1d0fd897186cdcca62b9141e9491 Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Fri, 4 Dec 2015 19:43:28 +0000 Subject: [PATCH] Runes used for recipes in the Runic Altar are now given back upon the recipe's completion. --- .../botania/common/block/tile/TileAltar.java | 2 +- .../botania/common/block/tile/TileRuneAltar.java | 15 ++++++++++++--- .../item/equipment/bauble/ItemMagnetRing.java | 10 ++++------ src/main/resources/assets/botania/lang/en_US.lang | 2 +- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/main/java/vazkii/botania/common/block/tile/TileAltar.java b/src/main/java/vazkii/botania/common/block/tile/TileAltar.java index a6cd1fd19..2f11f231b 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileAltar.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileAltar.java @@ -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; } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileRuneAltar.java b/src/main/java/vazkii/botania/common/block/tile/TileRuneAltar.java index 37ec00152..107311c1b 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileRuneAltar.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileRuneAltar.java @@ -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(); diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMagnetRing.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMagnetRing.java index 4fb9a7cd8..45589dcb3 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMagnetRing.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMagnetRing.java @@ -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; } diff --git a/src/main/resources/assets/botania/lang/en_US.lang b/src/main/resources/assets/botania/lang/en_US.lang index 8c733289b..4e955dd5d 100644 --- a/src/main/resources/assets/botania/lang/en_US.lang +++ b/src/main/resources/assets/botania/lang/en_US.lang @@ -2034,7 +2034,7 @@ botania.page.runeAltar1=Proceed by pointing a &1Mana Spreader&0 to the altar so botania.page.runeAltar2=Crafting the &1Runic Altar&0. botania.page.runeAltar3=A total of 16 &1Runes&0 exist.
The most basic and elementary runes are named after the &4Four Elements&0. The intermediate runes are named after the &4Four Seasons&0, and the most advanced runes are named after the &4Seven Deadly Sins&0. A separate &1Rune of Mana&0 also exists. botania.page.runeAltar20=Sneaking and right-clicking the &1Runic Altar&0 with an empty hand while it's not accepting mana will remove the last item put into it.
Last but not least, attaching a &1Comparator&0 to it will emit signal strength &41&0 if the altar is accepting &4Mana&0 and signal strength &42&0 if it's ready to craft the rune. -botania.page.runeAltar22=Similarly to the &1Petal Apothecary&0, right clicking this block with an empty hand after a recipe is complete will place back the items used for the last recipe for faster mass crafting. +botania.page.runeAltar22=Any runes used for recipes in the &1Runic Altar&0 function as catalysts, and will be given back upon completion of the rune recipe.
Similarly to the &1Petal Apothecary&0, right clicking this block with an empty hand after a recipe is complete will place back the items used for the last recipe for faster mass crafting. botania.page.runeAltar4=The &1Rune of Water&0. botania.page.runeAltar5=The &1Rune of Earth&0. botania.page.runeAltar6=The &1Rune of Air&0.