ActuallyAdditions/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java

353 lines
14 KiB
Java
Raw Normal View History

2015-08-29 14:33:25 +02:00
/*
2016-05-16 22:52:27 +02:00
* This file ("CreativeTab.java") is part of the Actually Additions mod for Minecraft.
2015-08-29 14:33:25 +02:00
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
2016-05-16 22:52:27 +02:00
* http://ellpeck.de/actaddlicense
2015-08-29 14:33:25 +02:00
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
2016-05-16 22:54:42 +02:00
* © 2015-2016 Ellpeck
2015-08-29 14:33:25 +02:00
*/
2016-01-05 04:47:35 +01:00
package de.ellpeck.actuallyadditions.mod.creative;
2015-01-30 20:16:32 +01:00
2016-01-05 04:47:35 +01:00
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
2016-05-06 22:27:38 +02:00
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
2016-01-05 04:47:35 +01:00
import de.ellpeck.actuallyadditions.mod.items.InitItems;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
2015-03-08 14:58:26 +01:00
import net.minecraft.block.Block;
2015-01-30 20:16:32 +01:00
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
2016-11-19 21:11:17 +01:00
import net.minecraft.util.NonNullList;
2016-05-06 22:23:41 +02:00
import net.minecraftforge.common.ForgeModContainer;
import net.minecraftforge.fluids.UniversalBucket;
2016-01-07 18:20:59 +01:00
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
2015-01-30 20:16:32 +01:00
2015-03-08 14:58:26 +01:00
import java.util.List;
2015-01-30 20:16:32 +01:00
public class CreativeTab extends CreativeTabs{
2016-06-17 23:50:38 +02:00
public static final CreativeTab INSTANCE = new CreativeTab();
2016-11-19 21:11:17 +01:00
private NonNullList<ItemStack> list;
2015-01-30 20:16:32 +01:00
public CreativeTab(){
2016-04-20 21:39:03 +02:00
super(ModUtil.MOD_ID);
this.setBackgroundImageName(ModUtil.MOD_ID+".png");
}
@Override
public boolean hasSearchBar(){
return true;
}
@Override
public int getSearchbarWidth(){
return 70;
2015-01-30 20:16:32 +01:00
}
2015-10-03 10:19:40 +02:00
@Override
2016-11-19 21:11:17 +01:00
public ItemStack getTabIconItem(){
return new ItemStack(InitItems.itemBooklet);
2015-10-03 10:19:40 +02:00
}
2015-03-08 14:58:26 +01:00
@Override
@SideOnly(Side.CLIENT)
2016-11-19 21:11:17 +01:00
public void displayAllRelevantItems(NonNullList<ItemStack> list){
2015-03-08 14:58:26 +01:00
this.list = list;
2016-05-02 17:46:53 +02:00
this.add(InitItems.itemBooklet);
this.add(InitBlocks.blockSmileyCloud);
2016-07-22 20:23:51 +02:00
this.add(InitBlocks.blockTinyTorch);
2016-05-02 17:46:53 +02:00
this.add(InitBlocks.blockFireworkBox);
this.add(InitBlocks.blockLaserRelay);
2016-07-14 16:44:01 +02:00
this.add(InitBlocks.blockLaserRelayAdvanced);
this.add(InitBlocks.blockLaserRelayExtreme);
2016-09-01 20:50:44 +02:00
this.add(InitBlocks.blockLaserRelayFluids);
2016-05-08 21:09:58 +02:00
this.add(InitBlocks.blockLaserRelayItem);
this.add(InitBlocks.blockLaserRelayItemWhitelist);
2016-05-08 21:09:58 +02:00
this.add(InitBlocks.blockItemViewer);
2016-05-02 17:46:53 +02:00
this.add(InitBlocks.blockAtomicReconstructor);
this.add(InitBlocks.blockEmpowerer);
2016-05-02 17:46:53 +02:00
this.add(InitBlocks.blockPhantomface);
this.add(InitBlocks.blockPhantomEnergyface);
this.add(InitBlocks.blockPhantomLiquiface);
2016-05-05 17:29:39 +02:00
this.add(InitBlocks.blockPhantomRedstoneface);
2016-05-02 17:46:53 +02:00
this.add(InitBlocks.blockPhantomPlacer);
this.add(InitBlocks.blockPhantomBreaker);
2016-06-05 04:05:37 +02:00
this.add(InitBlocks.blockPlayerInterface);
2016-05-02 17:46:53 +02:00
this.add(InitBlocks.blockInputter);
this.add(InitBlocks.blockInputterAdvanced);
this.add(InitBlocks.blockPhantomBooster);
this.add(InitBlocks.blockCoffeeMachine);
this.add(InitBlocks.blockXPSolidifier);
this.add(InitBlocks.blockDisplayStand);
2016-09-09 21:43:33 +02:00
this.add(InitBlocks.blockDistributorItem);
2016-05-02 17:46:53 +02:00
2016-10-31 19:03:04 +01:00
this.add(InitBlocks.blockFarmer);
this.add(InitBlocks.blockShockSuppressor);
2016-05-02 17:46:53 +02:00
this.add(InitBlocks.blockMiner);
this.add(InitBlocks.blockGreenhouseGlass);
this.add(InitBlocks.blockGrinder);
this.add(InitBlocks.blockGrinderDouble);
this.add(InitBlocks.blockFurnaceDouble);
this.add(InitBlocks.blockLavaFactoryController);
this.add(InitBlocks.blockEnergizer);
this.add(InitBlocks.blockEnervator);
this.add(InitBlocks.blockFurnaceSolar);
this.add(InitBlocks.blockHeatCollector);
this.add(InitBlocks.blockCoalGenerator);
this.add(InitBlocks.blockOilGenerator);
this.add(InitBlocks.blockLeafGenerator);
2016-09-14 21:42:03 +02:00
this.add(InitBlocks.blockBioReactor);
2016-05-02 17:46:53 +02:00
this.add(InitBlocks.blockItemRepairer);
this.add(InitBlocks.blockFishingNet);
this.add(InitBlocks.blockBreaker);
this.add(InitBlocks.blockDirectionalBreaker);
this.add(InitBlocks.blockRangedCollector);
this.add(InitBlocks.blockPlacer);
this.add(InitBlocks.blockDropper);
this.add(InitBlocks.blockFluidPlacer);
this.add(InitBlocks.blockFluidCollector);
this.add(InitBlocks.blockMisc);
this.add(InitBlocks.blockFeeder);
this.add(InitBlocks.blockCompost);
this.add(InitBlocks.blockGiantChest);
2016-06-27 20:19:04 +02:00
this.add(InitBlocks.blockGiantChestMedium);
this.add(InitBlocks.blockGiantChestLarge);
2016-05-02 17:46:53 +02:00
this.add(InitBlocks.blockCanolaPress);
this.add(InitBlocks.blockFermentingBarrel);
this.add(InitBlocks.blockTestifiBucksGreenWall);
this.add(InitBlocks.blockTestifiBucksWhiteWall);
this.add(InitBlocks.blockTestifiBucksGreenStairs);
this.add(InitBlocks.blockTestifiBucksWhiteStairs);
this.add(InitBlocks.blockTestifiBucksGreenSlab);
this.add(InitBlocks.blockTestifiBucksWhiteSlab);
this.add(InitBlocks.blockTestifiBucksGreenFence);
this.add(InitBlocks.blockTestifiBucksWhiteFence);
this.add(InitBlocks.blockQuartzWall);
this.add(InitBlocks.blockQuartzStair);
this.add(InitBlocks.blockQuartzSlab);
this.add(InitBlocks.blockChiseledQuartzWall);
this.add(InitBlocks.blockChiseledQuartzStair);
this.add(InitBlocks.blockChiseledQuartzSlab);
this.add(InitBlocks.blockPillarQuartzWall);
this.add(InitBlocks.blockPillarQuartzStair);
this.add(InitBlocks.blockPillarQuartzSlab);
this.add(InitBlocks.blockColoredLamp);
this.add(InitBlocks.blockColoredLampOn);
this.add(InitBlocks.blockLampPowerer);
this.add(InitBlocks.blockTreasureChest);
this.add(InitBlocks.blockBlackLotus);
this.add(InitItems.itemBag);
this.add(InitItems.itemVoidBag);
2016-07-22 20:23:51 +02:00
this.add(InitItems.itemWorm);
this.add(InitItems.itemPlayerProbe);
2016-05-02 17:46:53 +02:00
this.add(InitItems.itemColorLens);
this.add(InitItems.itemExplosionLens);
this.add(InitItems.itemDamageLens);
2016-11-02 18:49:57 +01:00
this.add(InitItems.itemMoreDamageLens);
2016-10-31 16:36:22 +01:00
this.add(InitItems.itemDisenchantingLens);
this.add(InitItems.itemMiningLens);
2016-05-02 17:46:53 +02:00
this.add(InitItems.itemLaserWrench);
this.add(InitItems.itemCrateKeeper);
this.add(InitItems.itemChestToCrateUpgrade);
this.add(InitItems.itemSmallToMediumCrateUpgrade);
this.add(InitItems.itemMediumToLargeCrateUpgrade);
2016-05-16 01:04:11 +02:00
this.add(InitItems.itemSpawnerChanger);
2016-06-02 19:28:51 +02:00
this.add(InitItems.itemWaterBowl);
2016-05-02 17:46:53 +02:00
this.add(InitItems.itemDrill);
this.add(InitItems.itemDrillUpgradeSpeed);
this.add(InitItems.itemDrillUpgradeSpeedII);
this.add(InitItems.itemDrillUpgradeSpeedIII);
this.add(InitItems.itemDrillUpgradeSilkTouch);
this.add(InitItems.itemDrillUpgradeFortune);
this.add(InitItems.itemDrillUpgradeFortuneII);
this.add(InitItems.itemDrillUpgradeThreeByThree);
this.add(InitItems.itemDrillUpgradeFiveByFive);
this.add(InitItems.itemDrillUpgradeBlockPlacing);
this.add(InitItems.itemBattery);
this.add(InitItems.itemBatteryDouble);
this.add(InitItems.itemBatteryTriple);
this.add(InitItems.itemBatteryQuadruple);
this.add(InitItems.itemBatteryQuintuple);
this.add(InitItems.itemTeleStaff);
2016-11-05 15:36:16 +01:00
this.add(InitItems.itemFillingWand);
2016-05-02 17:46:53 +02:00
this.add(InitItems.itemGrowthRing);
this.add(InitItems.itemMagnetRing);
this.add(InitItems.itemWaterRemovalRing);
UniversalBucket bucket = ForgeModContainer.getInstance().universalBucket;
this.list.add(UniversalBucket.getFilledBucket(bucket, InitFluids.fluidCanolaOil));
this.list.add(UniversalBucket.getFilledBucket(bucket, InitFluids.fluidOil));
this.list.add(UniversalBucket.getFilledBucket(bucket, InitFluids.fluidCrystalOil));
this.list.add(UniversalBucket.getFilledBucket(bucket, InitFluids.fluidEmpoweredOil));
2016-05-06 22:27:38 +02:00
2016-05-02 17:46:53 +02:00
this.add(InitItems.itemPhantomConnector);
2016-06-07 23:17:06 +02:00
this.add(InitItems.itemFilter);
2016-05-02 17:46:53 +02:00
this.add(InitItems.itemWingsOfTheBats);
this.add(InitItems.itemCoffeeSeed);
this.add(InitItems.itemCoffeeBean);
this.add(InitItems.itemRiceSeed);
this.add(InitItems.itemCanolaSeed);
this.add(InitItems.itemFlaxSeed);
this.add(InitItems.itemHairyBall);
this.add(InitItems.itemMisc);
this.add(InitItems.itemResonantRice);
this.add(InitItems.itemFertilizer);
this.add(InitItems.itemCoffee);
this.add(InitItems.itemFoods);
this.add(InitItems.itemKnife);
this.add(InitItems.itemCrafterOnAStick);
this.add(InitItems.itemDust);
this.add(InitItems.itemSolidifiedExperience);
this.add(InitItems.itemLeafBlower);
this.add(InitItems.itemLeafBlowerAdvanced);
this.add(InitItems.woodenPaxel);
this.add(InitItems.stonePaxel);
this.add(InitItems.ironPaxel);
this.add(InitItems.goldPaxel);
this.add(InitItems.diamondPaxel);
this.add(InitItems.emeraldPaxel);
this.add(InitItems.obsidianPaxel);
this.add(InitItems.quartzPaxel);
this.add(InitItems.itemPaxelCrystalRed);
this.add(InitItems.itemPaxelCrystalBlue);
this.add(InitItems.itemPaxelCrystalLightBlue);
this.add(InitItems.itemPaxelCrystalBlack);
this.add(InitItems.itemPaxelCrystalGreen);
this.add(InitItems.itemPaxelCrystalWhite);
2016-02-01 17:49:55 +01:00
2016-05-02 17:46:53 +02:00
this.add(InitBlocks.blockCrystal);
this.add(InitBlocks.blockCrystalEmpowered);
2016-05-02 17:46:53 +02:00
this.add(InitItems.itemCrystal);
this.add(InitItems.itemCrystalEmpowered);
2016-05-02 17:46:53 +02:00
this.add(InitItems.itemJams);
this.add(InitItems.itemPotionRing);
this.add(InitItems.itemPotionRingAdvanced);
this.add(InitItems.itemPickaxeQuartz);
this.add(InitItems.itemSwordQuartz);
this.add(InitItems.itemAxeQuartz);
this.add(InitItems.itemShovelQuartz);
this.add(InitItems.itemHoeQuartz);
this.add(InitItems.itemHelmQuartz);
this.add(InitItems.itemChestQuartz);
this.add(InitItems.itemPantsQuartz);
this.add(InitItems.itemBootsQuartz);
this.add(InitItems.itemPickaxeEmerald);
this.add(InitItems.itemSwordEmerald);
this.add(InitItems.itemAxeEmerald);
this.add(InitItems.itemShovelEmerald);
this.add(InitItems.itemHoeEmerald);
this.add(InitItems.itemHelmEmerald);
this.add(InitItems.itemChestEmerald);
this.add(InitItems.itemPantsEmerald);
this.add(InitItems.itemBootsEmerald);
this.add(InitItems.itemPickaxeObsidian);
this.add(InitItems.itemSwordObsidian);
this.add(InitItems.itemAxeObsidian);
this.add(InitItems.itemShovelObsidian);
this.add(InitItems.itemHoeObsidian);
this.add(InitItems.itemHelmObsidian);
this.add(InitItems.itemChestObsidian);
this.add(InitItems.itemPantsObsidian);
this.add(InitItems.itemBootsObsidian);
this.add(InitItems.itemPickaxeCrystalRed);
this.add(InitItems.itemAxeCrystalRed);
this.add(InitItems.itemShovelCrystalRed);
this.add(InitItems.itemSwordCrystalRed);
this.add(InitItems.itemHoeCrystalRed);
this.add(InitItems.itemHelmCrystalRed);
this.add(InitItems.itemChestCrystalRed);
this.add(InitItems.itemPantsCrystalRed);
this.add(InitItems.itemBootsCrystalRed);
this.add(InitItems.itemPickaxeCrystalBlue);
this.add(InitItems.itemAxeCrystalBlue);
this.add(InitItems.itemShovelCrystalBlue);
this.add(InitItems.itemSwordCrystalBlue);
this.add(InitItems.itemHoeCrystalBlue);
this.add(InitItems.itemHelmCrystalBlue);
this.add(InitItems.itemChestCrystalBlue);
this.add(InitItems.itemPantsCrystalBlue);
this.add(InitItems.itemBootsCrystalBlue);
this.add(InitItems.itemPickaxeCrystalLightBlue);
this.add(InitItems.itemAxeCrystalLightBlue);
this.add(InitItems.itemShovelCrystalLightBlue);
this.add(InitItems.itemSwordCrystalLightBlue);
this.add(InitItems.itemHoeCrystalLightBlue);
this.add(InitItems.itemHelmCrystalLightBlue);
this.add(InitItems.itemChestCrystalLightBlue);
this.add(InitItems.itemPantsCrystalLightBlue);
this.add(InitItems.itemBootsCrystalLightBlue);
this.add(InitItems.itemPickaxeCrystalBlack);
this.add(InitItems.itemAxeCrystalBlack);
this.add(InitItems.itemShovelCrystalBlack);
this.add(InitItems.itemSwordCrystalBlack);
this.add(InitItems.itemHoeCrystalBlack);
this.add(InitItems.itemHelmCrystalBlack);
this.add(InitItems.itemChestCrystalBlack);
this.add(InitItems.itemPantsCrystalBlack);
this.add(InitItems.itemBootsCrystalBlack);
this.add(InitItems.itemPickaxeCrystalGreen);
this.add(InitItems.itemAxeCrystalGreen);
this.add(InitItems.itemShovelCrystalGreen);
this.add(InitItems.itemSwordCrystalGreen);
this.add(InitItems.itemHoeCrystalGreen);
this.add(InitItems.itemHelmCrystalGreen);
this.add(InitItems.itemChestCrystalGreen);
this.add(InitItems.itemPantsCrystalGreen);
this.add(InitItems.itemBootsCrystalGreen);
this.add(InitItems.itemPickaxeCrystalWhite);
this.add(InitItems.itemAxeCrystalWhite);
this.add(InitItems.itemShovelCrystalWhite);
this.add(InitItems.itemSwordCrystalWhite);
this.add(InitItems.itemHoeCrystalWhite);
this.add(InitItems.itemHelmCrystalWhite);
this.add(InitItems.itemChestCrystalWhite);
this.add(InitItems.itemPantsCrystalWhite);
this.add(InitItems.itemBootsCrystalWhite);
2015-03-08 14:58:26 +01:00
}
public void add(Item item){
if(item != null){
2016-06-17 23:50:38 +02:00
item.getSubItems(item, INSTANCE, this.list);
}
2015-03-08 14:58:26 +01:00
}
public void add(Block block){
if(block != null){
2016-06-17 23:50:38 +02:00
block.getSubBlocks(new ItemStack(block).getItem(), INSTANCE, this.list);
}
2015-01-30 20:16:32 +01:00
}
}