Search in sources :

Example 1 with EnumFarmBlockTexture

use of forestry.farming.models.EnumFarmBlockTexture in project ForestryMC by ForestryMC.

the class TileFarm method decodeDescriptionPacket.

@Override
protected void decodeDescriptionPacket(NBTTagCompound packetData) {
    super.decodeDescriptionPacket(packetData);
    EnumFarmBlockTexture farmBlockTexture = EnumFarmBlockTexture.getFromCompound(packetData);
    setFarmBlockTexture(farmBlockTexture);
}
Also used : EnumFarmBlockTexture(forestry.farming.models.EnumFarmBlockTexture)

Example 2 with EnumFarmBlockTexture

use of forestry.farming.models.EnumFarmBlockTexture in project ForestryMC by ForestryMC.

the class ModuleFarming method registerRecipes.

@Override
public void registerRecipes() {
    ItemRegistryCore coreItems = ModuleCore.getItems();
    BlockRegistryFarming blocks = getBlocks();
    ItemStack basic = blocks.farm.get(EnumFarmBlockType.PLAIN, 1);
    ItemStack gearbox = blocks.farm.get(EnumFarmBlockType.GEARBOX, 1);
    ItemStack hatch = blocks.farm.get(EnumFarmBlockType.HATCH, 1);
    ItemStack valve = blocks.farm.get(EnumFarmBlockType.VALVE, 1);
    ItemStack control = blocks.farm.get(EnumFarmBlockType.CONTROL, 1);
    for (EnumFarmBlockTexture block : EnumFarmBlockTexture.values()) {
        NBTTagCompound compound = new NBTTagCompound();
        block.saveToCompound(compound);
        basic.setTagCompound(compound);
        gearbox.setTagCompound(compound);
        hatch.setTagCompound(compound);
        valve.setTagCompound(compound);
        control.setTagCompound(compound);
        RecipeUtil.addRecipe("farm_basic_" + block.getUid(), basic, "I#I", "WCW", '#', block.getBase(), 'W', "slabWood", 'C', coreItems.tubes.get(EnumElectronTube.TIN, 1), 'I', "ingotCopper");
        RecipeUtil.addRecipe("farm_gearbox_" + block.getUid(), gearbox, " # ", "TTT", '#', basic, 'T', "gearTin");
        RecipeUtil.addRecipe("farm_hatch_" + block.getUid(), hatch, " # ", "TDT", '#', basic, 'T', "gearTin", 'D', OreDictUtil.TRAPDOOR_WOOD);
        RecipeUtil.addRecipe("farm_valve_" + block.getUid(), valve, " # ", "XTX", '#', basic, 'T', "gearTin", 'X', "blockGlass");
        RecipeUtil.addRecipe("farm_control_" + block.getUid(), control, " # ", "XTX", '#', basic, 'T', coreItems.tubes.get(EnumElectronTube.GOLD, 1), 'X', "dustRedstone");
    }
    // Circuits
    ICircuitLayout layoutManaged = ChipsetManager.circuitRegistry.getLayout("forestry.farms.managed");
    ICircuitLayout layoutManual = ChipsetManager.circuitRegistry.getLayout("forestry.farms.manual");
    ChipsetManager.circuitRegistry.registerDeprecatedCircuitReplacement("managedCereal", Circuits.farmCropsManaged);
    ChipsetManager.circuitRegistry.registerDeprecatedCircuitReplacement("manualCereal", Circuits.farmCropsManual);
    ChipsetManager.circuitRegistry.registerDeprecatedCircuitReplacement("managedVegetable", Circuits.farmCropsManaged);
    ChipsetManager.circuitRegistry.registerDeprecatedCircuitReplacement("manualVegetable", Circuits.farmCropsManual);
    if (layoutManaged == null || layoutManual == null) {
        return;
    }
    ChipsetManager.solderManager.addRecipe(layoutManaged, coreItems.tubes.get(EnumElectronTube.GOLD, 1), Circuits.farmArborealManaged);
    ChipsetManager.solderManager.addRecipe(layoutManaged, coreItems.tubes.get(EnumElectronTube.COPPER, 1), Circuits.farmSucculentManaged);
    ChipsetManager.solderManager.addRecipe(layoutManaged, coreItems.tubes.get(EnumElectronTube.OBSIDIAN, 1), Circuits.farmPeatManaged);
    ChipsetManager.solderManager.addRecipe(layoutManaged, coreItems.tubes.get(EnumElectronTube.BRONZE, 1), Circuits.farmCropsManaged);
    ChipsetManager.solderManager.addRecipe(layoutManaged, coreItems.tubes.get(EnumElectronTube.BLAZE, 1), Circuits.farmInfernalManaged);
    ChipsetManager.solderManager.addRecipe(layoutManaged, coreItems.tubes.get(EnumElectronTube.TIN, 1), Circuits.farmPoalesManual);
    ChipsetManager.solderManager.addRecipe(layoutManaged, coreItems.tubes.get(EnumElectronTube.LAPIS, 1), Circuits.farmGourdManaged);
    ChipsetManager.solderManager.addRecipe(layoutManaged, coreItems.tubes.get(EnumElectronTube.APATITE, 1), Circuits.farmShroomManaged);
    ChipsetManager.solderManager.addRecipe(layoutManaged, coreItems.tubes.get(EnumElectronTube.DIAMOND, 1), Circuits.farmCocoaManaged);
    ChipsetManager.solderManager.addRecipe(layoutManaged, coreItems.tubes.get(EnumElectronTube.EMERALD, 1), Circuits.farmOrchardManaged);
    ChipsetManager.solderManager.addRecipe(layoutManaged, coreItems.tubes.get(EnumElectronTube.ENDER, 1), Circuits.farmEnderManaged);
    ChipsetManager.solderManager.addRecipe(layoutManual, coreItems.tubes.get(EnumElectronTube.GOLD, 1), Circuits.farmArborealManual);
    ChipsetManager.solderManager.addRecipe(layoutManual, coreItems.tubes.get(EnumElectronTube.COPPER, 1), Circuits.farmSucculentManual);
    ChipsetManager.solderManager.addRecipe(layoutManual, coreItems.tubes.get(EnumElectronTube.OBSIDIAN, 1), Circuits.farmPeatManual);
    ChipsetManager.solderManager.addRecipe(layoutManual, coreItems.tubes.get(EnumElectronTube.BRONZE, 1), Circuits.farmCropsManual);
    ChipsetManager.solderManager.addRecipe(layoutManual, coreItems.tubes.get(EnumElectronTube.TIN, 1), Circuits.farmPoalesManual);
    ChipsetManager.solderManager.addRecipe(layoutManual, coreItems.tubes.get(EnumElectronTube.LAPIS, 1), Circuits.farmGourdManual);
    ChipsetManager.solderManager.addRecipe(layoutManual, coreItems.tubes.get(EnumElectronTube.APATITE, 1), Circuits.farmShroomManual);
    ChipsetManager.solderManager.addRecipe(layoutManual, coreItems.tubes.get(EnumElectronTube.DIAMOND, 1), Circuits.farmCocoaManual);
    ChipsetManager.solderManager.addRecipe(layoutManual, coreItems.tubes.get(EnumElectronTube.EMERALD, 1), Circuits.farmOrchardManual);
    ChipsetManager.solderManager.addRecipe(layoutManual, coreItems.tubes.get(EnumElectronTube.ENDER, 1), Circuits.farmEnderManual);
}
Also used : BlockRegistryFarming(forestry.farming.blocks.BlockRegistryFarming) ICircuitLayout(forestry.api.circuits.ICircuitLayout) ItemRegistryCore(forestry.core.items.ItemRegistryCore) EnumFarmBlockTexture(forestry.farming.models.EnumFarmBlockTexture) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) ItemStack(net.minecraft.item.ItemStack)

Example 3 with EnumFarmBlockTexture

use of forestry.farming.models.EnumFarmBlockTexture in project ForestryMC by ForestryMC.

the class BlockFarm method getSubBlocks.

@Override
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
    for (int i = 0; i < 6; i++) {
        if (i == 1) {
            continue;
        }
        for (EnumFarmBlockTexture block : EnumFarmBlockTexture.values()) {
            ItemStack stack = new ItemStack(this, 1, i);
            NBTTagCompound compound = new NBTTagCompound();
            block.saveToCompound(compound);
            stack.setTagCompound(compound);
            list.add(stack);
        }
    }
}
Also used : EnumFarmBlockTexture(forestry.farming.models.EnumFarmBlockTexture) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) ItemStack(net.minecraft.item.ItemStack)

Example 4 with EnumFarmBlockTexture

use of forestry.farming.models.EnumFarmBlockTexture in project ForestryMC by ForestryMC.

the class ItemBlockFarm method addInformation.

@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack stack, @Nullable World world, List<String> tooltip, ITooltipFlag flag) {
    if (GuiScreen.isShiftKeyDown()) {
        tooltip.add(Translator.translateToLocal("tile.for.ffarm.tooltip"));
        if (stack.getTagCompound() == null) {
            return;
        }
        EnumFarmBlockTexture texture = EnumFarmBlockTexture.getFromCompound(stack.getTagCompound());
        tooltip.add(Translator.translateToLocal("tile.for.ffarm.material.tooltip") + texture.getFormatting() + TextFormatting.ITALIC + " " + texture.getName());
    } else {
        ItemTooltipUtil.addShiftInformation(stack, world, tooltip, flag);
    }
}
Also used : EnumFarmBlockTexture(forestry.farming.models.EnumFarmBlockTexture) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 5 with EnumFarmBlockTexture

use of forestry.farming.models.EnumFarmBlockTexture in project ForestryMC by ForestryMC.

the class FarmingJeiPlugin method registerItemSubtypes.

@Override
public void registerItemSubtypes(ISubtypeRegistry subtypeRegistry) {
    if (!ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING))) {
        return;
    }
    BlockRegistryFarming blocks = ModuleFarming.getBlocks();
    Item farmBlock = Item.getItemFromBlock(blocks.farm);
    subtypeRegistry.registerSubtypeInterpreter(farmBlock, itemStack -> {
        NBTTagCompound nbt = itemStack.getTagCompound();
        EnumFarmBlockTexture texture = EnumFarmBlockTexture.getFromCompound(nbt);
        return itemStack.getItemDamage() + "." + texture.getUid();
    });
}
Also used : Item(net.minecraft.item.Item) BlockRegistryFarming(forestry.farming.blocks.BlockRegistryFarming) EnumFarmBlockTexture(forestry.farming.models.EnumFarmBlockTexture) ResourceLocation(net.minecraft.util.ResourceLocation) NBTTagCompound(net.minecraft.nbt.NBTTagCompound)

Aggregations

EnumFarmBlockTexture (forestry.farming.models.EnumFarmBlockTexture)5 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)3 BlockRegistryFarming (forestry.farming.blocks.BlockRegistryFarming)2 ItemStack (net.minecraft.item.ItemStack)2 ICircuitLayout (forestry.api.circuits.ICircuitLayout)1 ItemRegistryCore (forestry.core.items.ItemRegistryCore)1 Item (net.minecraft.item.Item)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1