Search in sources :

Example 1 with QuadColor

use of dev.hypnotic.utils.render.QuadColor in project Hypnotic-Client by Hypnotic-Development.

the class NewChunks method onWorldRender.

@EventTarget
public void onWorldRender(EventRender3D event) {
    int renderY = (int) (mc.world.getBottomY() + yOffset.getValue());
    if (newChunksSet.isEnabled()) {
        int color = this.color.getRGB();
        QuadColor outlineColor = QuadColor.single(0xff000000 | color);
        QuadColor fillColor = QuadColor.single(((int) (100) << 24) | color);
        synchronized (newChunks) {
            for (ChunkPos c : newChunks) {
                if (mc.getCameraEntity().getBlockPos().isWithinDistance(c.getStartPos(), 1024)) {
                    Box box = new Box(c.getStartX(), renderY, c.getStartZ(), c.getStartX() + 16, renderY, c.getStartZ() + 16);
                    if (fill.isEnabled()) {
                        RenderUtils.drawBoxFill(box, fillColor, skipDirs);
                    }
                    RenderUtils.drawBoxOutline(box, outlineColor, 2f, skipDirs);
                }
            }
        }
    }
}
Also used : QuadColor(dev.hypnotic.utils.render.QuadColor) ChunkPos(net.minecraft.util.math.ChunkPos) Box(net.minecraft.util.math.Box) EventTarget(dev.hypnotic.event.EventTarget)

Aggregations

EventTarget (dev.hypnotic.event.EventTarget)1 QuadColor (dev.hypnotic.utils.render.QuadColor)1 Box (net.minecraft.util.math.Box)1 ChunkPos (net.minecraft.util.math.ChunkPos)1