mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-12 16:27:37 +00:00
Add Mana Pool dying.
This commit is contained in:
1 parent
c0a269636f
commit
aecee463c3
5 files changed
+24
-3
No files matched your search
@@ -16,6 +16,7 @@ import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -53,7 +54,11 @@ public class RenderTilePool extends TileEntitySpecialRenderer {
|
||||
|
||||
GL11.glTranslatef(0.5F, 1.5F, 0.5F);
|
||||
GL11.glScalef(1F, -1F, -1F);
|
||||
int color = pool.color;
|
||||
float[] acolor = EntitySheep.fleeceColorTable[color];
|
||||
GL11.glColor3f(acolor[0], acolor[1], acolor[2]);
|
||||
model.render();
|
||||
GL11.glColor3f(1F, 1F, 1F);
|
||||
GL11.glScalef(1F, -1F, -1F);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
|
||||
|
||||
@@ -59,8 +59,7 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
|
||||
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) {
|
||||
if(par5Entity instanceof EntityItem) {
|
||||
TileAltar tile = (TileAltar) par1World.getTileEntity(par2, par3, par4);
|
||||
if(tile.collideEntityItem((EntityItem) par5Entity))
|
||||
par1World.markBlockForUpdate(par2, par3, par4);
|
||||
tile.collideEntityItem((EntityItem) par5Entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.TileMod;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
|
||||
public class TilePool extends TileMod implements IManaPool {
|
||||
|
||||
@@ -46,10 +47,12 @@ public class TilePool extends TileMod implements IManaPool {
|
||||
private static final String TAG_MANA = "mana";
|
||||
private static final String TAG_KNOWN_MANA = "knownMana";
|
||||
private static final String TAG_OUTPUTTING = "outputting";
|
||||
private static final String TAG_COLOR = "color";
|
||||
|
||||
boolean outputting = false;
|
||||
public boolean alchemy = false;
|
||||
|
||||
public int color = 0;
|
||||
int mana;
|
||||
int knownMana = -1;
|
||||
int craftCooldown = 20;
|
||||
@@ -90,6 +93,17 @@ public class TilePool extends TileMod implements IManaPool {
|
||||
ItemStack stack = item.getEntityItem();
|
||||
if(stack == null)
|
||||
return false;
|
||||
|
||||
if(stack.getItem() == ModItems.dye && !worldObj.isRemote) {
|
||||
int meta = stack.getItemDamage();
|
||||
if(meta != color) {
|
||||
color = meta;
|
||||
stack.stackSize--;
|
||||
if(stack.stackSize == 0)
|
||||
item.setDead();
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
for(RecipeManaInfusion recipe : BotaniaAPI.manaInfusionRecipes) {
|
||||
if(recipe.matches(stack) && (!recipe.isAlchemy() || alchemy)) {
|
||||
@@ -195,12 +209,14 @@ public class TilePool extends TileMod implements IManaPool {
|
||||
public void writeCustomNBT(NBTTagCompound cmp) {
|
||||
cmp.setInteger(TAG_MANA, mana);
|
||||
cmp.setBoolean(TAG_OUTPUTTING, outputting);
|
||||
cmp.setInteger(TAG_COLOR, color);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readCustomNBT(NBTTagCompound cmp) {
|
||||
mana = cmp.getInteger(TAG_MANA);
|
||||
outputting = cmp.getBoolean(TAG_OUTPUTTING);
|
||||
color = cmp.getInteger(TAG_COLOR);
|
||||
|
||||
if(cmp.hasKey(TAG_KNOWN_MANA))
|
||||
knownMana = cmp.getInteger(TAG_KNOWN_MANA);
|
||||
|
||||
@@ -194,7 +194,7 @@ public final class LexiconData {
|
||||
spreader.setPriority().setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_SPREADER), new PageText("2"), new PageText("3"), new PageText("4"), new PageCraftingRecipe("5", ModCrafingRecipes.recipesSpreader), new PageText("6"), new PageCraftingRecipe("7", ModCrafingRecipes.recipeManaLens), new PageCraftingRecipe("8", ModCrafingRecipes.recipesLensDying), new PageCraftingRecipe("9", ModCrafingRecipes.recipeRainbowLens));
|
||||
|
||||
pool = new BLexiconEntry(LibLexicon.MANA_POOL, categoryMana);
|
||||
pool.setPriority().setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipePool), new PageText("2"), new PageManaInfusionRecipe("3", ModManaInfusionRecipes.manasteelRecipes), new PageManaInfusionRecipe("4", ModManaInfusionRecipes.manaPearlRecipe), new PageManaInfusionRecipe("5", ModManaInfusionRecipes.manaDiamondRecipe), new PageManaInfusionRecipe("6", ModManaInfusionRecipes.manaPetalRecipes), new PageManaInfusionRecipe("7", ModManaInfusionRecipes.manaCookieRecipe));
|
||||
pool.setPriority().setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipePool), new PageText("2"), new PageText("8"), new PageManaInfusionRecipe("3", ModManaInfusionRecipes.manasteelRecipes), new PageManaInfusionRecipe("4", ModManaInfusionRecipes.manaPearlRecipe), new PageManaInfusionRecipe("5", ModManaInfusionRecipes.manaDiamondRecipe), new PageManaInfusionRecipe("6", ModManaInfusionRecipes.manaPetalRecipes), new PageManaInfusionRecipe("7", ModManaInfusionRecipes.manaCookieRecipe));
|
||||
|
||||
distributor = new BLexiconEntry(LibLexicon.MANA_DISTRIBUTOR, categoryMana);
|
||||
distributor.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeDistributor));
|
||||
|
||||
@@ -544,6 +544,7 @@ botania.entry.pool=Mana Pool
|
||||
botania.page.pool0=The &1Mana Pool&0 is, simply put, a storage of &4Mana&0.<br>Mana can be inserted into it by usage of a &1Mana Spreader&0, and any adjacent &1Mana Spreaders&0 will pull mana from it to increase their internal buffer automatically.<br>Any &4Functional Flowers&0 require a nearby &1Mana Pool&0 to draw power from.
|
||||
botania.page.pool1=Making the &1Mana Pool&0.
|
||||
botania.page.pool2=Tossing in some resources into the Mana Pool will cause them to get infused with &4Mana&0, turning them into more powerful forms.<br>A few examples are &1Iron Ingots&0 or &1Mystical Petals&0.<br>&4Mana&0 reading for this block functions like the &1Mana Spreader&0. A &1Redstone Comparator&0 can also output a signal based on the contents.
|
||||
botania.page.pool8=For the artistic types, tossing any color of &1Floral Powder&0 in the pool will have it take it's color, all sixteen colors are viable for decoration and/or easy labelling.
|
||||
botania.page.pool3=Infusing &1Manasteel&0
|
||||
botania.page.pool4=Infusing &1Mana Pearls&0
|
||||
botania.page.pool5=Infusing &1Mana Diamonds&0
|
||||
|
||||
Reference in new issue
Block a user