use of org.blockartistry.lib.Color in project DynamicSurroundings by OreCruncher.
the class MoteWaterSpray method configureColor.
@Override
public void configureColor() {
final Color waterColor = BiomeUtils.getColorForLiquid(this.world, this.position);
this.red = waterColor.red;
this.green = waterColor.green;
this.blue = waterColor.blue;
this.alpha = 1F;
}
use of org.blockartistry.lib.Color in project DynamicSurroundings by OreCruncher.
the class AuroraClassic method render.
@Override
public void render(final float partialTick) {
final float alpha = getAlpha();
final Tessellator tess = Tessellator.getInstance();
final BufferBuilder renderer = tess.getBuffer();
final double tranY = getTranslationY(partialTick);
final double tranX = getTranslationX(partialTick);
final double tranZ = getTranslationZ(partialTick);
final Color base = getBaseColor();
final Color fade = getFadeColor();
final double zero = 0.0D;
final OpenGlState glState = OpenGlState.push();
GlStateManager.translate(tranX, tranY, tranZ);
GlStateManager.scale(0.5D, 8.0D, 0.5D);
GlStateManager.disableLighting();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.disableTexture2D();
GlStateManager.shadeModel(GL11.GL_SMOOTH);
GlStateManager.disableAlpha();
GlStateManager.disableCull();
GlStateManager.depthMask(false);
renderer.begin(GL11.GL_TRIANGLES, DefaultVertexFormats.POSITION_COLOR);
for (int b = 0; b < this.bands.length; b++) {
this.bands[b].translate(partialTick);
final Node[] array = this.bands[b].getNodeList();
for (int i = 0; i < array.length - 1; i++) {
final Node node = array[i];
final double posY = node.getModdedY();
final double posX = node.tetX;
final double posZ = node.tetZ;
final double tetX = node.tetX2;
final double tetZ = node.tetZ2;
final double posX2;
final double posZ2;
final double tetX2;
final double tetZ2;
final double posY2;
if (i < array.length - 2) {
final Node nodePlus = array[i + 1];
posX2 = nodePlus.tetX;
posZ2 = nodePlus.tetZ;
tetX2 = nodePlus.tetX2;
tetZ2 = nodePlus.tetZ2;
posY2 = nodePlus.getModdedY();
} else {
posX2 = tetX2 = node.posX;
posZ2 = tetZ2 = node.getModdedZ();
posY2 = 0.0D;
}
// Front
renderer.pos(posX, zero, posZ).color(base.red, base.green, base.blue, alpha).endVertex();
renderer.pos(posX, posY, posZ).color(fade.red, fade.green, fade.blue, 0).endVertex();
renderer.pos(posX2, posY2, posZ2).color(fade.red, fade.green, fade.blue, 0).endVertex();
renderer.pos(posX2, posY2, posZ2).color(fade.red, fade.green, fade.blue, 0).endVertex();
renderer.pos(posX2, zero, posZ2).color(base.red, base.green, base.blue, alpha).endVertex();
renderer.pos(posX, zero, posZ).color(base.red, base.green, base.blue, alpha).endVertex();
// Bottom
renderer.pos(posX, zero, posZ).color(base.red, base.green, base.blue, alpha).endVertex();
renderer.pos(posX2, zero, posZ2).color(base.red, base.green, base.blue, alpha).endVertex();
renderer.pos(tetX2, zero, tetZ2).color(base.red, base.green, base.blue, alpha).endVertex();
renderer.pos(tetX2, zero, tetZ2).color(base.red, base.green, base.blue, alpha).endVertex();
renderer.pos(tetX, zero, tetZ).color(base.red, base.green, base.blue, alpha).endVertex();
renderer.pos(posX, zero, posZ).color(base.red, base.green, base.blue, alpha).endVertex();
// Back
renderer.pos(tetX, zero, tetZ).color(base.red, base.green, base.blue, alpha).endVertex();
renderer.pos(tetX, posY, tetZ).color(fade.red, fade.green, fade.blue, 0).endVertex();
renderer.pos(tetX2, posY2, tetZ2).color(fade.red, fade.green, fade.blue, 0).endVertex();
renderer.pos(tetX2, posY2, tetZ2).color(fade.red, fade.green, fade.blue, 0).endVertex();
renderer.pos(tetX2, zero, tetZ2).color(base.red, base.green, base.blue, alpha).endVertex();
renderer.pos(tetX, zero, tetZ).color(base.red, base.green, base.blue, alpha).endVertex();
}
}
tess.draw();
OpenGlState.pop(glState);
}
use of org.blockartistry.lib.Color in project DynamicSurroundings by OreCruncher.
the class BiomeInfo method update.
// Internal to the package
void update(@Nonnull final BiomeConfig entry) {
addComment(entry.comment);
if (entry.hasPrecipitation != null)
setHasPrecipitation(entry.hasPrecipitation.booleanValue());
if (entry.hasAurora != null)
setHasAurora(entry.hasAurora.booleanValue());
if (entry.hasDust != null)
setHasDust(entry.hasDust.booleanValue());
if (entry.hasFog != null)
setHasFog(entry.hasFog.booleanValue());
if (entry.fogDensity != null)
setFogDensity(entry.fogDensity.floatValue());
if (entry.fogColor != null) {
final int[] rgb = MyUtils.splitToInts(entry.fogColor, ',');
if (rgb.length == 3)
setFogColor(new Color(rgb[0], rgb[1], rgb[2]));
}
if (entry.dustColor != null) {
final int[] rgb = MyUtils.splitToInts(entry.dustColor, ',');
if (rgb.length == 3)
setDustColor(new Color(rgb[0], rgb[1], rgb[2]));
}
if (entry.soundReset != null && entry.soundReset.booleanValue()) {
addComment("> Sound Reset");
resetSounds();
}
if (entry.spotSoundChance != null)
setSpotSoundChance(entry.spotSoundChance.intValue());
for (final SoundConfig sr : entry.sounds) {
if (ClientRegistry.SOUND.isSoundBlocked(sr.sound))
continue;
final SoundEffect.Builder b = new SoundEffect.Builder(sr);
final SoundEffect s = b.build();
if (s.getSoundType() == SoundType.SPOT)
addSpotSound(s);
else
addSound(s);
}
}
Aggregations