Search in sources :

Example 16 with EnumColor

use of mekanism.api.text.EnumColor in project Mekanism by mekanism.

the class PlasticBlockRecipeProvider method registerPlasticRoad.

private void registerPlasticRoad(Consumer<IFinishedRecipe> consumer, BlockRegistryObject<? extends IColoredBlock, ?> result, IItemProvider slickPlastic, String basePath) {
    EnumColor color = result.getBlock().getColor();
    ExtendedShapedRecipeBuilder.shapedRecipe(result, 3).pattern(PLASTIC_ROAD).key(AdditionsRecipeProvider.SAND_CHAR, Tags.Items.SAND).key(Pattern.CONSTANT, slickPlastic).build(consumer, MekanismAdditions.rl(basePath + color.getRegistryPrefix()));
    registerRecolor(consumer, result, AdditionsTags.Items.PLASTIC_BLOCKS_ROAD, color, basePath);
}
Also used : EnumColor(mekanism.api.text.EnumColor)

Example 17 with EnumColor

use of mekanism.api.text.EnumColor in project Mekanism by mekanism.

the class PlasticBlockRecipeProvider method registerPlasticGlow.

private void registerPlasticGlow(Consumer<IFinishedRecipe> consumer, BlockRegistryObject<? extends IColoredBlock, ?> result, IItemProvider plastic, String basePath) {
    EnumColor color = result.getBlock().getColor();
    ExtendedShapelessRecipeBuilder.shapelessRecipe(result, 3).addIngredient(plastic, 3).addIngredient(Tags.Items.DUSTS_GLOWSTONE).build(consumer, MekanismAdditions.rl(basePath + color.getRegistryPrefix()));
    registerRecolor(consumer, result, AdditionsTags.Items.PLASTIC_BLOCKS_GLOW, color, basePath);
}
Also used : EnumColor(mekanism.api.text.EnumColor)

Example 18 with EnumColor

use of mekanism.api.text.EnumColor in project Mekanism by mekanism.

the class PlasticFencesRecipeProvider method registerPlasticFenceGate.

private void registerPlasticFenceGate(Consumer<IFinishedRecipe> consumer, BlockRegistryObject<? extends IColoredBlock, ?> result, IItemProvider plastic, String basePath) {
    EnumColor color = result.getBlock().getColor();
    ExtendedShapedRecipeBuilder.shapedRecipe(result).pattern(PLASTIC_FENCE_GATE).key(AdditionsRecipeProvider.PLASTIC_ROD_CHAR, MekanismTags.Items.RODS_PLASTIC).key(Pattern.CONSTANT, plastic).build(consumer, MekanismAdditions.rl(basePath + color.getRegistryPrefix()));
    PlasticBlockRecipeProvider.registerRecolor(consumer, result, AdditionsTags.Items.FENCE_GATES_PLASTIC, color, basePath);
}
Also used : EnumColor(mekanism.api.text.EnumColor)

Example 19 with EnumColor

use of mekanism.api.text.EnumColor in project Mekanism by mekanism.

the class StorageUtils method getStoragePercent.

public static ITextComponent getStoragePercent(double ratio, boolean colorText) {
    ITextComponent text = TextUtils.getPercent(ratio);
    if (!colorText) {
        return text;
    }
    EnumColor color;
    if (ratio < 0.01F) {
        color = EnumColor.DARK_RED;
    } else if (ratio < 0.1F) {
        color = EnumColor.RED;
    } else if (ratio < 0.25F) {
        color = EnumColor.ORANGE;
    } else if (ratio < 0.5F) {
        color = EnumColor.YELLOW;
    } else {
        color = EnumColor.BRIGHT_GREEN;
    }
    return TextComponentUtil.build(color, text);
}
Also used : EnumColor(mekanism.api.text.EnumColor) ITextComponent(net.minecraft.util.text.ITextComponent)

Example 20 with EnumColor

use of mekanism.api.text.EnumColor in project Mekanism by mekanism.

the class LogisticalTransporter method onConfigure.

@Override
public ActionResultType onConfigure(PlayerEntity player, Direction side) {
    TransporterUtils.incrementColor(this);
    PathfinderCache.onChanged(getTransmitterNetwork());
    getTransmitterTile().sendUpdatePacket();
    EnumColor color = getColor();
    player.sendMessage(MekanismUtils.logFormat(MekanismLang.TOGGLE_COLOR.translate(color == null ? MekanismLang.NONE : color.getColoredName())), Util.NIL_UUID);
    return ActionResultType.SUCCESS;
}
Also used : EnumColor(mekanism.api.text.EnumColor)

Aggregations

EnumColor (mekanism.api.text.EnumColor)33 Map (java.util.Map)6 DyeColor (net.minecraft.item.DyeColor)6 ItemStack (net.minecraft.item.ItemStack)5 ISideConfiguration (mekanism.common.tile.interfaces.ISideConfiguration)4 DataType (mekanism.common.tile.component.config.DataType)3 ArrayList (java.util.ArrayList)2 IPigmentProvider (mekanism.api.providers.IPigmentProvider)2 ItemConfigurator (mekanism.common.item.ItemConfigurator)2 PigmentRegistryObject (mekanism.common.registration.impl.PigmentRegistryObject)2 ITextComponent (net.minecraft.util.text.ITextComponent)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 MatrixStack (com.mojang.blaze3d.matrix.MatrixStack)1 IVertexBuilder (com.mojang.blaze3d.vertex.IVertexBuilder)1 Long2ObjectMap (it.unimi.dsi.fastutil.longs.Long2ObjectMap)1 Object2ObjectOpenHashMap (it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap)1 EnumMap (java.util.EnumMap)1 HashMap (java.util.HashMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 Consumer (java.util.function.Consumer)1