mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-20 12:19:46 +00:00
Sparks can now be dyed with Phantom Ink to make them highly translucent.
This commit is contained in:
1 parent
525fbc4683
commit
14b8331e9e
6 files changed
+35
-6
No files matched your search
@@ -35,9 +35,9 @@ public class RenderCorporeaSpark extends RenderSparkBase<EntityCorporeaSpark> {
|
||||
}
|
||||
|
||||
@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
|
||||
|
||||
@@ -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<T extends Entity> extends RenderEntity {
|
||||
@@ -41,7 +42,9 @@ public class RenderSparkBase<T extends Entity> 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<T extends Entity> 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<T extends Entity> extends RenderEntity {
|
||||
return ItemSpark.worldIcon;
|
||||
}
|
||||
|
||||
public void colorSpinningIcon(T entity) {
|
||||
public void colorSpinningIcon(T entity, float a) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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<ISparkEntity> 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in new issue
Block a user