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