Java Code Examples for net.minecraft.world.World.getCelestialAngle()

The following are Jave code examples for showing how to use getCelestialAngle() of the net.minecraft.world.World class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Backmemed   File: CustomSky.java   View Source Code Vote up 5 votes
public static void renderSky(World p_renderSky_0_, TextureManager p_renderSky_1_, float p_renderSky_2_)
{
    if (worldSkyLayers != null)
    {
        int i = p_renderSky_0_.provider.getDimensionType().getId();

        if (i >= 0 && i < worldSkyLayers.length)
        {
            CustomSkyLayer[] acustomskylayer = worldSkyLayers[i];

            if (acustomskylayer != null)
            {
                long j = p_renderSky_0_.getWorldTime();
                int k = (int)(j % 24000L);
                float f = p_renderSky_0_.getCelestialAngle(p_renderSky_2_);
                float f1 = p_renderSky_0_.getRainStrength(p_renderSky_2_);
                float f2 = p_renderSky_0_.getThunderStrength(p_renderSky_2_);

                if (f1 > 0.0F)
                {
                    f2 /= f1;
                }

                for (int l = 0; l < acustomskylayer.length; ++l)
                {
                    CustomSkyLayer customskylayer = acustomskylayer[l];

                    if (customskylayer.isActive(p_renderSky_0_, k))
                    {
                        customskylayer.render(k, f, f1, f2);
                    }
                }

                float f3 = 1.0F - f1;
                Blender.clearBlend(f3);
            }
        }
    }
}
 
Example 2
Project: OpenSensors   File: ItemWorldSensor.java   View Source Code Vote up 5 votes
@Override
@Callback
public Object[] get(Context context, Arguments args, World worldIn, TileEntitySensor teIn) {
	if (args.checkString(0).equalsIgnoreCase("biome")) {
		return new Object[] { worldIn.getBiomeGenForCoords((teIn.xCoord + rangeLimit(args.optInteger(1, 0))), (teIn.zCoord + rangeLimit(args.optInteger(1, 0)))).biomeName };
	} else if (args.checkString(0).equalsIgnoreCase("lightlevel")) {
		return new Object[] { worldIn.getBlockLightValue((teIn.xCoord + rangeLimit(args.optInteger(1, 0))), (teIn.yCoord + rangeLimit(rangeLimit(args.optInteger(1, 0)))), (teIn.zCoord + rangeLimit(args.optInteger(1, 0)))) };
	} else if (args.checkString(0).equalsIgnoreCase("raining")) {
		return new Object[] { worldIn.isRaining() };
	} else if (args.checkString(0).equalsIgnoreCase("thundering")) {
		return new Object[] { worldIn.isThundering() };
	} else if (args.checkString(0).equalsIgnoreCase("daytime")) {
		return new Object[] { worldIn.isDaytime() };
	} else if (args.checkString(0).equalsIgnoreCase("moonphase")) {
		return new Object[] { worldIn.getCurrentMoonPhaseFactor() };
	} else if (args.checkString(0).equalsIgnoreCase("celestialangle")) {
		return new Object[] { worldIn.getCelestialAngle(1.0F)};
	} else if (args.checkString(0).equalsIgnoreCase("dimension")) {
		return new Object[] { worldIn.getWorldInfo().getVanillaDimension()};
	} else if (args.checkString(0).equalsIgnoreCase("temperature") || args.checkString(0).equalsIgnoreCase("temp")) {
		return new Object[] { worldIn.getBiomeGenForCoords((teIn.xCoord + rangeLimit(args.optInteger(1, 0))), (teIn.zCoord + rangeLimit(args.optInteger(1, 0)))).temperature};
	} else if (args.checkString(0).equalsIgnoreCase("highhumidity")) {
		return new Object[] { worldIn.getBiomeGenForCoords((teIn.xCoord + rangeLimit(args.optInteger(1, 0))), (teIn.zCoord + rangeLimit(args.optInteger(1, 0)))).isHighHumidity()};
	} else if (args.checkString(0).equalsIgnoreCase("humidity")) {
		return new Object[] { worldIn.getBiomeGenForCoords((teIn.xCoord + rangeLimit(args.optInteger(1, 0))), (teIn.zCoord + rangeLimit(args.optInteger(1, 0)))).rainfall};
	} else if (args.checkString(0).equalsIgnoreCase("worldseed")) {
		return new Object[] { worldIn.getSeed()};
	}
	return new Object[] { "No method passed, or not found" };
}