Migrated batteries + TR Itemgroup
This commit is contained in:
parent
0c99a94250
commit
e513e20e5a
16 changed files with 101 additions and 108 deletions
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.items.battery;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
|
@ -38,20 +38,19 @@ public class ItemLithiumIonBattery extends ItemBattery {
|
|||
public ItemLithiumIonBattery() {
|
||||
super(400_000, 1_000);
|
||||
}
|
||||
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
|
||||
if (!isInCreativeTab(par2CreativeTabs)) {
|
||||
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> items) {
|
||||
if (!isInGroup(group)) {
|
||||
return;
|
||||
}
|
||||
ItemStack stack = new ItemStack(TRContent.LITHIUM_ION_BATTERY);
|
||||
ItemStack charged = stack.copy();
|
||||
ItemStack uncharged = new ItemStack(TRContent.LITHIUM_ION_BATTERY);
|
||||
ItemStack charged = new ItemStack(TRContent.LITHIUM_ION_BATTERY);
|
||||
ForgePowerItemManager capEnergy = new ForgePowerItemManager(charged);
|
||||
capEnergy.setEnergyStored(capEnergy.getMaxEnergyStored());
|
||||
|
||||
itemList.add(stack);
|
||||
itemList.add(charged);
|
||||
items.add(uncharged);
|
||||
items.add(charged);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue