use of net.minecraft.creativetab.CreativeTabs in project LogisticsPipes by RS485.
the class RequestUpdateNamesPacket method processPacket.
@Override
public void processPacket(EntityPlayer player) {
//XXX stubbed out. How do you enumerate every item now?
//Item[] itemList = Item.itemsList;
Item[] itemList = new Item[0];
List<ItemIdentifier> identList = new LinkedList<>();
for (Item item : itemList) {
if (item != null) {
for (CreativeTabs tab : item.getCreativeTabs()) {
List<ItemStack> list = new ArrayList<>();
item.getSubItems(item, tab, list);
if (list.size() > 0) {
identList.addAll(list.stream().map(ItemIdentifier::get).collect(Collectors.toList()));
} else {
identList.add(ItemIdentifier.get(item, 0, null));
}
}
}
}
SimpleServiceLocator.clientBufferHandler.setPause(true);
for (ItemIdentifier item : identList) {
MainProxy.sendPacketToServer(PacketHandler.getPacket(UpdateName.class).setIdent(item).setName(item.getFriendlyName()));
}
SimpleServiceLocator.clientBufferHandler.setPause(false);
FMLClientHandler.instance().getClient().thePlayer.sendChatMessage("Names in send Queue");
}
use of net.minecraft.creativetab.CreativeTabs in project ImmersiveEngineering by BluSunrize.
the class IEContent method preInit.
public static void preInit() {
fluidCreosote = new Fluid("creosote", new ResourceLocation("immersiveengineering:blocks/fluid/creosote_still"), new ResourceLocation("immersiveengineering:blocks/fluid/creosote_flow")).setDensity(1100).setViscosity(3000);
if (!FluidRegistry.registerFluid(fluidCreosote))
fluidCreosote = FluidRegistry.getFluid("creosote");
FluidRegistry.addBucketForFluid(fluidCreosote);
fluidPlantoil = new Fluid("plantoil", new ResourceLocation("immersiveengineering:blocks/fluid/plantoil_still"), new ResourceLocation("immersiveengineering:blocks/fluid/plantoil_flow")).setDensity(925).setViscosity(2000);
if (!FluidRegistry.registerFluid(fluidPlantoil))
fluidPlantoil = FluidRegistry.getFluid("plantoil");
FluidRegistry.addBucketForFluid(fluidPlantoil);
fluidEthanol = new Fluid("ethanol", new ResourceLocation("immersiveengineering:blocks/fluid/ethanol_still"), new ResourceLocation("immersiveengineering:blocks/fluid/ethanol_flow")).setDensity(789).setViscosity(1000);
if (!FluidRegistry.registerFluid(fluidEthanol))
fluidEthanol = FluidRegistry.getFluid("ethanol");
FluidRegistry.addBucketForFluid(fluidEthanol);
fluidBiodiesel = new Fluid("biodiesel", new ResourceLocation("immersiveengineering:blocks/fluid/biodiesel_still"), new ResourceLocation("immersiveengineering:blocks/fluid/biodiesel_flow")).setDensity(789).setViscosity(1000);
if (!FluidRegistry.registerFluid(fluidBiodiesel))
fluidBiodiesel = FluidRegistry.getFluid("biodiesel");
FluidRegistry.addBucketForFluid(fluidBiodiesel);
fluidConcrete = new Fluid("concrete", new ResourceLocation("immersiveengineering:blocks/fluid/concrete_still"), new ResourceLocation("immersiveengineering:blocks/fluid/concrete_flow")).setDensity(2400).setViscosity(4000);
if (!FluidRegistry.registerFluid(fluidConcrete))
fluidConcrete = FluidRegistry.getFluid("concrete");
FluidRegistry.addBucketForFluid(fluidConcrete);
fluidPotion = new FluidPotion("potion", new ResourceLocation("immersiveengineering:blocks/fluid/potion_still"), new ResourceLocation("immersiveengineering:blocks/fluid/potion_flow"));
if (!FluidRegistry.registerFluid(fluidPotion))
fluidPotion = FluidRegistry.getFluid("potion");
FluidRegistry.addBucketForFluid(fluidPotion);
blockOre = (BlockIEBase) new BlockIEBase("ore", Material.ROCK, PropertyEnum.create("type", BlockTypes_Ore.class), ItemBlockIEBase.class).setOpaque(true).setHardness(3.0F).setResistance(5.0F);
blockStorage = (BlockIEBase) new BlockIEBase("storage", Material.IRON, PropertyEnum.create("type", BlockTypes_MetalsIE.class), ItemBlockIEBase.class).setOpaque(true).setHardness(5.0F).setResistance(10.0F);
blockStorageSlabs = (BlockIESlab) new BlockIESlab("storageSlab", Material.IRON, PropertyEnum.create("type", BlockTypes_MetalsIE.class)).setHardness(5.0F).setResistance(10.0F);
int insGlassMeta = BlockTypes_StoneDecoration.INSULATING_GLASS.getMeta();
blockStoneDecoration = (BlockIEBase) new BlockIEBase("stoneDecoration", Material.ROCK, PropertyEnum.create("type", BlockTypes_StoneDecoration.class), ItemBlockIEBase.class).setMetaBlockLayer(insGlassMeta, BlockRenderLayer.TRANSLUCENT).setMetaLightOpacity(insGlassMeta, 0).setNotNormalBlock(insGlassMeta).setMetaExplosionResistance(BlockTypes_StoneDecoration.CONCRETE_LEADED.getMeta(), 180).setHardness(2.0F).setResistance(10.0F);
blockStoneDecorationSlabs = (BlockIEBase) new BlockIESlab("stoneDecorationSlab", Material.ROCK, PropertyEnum.create("type", BlockTypes_StoneDecoration.class)).setMetaHidden(3, 8).setMetaExplosionResistance(BlockTypes_StoneDecoration.CONCRETE_LEADED.getMeta(), 180).setHardness(2.0F).setResistance(10.0F);
blockStoneStair_hempcrete = new BlockIEStairs("stoneDecorationStairs_hempcrete", blockStoneDecoration.getStateFromMeta(BlockTypes_StoneDecoration.HEMPCRETE.getMeta()));
blockStoneStair_concrete0 = new BlockIEStairs("stoneDecorationStairs_concrete", blockStoneDecoration.getStateFromMeta(BlockTypes_StoneDecoration.CONCRETE.getMeta()));
blockStoneStair_concrete1 = new BlockIEStairs("stoneDecorationStairs_concrete_tile", blockStoneDecoration.getStateFromMeta(BlockTypes_StoneDecoration.CONCRETE_TILE.getMeta()));
blockStoneStair_concrete2 = new BlockIEStairs("stoneDecorationStairs_concrete_leaded", blockStoneDecoration.getStateFromMeta(BlockTypes_StoneDecoration.CONCRETE_LEADED.getMeta())).setExplosionResistance(180f);
blockStoneDevice = new BlockStoneDevice();
blockTreatedWood = (BlockIEBase) new BlockIEBase("treatedWood", Material.WOOD, PropertyEnum.create("type", BlockTypes_TreatedWood.class), ItemBlockIEBase.class).setOpaque(true).setHasFlavour().setHardness(2.0F).setResistance(5.0F);
blockTreatedWoodSlabs = (BlockIESlab) new BlockIESlab("treatedWoodSlab", Material.WOOD, PropertyEnum.create("type", BlockTypes_TreatedWood.class)).setHasFlavour().setHardness(2.0F).setResistance(5.0F);
blockWoodenStair = new BlockIEStairs("treatedWoodStairs0", blockTreatedWood.getStateFromMeta(0)).setHasFlavour(true);
blockWoodenStair1 = new BlockIEStairs("treatedWoodStairs1", blockTreatedWood.getStateFromMeta(1)).setHasFlavour(true);
blockWoodenStair2 = new BlockIEStairs("treatedWoodStairs2", blockTreatedWood.getStateFromMeta(2)).setHasFlavour(true);
blockWoodenDecoration = new BlockWoodenDecoration();
blockWoodenDevice0 = new BlockWoodenDevice0();
blockWoodenDevice1 = new BlockWoodenDevice1();
blockCrop = new BlockIECrop("hemp", PropertyEnum.create("type", BlockTypes_Hemp.class));
blockClothDevice = new BlockClothDevice();
blockFakeLight = new BlockFakeLight();
blockSheetmetal = (BlockIEBase) new BlockIEBase("sheetmetal", Material.IRON, PropertyEnum.create("type", BlockTypes_MetalsAll.class), ItemBlockIEBase.class).setOpaque(true).setHardness(3.0F).setResistance(10.0F);
blockSheetmetalSlabs = (BlockIESlab) new BlockIESlab("sheetmetalSlab", Material.IRON, PropertyEnum.create("type", BlockTypes_MetalsAll.class)).setHardness(3.0F).setResistance(10.0F);
blockMetalDecoration0 = (BlockIEBase) new BlockIEBase("metalDecoration0", Material.IRON, PropertyEnum.create("type", BlockTypes_MetalDecoration0.class), ItemBlockIEBase.class).setHardness(3.0F).setResistance(15.0F);
blockMetalDecoration1 = new BlockMetalDecoration1();
blockMetalDecoration2 = new BlockMetalDecoration2();
blockConnectors = new BlockConnector();
blockMetalDevice0 = new BlockMetalDevice0();
blockMetalDevice1 = new BlockMetalDevice1();
blockConveyor = new BlockConveyor();
blockMetalMultiblock = new BlockMetalMultiblocks();
blockFluidCreosote = new BlockIEFluid("fluidCreosote", fluidCreosote, Material.WATER).setFlammability(40, 400);
blockFluidPlantoil = new BlockIEFluid("fluidPlantoil", fluidPlantoil, Material.WATER);
blockFluidEthanol = new BlockIEFluid("fluidEthanol", fluidEthanol, Material.WATER).setFlammability(60, 600);
blockFluidBiodiesel = new BlockIEFluid("fluidBiodiesel", fluidBiodiesel, Material.WATER).setFlammability(60, 200);
blockFluidConcrete = new BlockIEFluidConcrete("fluidConcrete", fluidConcrete, Material.WATER);
itemMaterial = new ItemIEBase("material", 64, "stickTreated", "stickIron", "stickSteel", "stickAluminum", "hempFiber", "hempFabric", "coalCoke", "slag", "componentIron", "componentSteel", "waterwheelSegment", "windmillBlade", "windmillBladeAdvanced", "woodenGrip", "gunpartBarrel", "gunpartDrum", "gunpartHammer", "dustCoke", "dustHOPGraphite", "ingotHOPGraphite", "wireCopper", "wireElectrum", "wireAluminum", "wireSteel");
itemMetal = new ItemIEBase("metal", 64, "ingotCopper", "ingotAluminum", "ingotLead", "ingotSilver", "ingotNickel", "ingotUranium", "ingotConstantan", "ingotElectrum", "ingotSteel", "dustCopper", "dustAluminum", "dustLead", "dustSilver", "dustNickel", "dustUranium", "dustConstantan", "dustElectrum", "dustSteel", "dustIron", "dustGold", "nuggetCopper", "nuggetAluminum", "nuggetLead", "nuggetSilver", "nuggetNickel", "nuggetUranium", "nuggetConstantan", "nuggetElectrum", "nuggetSteel", "nuggetIron", "plateCopper", "plateAluminum", "plateLead", "plateSilver", "plateNickel", "plateUranium", "plateConstantan", "plateElectrum", "plateSteel", "plateIron", "plateGold");
itemTool = new ItemIETool();
itemToolbox = new ItemToolbox();
itemWireCoil = new ItemWireCoil();
WireType.ieWireCoil = itemWireCoil;
itemSeeds = new ItemIESeed(blockCrop, "hemp");
if (Config.IEConfig.hempSeedWeight > 0)
MinecraftForge.addGrassSeed(new ItemStack(itemSeeds), Config.IEConfig.hempSeedWeight);
itemDrill = new ItemDrill();
itemDrillhead = new ItemDrillhead();
itemJerrycan = new ItemJerrycan();
itemMold = new ItemIEBase("mold", 1, "plate", "gear", "rod", "bulletCasing", "wire").setMetaHidden(1);
itemBlueprint = new ItemEngineersBlueprint().setRegisterSubModels(false);
itemRevolver = new ItemRevolver();
itemBullet = new ItemBullet();
itemChemthrower = new ItemChemthrower();
itemRailgun = new ItemRailgun();
itemSkyhook = new ItemSkyhook();
itemToolUpgrades = new ItemToolUpgrade();
itemShader = new ItemShader();
itemShaderBag = new ItemShaderBag();
itemEarmuffs = new ItemEarmuffs();
itemCoresample = new ItemCoresample();
itemGraphiteElectrode = new ItemGraphiteElectrode();
ItemFaradaySuit.mat = EnumHelper.addArmorMaterial("faradayChains", "immersiveEngineering:faradaySuit", 1, new int[] { 1, 3, 2, 1 }, 0, SoundEvents.ITEM_ARMOR_EQUIP_CHAIN, 0);
for (int i = 0; i < itemsFaradaySuit.length; i++) itemsFaradaySuit[i] = new ItemFaradaySuit(EntityEquipmentSlot.values()[2 + i]);
itemFluorescentTube = new ItemFluorescentTube();
itemFakeIcons = new ItemIEBase("fakeIcon", 1, "birthday", "lucky") {
@Override
public void getSubItems(Item item, CreativeTabs tab, List list) {
}
};
// blockMetalDevice = new BlockMetalDevices();
// blockMetalDevice2 = new BlockMetalDevices2();
// blockMetalDecoration = new BlockMetalDecoration();
// blockMetalMultiblocks = new BlockMetalMultiblocks();
// blockWoodenDevice = new BlockWoodenDevices().setFlammable(true);
// blockWoodenDecoration = new BlockWoodenDecoration().setFlammable(true);
// blockStoneDevice = new BlockStoneDevices();
// blockStoneDecoration = new BlockStoneDecoration();
// blockConcreteStair = new BlockIEStairs("concreteStairs",blockStoneDecoration,4);
// blockConcreteTileStair = new BlockIEStairs("concreteTileStairs",blockStoneDecoration,5);
// blockClothDevice = new BlockClothDevices();
//
//Ore Dict
registerToOreDict("ore", blockOre);
registerToOreDict("block", blockStorage);
registerToOreDict("slab", blockStorageSlabs);
registerToOreDict("blockSheetmetal", blockSheetmetal);
registerToOreDict("slabSheetmetal", blockSheetmetalSlabs);
registerToOreDict("", itemMetal);
// registerOre("Cupronickel", null,new ItemStack(itemMetal,1,6),new ItemStack(itemMetal,1,15),new ItemStack(itemMetal,1,26),new ItemStack(itemMetal,1,36), new ItemStack(blockStorage,1,6),new ItemStack(blockStorageSlabs,1,6), new ItemStack(blockSheetmetal,1,6),new ItemStack(blockSheetmetalSlabs,1,6));
// OreDictionary.registerOre("seedIndustrialHemp", new ItemStack(itemSeeds));
OreDictionary.registerOre("stickTreatedWood", new ItemStack(itemMaterial, 1, 0));
OreDictionary.registerOre("stickIron", new ItemStack(itemMaterial, 1, 1));
OreDictionary.registerOre("stickSteel", new ItemStack(itemMaterial, 1, 2));
OreDictionary.registerOre("stickAluminum", new ItemStack(itemMaterial, 1, 3));
OreDictionary.registerOre("fiberHemp", new ItemStack(itemMaterial, 1, 4));
OreDictionary.registerOre("fabricHemp", new ItemStack(itemMaterial, 1, 5));
OreDictionary.registerOre("fuelCoke", new ItemStack(itemMaterial, 1, 6));
OreDictionary.registerOre("itemSlag", new ItemStack(itemMaterial, 1, 7));
OreDictionary.registerOre("dustCoke", new ItemStack(itemMaterial, 1, 17));
OreDictionary.registerOre("dustHOPGraphite", new ItemStack(itemMaterial, 1, 18));
OreDictionary.registerOre("ingotHOPGraphite", new ItemStack(itemMaterial, 1, 19));
OreDictionary.registerOre("wireCopper", new ItemStack(itemMaterial, 1, 20));
OreDictionary.registerOre("wireElectrum", new ItemStack(itemMaterial, 1, 21));
OreDictionary.registerOre("wireAluminum", new ItemStack(itemMaterial, 1, 22));
OreDictionary.registerOre("wireSteel", new ItemStack(itemMaterial, 1, 23));
OreDictionary.registerOre("plankTreatedWood", new ItemStack(blockTreatedWood, 1, OreDictionary.WILDCARD_VALUE));
OreDictionary.registerOre("slabTreatedWood", new ItemStack(blockTreatedWoodSlabs, 1, OreDictionary.WILDCARD_VALUE));
OreDictionary.registerOre("fenceTreatedWood", new ItemStack(blockWoodenDecoration, 1, BlockTypes_WoodenDecoration.FENCE.getMeta()));
OreDictionary.registerOre("scaffoldingTreatedWood", new ItemStack(blockWoodenDecoration, 1, BlockTypes_WoodenDecoration.SCAFFOLDING.getMeta()));
OreDictionary.registerOre("blockFuelCoke", new ItemStack(blockStoneDecoration, 1, BlockTypes_StoneDecoration.COKE.getMeta()));
OreDictionary.registerOre("concrete", new ItemStack(blockStoneDecoration, 1, BlockTypes_StoneDecoration.CONCRETE.getMeta()));
OreDictionary.registerOre("concrete", new ItemStack(blockStoneDecoration, 1, BlockTypes_StoneDecoration.CONCRETE_TILE.getMeta()));
OreDictionary.registerOre("fenceSteel", new ItemStack(blockMetalDecoration1, 1, BlockTypes_MetalDecoration1.STEEL_FENCE.getMeta()));
OreDictionary.registerOre("fenceAluminum", new ItemStack(blockMetalDecoration1, 1, BlockTypes_MetalDecoration1.ALUMINUM_FENCE.getMeta()));
OreDictionary.registerOre("scaffoldingSteel", new ItemStack(blockMetalDecoration1, 1, BlockTypes_MetalDecoration1.STEEL_SCAFFOLDING_0.getMeta()));
OreDictionary.registerOre("scaffoldingSteel", new ItemStack(blockMetalDecoration1, 1, BlockTypes_MetalDecoration1.STEEL_SCAFFOLDING_1.getMeta()));
OreDictionary.registerOre("scaffoldingSteel", new ItemStack(blockMetalDecoration1, 1, BlockTypes_MetalDecoration1.STEEL_SCAFFOLDING_2.getMeta()));
OreDictionary.registerOre("scaffoldingAluminum", new ItemStack(blockMetalDecoration1, 1, BlockTypes_MetalDecoration1.ALUMINUM_SCAFFOLDING_0.getMeta()));
OreDictionary.registerOre("scaffoldingAluminum", new ItemStack(blockMetalDecoration1, 1, BlockTypes_MetalDecoration1.ALUMINUM_SCAFFOLDING_1.getMeta()));
OreDictionary.registerOre("scaffoldingAluminum", new ItemStack(blockMetalDecoration1, 1, BlockTypes_MetalDecoration1.ALUMINUM_SCAFFOLDING_2.getMeta()));
//Vanilla OreDict
OreDictionary.registerOre("bricksStone", new ItemStack(Blocks.STONEBRICK));
OreDictionary.registerOre("blockIce", new ItemStack(Blocks.ICE));
// OreDictionary.registerOre("blockFrostedIce", new ItemStack(Blocks.FROSTED_ICE));
OreDictionary.registerOre("blockPackedIce", new ItemStack(Blocks.PACKED_ICE));
OreDictionary.registerOre("craftingTableWood", new ItemStack(Blocks.CRAFTING_TABLE));
OreDictionary.registerOre("rodBlaze", new ItemStack(Items.BLAZE_ROD));
OreDictionary.registerOre("charcoal", new ItemStack(Items.COAL, 1, 1));
//Fluid Containers
// FluidContainerRegistry.registerFluidContainer(fluidCreosote, new ItemStack(itemFluidContainers,1,0), new ItemStack(Items.GLASS_BOTTLE));
// FluidContainerRegistry.registerFluidContainer(fluidCreosote, new ItemStack(itemFluidContainers,1,1), new ItemStack(Items.BUCKET));
// FluidContainerRegistry.registerFluidContainer(fluidPlantoil, new ItemStack(itemFluidContainers,1,2), new ItemStack(Items.GLASS_BOTTLE));
// FluidContainerRegistry.registerFluidContainer(fluidPlantoil, new ItemStack(itemFluidContainers,1,3), new ItemStack(Items.BUCKET));
// FluidContainerRegistry.registerFluidContainer(fluidEthanol, new ItemStack(itemFluidContainers,1,4), new ItemStack(Items.GLASS_BOTTLE));
// FluidContainerRegistry.registerFluidContainer(fluidEthanol, new ItemStack(itemFluidContainers,1,5), new ItemStack(Items.BUCKET));
// FluidContainerRegistry.registerFluidContainer(fluidBiodiesel, new ItemStack(itemFluidContainers,1,6), new ItemStack(Items.GLASS_BOTTLE));
// FluidContainerRegistry.registerFluidContainer(fluidBiodiesel, new ItemStack(itemFluidContainers,1,7), new ItemStack(Items.BUCKET));
// //Mining
blockOre.setHarvestLevel("pickaxe", 1, blockOre.getStateFromMeta(BlockTypes_Ore.COPPER.getMeta()));
blockOre.setHarvestLevel("pickaxe", 1, blockOre.getStateFromMeta(BlockTypes_Ore.ALUMINUM.getMeta()));
blockOre.setHarvestLevel("pickaxe", 2, blockOre.getStateFromMeta(BlockTypes_Ore.LEAD.getMeta()));
blockOre.setHarvestLevel("pickaxe", 2, blockOre.getStateFromMeta(BlockTypes_Ore.SILVER.getMeta()));
blockOre.setHarvestLevel("pickaxe", 2, blockOre.getStateFromMeta(BlockTypes_Ore.NICKEL.getMeta()));
blockOre.setHarvestLevel("pickaxe", 2, blockOre.getStateFromMeta(BlockTypes_Ore.URANIUM.getMeta()));
blockStorage.setHarvestLevel("pickaxe", 1, blockStorage.getStateFromMeta(BlockTypes_MetalsIE.COPPER.getMeta()));
blockStorage.setHarvestLevel("pickaxe", 1, blockStorage.getStateFromMeta(BlockTypes_MetalsIE.ALUMINUM.getMeta()));
blockStorage.setHarvestLevel("pickaxe", 2, blockStorage.getStateFromMeta(BlockTypes_MetalsIE.LEAD.getMeta()));
blockStorage.setHarvestLevel("pickaxe", 2, blockStorage.getStateFromMeta(BlockTypes_MetalsIE.SILVER.getMeta()));
blockStorage.setHarvestLevel("pickaxe", 2, blockStorage.getStateFromMeta(BlockTypes_MetalsIE.NICKEL.getMeta()));
blockStorage.setHarvestLevel("pickaxe", 2, blockStorage.getStateFromMeta(BlockTypes_MetalsIE.URANIUM.getMeta()));
blockStorage.setHarvestLevel("pickaxe", 2, blockStorage.getStateFromMeta(BlockTypes_MetalsIE.CONSTANTAN.getMeta()));
blockStorage.setHarvestLevel("pickaxe", 2, blockStorage.getStateFromMeta(BlockTypes_MetalsIE.ELECTRUM.getMeta()));
blockStorage.setHarvestLevel("pickaxe", 2, blockStorage.getStateFromMeta(BlockTypes_MetalsIE.STEEL.getMeta()));
addConfiguredWorldgen(blockOre.getStateFromMeta(0), "copper", IEConfig.Ores.ore_copper);
addConfiguredWorldgen(blockOre.getStateFromMeta(1), "bauxite", IEConfig.Ores.ore_bauxite);
addConfiguredWorldgen(blockOre.getStateFromMeta(2), "lead", IEConfig.Ores.ore_lead);
addConfiguredWorldgen(blockOre.getStateFromMeta(3), "silver", IEConfig.Ores.ore_silver);
addConfiguredWorldgen(blockOre.getStateFromMeta(4), "nickel", IEConfig.Ores.ore_nickel);
addConfiguredWorldgen(blockOre.getStateFromMeta(5), "uranium", IEConfig.Ores.ore_uranium);
DataSerializers.registerSerializer(IEFluid.OPTIONAL_FLUID_STACK);
}
use of net.minecraft.creativetab.CreativeTabs in project PneumaticCraft by MineMaarten.
the class Fluids method initializeFluidBlocksAndBuckets.
private static void initializeFluidBlocksAndBuckets() {
for (final Fluid fluid : fluids) {
//FluidRegistry.registerFluid(fluid); (The constructor of FluidPneumaticCrafts registers the fluid.
Block fluidBlock = fluid.getBlock();
Blockss.registerBlock(fluidBlock);
fluidToBlockMap.put(fluid.getName(), fluidBlock);
Item fluidBucket = new ItemBucket(fluidBlock) {
@Override
public void addInformation(ItemStack p_77624_1_, net.minecraft.entity.player.EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {
super.addInformation(p_77624_1_, p_77624_2_, p_77624_3_, p_77624_4_);
ItemPneumatic.addTooltip(p_77624_1_, p_77624_2_, p_77624_3_);
}
;
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs creativeTab, List items) {
if (FluidRegistry.isFluidDefault(fluid))
super.getSubItems(item, creativeTab, items);
}
}.setContainerItem(Items.bucket).setCreativeTab(PneumaticCraft.tabPneumaticCraft).setTextureName(Textures.ICON_LOCATION + fluid.getName() + "Bucket").setUnlocalizedName(fluid.getName() + "Bucket");
Itemss.registerItem(fluidBucket);
fluidBlockToBucketMap.put(fluidBlock, fluidBucket);
FluidContainerRegistry.registerFluidContainer(new FluidStack(fluid, 1000), new ItemStack(fluidBucket), new ItemStack(Items.bucket));
}
}
use of net.minecraft.creativetab.CreativeTabs in project RecurrentComplex by Ivorforce.
the class RCRegistryHandler method preInit.
public static void preInit(FMLPreInitializationEvent event, RecurrentComplex mod) {
if (!RecurrentComplex.isLite()) {
tabStructureTools = new CreativeTabs("structureTools") {
@Override
public ItemStack getTabIconItem() {
return new ItemStack(RCItems.blockSelector);
}
};
tabInventoryGenerators = new CreativeTabs("inventoryGenerators") {
@Override
public ItemStack getTabIconItem() {
return new ItemStack(RCItems.inventoryGenerationTag);
}
};
}
RCMaterials.materialNegativeSpace = new MaterialNegativeSpace();
RCMaterials.materialGenericSolid = (new Material(MapColor.STONE));
CapabilityManager.INSTANCE.register(RCEntityInfo.class, new NBTCompoundObjectCapabilityStorage<>(RCEntityInfo.class), RCEntityInfo::new);
CapabilityManager.INSTANCE.register(CapabilitySelection.class, new NBTCompoundObjectCapabilityStorage<>(CapabilitySelection.class), CapabilitySelection::new);
blockSelector = new ItemBlockSelectorBlock().setUnlocalizedName("blockSelector");
blockSelector.setCreativeTab(tabStructureTools);
register(blockSelector, "block_selector");
RecurrentComplex.cremapper.registerLegacyIDs(blockSelector, "blockSelector");
blockSelectorFloating = new ItemBlockSelectorFloating().setUnlocalizedName("blockSelectorFloating");
blockSelectorFloating.setCreativeTab(tabStructureTools);
register(blockSelectorFloating, "block_selector_floating");
RecurrentComplex.cremapper.registerLegacyIDs(blockSelectorFloating, "blockSelectorFloating");
inventoryGenerationTag = (ItemInventoryGenMultiTag) new ItemInventoryGenMultiTag().setUnlocalizedName("inventoryGenerationTag");
inventoryGenerationTag.setCreativeTab(tabInventoryGenerators);
register(inventoryGenerationTag, "inventory_generation_tag");
RecurrentComplex.cremapper.registerLegacyIDs(inventoryGenerationTag, "inventoryGenerationTag");
inventoryGenerationSingleTag = (ItemInventoryGenSingleTag) new ItemInventoryGenSingleTag().setUnlocalizedName("inventoryGenerationSingleTag");
inventoryGenerationSingleTag.setCreativeTab(tabInventoryGenerators);
register(inventoryGenerationSingleTag, "inventory_generation_single_tag");
RecurrentComplex.cremapper.registerLegacyIDs(inventoryGenerationSingleTag, "inventoryGenerationSingleTag");
inventoryGenerationComponentTag = (ItemInventoryGenComponentTag) new ItemInventoryGenComponentTag().setUnlocalizedName("inventoryGenerationComponentTag");
inventoryGenerationComponentTag.setCreativeTab(tabInventoryGenerators);
register(inventoryGenerationComponentTag, "inventory_generation_component_tag");
artifactGenerationTag = new ItemArtifactGenerator().setUnlocalizedName("artifactGenerationTag");
artifactGenerationTag.setCreativeTab(tabInventoryGenerators);
register(artifactGenerationTag, "artifact_generation_tag");
RecurrentComplex.cremapper.registerLegacyIDs(artifactGenerationTag, "artifactGenerationTag");
bookGenerationTag = new ItemBookGenerator().setUnlocalizedName("bookGenerationTag");
bookGenerationTag.setCreativeTab(tabInventoryGenerators);
register(bookGenerationTag, "book_generation_tag");
RecurrentComplex.cremapper.registerLegacyIDs(bookGenerationTag, "bookGenerationTag");
genericSpace = (BlockGenericSpace) new BlockGenericSpace().setUnlocalizedName("negativeSpace");
genericSpace.setCreativeTab(tabStructureTools);
register(genericSpace, "generic_space", new ItemBlockGenericSpace(genericSpace));
RecurrentComplex.cremapper.registerLegacyIDs(genericSpace, true, "negativeSpace");
genericSolid = new BlockGenericSolid().setUnlocalizedName("naturalFloor");
genericSolid.setCreativeTab(tabStructureTools);
register(genericSolid, "generic_solid", new ItemBlockGenericSolid(genericSolid));
RecurrentComplex.cremapper.registerLegacyIDs(genericSolid, true, "naturalFloor");
structureGenerator = new BlockStructureGenerator().setUnlocalizedName("structureGenerator");
register(structureGenerator, "structure_generator");
register(BlockStructureGenerator.TileEntityStructureGenerator.class, "RCStructureGenerator", "SGStructureGenerator");
RecurrentComplex.cremapper.registerLegacyIDs(structureGenerator, true, "structureGenerator");
mazeGenerator = new BlockMazeGenerator().setUnlocalizedName("mazeGenerator");
register(mazeGenerator, "maze_generator");
register(BlockMazeGenerator.TileEntityMazeGenerator.class, "RCMazeGenerator", "SGMazeGenerator");
RecurrentComplex.cremapper.registerLegacyIDs(mazeGenerator, true, "mazeGenerator");
spawnCommands = new BlockSpawnCommand().setUnlocalizedName("spawn_command");
register(spawnCommands, "weighted_command_block");
register(BlockSpawnCommand.TileEntitySpawnCommand.class, "RCSpawnCommand");
RecurrentComplex.cremapper.registerLegacyIDs(spawnCommands, true, "spawnCommand");
spawnScript = new BlockScript().setUnlocalizedName("spawn_script");
spawnScript.setCreativeTab(tabStructureTools);
register(spawnScript, "spawn_script");
register(TileEntityBlockScript.class, "RCSpawnScript");
inspector = new ItemInspector().setUnlocalizedName("recinspector");
inspector.setCreativeTab(tabStructureTools);
register(inspector, "inspector");
// Set preset defaults
GenericPlacerPresets.instance().getRegistry().register("clear", MOD_ID, PresetRegistry.fullPreset("clear", new GenericPlacer(), new PresetRegistry.Metadata("Clear", "Do not place anywhere")), true, LeveledRegistry.Level.INTERNAL);
GenericPlacerPresets.instance().setDefault("clear");
DimensionMatcherPresets.instance().getRegistry().register("clear", MOD_ID, PresetRegistry.fullPreset("clear", new ArrayList<>(), new PresetRegistry.Metadata("None", "No dimensions")), true, LeveledRegistry.Level.INTERNAL);
DimensionMatcherPresets.instance().setDefault("clear");
BiomeMatcherPresets.instance().getRegistry().register("clear", MOD_ID, PresetRegistry.fullPreset("clear", new ArrayList<>(), new PresetRegistry.Metadata("None", "No biomes")), true, LeveledRegistry.Level.INTERNAL);
BiomeMatcherPresets.instance().setDefault("clear");
WeightedBlockStatePresets.instance().getRegistry().register("clear", MOD_ID, PresetRegistry.fullPreset("clear", new ArrayList<>(), new PresetRegistry.Metadata("None", "No blocks")), true, LeveledRegistry.Level.INTERNAL);
WeightedBlockStatePresets.instance().setDefault("clear");
TransfomerPresets.instance().getRegistry().register("clear", MOD_ID, PresetRegistry.fullPreset("clear", new TransformerMulti.Data(), new PresetRegistry.Metadata("None", "No transformers")), true, LeveledRegistry.Level.INTERNAL);
TransfomerPresets.instance().setDefault("clear");
GenerationSanityChecker.init();
}
use of net.minecraft.creativetab.CreativeTabs in project Engine by VoltzEngine-Project.
the class ModCreativeTab method displayAllReleventItems.
@Override
public void displayAllReleventItems(List list) {
for (Object anItemRegistry : Item.itemRegistry) {
Item item = (Item) anItemRegistry;
if (item != null) {
for (CreativeTabs tab : item.getCreativeTabs()) {
if (tab == this) {
List temp_list = new ArrayList();
item.getSubItems(item, this, temp_list);
for (Object o : temp_list) {
if (o instanceof ItemStack) {
if (((ItemStack) o).getItem() != null) {
list.add(o);
} else {
Engine.instance.logger().error("Item: " + item + " attempted to add a stack with a null item to creative tab " + this);
}
} else {
Engine.instance.logger().error("Item: " + item + " attempted to add a non ItemStack to creative tab " + this);
}
}
}
}
}
}
if (this.func_111225_m() != null) {
this.addEnchantmentBooksToList(list, this.func_111225_m());
}
if (itemSorter != null && !list.isEmpty()) {
Collections.sort(list, itemSorter);
}
}
Aggregations