mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-24 22:14:45 +00:00
Allow the Runic Altar to be fully automated.
This commit is contained in:
1 parent
65e1f3862f
commit
a94e2982f8
2 files changed
+16
-6
No files matched your search
@@ -37,7 +37,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
|
||||
int mana = 0;
|
||||
|
||||
public boolean addItem(EntityPlayer player, ItemStack stack) {
|
||||
if(stack.getItem() == ModItems.twigWand || stack.getItem() == ModItems.lexicon || manaToGet != 0)
|
||||
if(stack.getItem() == ModItems.twigWand || stack.getItem() == ModItems.lexicon || manaToGet != 0)
|
||||
return false;
|
||||
|
||||
boolean did = false;
|
||||
@@ -49,9 +49,9 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
|
||||
stackToAdd.stackSize = 1;
|
||||
setInventorySlotContents(i, stackToAdd);
|
||||
|
||||
if(!player.capabilities.isCreativeMode) {
|
||||
if(player == null || !player.capabilities.isCreativeMode) {
|
||||
stack.stackSize--;
|
||||
if(stack.stackSize == 0)
|
||||
if(stack.stackSize == 0 && player != null)
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||
}
|
||||
|
||||
@@ -71,6 +71,17 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
|
||||
// Update every tick.
|
||||
recieveMana(0);
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1));
|
||||
for(EntityItem item : items)
|
||||
if(!item.isDead && item.getEntityItem() != null && item.getEntityItem().getItem() != Item.getItemFromBlock(ModBlocks.livingrock)) {
|
||||
ItemStack stack = item.getEntityItem();
|
||||
if(addItem(null, stack) && stack.stackSize == 0)
|
||||
item.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(worldObj.isRemote && manaToGet > 0 && mana >= manaToGet) {
|
||||
if(worldObj.rand.nextInt(20) == 0) {
|
||||
worldObj.playSoundEffect(xCoord, yCoord, zCoord, "mob.creeper.live", 1F, 1F);
|
||||
@@ -80,7 +91,6 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
|
||||
Botania.proxy.lightningFX(worldObj, vec, endVec, 2F, 0x00948B, 0x00E4D7);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void updateRecipe() {
|
||||
@@ -117,7 +127,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
|
||||
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1));
|
||||
EntityItem livingrock = null;
|
||||
for(EntityItem item : items)
|
||||
if(item.getEntityItem() != null && item.getEntityItem().getItem() == Item.getItemFromBlock(ModBlocks.livingrock)) {
|
||||
if(!item.isDead && item.getEntityItem() != null && item.getEntityItem().getItem() == Item.getItemFromBlock(ModBlocks.livingrock)) {
|
||||
livingrock = item;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -377,7 +377,7 @@ botania.page.wand1=The petals used determine the colors of the wand
|
||||
|
||||
# -- RUNIC ALTAR
|
||||
botania.entry.runeAltar=Runic Altar
|
||||
botania.page.runeAltar0=&1Runes&0 are extremely important components of complex magical devices or flora.<br>In order to create these, one would require a &1Runic Altar&0.<br>To utilize this &1Runic Altar&0, start by placing, via right click, the components to the rune you want to create.
|
||||
botania.page.runeAltar0=&1Runes&0 are extremely important components of complex magical devices or flora.<br>In order to create these, one would require a &1Runic Altar&0.<br>To utilize this &1Runic Altar&0, start by placing, via either a right click or simply tossing, the components to the rune you want to create.
|
||||
botania.page.runeAltar1=Proceed by linking a &1Mana Spreader&0 to the altar, and right click it with a &1Wand of the Forest&0.<br>It should be apparent when the altar has received enough &4Mana&0. When that happens, just drop a piece of &1Livingrock&0 on top of it and use the wand on it again to collect your rune.
|
||||
botania.page.runeAltar2=Crafting the &1Runic Altar&0.
|
||||
botania.page.runeAltar3=A total of 16 &1Runes&0 exist.<br>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.
|
||||
|
||||
Reference in new issue
Block a user