Moved power system to RC and spawn trees in groups
This commit is contained in:
parent
891d2cce32
commit
71c2bfee7f
115 changed files with 296 additions and 1630 deletions
|
@ -1,77 +0,0 @@
|
|||
package techreborn.api.power;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IEnergyInterfaceItem extends IEnergyItemInfo{
|
||||
/**
|
||||
* @return Amount of energy in the tile
|
||||
*
|
||||
* @param stack The {@link ItemStack} that contains the power
|
||||
*/
|
||||
public double getEnergy(ItemStack stack);
|
||||
|
||||
/**
|
||||
* Sets the energy in the tile
|
||||
*
|
||||
* @param energy the amount of energy to set.
|
||||
* @param stack The {@link ItemStack} that contains the power
|
||||
*/
|
||||
public void setEnergy(double energy, ItemStack stack);
|
||||
|
||||
|
||||
/**
|
||||
* @param energy amount of energy to add to the tile
|
||||
* @param stack The {@link ItemStack} that contains the power
|
||||
* @return will return true if can fit all
|
||||
*/
|
||||
public boolean canAddEnergy(double energy, ItemStack stack);
|
||||
|
||||
/**
|
||||
* Will try add add the full amount of energy.
|
||||
*
|
||||
* @param energy amount to add
|
||||
* @param stack The {@link ItemStack} that contains the power
|
||||
* @return The amount of energy that was added.
|
||||
*/
|
||||
public double addEnergy(double energy, ItemStack stack);
|
||||
|
||||
/**
|
||||
* Will try add add the full amount of energy, if simulate is true it wont add the energy
|
||||
*
|
||||
* @param energy amount to add
|
||||
* @param stack The {@link ItemStack} that contains the power
|
||||
* @return The amount of energy that was added.
|
||||
*/
|
||||
public double addEnergy(double energy, boolean simulate, ItemStack stack);
|
||||
|
||||
/**
|
||||
* Returns true if it can use the full amount of energy
|
||||
*
|
||||
* @param energy amount of energy to use from the tile.
|
||||
* @param stack The {@link ItemStack} that contains the power
|
||||
* @return if all the energy can be used.
|
||||
*/
|
||||
public boolean canUseEnergy(double energy, ItemStack stack);
|
||||
|
||||
/**
|
||||
* Will try and use the full amount of energy
|
||||
*
|
||||
* @param energy energy to use
|
||||
* @param stack The {@link ItemStack} that contains the power
|
||||
* @return the amount of energy used
|
||||
*/
|
||||
public double useEnergy(double energy, ItemStack stack);
|
||||
|
||||
|
||||
/**
|
||||
* Will try and use the full amount of energy, if simulate is true it wont add the energy
|
||||
*
|
||||
* @param energy energy to use
|
||||
* @param simulate if true it will not use the item, it will only simulate it.
|
||||
* @param stack The {@link ItemStack} that contains the power
|
||||
* @return the amount of energy used
|
||||
*/
|
||||
public double useEnergy(double energy, boolean simulate, ItemStack stack);
|
||||
|
||||
}
|
||||
|
|
@ -1,101 +0,0 @@
|
|||
package techreborn.api.power;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
public interface IEnergyInterfaceTile {
|
||||
|
||||
/**
|
||||
* @return Amount of energy in the tile
|
||||
*/
|
||||
public double getEnergy();
|
||||
|
||||
/**
|
||||
* Sets the energy in the tile
|
||||
*
|
||||
* @param energy the amount of energy to set.
|
||||
*/
|
||||
public void setEnergy(double energy);
|
||||
|
||||
/**
|
||||
* Gets the max stored energy in the tile
|
||||
*
|
||||
* @return The max energy
|
||||
*/
|
||||
public double getMaxPower();
|
||||
|
||||
/**
|
||||
* @param energy amount of energy to add to the tile
|
||||
* @return will return true if can fit all
|
||||
*/
|
||||
public boolean canAddEnergy(double energy);
|
||||
|
||||
/**
|
||||
* Will try add add the full amount of energy.
|
||||
*
|
||||
* @param energy amount to add
|
||||
* @return The amount of energy that was added.
|
||||
*/
|
||||
public double addEnergy(double energy);
|
||||
|
||||
/**
|
||||
* Will try add add the full amount of energy, if simulate is true it wont add the energy
|
||||
*
|
||||
* @param energy amount to add
|
||||
* @param simulate set to true to simulate not perform the action.
|
||||
* @return The amount of energy that was added.
|
||||
*/
|
||||
public double addEnergy(double energy, boolean simulate);
|
||||
|
||||
/**
|
||||
* Returns true if it can use the full amount of energy
|
||||
*
|
||||
* @param energy amount of energy to use from the tile.
|
||||
* @return if all the energy can be used.
|
||||
*/
|
||||
public boolean canUseEnergy(double energy);
|
||||
|
||||
/**
|
||||
* Will try and use the full amount of energy
|
||||
*
|
||||
* @param energy energy to use
|
||||
* @return the amount of energy used
|
||||
*/
|
||||
public double useEnergy(double energy);
|
||||
|
||||
|
||||
/**
|
||||
* Will try and use the full amount of energy, if simulate is true it wont add the energy
|
||||
*
|
||||
* @param energy energy to use
|
||||
* @param simulate set to true to simulate not perform the action.
|
||||
* @return the amount of energy used
|
||||
*/
|
||||
public double useEnergy(double energy, boolean simulate);
|
||||
|
||||
/**
|
||||
* @param direction The direction to insert energy into
|
||||
* @return if the tile can accept energy from the direction
|
||||
*/
|
||||
public boolean canAcceptEnergy(EnumFacing direction);
|
||||
|
||||
/**
|
||||
* @param direction The direction to provide energy from
|
||||
* @return true if the tile can provide energy to that direction
|
||||
*/
|
||||
public boolean canProvideEnergy(EnumFacing direction);
|
||||
|
||||
/**
|
||||
* Gets the max output, set to -1 if you don't want the tile to provide energy
|
||||
*
|
||||
* @return the max amount of energy outputted per tick.
|
||||
*/
|
||||
public double getMaxOutput();
|
||||
|
||||
/**
|
||||
* Return -1 if you don't want to accept power ever.
|
||||
*
|
||||
* @return The max amount of energy that can be added to the tile in one tick.
|
||||
*/
|
||||
public double getMaxInput();
|
||||
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
package techreborn.api.power;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IEnergyItemInfo {
|
||||
|
||||
/**
|
||||
* Gets the max stored energy in the item
|
||||
*
|
||||
* @param stack The {@link ItemStack} that contains the power
|
||||
* @return The max energy
|
||||
*/
|
||||
double getMaxPower(ItemStack stack);
|
||||
|
||||
/**
|
||||
* Can the item accept energy.
|
||||
* @param stack The {@link ItemStack} that contains the power
|
||||
* @return if it can accept energy
|
||||
*/
|
||||
boolean canAcceptEnergy(ItemStack stack);
|
||||
|
||||
/**
|
||||
* Can the item recieve energy
|
||||
* @param stack The {@link ItemStack} that contains the power
|
||||
* @return if it can provide energy
|
||||
*/
|
||||
boolean canProvideEnergy(ItemStack stack);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param stack The {@link ItemStack} that contains the power
|
||||
* @return Max amout of energy that can be transfured in one tick.
|
||||
*/
|
||||
double getMaxTransfer(ItemStack stack);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param stack The {@link ItemStack} that contains the power
|
||||
* @return The ic2 teir that the stack should be.
|
||||
*/
|
||||
int getStackTeir(ItemStack stack);
|
||||
}
|
|
@ -4,9 +4,9 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.api.power.IEnergyInterfaceTile;
|
||||
import techreborn.blocks.BlockMachineBase;
|
||||
import techreborn.tiles.TileMachineBase;
|
||||
import reborncore.api.power.IEnergyInterfaceTile;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.tile.TileMachineBase;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue