Fix Creative tab issue
This commit is contained in:
parent
7426d83900
commit
e0c39a4777
31 changed files with 102 additions and 9 deletions
|
@ -131,6 +131,9 @@ public class DynamicCell extends Item {
|
|||
|
||||
@Override
|
||||
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> subItems) {
|
||||
if(!func_194125_a(tab)){
|
||||
return;
|
||||
}
|
||||
subItems.add(getEmptyCell(1));
|
||||
for (Fluid fluid : FluidRegistry.getRegisteredFluids().values()) {
|
||||
subItems.add(getCellWithFluid(fluid));
|
||||
|
|
|
@ -91,6 +91,9 @@ public class ItemDusts extends ItemTRNoDestroy {
|
|||
// Adds Dusts SubItems To Creative Tab
|
||||
@Override
|
||||
public void getSubItems(CreativeTabs creativeTabs, NonNullList list) {
|
||||
if(!func_194125_a(creativeTabs)){
|
||||
return;
|
||||
}
|
||||
for (int meta = 0; meta < types.length; ++meta) {
|
||||
if (!types[meta].equals(ModItems.META_PLACEHOLDER)) {
|
||||
list.add(new ItemStack(this, 1, meta));
|
||||
|
|
|
@ -26,7 +26,6 @@ package techreborn.items;
|
|||
|
||||
import com.google.common.base.CaseFormat;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
|
@ -80,10 +79,14 @@ public class ItemDustsSmall extends ItemTRNoDestroy {
|
|||
}
|
||||
|
||||
// Adds Dusts SubItems To Creative Tab
|
||||
public void getSubItems(Item item, CreativeTabs creativeTabs, NonNullList list) {
|
||||
@Override
|
||||
public void getSubItems(CreativeTabs creativeTabs, NonNullList list) {
|
||||
if(!func_194125_a(creativeTabs)){
|
||||
return;
|
||||
}
|
||||
for (int meta = 0; meta < types.length; ++meta) {
|
||||
if (!types[meta].equals(ModItems.META_PLACEHOLDER)) {
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
list.add(new ItemStack(this, 1, meta));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ package techreborn.items;
|
|||
|
||||
import com.google.common.base.CaseFormat;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
|
@ -70,9 +69,13 @@ public class ItemGems extends ItemTRNoDestroy {
|
|||
}
|
||||
|
||||
// Adds Dusts SubItems To Creative Tab
|
||||
public void getSubItems(Item item, CreativeTabs creativeTabs, NonNullList list) {
|
||||
@Override
|
||||
public void getSubItems(CreativeTabs creativeTabs, NonNullList list) {
|
||||
if(!func_194125_a(creativeTabs)){
|
||||
return;
|
||||
}
|
||||
for (int meta = 0; meta < types.length; ++meta) {
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
list.add(new ItemStack(this, 1, meta));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -80,6 +80,9 @@ public class ItemIngots extends ItemTRNoDestroy {
|
|||
// Adds Dusts SubItems To Creative Tab
|
||||
@Override
|
||||
public void getSubItems(CreativeTabs creativeTabs, NonNullList list) {
|
||||
if(!func_194125_a(creativeTabs)){
|
||||
return;
|
||||
}
|
||||
for (int meta = 0; meta < types.length; ++meta) {
|
||||
if (!types[meta].equals(ModItems.META_PLACEHOLDER)) {
|
||||
list.add(new ItemStack(this, 1, meta));
|
||||
|
|
|
@ -74,6 +74,9 @@ public class ItemNuggets extends ItemTRNoDestroy {
|
|||
// Adds Dusts SubItems To Creative Tab
|
||||
@Override
|
||||
public void getSubItems(CreativeTabs creativeTabs, NonNullList list) {
|
||||
if(!func_194125_a(creativeTabs)){
|
||||
return;
|
||||
}
|
||||
for (int meta = 0; meta < types.length; ++meta) {
|
||||
if (!types[meta].equals(ModItems.META_PLACEHOLDER)) {
|
||||
list.add(new ItemStack(this, 1, meta));
|
||||
|
|
|
@ -96,6 +96,9 @@ public class ItemParts extends ItemTRNoDestroy {
|
|||
// Adds Dusts SubItems To Creative Tab
|
||||
@Override
|
||||
public void getSubItems(final CreativeTabs creativeTabs, final NonNullList list) {
|
||||
if(!func_194125_a(creativeTabs)){
|
||||
return;
|
||||
}
|
||||
for (int meta = 0; meta < ItemParts.types.length; ++meta) {
|
||||
if (!ItemParts.types[meta].equals(ModItems.META_PLACEHOLDER)) {
|
||||
list.add(new ItemStack(this, 1, meta));
|
||||
|
|
|
@ -26,7 +26,6 @@ package techreborn.items;
|
|||
|
||||
import com.google.common.base.CaseFormat;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
@ -91,10 +90,14 @@ public class ItemPlates extends ItemTRNoDestroy {
|
|||
}
|
||||
|
||||
// Adds Dusts SubItems To Creative Tab
|
||||
public void getSubItems(Item item, CreativeTabs creativeTabs, NonNullList list) {
|
||||
@Override
|
||||
public void getSubItems(CreativeTabs creativeTabs, NonNullList list) {
|
||||
if(!func_194125_a(creativeTabs)){
|
||||
return;
|
||||
}
|
||||
for (int meta = 0; meta < types.length; ++meta) {
|
||||
if (!types[meta].equals(ModItems.META_PLACEHOLDER)) {
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
list.add(new ItemStack(this, 1, meta));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,6 +96,9 @@ public class ItemUpgrades extends ItemTRNoDestroy implements IUpgrade {
|
|||
// Adds Dusts SubItems To Creative Tab
|
||||
@Override
|
||||
public void getSubItems(CreativeTabs creativeTabs, NonNullList list) {
|
||||
if(!func_194125_a(creativeTabs)){
|
||||
return;
|
||||
}
|
||||
for (int meta = 0; meta < types.length; ++meta) {
|
||||
list.add(new ItemStack(this, 1, meta));
|
||||
}
|
||||
|
|
|
@ -89,6 +89,9 @@ public class ItemLapotronPack extends ItemArmor implements IEnergyItemInfo {
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item,
|
||||
CreativeTabs par2CreativeTabs, NonNullList itemList) {
|
||||
if(!func_194125_a(par2CreativeTabs)){
|
||||
return;
|
||||
}
|
||||
ItemStack uncharged = new ItemStack(ModItems.LAPOTRONIC_ORB_PACK);
|
||||
ItemStack charged = new ItemStack(ModItems.LAPOTRONIC_ORB_PACK);
|
||||
PoweredItem.setEnergy(getMaxPower(charged), charged);
|
||||
|
|
|
@ -107,6 +107,9 @@ public class ItemLithiumBatpack extends ItemArmor implements IEnergyItemInfo {
|
|||
@Override
|
||||
public void getSubItems(
|
||||
CreativeTabs par2CreativeTabs, NonNullList itemList) {
|
||||
if(!func_194125_a(par2CreativeTabs)){
|
||||
return;
|
||||
}
|
||||
ItemStack uncharged = new ItemStack(ModItems.LITHIUM_BATTERY_PACK);
|
||||
ItemStack charged = new ItemStack(ModItems.LITHIUM_BATTERY_PACK);
|
||||
PoweredItem.setEnergy(getMaxPower(charged), charged);
|
||||
|
|
|
@ -42,6 +42,9 @@ public class ItemEnergyCrystal extends ItemBattery {
|
|||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList itemList) {
|
||||
if(!func_194125_a(par2CreativeTabs)){
|
||||
return;
|
||||
}
|
||||
ItemStack stack = new ItemStack(ModItems.ENERGY_CRYSTAL);
|
||||
ItemStack uncharged = stack.copy();
|
||||
ItemStack charged = stack.copy();
|
||||
|
|
|
@ -43,6 +43,9 @@ public class ItemLapotronCrystal extends ItemBattery {
|
|||
@Override
|
||||
public void getSubItems(
|
||||
CreativeTabs par2CreativeTabs, NonNullList itemList) {
|
||||
if(!func_194125_a(par2CreativeTabs)){
|
||||
return;
|
||||
}
|
||||
ItemStack stack = new ItemStack(ModItems.LAPOTRONIC_CRYSTAL);
|
||||
ItemStack uncharged = stack.copy();
|
||||
ItemStack charged = stack.copy();
|
||||
|
|
|
@ -44,6 +44,9 @@ public class ItemLapotronicOrb extends ItemBattery {
|
|||
@Override
|
||||
public void getSubItems(
|
||||
CreativeTabs par2CreativeTabs, NonNullList itemList) {
|
||||
if(!func_194125_a(par2CreativeTabs)){
|
||||
return;
|
||||
}
|
||||
ItemStack stack = new ItemStack(ModItems.LAPOTRONIC_ORB);
|
||||
ItemStack uncharged = stack.copy();
|
||||
ItemStack charged = stack.copy();
|
||||
|
|
|
@ -43,6 +43,9 @@ public class ItemLithiumBattery extends ItemBattery {
|
|||
@Override
|
||||
public void getSubItems(
|
||||
CreativeTabs par2CreativeTabs, NonNullList itemList) {
|
||||
if(!func_194125_a(par2CreativeTabs)){
|
||||
return;
|
||||
}
|
||||
ItemStack stack = new ItemStack(ModItems.LITHIUM_BATTERY);
|
||||
ItemStack uncharged = stack.copy();
|
||||
ItemStack charged = stack.copy();
|
||||
|
|
|
@ -43,6 +43,9 @@ public class ItemReBattery extends ItemBattery {
|
|||
@Override
|
||||
public void getSubItems(
|
||||
CreativeTabs par2CreativeTabs, NonNullList itemList) {
|
||||
if(!func_194125_a(par2CreativeTabs)){
|
||||
return;
|
||||
}
|
||||
ItemStack stack = new ItemStack(ModItems.RE_BATTERY);
|
||||
ItemStack uncharged = stack.copy();
|
||||
ItemStack charged = stack.copy();
|
||||
|
|
|
@ -48,6 +48,9 @@ public class ItemAdvancedChainsaw extends ItemChainsaw {
|
|||
@Override
|
||||
public void getSubItems(
|
||||
CreativeTabs par2CreativeTabs, NonNullList itemList) {
|
||||
if(!func_194125_a(par2CreativeTabs)){
|
||||
return;
|
||||
}
|
||||
ItemStack stack = new ItemStack(ModItems.ADVANCED_CHAINSAW);
|
||||
ItemStack uncharged = stack.copy();
|
||||
ItemStack charged = stack.copy();
|
||||
|
|
|
@ -59,6 +59,9 @@ public class ItemAdvancedDrill extends ItemDrill {
|
|||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList itemList) {
|
||||
if(!func_194125_a(par2CreativeTabs)){
|
||||
return;
|
||||
}
|
||||
ItemStack stack = new ItemStack(ModItems.ADVANCED_DRILL);
|
||||
ItemStack uncharged = stack.copy();
|
||||
ItemStack charged = stack.copy();
|
||||
|
|
|
@ -47,6 +47,9 @@ public class ItemAdvancedJackhammer extends ItemJackhammer {
|
|||
@Override
|
||||
public void getSubItems(
|
||||
CreativeTabs par2CreativeTabs, NonNullList itemList) {
|
||||
if(!func_194125_a(par2CreativeTabs)){
|
||||
return;
|
||||
}
|
||||
ItemStack stack = new ItemStack(ModItems.ADVANCED_JACKHAMMER);
|
||||
ItemStack uncharged = stack.copy();
|
||||
ItemStack charged = stack.copy();
|
||||
|
|
|
@ -106,6 +106,9 @@ public class ItemCloakingDevice extends ItemTRNoDestroy implements IEnergyItemIn
|
|||
@Override
|
||||
public void getSubItems(
|
||||
CreativeTabs par2CreativeTabs, NonNullList itemList) {
|
||||
if(!func_194125_a(par2CreativeTabs)){
|
||||
return;
|
||||
}
|
||||
ItemStack uncharged = new ItemStack(ModItems.CLOAKING_DEVICE);
|
||||
ItemStack charged = new ItemStack(ModItems.CLOAKING_DEVICE);
|
||||
PoweredItem.setEnergy(getMaxPower(charged), charged);
|
||||
|
|
|
@ -48,6 +48,9 @@ public class ItemDiamondChainsaw extends ItemChainsaw {
|
|||
@Override
|
||||
public void getSubItems(
|
||||
CreativeTabs par2CreativeTabs, NonNullList itemList) {
|
||||
if(!func_194125_a(par2CreativeTabs)){
|
||||
return;
|
||||
}
|
||||
ItemStack stack = new ItemStack(ModItems.DIAMOND_CHAINSAW);
|
||||
ItemStack uncharged = stack.copy();
|
||||
ItemStack charged = stack.copy();
|
||||
|
|
|
@ -48,6 +48,9 @@ public class ItemDiamondDrill extends ItemDrill {
|
|||
@Override
|
||||
public void getSubItems(
|
||||
CreativeTabs par2CreativeTabs, NonNullList itemList) {
|
||||
if(!func_194125_a(par2CreativeTabs)){
|
||||
return;
|
||||
}
|
||||
ItemStack stack = new ItemStack(ModItems.DIAMOND_DRILL);
|
||||
ItemStack uncharged = stack.copy();
|
||||
ItemStack charged = stack.copy();
|
||||
|
|
|
@ -46,6 +46,9 @@ public class ItemDiamondJackhammer extends ItemJackhammer {
|
|||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList itemList) {
|
||||
if(!func_194125_a(par2CreativeTabs)){
|
||||
return;
|
||||
}
|
||||
ItemStack stack = new ItemStack(ModItems.DIAMOND_JACKHAMMER);
|
||||
ItemStack uncharged = stack.copy();
|
||||
ItemStack charged = stack.copy();
|
||||
|
|
|
@ -101,6 +101,9 @@ public class ItemElectricTreetap extends ItemTRNoDestroy implements IEnergyItemI
|
|||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList itemList) {
|
||||
if(!func_194125_a(par2CreativeTabs)){
|
||||
return;
|
||||
}
|
||||
ItemStack uncharged = new ItemStack(ModItems.ELECTRIC_TREE_TAP);
|
||||
ItemStack charged = new ItemStack(ModItems.ELECTRIC_TREE_TAP);
|
||||
PoweredItem.setEnergy(getMaxPower(charged), charged);
|
||||
|
|
|
@ -127,6 +127,9 @@ public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo {
|
|||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
|
||||
if(!func_194125_a(par2CreativeTabs)){
|
||||
return;
|
||||
}
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
itemList.add(itemStack);
|
||||
|
||||
|
|
|
@ -114,6 +114,9 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo {
|
|||
@Override
|
||||
public void getSubItems(
|
||||
CreativeTabs par2CreativeTabs, NonNullList itemList) {
|
||||
if(!func_194125_a(par2CreativeTabs)){
|
||||
return;
|
||||
}
|
||||
ItemStack inactiveUncharged = new ItemStack(ModItems.NANOSABER);
|
||||
inactiveUncharged.setTagCompound(new NBTTagCompound());
|
||||
inactiveUncharged.getTagCompound().setBoolean("isActive", false);
|
||||
|
|
|
@ -145,6 +145,9 @@ public class ItemOmniTool extends ItemPickaxe implements IEnergyItemInfo {
|
|||
@Override
|
||||
public void getSubItems(
|
||||
CreativeTabs par2CreativeTabs, NonNullList itemList) {
|
||||
if(!func_194125_a(par2CreativeTabs)){
|
||||
return;
|
||||
}
|
||||
ItemStack uncharged = new ItemStack(ModItems.OMNI_TOOL);
|
||||
ItemStack charged = new ItemStack(ModItems.OMNI_TOOL);
|
||||
PoweredItem.setEnergy(getMaxPower(charged), charged);
|
||||
|
|
|
@ -142,6 +142,9 @@ public class ItemRockCutter extends ItemPickaxe implements IEnergyItemInfo {
|
|||
@Override
|
||||
public void getSubItems(
|
||||
CreativeTabs par2CreativeTabs, NonNullList itemList) {
|
||||
if(!func_194125_a(par2CreativeTabs)){
|
||||
return;
|
||||
}
|
||||
ItemStack uncharged = new ItemStack(ModItems.ROCK_CUTTER);
|
||||
ItemStack charged = new ItemStack(ModItems.ROCK_CUTTER);
|
||||
PoweredItem.setEnergy(getMaxPower(charged), charged);
|
||||
|
|
|
@ -48,6 +48,9 @@ public class ItemSteelChainsaw extends ItemChainsaw {
|
|||
@Override
|
||||
public void getSubItems(
|
||||
CreativeTabs par2CreativeTabs, NonNullList itemList) {
|
||||
if(!func_194125_a(par2CreativeTabs)){
|
||||
return;
|
||||
}
|
||||
ItemStack stack = new ItemStack(ModItems.STEEL_CHAINSAW);
|
||||
ItemStack uncharged = stack.copy();
|
||||
ItemStack charged = stack.copy();
|
||||
|
|
|
@ -48,6 +48,9 @@ public class ItemSteelDrill extends ItemDrill {
|
|||
@Override
|
||||
public void getSubItems(
|
||||
CreativeTabs par2CreativeTabs, NonNullList itemList) {
|
||||
if(!func_194125_a(par2CreativeTabs)){
|
||||
return;
|
||||
}
|
||||
ItemStack stack = new ItemStack(ModItems.STEEL_DRILL);
|
||||
ItemStack uncharged = stack.copy();
|
||||
ItemStack charged = stack.copy();
|
||||
|
|
|
@ -47,6 +47,9 @@ public class ItemSteelJackhammer extends ItemJackhammer {
|
|||
@Override
|
||||
public void getSubItems(
|
||||
CreativeTabs par2CreativeTabs, NonNullList itemList) {
|
||||
if(!func_194125_a(par2CreativeTabs)){
|
||||
return;
|
||||
}
|
||||
ItemStack stack = new ItemStack(ModItems.STEEL_JACKHAMMER);
|
||||
ItemStack uncharged = stack.copy();
|
||||
ItemStack charged = stack.copy();
|
||||
|
|
Loading…
Reference in a new issue