diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockPrism.java b/src/main/java/vazkii/botania/common/block/mana/BlockPrism.java
index 9c1fbfbb9..a830f51e6 100644
--- a/src/main/java/vazkii/botania/common/block/mana/BlockPrism.java
+++ b/src/main/java/vazkii/botania/common/block/mana/BlockPrism.java
@@ -33,6 +33,7 @@ import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.common.block.BlockModContainer;
import vazkii.botania.common.block.tile.TileSimpleInventory;
import vazkii.botania.common.block.tile.mana.TilePrism;
+import vazkii.botania.common.block.tile.string.TileRedStringDispenser;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
@@ -95,24 +96,39 @@ public class BlockPrism extends BlockModContainer implements IManaTrigger, ILexi
ItemStack lens = prism.getStackInSlot(0);
ItemStack heldItem = par5EntityPlayer.getCurrentEquippedItem();
boolean isHeldItemLens = heldItem != null && heldItem.getItem() instanceof ILens;
+ int meta = par1World.getBlockMetadata(par2, par3, par4);
if(lens == null && isHeldItemLens) {
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, null);
prism.setInventorySlotContents(0, heldItem.copy());
prism.markDirty();
- par1World.setBlockMetadataWithNotify(par2, par3, par4, 1, 1 | 2);
+ par1World.setBlockMetadataWithNotify(par2, par3, par4, meta | 1, 1 | 2);
} else if(lens != null) {
ItemStack add = lens.copy();
if(!par5EntityPlayer.inventory.addItemStackToInventory(add))
par5EntityPlayer.dropPlayerItemWithRandomChoice(add, false);
prism.setInventorySlotContents(0, null);
prism.markDirty();
- par1World.setBlockMetadataWithNotify(par2, par3, par4, 0, 1 | 2);
+ par1World.setBlockMetadataWithNotify(par2, par3, par4, meta & 14, 1 | 2);
}
return true;
}
+ @Override
+ public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
+ boolean power = world.isBlockIndirectlyGettingPowered(x, y, z) || world.isBlockIndirectlyGettingPowered(x, y + 1, z);
+ int meta = world.getBlockMetadata(x, y, z);
+ boolean powered = (meta & 8) != 0;
+
+ if(!world.isRemote) {
+ if(power && !powered)
+ world.setBlockMetadataWithNotify(x, y, z, meta | 8, 1 | 2);
+ else if(!power && powered)
+ world.setBlockMetadataWithNotify(x, y, z, meta & -9, 1 | 2);
+ }
+ }
+
@Override
public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) {
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TilePrism.java b/src/main/java/vazkii/botania/common/block/tile/mana/TilePrism.java
index 382ca829a..b9c4cc673 100644
--- a/src/main/java/vazkii/botania/common/block/tile/mana/TilePrism.java
+++ b/src/main/java/vazkii/botania/common/block/tile/mana/TilePrism.java
@@ -24,24 +24,27 @@ public class TilePrism extends TileSimpleInventory implements IManaCollisionGhos
public void onBurstCollision(IManaBurst burst) {
ItemStack lens = getStackInSlot(0);
+ boolean active = (getBlockMetadata() & 8) == 0;
boolean valid = lens != null && lens.getItem() instanceof ILens;
- burst.setSourceLens(valid ? lens.copy() : null);
- burst.setColor(0xFFFFFF);
- burst.setGravity(0F);
+ if(active) {
+ burst.setSourceLens(valid ? lens.copy() : null);
+ burst.setColor(0xFFFFFF);
+ burst.setGravity(0F);
- if(valid) {
- Entity burstEntity = (Entity) burst;
- BurstProperties properties = new BurstProperties(burst.getStartingMana(), burst.getMinManaLoss(), burst.getManaLossPerTick(), burst.getGravity(), 1F, burst.getColor());
+ if(valid) {
+ Entity burstEntity = (Entity) burst;
+ BurstProperties properties = new BurstProperties(burst.getStartingMana(), burst.getMinManaLoss(), burst.getManaLossPerTick(), burst.getGravity(), 1F, burst.getColor());
- ((ILens) lens.getItem()).apply(lens, properties);
+ ((ILens) lens.getItem()).apply(lens, properties);
- burst.setColor(properties.color);
- burst.setStartingMana(properties.maxMana);
- burst.setMinManaLoss(properties.ticksBeforeManaLoss);
- burst.setManaLossPerTick(properties.manaLossPerTick);
- burst.setGravity(properties.gravity);
- burst.setMotion(burstEntity.motionX * properties.motionModifier, burstEntity.motionY * properties.motionModifier,burstEntity.motionZ * properties.motionModifier);
+ burst.setColor(properties.color);
+ burst.setStartingMana(properties.maxMana);
+ burst.setMinManaLoss(properties.ticksBeforeManaLoss);
+ burst.setManaLossPerTick(properties.manaLossPerTick);
+ burst.setGravity(properties.gravity);
+ burst.setMotion(burstEntity.motionX * properties.motionModifier, burstEntity.motionY * properties.motionModifier,burstEntity.motionZ * properties.motionModifier);
+ }
}
}
diff --git a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java
index db785b6bc..d141c2d75 100644
--- a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java
+++ b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java
@@ -316,7 +316,7 @@ public final class LexiconData {
paintLens.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeLensPaint));
prism = new ALexiconEntry(LibLexicon.MANA_PRISM, categoryMana);
- prism.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipePrism));
+ prism.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipePrism));
// FUNCTIONAL FLOWERS ENTRIES
functionalIntro = new BLexiconEntry(LibLexicon.FFLOWER_INTRO, categoryFunctionalFlowers);
diff --git a/src/main/resources/assets/botania/lang/en_US.lang b/src/main/resources/assets/botania/lang/en_US.lang
index b8ecdc0e7..7aec1a1ec 100644
--- a/src/main/resources/assets/botania/lang/en_US.lang
+++ b/src/main/resources/assets/botania/lang/en_US.lang
@@ -1080,7 +1080,8 @@ botania.page.paintLens1=A M'AIDER Stranded Girl
botania.entry.prism=Mana Prism
botania.page.prism0=The concept of &1Mana Lens&0 allows for the manipulation of the power convyed through &4Mana Bursts&0, the &1Mana Prism&0 works on that technology to allow a burst to have its lens effect switched on the fly.
Using a &1Spectral Platform&0 as a component, this block does not have a physical presence, entities and bursts can go through it as if it doesn't exist.
botania.page.prism1=Right clicking it with any variety of &1Mana Lens&0 sets the lens in the prism. Whenever a &4Mana Burst&0 goes through the prism, its color and effect will be set to that of the lens in the prism. Case the lens is not dyed, the burst will turn white.
Using any of the four basic lenses also increases the time the burst can go before losing &4Mana&0, allowing it to go further.
-botania.page.prism2=Another pixel in the wall
+botania.page.prism2=It can also be turned off by the use of a redstone signal.
+botania.page.prism3=Another pixel in the wall
# - FUNCTIONAL FLOWERS
# -- AN INTRODUCTION TO FUNCTION