use of mcjty.rftoolsdim.network.PacketGetDimensionEnergy in project RFToolsDimensions by McJty.
the class GenericWorldProvider method getSkyColor.
@Override
@SideOnly(Side.CLIENT)
public Vec3 getSkyColor(Entity cameraEntity, float partialTicks) {
int dim = worldObj.provider.getDimensionId();
if (System.currentTimeMillis() - lastTime > 1000) {
lastTime = System.currentTimeMillis();
RFToolsDimMessages.INSTANCE.sendToServer(new PacketGetDimensionEnergy(dim));
}
float factor = calculatePowerBlackout(dim);
getDimensionInformation();
float r;
float g;
float b;
if (dimensionInformation == null) {
r = g = b = 1.0f;
} else {
r = dimensionInformation.getSkyDescriptor().getSkyColorFactorR() * factor;
g = dimensionInformation.getSkyDescriptor().getSkyColorFactorG() * factor;
b = dimensionInformation.getSkyDescriptor().getSkyColorFactorB() * factor;
}
Vec3 skyColor = super.getSkyColor(cameraEntity, partialTicks);
return new Vec3(skyColor.xCoord * r, skyColor.yCoord * g, skyColor.zCoord * b);
}
use of mcjty.rftoolsdim.network.PacketGetDimensionEnergy in project RFToolsDimensions by McJty.
the class GenericWorldProvider method getFogColor.
@Override
@SideOnly(Side.CLIENT)
public Vec3 getFogColor(float angle, float dt) {
int dim = worldObj.provider.getDimensionId();
if (System.currentTimeMillis() - lastFogTime > 1000) {
lastFogTime = System.currentTimeMillis();
RFToolsDimMessages.INSTANCE.sendToServer(new PacketGetDimensionEnergy(dim));
}
float factor = calculatePowerBlackout(dim);
getDimensionInformation();
float r;
float g;
float b;
if (dimensionInformation == null) {
r = g = b = 1.0f;
} else {
r = dimensionInformation.getSkyDescriptor().getFogColorFactorR() * factor;
g = dimensionInformation.getSkyDescriptor().getFogColorFactorG() * factor;
b = dimensionInformation.getSkyDescriptor().getFogColorFactorB() * factor;
}
Vec3 color = super.getFogColor(angle, dt);
return new Vec3(color.xCoord * r, color.yCoord * g, color.zCoord * b);
}
Aggregations