Fix CreativeTab ordering and erronous adding to all item groups for some items.

This commit is contained in:
Sebastian Hartte
2020-06-09 10:58:09 +02:00
parent 97e065ea1f
commit 7d3ecd580e
8 changed files with 77 additions and 37 deletions
@@ -88,12 +88,14 @@ public abstract class AEBasePoweredItem extends AEBaseItem implements IAEItemPow
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> items) {
super.fillItemGroup(group, items);
final ItemStack charged = new ItemStack( this, 1 );
final CompoundNBT tag = charged.getOrCreateTag();
tag.putDouble(CURRENT_POWER_NBT_KEY, this.getAEMaxPower( charged ));
tag.putDouble(MAX_POWER_NBT_KEY, this.getAEMaxPower( charged ));
if (this.isInGroup(group)) {
final ItemStack charged = new ItemStack(this, 1);
final CompoundNBT tag = charged.getOrCreateTag();
tag.putDouble(CURRENT_POWER_NBT_KEY, this.getAEMaxPower(charged));
tag.putDouble(MAX_POWER_NBT_KEY, this.getAEMaxPower(charged));
items.add( charged );
items.add(charged);
}
}
@Override