mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-28 15:56:07 +00:00
Removed old thermal expansion API file.
This commit is contained in:
1 parent
83b4084648
commit
b2455eaef6
2 files changed
+2
-77
No files matched your search
@@ -16,7 +16,6 @@ import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import thermalexpansion.api.item.IChargeableItem;
|
||||
import buildcraft.api.power.PowerHandler;
|
||||
import buildcraft.api.power.PowerHandler.PowerReceiver;
|
||||
import buildcraft.api.power.PowerHandler.Type;
|
||||
@@ -289,29 +288,7 @@ public class TileCapacitorBank extends TileEntityEio implements IInternalPowerRe
|
||||
used = (chargable.getEnergyStored(item) - cur) / 10;
|
||||
}
|
||||
|
||||
} else if(item.getItem() instanceof IChargeableItem) {
|
||||
IChargeableItem chargable = (IChargeableItem) item.getItem();
|
||||
float max = chargable.getMaxEnergyStored(item);
|
||||
float cur = chargable.getEnergyStored(item);
|
||||
float canUse = Math.min(available, max - cur);
|
||||
|
||||
if(cur < max) {
|
||||
if(chargable.getClass().getName().startsWith("appeng") || "appeng.common.base.AppEngMultiChargeable".equals(chargable.getClass().getName())) {
|
||||
// 256 max limit
|
||||
canUse = Math.min(canUse, 256);
|
||||
NBTTagCompound tc = item.getTagCompound();
|
||||
if(tc == null) {
|
||||
item.setTagCompound(tc = new NBTTagCompound());
|
||||
}
|
||||
double newVal = (cur + canUse) * 5.0;
|
||||
tc.setDouble("powerLevel", newVal);
|
||||
used = canUse;
|
||||
|
||||
} else {
|
||||
used = chargable.receiveEnergy(item, canUse, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(used > 0) {
|
||||
storedEnergy = storedEnergy - used;
|
||||
chargedItem = true;
|
||||
@@ -1028,7 +1005,7 @@ public class TileCapacitorBank extends TileEntityEio implements IInternalPowerRe
|
||||
if(itemstack == null) {
|
||||
return false;
|
||||
}
|
||||
return itemstack.getItem() instanceof IChargeableItem || itemstack.getItem() instanceof IEnergyContainerItem;
|
||||
return itemstack.getItem() instanceof IEnergyContainerItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
package thermalexpansion.api.item;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Implement this interface on Item classes that support external manipulation
|
||||
* of their internal energy storages. This interface does not provide methods
|
||||
* for the underlying internal energy usage.
|
||||
*/
|
||||
|
||||
public interface IChargeableItem {
|
||||
|
||||
/**
|
||||
* Adds energy to an item. Returns the quantity of energy that was accepted.
|
||||
* This should always return 0 if the item cannot be externally charged.
|
||||
*
|
||||
* @param theItem
|
||||
* ItemStack to be charged.
|
||||
* @param energy
|
||||
* Maximum amount of energy to be sent into the item.
|
||||
* @param doReceive
|
||||
* If false, the charge will only be simulated.
|
||||
* @return Amount of energy that was accepted by the item.
|
||||
*/
|
||||
public float receiveEnergy(ItemStack theItem, float energy, boolean doReceive);
|
||||
|
||||
/**
|
||||
* Removes energy from an item. Returns the quantity of energy that was
|
||||
* removed. This should always return 0 if the item cannot be externally
|
||||
* discharged.
|
||||
*
|
||||
* @param theItem
|
||||
* ItemStack to be discharged.
|
||||
* @param energy
|
||||
* Maximum amount of energy to be removed from the item.
|
||||
* @param doTransfer
|
||||
* If false, the discharge will only be simulated.
|
||||
* @return Amount of energy that was removed from the item.
|
||||
*/
|
||||
public float transferEnergy(ItemStack theItem, float energy, boolean doTransfer);
|
||||
|
||||
/**
|
||||
* Get the amount of energy currently stored in the item.
|
||||
*/
|
||||
public float getEnergyStored(ItemStack theItem);
|
||||
|
||||
/**
|
||||
* Get the max amount of energy that can be stored in the item.
|
||||
*/
|
||||
public float getMaxEnergyStored(ItemStack theItem);
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user