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);
}
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);
}
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);
}
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);
}
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;
}
Aggregations