Search in sources :

Example 16 with EnumColor

use of mods.railcraft.common.plugins.color.EnumColor in project Railcraft by Railcraft.

the class BlockPostMetalBase method initializeDefinition.

@Override
public void initializeDefinition() {
    HarvestPlugin.setBlockHarvestLevel("pickaxe", 2, this);
    ForestryPlugin.addBackpackItem("forestry.builder", this);
    for (EnumColor color : EnumColor.VALUES) {
        ItemStack stack = getStack(1, color);
        if (!stack.isEmpty())
            RailcraftRegistry.register(this, color, stack);
    }
}
Also used : EnumColor(mods.railcraft.common.plugins.color.EnumColor) ItemStack(net.minecraft.item.ItemStack)

Example 17 with EnumColor

use of mods.railcraft.common.plugins.color.EnumColor in project Railcraft by Railcraft.

the class TilePostEmblem method readPacketData.

@Override
public void readPacketData(RailcraftInputStream data) throws IOException {
    super.readPacketData(data);
    boolean needsUpdate = false;
    EnumFacing f = EnumFacing.byIndex(data.readByte());
    if (facing != f) {
        facing = f;
        needsUpdate = true;
    }
    byte cByte = data.readByte();
    if (cByte < 0) {
        if (color != null) {
            color = null;
            needsUpdate = true;
        }
    } else {
        EnumColor c = EnumColor.fromOrdinal(cByte);
        if (color != c) {
            color = c;
            needsUpdate = true;
        }
    }
    emblem = data.readUTF();
    if (needsUpdate)
        markBlockForUpdate();
}
Also used : EnumColor(mods.railcraft.common.plugins.color.EnumColor) EnumFacing(net.minecraft.util.EnumFacing)

Example 18 with EnumColor

use of mods.railcraft.common.plugins.color.EnumColor in project Railcraft by Railcraft.

the class BlockReinforcedConcrete method getState.

@Override
public IBlockState getState(@Nullable IVariantEnum variant) {
    IBlockState state = getDefaultState();
    if (variant != null) {
        checkVariant(variant);
        state = state.withProperty(getVariantEnumProperty(), (EnumColor) variant);
    }
    return state;
}
Also used : EnumColor(mods.railcraft.common.plugins.color.EnumColor) IBlockState(net.minecraft.block.state.IBlockState)

Example 19 with EnumColor

use of mods.railcraft.common.plugins.color.EnumColor in project Railcraft by Railcraft.

the class BlockReinforcedConcrete method defineRecipes.

@Override
public void defineRecipes() {
    super.defineRecipes();
    for (EnumColor color : EnumColor.VALUES) {
        CraftingPlugin.addShapedRecipe(getStack(8, color), "GGG", "GDG", "GGG", 'G', RailcraftBlocks.REINFORCED_CONCRETE.getWildcard(), 'D', color.getDyeOreDictTag());
    }
    // TODO: Make it craft a powder ALA Vanilla? World interaction may not be such a bad idea, and we can get rid of the fluid crafting in exchange for crafting colors directly...
    FluidStack water = Fluids.WATER.get(FluidTools.BUCKET_VOLUME);
    CraftingPlugin.addShapedRecipe(getStack(8, EnumColor.SILVER), "SIS", "IWI", "SIS", 'W', water, 'I', RailcraftItems.REBAR, 'S', RailcraftItems.CONCRETE);
}
Also used : EnumColor(mods.railcraft.common.plugins.color.EnumColor) FluidStack(net.minecraftforge.fluids.FluidStack)

Example 20 with EnumColor

use of mods.railcraft.common.plugins.color.EnumColor in project Railcraft by Railcraft.

the class BlockStrengthGlass method getState.

@Override
public IBlockState getState(@Nullable IVariantEnum variant) {
    IBlockState state = getDefaultState();
    if (variant != null) {
        checkVariant(variant);
        state = state.withProperty(EnumColor.PROPERTY, (EnumColor) variant);
    }
    return state;
}
Also used : EnumColor(mods.railcraft.common.plugins.color.EnumColor) IBlockState(net.minecraft.block.state.IBlockState)

Aggregations

EnumColor (mods.railcraft.common.plugins.color.EnumColor)21 ItemStack (net.minecraft.item.ItemStack)7 IBlockState (net.minecraft.block.state.IBlockState)4 GameProfile (com.mojang.authlib.GameProfile)2 Emblem (mods.railcraft.client.emblems.Emblem)2 EntityLocomotive (mods.railcraft.common.carts.EntityLocomotive)2 ResourceLocation (net.minecraft.util.ResourceLocation)2 FluidStack (net.minecraftforge.fluids.FluidStack)2 LocomotiveModelRenderer (mods.railcraft.api.carts.locomotive.LocomotiveModelRenderer)1 LocomotiveRenderType (mods.railcraft.api.carts.locomotive.LocomotiveRenderType)1 LocomotiveModelRenderer (mods.railcraft.client.render.carts.LocomotiveModelRenderer)1 EnumDetector (mods.railcraft.common.blocks.detector.EnumDetector)1 Ingredient (net.minecraft.item.crafting.Ingredient)1 EnumFacing (net.minecraft.util.EnumFacing)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1 ThaumcraftApi (thaumcraft.api.ThaumcraftApi)1 AspectList (thaumcraft.api.aspects.AspectList)1