All Downloads are FREE. Search and download functionalities are using the official Maven repository.

top.hendrixshen.magiclib.api.render.context.RenderContext Maven / Gradle / Ivy

There is a newer version: 0.6.59
Show newest version
/*
 * This file is part of the TweakerMore project, licensed under the
 * GNU Lesser General Public License v3.0
 *
 * Copyright (C) 2023  Fallen_Breath and contributors
 *
 * TweakerMore is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TweakerMore is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with TweakerMore.  If not, see .
 */

package top.hendrixshen.magiclib.api.render.context;

import org.joml.Matrix4f;
import net.minecraft.class_332;
import net.minecraft.class_4587;
import org.jetbrains.annotations.NotNull;
import top.hendrixshen.magiclib.impl.render.context.RenderContextImpl;

/**
 * Reference to TweakerMore
 */
public interface RenderContext {
    static @NotNull RenderContext of(
            //#if MC > 11502
            @NotNull class_4587 poseStack
            //#endif
    ) {
        //#if MC > 11904
        //$$ GuiGraphics guiGraphics = new GuiGraphics(Minecraft.getInstance(),
        //$$         MultiBufferSource.immediate(Tesselator.getInstance().getBuilder()));
        //$$ ((GuiGraphicsAccessor) guiGraphics).magiclib$setPose(poseStack);
        //#endif

        return new RenderContextImpl(
                //#if MC > 11904
                //$$ guiGraphics,
                //#endif
                //#if MC > 11502
                poseStack
                //#endif
        );
    }

    //#if MC > 11904
    //$$ static RenderContext of(@NotNull GuiGraphics guiGraphics) {
    //$$ 	return new RenderContextImpl(guiGraphics, guiGraphics.pose());
    //$$ }
    //#endif

    class_332 getGuiComponent();

    //#if MC > 11502
    class_4587 getPoseStack();
    //#endif

    void pushPose();

    void popPose();

    void translate(double x, double y, double z);

    void scale(double x, double y, double z);

    void mulPoseMatrix(Matrix4f matrix4f);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy