Spell Work

Finished the spell blocks enough to allow further expansion. Need to
work on textures, as well as the orientation mechanics of the blocks.
Also need to look at Vazkii's block renderer to verify a few feature
additions.
This commit is contained in:
WayofTime 2014-01-24 18:07:13 -05:00
parent 1393a24b6e
commit 5dcef131dc
22 changed files with 765 additions and 85 deletions

View file

@ -1,6 +1,50 @@
package WayofTime.alchemicalWizardry.common.tileEntity;
public class TESpellBlock extends TEOrientable
{
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigm;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffectFire;
public abstract class TESpellBlock extends TEOrientable
{
public void modifySpellParadigm(SpellParadigm parad)
{
this.applySpellChange(parad);
TileEntity tile = this.getTileAtOutput();
if(tile instanceof TESpellBlock)
{
TESpellBlock outputBlock = (TESpellBlock)tile;
outputBlock.modifySpellParadigm(parad);
}
}
protected abstract void applySpellChange(SpellParadigm parad);
public TESpellBlock getTileAtOutput()
{
ForgeDirection output = this.getOutputDirection();
int xOffset = output.offsetX;
int yOffset = output.offsetY;
int zOffset = output.offsetZ;
TileEntity tile = worldObj.getBlockTileEntity(xCoord + xOffset, yCoord + yOffset, zCoord + zOffset);
if(tile instanceof TESpellBlock && ((TESpellBlock)tile).canInputRecieveOutput(output))
{
return (TESpellBlock)tile;
}
return null;
}
public boolean canInputRecieve()
{
return true;
}
public boolean canInputRecieveOutput(ForgeDirection output)
{
return this.canInputRecieve() && this.getInputDirection().getOpposite()==output;
}
}