use of mekanism.api.text.EnumColor in project Mekanism by mekanism.
the class PlasticFencesRecipeProvider method registerPlasticFence.
private void registerPlasticFence(Consumer<IFinishedRecipe> consumer, BlockRegistryObject<? extends IColoredBlock, ?> result, IItemProvider plastic, String basePath) {
EnumColor color = result.getBlock().getColor();
ExtendedShapedRecipeBuilder.shapedRecipe(result, 3).pattern(PLASTIC_FENCE).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.FENCES_PLASTIC, color, basePath);
}
use of mekanism.api.text.EnumColor in project Mekanism by mekanism.
the class PlasticStairsRecipeProvider method registerPlasticStairs.
private void registerPlasticStairs(Consumer<IFinishedRecipe> consumer, Map<EnumColor, ? extends IItemProvider> blocks, Map<EnumColor, ? extends IItemProvider> plastic, ITag<Item> blockType, boolean transparent, String basePath) {
for (Map.Entry<EnumColor, ? extends IItemProvider> entry : blocks.entrySet()) {
EnumColor color = entry.getKey();
registerPlasticStairs(consumer, color, entry.getValue(), plastic.get(color), blockType, transparent, basePath);
}
}
use of mekanism.api.text.EnumColor in project Mekanism by mekanism.
the class RenderBalloon method render.
@Override
public void render(@Nonnull EntityBalloon balloon, float entityYaw, float partialTick, @Nonnull MatrixStack matrix, @Nonnull IRenderTypeBuffer renderer, int light) {
matrix.pushPose();
matrix.translate(-0.5, -1, -0.5);
if (balloon.isLatchedToEntity()) {
// Shift the rendering of the balloon to be over the entity
double x = balloon.latchedEntity.xOld + (balloon.latchedEntity.getX() - balloon.latchedEntity.xOld) * partialTick - (balloon.xOld + (balloon.getX() - balloon.xOld) * partialTick);
double y = balloon.latchedEntity.yOld + (balloon.latchedEntity.getY() - balloon.latchedEntity.yOld) * partialTick - (balloon.yOld + (balloon.getY() - balloon.yOld) * partialTick) + balloon.getAddedHeight();
double z = balloon.latchedEntity.zOld + (balloon.latchedEntity.getZ() - balloon.latchedEntity.zOld) * partialTick - (balloon.zOld + (balloon.getZ() - balloon.zOld) * partialTick);
matrix.translate(x, y, z);
}
JSONModelData model = balloon.isLatched() ? AdditionsModelCache.INSTANCE.BALLOON : AdditionsModelCache.INSTANCE.BALLOON_FREE;
List<BakedQuad> quads = model.getBakedModel().getQuads(null, null, balloon.level.random);
RenderType renderType = RenderType.entityTranslucent(AtlasTexture.LOCATION_BLOCKS);
IVertexBuilder builder = renderer.getBuffer(renderType);
MatrixStack.Entry last = matrix.last();
for (BakedQuad quad : quads) {
float[] color = new float[] { 1, 1, 1, 1 };
if (quad.getTintIndex() == 0) {
EnumColor balloonColor = balloon.getColor();
color[0] = balloonColor.getColor(0);
color[1] = balloonColor.getColor(1);
color[2] = balloonColor.getColor(2);
}
builder.addVertexData(last, quad, color[0], color[1], color[2], color[3], light, OverlayTexture.NO_OVERLAY);
}
((IRenderTypeBuffer.Impl) renderer).endBatch(renderType);
matrix.popPose();
super.render(balloon, entityYaw, partialTick, matrix, renderer, light);
}
Aggregations