Search in sources :

Example 1 with ShapeRenderer

use of mcjty.rftools.shapes.ShapeRenderer in project RFTools by McJty.

the class GuiShapeCard method getShapeRenderer.

private ShapeRenderer getShapeRenderer() {
    if (shapeID == null) {
        shapeID = getShapeID();
    } else if (!shapeID.equals(getShapeID())) {
        shapeID = getShapeID();
        shapeRenderer = null;
    }
    if (shapeRenderer == null) {
        shapeRenderer = new ShapeRenderer(shapeID);
        shapeRenderer.initView(getPreviewLeft(), guiTop);
    }
    return shapeRenderer;
}
Also used : ShapeRenderer(mcjty.rftools.shapes.ShapeRenderer)

Example 2 with ShapeRenderer

use of mcjty.rftools.shapes.ShapeRenderer in project RFTools by McJty.

the class ProjectorRenderer method render.

@Override
public void render(ProjectorTileEntity te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
    super.render(te, x, y, z, partialTicks, destroyStage, alpha);
    boolean sound = false;
    ItemStack renderStack = te.getRenderStack();
    if (te.isProjecting() && !renderStack.isEmpty()) {
        ShapeRenderer renderer = te.getShapeRenderer();
        boolean doSound = renderer.renderShapeInWorld(renderStack, x, y, z, te.getVerticalOffset(), te.getScale(), te.getAngle(), te.isScanline(), te.getShapeID());
        if (ScannerConfiguration.baseProjectorVolume > 0.0f && doSound && te.isSound()) {
            sound = true;
        }
    }
    if (ScannerConfiguration.baseProjectorVolume > 0.0f) {
        if (sound) {
            if (!ProjectorSounds.isScanPlaying(te.getPos())) {
                ProjectorSounds.playScan(te.getWorld(), te.getPos());
            }
        } else {
            ProjectorSounds.stopSound(te.getPos());
        }
    }
}
Also used : ItemStack(net.minecraft.item.ItemStack) ShapeRenderer(mcjty.rftools.shapes.ShapeRenderer)

Aggregations

ShapeRenderer (mcjty.rftools.shapes.ShapeRenderer)2 ItemStack (net.minecraft.item.ItemStack)1