Search in sources :

Example 1 with BlockIECrop

use of blusunrize.immersiveengineering.common.blocks.plant.BlockIECrop 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);
}
Also used : Item(net.minecraft.item.Item) BlockIECrop(blusunrize.immersiveengineering.common.blocks.plant.BlockIECrop) List(java.util.List) ArrayList(java.util.ArrayList) LootTableList(net.minecraft.world.storage.loot.LootTableList) Fluid(net.minecraftforge.fluids.Fluid) CreativeTabs(net.minecraft.creativetab.CreativeTabs) FluidPotion(blusunrize.immersiveengineering.common.util.IEFluid.FluidPotion) ComparableItemStack(blusunrize.immersiveengineering.api.ComparableItemStack) ItemStack(net.minecraft.item.ItemStack) BlockClothDevice(blusunrize.immersiveengineering.common.blocks.cloth.BlockClothDevice) ResourceLocation(net.minecraft.util.ResourceLocation)

Example 2 with BlockIECrop

use of blusunrize.immersiveengineering.common.blocks.plant.BlockIECrop in project ImmersiveEngineering by BluSunrize.

the class IEWailaDataProvider method getWailaBody.

@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
    Block b = accessor.getBlock();
    TileEntity tile = accessor.getTileEntity();
    if (b instanceof BlockIECrop) {
        int meta = accessor.getMetadata();
        int min = ((BlockIECrop) b).getMinMeta(meta);
        int max = ((BlockIECrop) b).getMaxMeta(meta);
        if (min == max)
            currenttip.add(String.format("%s : %s", I18n.format("hud.msg.growth"), I18n.format("hud.msg.mature")));
        else {
            float growth = ((meta - min) / (float) (max - min)) * 100f;
            if (growth < 100.0)
                currenttip.add(String.format("%s : %.0f %%", I18n.format("hud.msg.growth"), growth));
            else
                currenttip.add(String.format("%s : %s", I18n.format("hud.msg.growth"), I18n.format("hud.msg.mature")));
        }
        return currenttip;
    } else if (tile instanceof TileEntityWoodenBarrel) {
        NBTTagCompound tank = accessor.getNBTData().getCompoundTag("tank");
        if (!tank.hasKey("Empty") && !tank.hasNoTags()) {
            FluidStack fluid = FluidStack.loadFluidStackFromNBT(tank);
            currenttip.add(String.format("%s: %d / %d mB", fluid.getLocalizedName(), Integer.valueOf(fluid.amount), 12000));
        } else
            currenttip.add(I18n.format("hud.msg.empty"));
    }
    if (accessor.getNBTData().hasKey("Energy")) {
        int cur = accessor.getNBTInteger(accessor.getNBTData(), "Energy");
        int max = accessor.getNBTInteger(accessor.getNBTData(), "MaxStorage");
        if (max > 0 && ((ITaggedList) currenttip).getEntries("IFEnergyStorage").size() == 0)
            ((ITaggedList) currenttip).add(String.format("%d / %d IF", new Object[] { cur, max }), "IFEnergyStorage");
        if (tile instanceof TileEntityTeslaCoil) {
            boolean rsInv = accessor.getNBTData().getBoolean("redstoneInverted");
            boolean lowPower = accessor.getNBTData().getBoolean("lowPower");
            currenttip.add(I18n.format(Lib.CHAT_INFO + "rsControl." + (rsInv ? "invertedOn" : "invertedOff")));
            currenttip.add(I18n.format(Lib.CHAT_INFO + "tesla." + (lowPower ? "lowPower" : "highPower")));
        }
    }
    return currenttip;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TileEntityWoodenBarrel(blusunrize.immersiveengineering.common.blocks.wooden.TileEntityWoodenBarrel) BlockIECrop(blusunrize.immersiveengineering.common.blocks.plant.BlockIECrop) TileEntityTeslaCoil(blusunrize.immersiveengineering.common.blocks.metal.TileEntityTeslaCoil) FluidStack(net.minecraftforge.fluids.FluidStack) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) Block(net.minecraft.block.Block)

Aggregations

BlockIECrop (blusunrize.immersiveengineering.common.blocks.plant.BlockIECrop)2 ComparableItemStack (blusunrize.immersiveengineering.api.ComparableItemStack)1 BlockClothDevice (blusunrize.immersiveengineering.common.blocks.cloth.BlockClothDevice)1 TileEntityTeslaCoil (blusunrize.immersiveengineering.common.blocks.metal.TileEntityTeslaCoil)1 TileEntityWoodenBarrel (blusunrize.immersiveengineering.common.blocks.wooden.TileEntityWoodenBarrel)1 FluidPotion (blusunrize.immersiveengineering.common.util.IEFluid.FluidPotion)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Block (net.minecraft.block.Block)1 CreativeTabs (net.minecraft.creativetab.CreativeTabs)1 Item (net.minecraft.item.Item)1 ItemStack (net.minecraft.item.ItemStack)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 TileEntity (net.minecraft.tileentity.TileEntity)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 LootTableList (net.minecraft.world.storage.loot.LootTableList)1 Fluid (net.minecraftforge.fluids.Fluid)1 FluidStack (net.minecraftforge.fluids.FluidStack)1