Merge pull request #41 from Pokefenn/master
Added in IBloodAltar and fixed a few derpy things
This commit is contained in:
commit
b6591ad5d7
|
@ -0,0 +1,26 @@
|
|||
package WayofTime.alchemicalWizardry.api.tile;
|
||||
|
||||
/**
|
||||
* Created by Pokefenn.
|
||||
*/
|
||||
public interface IBloodAltar
|
||||
{
|
||||
|
||||
public int getCapacity();
|
||||
|
||||
public int getCurrentBlood();
|
||||
|
||||
public int getTier();
|
||||
|
||||
public int getProgress();
|
||||
|
||||
public float getSacrificeMultiplier();
|
||||
|
||||
public float getSelfSacrificeMultiplier();
|
||||
|
||||
public float getOrbMultiplier();
|
||||
|
||||
public float getDislocationMultiplier();
|
||||
|
||||
public int getBufferCapacity();
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.common.tileEntity;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.tile.IBloodAltar;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
|
@ -31,7 +32,7 @@ import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.AltarUpgradeCompone
|
|||
import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.UpgradedAltars;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFluidHandler
|
||||
public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFluidHandler, IBloodAltar
|
||||
{
|
||||
public static final int sizeInv = 1;
|
||||
private ItemStack[] inv;
|
||||
|
@ -353,6 +354,54 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
|
|||
return capacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCurrentBlood()
|
||||
{
|
||||
return getFluidAmount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier()
|
||||
{
|
||||
return upgradeLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProgress()
|
||||
{
|
||||
return progress;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getSacrificeMultiplier()
|
||||
{
|
||||
return sacrificeEfficiencyMultiplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getSelfSacrificeMultiplier()
|
||||
{
|
||||
return selfSacrificeEfficiencyMultiplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getOrbMultiplier()
|
||||
{
|
||||
return orbCapacityMultiplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDislocationMultiplier()
|
||||
{
|
||||
return dislocationMultiplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBufferCapacity()
|
||||
{
|
||||
return bufferCapacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo getInfo()
|
||||
{
|
||||
|
@ -393,6 +442,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
|
|||
{
|
||||
fluidInput = new FluidStack(resource, Math.min(bufferCapacity, resource.amount));
|
||||
|
||||
//The tile is never null, so we dont need this
|
||||
if (tile != null)
|
||||
{
|
||||
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluidInput, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this));
|
||||
|
@ -417,6 +467,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
|
|||
fluidInput.amount = bufferCapacity;
|
||||
}
|
||||
|
||||
//Never null, so not needed :P
|
||||
if (tile != null)
|
||||
{
|
||||
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluidInput, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this));
|
||||
|
@ -451,6 +502,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
|
|||
fluidOutput = null;
|
||||
}
|
||||
|
||||
//This is never null, so its un needed :D
|
||||
if (this != null)
|
||||
{
|
||||
FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(fluidOutput, this.worldObj, this.xCoord, this.yCoord, this.zCoord, this));
|
||||
|
@ -513,6 +565,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
|
|||
return;
|
||||
}
|
||||
|
||||
//o,o this is always true
|
||||
if (worldTime % 1 == 0)
|
||||
{
|
||||
if (!canBeFilled)
|
||||
|
@ -886,12 +939,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
|
|||
@Override
|
||||
public boolean isItemValidForSlot(int slot, ItemStack itemstack)
|
||||
{
|
||||
if (slot == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return slot == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -957,12 +1005,8 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
|
|||
public boolean canFill(ForgeDirection from, Fluid fluid)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
if (this.fluidInput != null && this.fluid.getFluid().equals(fluidInput))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
//I changed this, since fluidstack != fluid... :p dunno if it was a accident? so you might wanna check this
|
||||
return this.fluidInput != null && this.fluid.getFluid().equals(fluidInput.getFluid());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue