Search in sources :

Example 1 with CeramicBrickType

use of binnie.botany.ceramic.brick.CeramicBrickType in project Binnie by ForestryMC.

the class BlockCeramicBrick method getSubBlocks.

@Override
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> itemList) {
    for (EnumFlowerColor color : EnumFlowerColor.values()) {
        itemList.add(new CeramicBrickPair(color, color, CeramicBrickType.TILE).getStack(1));
    }
    for (CeramicBrickType type : CeramicBrickType.VALUES) {
        if (type.canDouble()) {
            itemList.add(new CeramicBrickPair(EnumFlowerColor.Brown, EnumFlowerColor.Gold, type).getStack(1));
        }
    }
    itemList.add(new CeramicBrickPair(EnumFlowerColor.Gold, EnumFlowerColor.Gold, CeramicBrickType.SPLIT).getStack(1));
    itemList.add(new CeramicBrickPair(EnumFlowerColor.Brown, EnumFlowerColor.Brown, CeramicBrickType.CHEQUERED).getStack(1));
    itemList.add(new CeramicBrickPair(EnumFlowerColor.Gold, EnumFlowerColor.Brown, CeramicBrickType.LARGE_BRICK).getStack(1));
}
Also used : EnumFlowerColor(binnie.botany.api.genetics.EnumFlowerColor) CeramicBrickPair(binnie.botany.ceramic.brick.CeramicBrickPair) CeramicBrickType(binnie.botany.ceramic.brick.CeramicBrickType)

Example 2 with CeramicBrickType

use of binnie.botany.ceramic.brick.CeramicBrickType in project Binnie by ForestryMC.

the class CeramicTileRecipe method getCraftingResult.

@Override
public ItemStack getCraftingResult(InventoryCrafting inv) {
    Item ceramicBlock = Item.getItemFromBlock(ModuleCeramic.ceramic);
    Item ceramicTile = Item.getItemFromBlock(ModuleCeramic.ceramicTile);
    Item ceramicBrick = Item.getItemFromBlock(ModuleCeramic.ceramicBrick);
    Item mortar = ModuleCeramic.misc;
    List<ItemStack> stacks = new ArrayList<>();
    int ix = -1;
    int iy = -1;
    for (int i = 0; i < inv.getSizeInventory(); ++i) {
        ItemStack stack = inv.getStackInSlot(i);
        if (!stack.isEmpty()) {
            int x = i / 3;
            int y = i % 3;
            if (ix == -1) {
                ix = x;
                iy = y;
            }
            if (x - ix >= 2 || y - iy >= 2 || y < iy || x < ix) {
                return ItemStack.EMPTY;
            }
            if (stack.getItem() != ceramicBlock && stack.getItem() != ceramicTile && stack.getItem() != ceramicBrick && stack.getItem() != mortar) {
                return ItemStack.EMPTY;
            }
            stacks.add(stack);
        }
    }
    for (CeramicBrickType type : CeramicBrickType.VALUES) {
        ItemStack result = type.getRecipe(stacks);
        if (!result.isEmpty()) {
            return result;
        }
    }
    return ItemStack.EMPTY;
}
Also used : Item(net.minecraft.item.Item) CeramicBrickType(binnie.botany.ceramic.brick.CeramicBrickType) ArrayList(java.util.ArrayList) ItemStack(net.minecraft.item.ItemStack)

Example 3 with CeramicBrickType

use of binnie.botany.ceramic.brick.CeramicBrickType in project Binnie by ForestryMC.

the class BlockCeramicBrick method registerSprites.

@Override
@SideOnly(Side.CLIENT)
public void registerSprites(ITextureManager manager) {
    TextureMap textureMap = Minecraft.getMinecraft().getTextureMapBlocks();
    for (CeramicBrickType type : CeramicBrickType.VALUES) {
        TextureAtlasSprite[] sprites = new TextureAtlasSprite[3];
        for (int i = 0; i < 3; ++i) {
            ResourceLocation location = new ResourceLocation(Constants.BOTANY_MOD_ID + ":blocks/ceramic." + type.getId() + '.' + i);
            sprites[i] = textureMap.registerSprite(location);
        }
        type.setSprites(sprites);
    }
}
Also used : TextureMap(net.minecraft.client.renderer.texture.TextureMap) CeramicBrickType(binnie.botany.ceramic.brick.CeramicBrickType) TextureAtlasSprite(net.minecraft.client.renderer.texture.TextureAtlasSprite) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) ResourceLocation(net.minecraft.util.ResourceLocation) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

CeramicBrickType (binnie.botany.ceramic.brick.CeramicBrickType)3 EnumFlowerColor (binnie.botany.api.genetics.EnumFlowerColor)1 CeramicBrickPair (binnie.botany.ceramic.brick.CeramicBrickPair)1 ArrayList (java.util.ArrayList)1 ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)1 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)1 TextureMap (net.minecraft.client.renderer.texture.TextureMap)1 Item (net.minecraft.item.Item)1 ItemStack (net.minecraft.item.ItemStack)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1