Search in sources :

Example 1 with IDesignMaterial

use of binnie.design.api.IDesignMaterial in project Binnie by ForestryMC.

the class WindowArboristDatabase method addTabs.

@Override
@SideOnly(Side.CLIENT)
protected void addTabs() {
    new PageSpeciesOverview(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "species.overview"));
    new PageSpeciesTreeGenome(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "species.genome"));
    new PageSpeciesClassification(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "species.classification"));
    new PageSpeciesResultant(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "species.resultant"));
    new PageSpeciesMutations(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "species.further"));
    new PageBranchOverview(this.getInfoPages(Mode.BRANCHES), new DatabaseTab(ExtraTrees.instance, "branches.overview"));
    new PageBranchSpecies(this.getInfoPages(Mode.BRANCHES), new DatabaseTab(ExtraTrees.instance, "branches.species"));
    new PageBreeder(this.getInfoPages(Mode.BREEDER), this.getUsername(), new DatabaseTab(ExtraTrees.instance, "breeder"));
    this.createMode(TreeMode.FRUIT, new ModeWidgets(TreeMode.FRUIT, this, (area, modePage) -> {
        ControlListBox<ItemStack> controlListBox = new ModeControlListBox(modePage, area);
        ITreeBreedingSystem breedingSystem = this.getBreedingSystem();
        controlListBox.setOptions(breedingSystem.getAllFruits());
        return controlListBox;
    }));
    this.createMode(TreeMode.WOOD, new ModeWidgets(TreeMode.WOOD, this, (area, modePage) -> {
        ControlListBox<ItemStack> controlListBox = new ModeControlListBox(modePage, area);
        ITreeBreedingSystem breedingSystem = this.getBreedingSystem();
        controlListBox.setOptions(breedingSystem.getAllWoods());
        return controlListBox;
    }));
    this.createMode(TreeMode.PLANKS, new ModeWidgets(TreeMode.PLANKS, this, (area, modePage) -> {
        ControlListBox<ItemStack> controlListBox = new ModeControlListBox(modePage, area);
        List<ItemStack> planks = WoodManager.getAllPlankTypes().stream().map(IDesignMaterial::getStack).collect(Collectors.toList());
        controlListBox.setOptions(planks);
        return controlListBox;
    }));
    new PageFruit(this.getInfoPages(TreeMode.FRUIT), new DatabaseTab(ExtraTrees.instance, "fruit.natural"), true);
    new PageFruit(this.getInfoPages(TreeMode.FRUIT), new DatabaseTab(ExtraTrees.instance, "fruit.potential"), false);
    new PageWood(this.getInfoPages(TreeMode.WOOD), new DatabaseTab(ExtraTrees.instance, "wood.natural"));
    new PagePlanksOverview(this.getInfoPages(TreeMode.PLANKS), new DatabaseTab(ExtraTrees.instance, "planks.overview"));
    new PagePlanksTrees(this.getInfoPages(TreeMode.PLANKS), new DatabaseTab(ExtraTrees.instance, "planks.natural"));
}
Also used : Binnie(binnie.core.Binnie) ITreeBreedingSystem(binnie.genetics.api.ITreeBreedingSystem) IDatabaseMode(binnie.core.gui.database.IDatabaseMode) ControlListBox(binnie.core.gui.controls.listbox.ControlListBox) ItemStack(net.minecraft.item.ItemStack) ExtraTrees(binnie.extratrees.ExtraTrees) Side(net.minecraftforge.fml.relauncher.Side) PageSpeciesOverview(binnie.core.gui.database.PageSpeciesOverview) WoodManager(binnie.extratrees.wood.WoodManager) PageSpeciesClassification(binnie.core.gui.database.PageSpeciesClassification) IWidget(binnie.core.api.gui.IWidget) ControlItemStackOption(binnie.core.gui.database.ControlItemStackOption) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) ModeWidgets(binnie.core.gui.database.ModeWidgets) IArea(binnie.core.api.gui.IArea) PageBranchSpecies(binnie.core.gui.database.PageBranchSpecies) DatabaseTab(binnie.core.gui.database.DatabaseTab) TreeManager(forestry.api.arboriculture.TreeManager) PageSpeciesResultant(binnie.core.gui.database.PageSpeciesResultant) Collectors(java.util.stream.Collectors) I18N(binnie.core.util.I18N) List(java.util.List) EntityPlayer(net.minecraft.entity.player.EntityPlayer) PageBranchOverview(binnie.core.gui.database.PageBranchOverview) PageBreeder(binnie.core.gui.database.PageBreeder) WindowAbstractDatabase(binnie.core.gui.database.WindowAbstractDatabase) ControlPage(binnie.core.gui.controls.page.ControlPage) IDesignMaterial(binnie.design.api.IDesignMaterial) PageSpeciesMutations(binnie.core.gui.database.PageSpeciesMutations) Window(binnie.core.gui.minecraft.Window) PageBranchSpecies(binnie.core.gui.database.PageBranchSpecies) IDesignMaterial(binnie.design.api.IDesignMaterial) DatabaseTab(binnie.core.gui.database.DatabaseTab) ITreeBreedingSystem(binnie.genetics.api.ITreeBreedingSystem) ControlListBox(binnie.core.gui.controls.listbox.ControlListBox) PageSpeciesMutations(binnie.core.gui.database.PageSpeciesMutations) PageSpeciesOverview(binnie.core.gui.database.PageSpeciesOverview) PageSpeciesClassification(binnie.core.gui.database.PageSpeciesClassification) List(java.util.List) PageSpeciesResultant(binnie.core.gui.database.PageSpeciesResultant) ModeWidgets(binnie.core.gui.database.ModeWidgets) PageBranchOverview(binnie.core.gui.database.PageBranchOverview) PageBreeder(binnie.core.gui.database.PageBreeder) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 2 with IDesignMaterial

use of binnie.design.api.IDesignMaterial in project Binnie by ForestryMC.

the class DesignHelper method getDesignBlock.

public static DesignBlock getDesignBlock(final IDesignSystem system, final int meta) {
    final int plankID1 = meta & 0xFF;
    final int plankID2 = meta >> 8 & 0xFF;
    final int tile = meta >> 16 & 0x3FF;
    final int rotation = meta >> 26 & 0x3;
    final int axis = meta >> 28 & 0x7;
    final IDesignMaterial type1 = system.getMaterial(plankID1);
    final IDesignMaterial type2 = system.getMaterial(plankID2);
    final IDesign type3 = Design.getDesignManager().getDesign(tile);
    return new DesignBlock(system, type1, type2, type3, rotation, EnumFacing.VALUES[axis]);
}
Also used : DesignBlock(binnie.design.blocks.DesignBlock) IDesign(binnie.design.api.IDesign) IDesignMaterial(binnie.design.api.IDesignMaterial)

Example 3 with IDesignMaterial

use of binnie.design.api.IDesignMaterial in project Binnie by ForestryMC.

the class ComponentDesignerRecipe method getProduct.

@Override
public ItemStack getProduct() {
    final ItemStack plank1 = this.getUtil().getStack(DesignerSlots.DESIGN_SLOT_1);
    final ItemStack plank2 = this.getUtil().getStack(DesignerSlots.DESIGN_SLOT_2);
    if (plank1.isEmpty() || plank2.isEmpty()) {
        return ItemStack.EMPTY;
    }
    final IDesignMaterial type1 = this.type.getSystem().getMaterial(plank1);
    final IDesignMaterial type2 = this.type.getSystem().getMaterial(plank2);
    final IDesign design = this.getDesign();
    return this.type.getBlock(type1, type2, design);
}
Also used : IDesign(binnie.design.api.IDesign) IDesignMaterial(binnie.design.api.IDesignMaterial) ItemStack(net.minecraft.item.ItemStack)

Aggregations

IDesignMaterial (binnie.design.api.IDesignMaterial)3 IDesign (binnie.design.api.IDesign)2 ItemStack (net.minecraft.item.ItemStack)2 Binnie (binnie.core.Binnie)1 IArea (binnie.core.api.gui.IArea)1 IWidget (binnie.core.api.gui.IWidget)1 ControlListBox (binnie.core.gui.controls.listbox.ControlListBox)1 ControlPage (binnie.core.gui.controls.page.ControlPage)1 ControlItemStackOption (binnie.core.gui.database.ControlItemStackOption)1 DatabaseTab (binnie.core.gui.database.DatabaseTab)1 IDatabaseMode (binnie.core.gui.database.IDatabaseMode)1 ModeWidgets (binnie.core.gui.database.ModeWidgets)1 PageBranchOverview (binnie.core.gui.database.PageBranchOverview)1 PageBranchSpecies (binnie.core.gui.database.PageBranchSpecies)1 PageBreeder (binnie.core.gui.database.PageBreeder)1 PageSpeciesClassification (binnie.core.gui.database.PageSpeciesClassification)1 PageSpeciesMutations (binnie.core.gui.database.PageSpeciesMutations)1 PageSpeciesOverview (binnie.core.gui.database.PageSpeciesOverview)1 PageSpeciesResultant (binnie.core.gui.database.PageSpeciesResultant)1 WindowAbstractDatabase (binnie.core.gui.database.WindowAbstractDatabase)1