Made batteries charge configurable for non-basic batteries.
This commit is contained in:
parent
1ebf67d933
commit
48d2227407
7 changed files with 27 additions and 26 deletions
|
@ -81,6 +81,12 @@ public class ConfigTechReborn {
|
|||
@ConfigRegistry(config = "items", category = "power", key = "LithiumBatpackCharge", comment = "Energy Capacity for Lithium Batpack (FE)")
|
||||
public static int LithiumBatpackCharge = 16_000_000;
|
||||
|
||||
@ConfigRegistry(config = "items", category = "power", key = "energyCrystalMaxCharge", comment = "Energy Capacity for Energy Crystal (FE)")
|
||||
public static int EnergyCrystalMaxCharge = 4_000_000;
|
||||
|
||||
@ConfigRegistry(config = "items", category = "power", key = "lapotronCrystalMaxCharge", comment = "Energy Capacity for Lapotron Crystal (FE)")
|
||||
public static int LapotronCrystalMaxCharge = 40_000_000;
|
||||
|
||||
@ConfigRegistry(config = "items", category = "power", key = "lapotronicOrbMaxCharge", comment = "Energy Capacity for Lapotronic Orb (FE)")
|
||||
public static int LapotronicOrbMaxCharge = 400_000_000;
|
||||
|
||||
|
|
|
@ -110,7 +110,4 @@ public class ItemBattery extends ItemTR implements IEnergyItemInfo {
|
|||
public double getMaxTransfer(ItemStack stack) {
|
||||
return maxTransfer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -31,12 +31,14 @@ import net.minecraftforge.energy.CapabilityEnergy;
|
|||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.common.powerSystem.forge.ForgePowerItemManager;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
public class ItemEnergyCrystal extends ItemBattery {
|
||||
|
||||
// 4M FE storage with 10k charge rate
|
||||
public ItemEnergyCrystal() {
|
||||
super("energyCrystal", 100000, 512);
|
||||
super("energyCrystal", ConfigTechReborn.EnergyCrystalMaxCharge, 10_000);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
@ -46,12 +48,11 @@ public class ItemEnergyCrystal extends ItemBattery {
|
|||
return;
|
||||
}
|
||||
ItemStack stack = new ItemStack(ModItems.ENERGY_CRYSTAL);
|
||||
ItemStack uncharged = stack.copy();
|
||||
ItemStack charged = stack.copy();
|
||||
ForgePowerItemManager capEnergy = (ForgePowerItemManager) charged.getCapability(CapabilityEnergy.ENERGY, null);
|
||||
capEnergy.setEnergyStored(capEnergy.getMaxEnergyStored());
|
||||
|
||||
itemList.add(uncharged);
|
||||
itemList.add(stack);
|
||||
itemList.add(charged);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,28 +31,28 @@ import net.minecraftforge.energy.CapabilityEnergy;
|
|||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.common.powerSystem.forge.ForgePowerItemManager;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
public class ItemLapotronCrystal extends ItemBattery {
|
||||
|
||||
// 40M FE capacity with 40k FE\t charge rate
|
||||
public ItemLapotronCrystal() {
|
||||
super("lapotronCrystal", 10000000, 2048);
|
||||
super("lapotronCrystal", ConfigTechReborn.LapotronCrystalMaxCharge, 40_000);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubItems(
|
||||
CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
|
||||
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
|
||||
if (!isInCreativeTab(par2CreativeTabs)) {
|
||||
return;
|
||||
}
|
||||
ItemStack stack = new ItemStack(ModItems.LAPOTRONIC_CRYSTAL);
|
||||
ItemStack uncharged = stack.copy();
|
||||
ItemStack charged = stack.copy();
|
||||
ForgePowerItemManager capEnergy = (ForgePowerItemManager) charged.getCapability(CapabilityEnergy.ENERGY, null);
|
||||
capEnergy.setEnergyStored(capEnergy.getMaxEnergyStored());
|
||||
|
||||
itemList.add(uncharged);
|
||||
itemList.add(stack);
|
||||
itemList.add(charged);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,24 +36,23 @@ import techreborn.init.ModItems;
|
|||
|
||||
public class ItemLapotronicOrb extends ItemBattery {
|
||||
|
||||
// 400M capacity with 40k FE\t charge rate
|
||||
public ItemLapotronicOrb() {
|
||||
super("lapotronicorb", ConfigTechReborn.LapotronicOrbMaxCharge, 10000);
|
||||
super("lapotronicorb", ConfigTechReborn.LapotronicOrbMaxCharge, 40_000);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubItems(
|
||||
CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
|
||||
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
|
||||
if (!isInCreativeTab(par2CreativeTabs)) {
|
||||
return;
|
||||
}
|
||||
ItemStack stack = new ItemStack(ModItems.LAPOTRONIC_ORB);
|
||||
ItemStack uncharged = stack.copy();
|
||||
ItemStack charged = stack.copy();
|
||||
ForgePowerItemManager capEnergy = (ForgePowerItemManager) charged.getCapability(CapabilityEnergy.ENERGY, null);
|
||||
capEnergy.setEnergyStored(capEnergy.getMaxEnergyStored());
|
||||
|
||||
itemList.add(uncharged);
|
||||
itemList.add(stack);
|
||||
itemList.add(charged);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,24 +35,23 @@ import techreborn.init.ModItems;
|
|||
|
||||
public class ItemLithiumBattery extends ItemBattery {
|
||||
|
||||
// 400k FE with 1k FE\t charge rate
|
||||
public ItemLithiumBattery() {
|
||||
super("lithiumBattery", 100000, 512);
|
||||
super("lithiumBattery", 400_000, 1_000);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubItems(
|
||||
CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
|
||||
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
|
||||
if (!isInCreativeTab(par2CreativeTabs)) {
|
||||
return;
|
||||
}
|
||||
ItemStack stack = new ItemStack(ModItems.LITHIUM_BATTERY);
|
||||
ItemStack uncharged = stack.copy();
|
||||
ItemStack charged = stack.copy();
|
||||
ForgePowerItemManager capEnergy = (ForgePowerItemManager) charged.getCapability(CapabilityEnergy.ENERGY, null);
|
||||
capEnergy.setEnergyStored(capEnergy.getMaxEnergyStored());
|
||||
|
||||
itemList.add(uncharged);
|
||||
itemList.add(stack);
|
||||
itemList.add(charged);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,24 +35,23 @@ import techreborn.init.ModItems;
|
|||
|
||||
public class ItemReBattery extends ItemBattery {
|
||||
|
||||
// 40k FE capacity with 100 FE\t charge rate
|
||||
public ItemReBattery() {
|
||||
super("rebattery", 10000, 64);
|
||||
super("rebattery", 40_000, 100);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubItems(
|
||||
CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
|
||||
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
|
||||
if (!isInCreativeTab(par2CreativeTabs)) {
|
||||
return;
|
||||
}
|
||||
ItemStack stack = new ItemStack(ModItems.RE_BATTERY);
|
||||
ItemStack uncharged = stack.copy();
|
||||
ItemStack charged = stack.copy();
|
||||
ForgePowerItemManager capEnergy = (ForgePowerItemManager) charged.getCapability(CapabilityEnergy.ENERGY, null);
|
||||
capEnergy.setEnergyStored(capEnergy.getMaxEnergyStored());
|
||||
|
||||
itemList.add(uncharged);
|
||||
itemList.add(stack);
|
||||
itemList.add(charged);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue