diff --git a/src/main/java/vazkii/botania/client/render/entity/RenderCorporeaSpark.java b/src/main/java/vazkii/botania/client/render/entity/RenderCorporeaSpark.java index db639df51..5dc731a27 100644 --- a/src/main/java/vazkii/botania/client/render/entity/RenderCorporeaSpark.java +++ b/src/main/java/vazkii/botania/client/render/entity/RenderCorporeaSpark.java @@ -35,9 +35,9 @@ public class RenderCorporeaSpark extends RenderSparkBase { } @Override - public void colorSpinningIcon(EntityCorporeaSpark entity) { + public void colorSpinningIcon(EntityCorporeaSpark entity, float a) { int network = Math.min(15, entity.getNetwork()); - GL11.glColor3f(EntitySheep.fleeceColorTable[network][0], EntitySheep.fleeceColorTable[network][1], EntitySheep.fleeceColorTable[network][2]); + GL11.glColor4f(EntitySheep.fleeceColorTable[network][0], EntitySheep.fleeceColorTable[network][1], EntitySheep.fleeceColorTable[network][2], a); } @Override diff --git a/src/main/java/vazkii/botania/client/render/entity/RenderSparkBase.java b/src/main/java/vazkii/botania/client/render/entity/RenderSparkBase.java index a6fa75208..15043e670 100644 --- a/src/main/java/vazkii/botania/client/render/entity/RenderSparkBase.java +++ b/src/main/java/vazkii/botania/client/render/entity/RenderSparkBase.java @@ -23,6 +23,7 @@ import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; import vazkii.botania.client.core.handler.ClientTickHandler; +import vazkii.botania.common.entity.EntitySpark; import vazkii.botania.common.item.ItemSpark; public class RenderSparkBase extends RenderEntity { @@ -41,7 +42,9 @@ public class RenderSparkBase extends RenderEntity { double time = ClientTickHandler.ticksInGame + par9; time += new Random(par1Entity.getEntityId()).nextInt(); - GL11.glColor4f(1F, 1F, 1F, 0.7F + 0.3F * (float) (Math.sin(time / 5.0) + 0.5) * 2); + float a = 0.1F + (1 - par1Entity.getDataWatcher().getWatchableObjectInt(EntitySpark.INVISIBILITY_DATA_WATCHER_KEY)) * 0.8F; + + GL11.glColor4f(1F, 1F, 1F, (0.7F + 0.3F * (float) (Math.sin(time / 5.0) + 0.5) * 2) * a); float scale = 0.75F + 0.1F * (float) Math.sin(time / 10); GL11.glScalef(scale, scale, scale); @@ -58,7 +61,7 @@ public class RenderSparkBase extends RenderEntity { if(spinningIcon != null) { GL11.glTranslatef(-0.02F + (float) Math.sin(time / 20) * 0.2F, 0.24F + (float) Math.cos(time / 20) * 0.2F, 0.005F); GL11.glScalef(0.2F, 0.2F, 0.2F); - colorSpinningIcon(tEntity); + colorSpinningIcon(tEntity, a); func_77026_a(tessellator, spinningIcon); } GL11.glPopMatrix(); @@ -74,7 +77,7 @@ public class RenderSparkBase extends RenderEntity { return ItemSpark.worldIcon; } - public void colorSpinningIcon(T entity) { + public void colorSpinningIcon(T entity, float a) { // NO-OP } diff --git a/src/main/java/vazkii/botania/common/entity/EntityCorporeaSpark.java b/src/main/java/vazkii/botania/common/entity/EntityCorporeaSpark.java index c1c277a70..33f55bb3e 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityCorporeaSpark.java +++ b/src/main/java/vazkii/botania/common/entity/EntityCorporeaSpark.java @@ -48,11 +48,13 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark { @Override protected void entityInit() { setSize(0.1F, 0.5F); + dataWatcher.addObject(EntitySpark.INVISIBILITY_DATA_WATCHER_KEY, 0); dataWatcher.addObject(28, 0); dataWatcher.addObject(29, 0); dataWatcher.addObject(30, 0); dataWatcher.addObject(31, new ItemStack(Blocks.stone, 0, 0)); + dataWatcher.setObjectWatched(EntitySpark.INVISIBILITY_DATA_WATCHER_KEY); dataWatcher.setObjectWatched(28); dataWatcher.setObjectWatched(29); dataWatcher.setObjectWatched(30); @@ -279,6 +281,16 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark { } } + return doPhantomInk(stack); + } + + public boolean doPhantomInk(ItemStack stack) { + if(stack.getItem() == ModItems.phantomInk && !worldObj.isRemote) { + int invis = dataWatcher.getWatchableObjectInt(EntitySpark.INVISIBILITY_DATA_WATCHER_KEY); + dataWatcher.updateObject(EntitySpark.INVISIBILITY_DATA_WATCHER_KEY, ~invis & 1); + return true; + } + return false; } diff --git a/src/main/java/vazkii/botania/common/entity/EntitySpark.java b/src/main/java/vazkii/botania/common/entity/EntitySpark.java index cf5fa51a1..71c352e58 100644 --- a/src/main/java/vazkii/botania/common/entity/EntitySpark.java +++ b/src/main/java/vazkii/botania/common/entity/EntitySpark.java @@ -42,6 +42,7 @@ public class EntitySpark extends Entity implements ISparkEntity { private static final int TRANSFER_RATE = 1000; private static final String TAG_UPGRADE = "upgrade"; + public static final int INVISIBILITY_DATA_WATCHER_KEY = 27; Set transfers = Collections.newSetFromMap(new WeakHashMap()); @@ -56,7 +57,9 @@ public class EntitySpark extends Entity implements ISparkEntity { @Override protected void entityInit() { setSize(0.1F, 0.5F); + dataWatcher.addObject(INVISIBILITY_DATA_WATCHER_KEY, 0); dataWatcher.addObject(28, 0); + dataWatcher.setObjectWatched(INVISIBILITY_DATA_WATCHER_KEY); dataWatcher.setObjectWatched(28); } @@ -277,6 +280,16 @@ public class EntitySpark extends Entity implements ISparkEntity { } } + return doPhantomInk(stack); + } + + public boolean doPhantomInk(ItemStack stack) { + if(stack.getItem() == ModItems.phantomInk && !worldObj.isRemote) { + int invis = dataWatcher.getWatchableObjectInt(INVISIBILITY_DATA_WATCHER_KEY); + dataWatcher.updateObject(INVISIBILITY_DATA_WATCHER_KEY, ~invis & 1); + return true; + } + return false; } diff --git a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java index 4c27419c7..04952c267 100644 --- a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java +++ b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java @@ -370,7 +370,7 @@ public final class LexiconData { pool.setPriority().setLexiconPages(new PageText("0"), new PageText("9"), new PageCraftingRecipe("1", ModCraftingRecipes.recipePool), new PageManaInfusionRecipe("10", ModManaInfusionRecipes.poolRecipe), new PageText("2"), new PageText("8"), new PageManaInfusionRecipe("3", ModManaInfusionRecipes.manasteelRecipes), new PageManaInfusionRecipe("4", ModManaInfusionRecipes.manaPearlRecipe), new PageManaInfusionRecipe("5", ModManaInfusionRecipes.manaDiamondRecipes), new PageManaInfusionRecipe("6", ModManaInfusionRecipes.manaPetalRecipes), new PageManaInfusionRecipe("11", ModManaInfusionRecipes.managlassRecipe), new PageManaInfusionRecipe("12", ModManaInfusionRecipes.manaStringRecipe), new PageCraftingRecipe("13", ModCraftingRecipes.recipeCobweb), new PageManaInfusionRecipe("7", ModManaInfusionRecipes.manaCookieRecipe)).setIcon(new ItemStack(ModBlocks.pool)); sparks = new BLexiconEntry(LibLexicon.MANA_SPARKS, categoryMana); - sparks.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipesSpark)); + sparks.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageText("3"), new PageCraftingRecipe("2", ModCraftingRecipes.recipesSpark)); sparkUpgrades = new ALexiconEntry(LibLexicon.MANA_SPARK_UPGRADES, categoryMana); sparkUpgrades.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"), new PageText("4"), new PageCraftingRecipe("5", ModCraftingRecipes.recipesSparkUpgrades)); diff --git a/src/main/resources/assets/botania/lang/en_US.lang b/src/main/resources/assets/botania/lang/en_US.lang index 15900da98..e9b3cea5c 100644 --- a/src/main/resources/assets/botania/lang/en_US.lang +++ b/src/main/resources/assets/botania/lang/en_US.lang @@ -2129,6 +2129,7 @@ botania.entry.sparks=Sparks botania.tagline.sparks=Simple and fast short-range Mana transporters botania.page.sparks0=&1Sparks&0 are interesting entities. Created from a combination of raw energy and &4Mana&0, they have the ability to be placed on top of a few specific &4Mana&0 containing or accepting blocks, mainly, &1Mana Pools&0.
Some blocks have the ability to harness &4Mana&0 from &1Sparks&0, but the uses for them seem limited to a few blocks right now. botania.page.sparks1=Placing a &1Spark&0 on top of a &1Mana Pool&0 and another on top of a block that can accept it will allow for the latter to remotely access the reservoirs of the &1Mana Pool&0 when needed, given it's not too far away.
To remove a &1Spark&0 simply shift-right click it with a &1Wand of the Forest&0. Regular right clicking shows which other &1Sparks&0 it can transfer to. +botania.page.sparks3=In the case that one might think that &1Sparks&0 are too obstrusive in their looks, one can use &1Phantom Ink&0 to turn the target &1Spark&0 highly translucent. This does not consume the ink. botania.page.sparks2=&oholds up spork&r # -- SPARK AUGMENTATION