Search in sources :

Example 1 with ChunkCoordinates

use of net.minecraft.util.ChunkCoordinates in project SecurityCraft by Geforce132.

the class LookingGlassAPIProvider method createLookingGlassView.

/**
	 * Creates an {@link IWorldView} object, then adds it to ClientProxy.worldViews.
	 * 
	 * Only works on the CLIENT side.
	 * 
	 * @param world The world we are in.
	 * @param dimension The dimension to view. (0 = Overworld, -1 = Nether)
	 * @param xCoord View X coordinate.
	 * @param yCoord View Y coordinate.
	 * @param zCoord View Z coordinate.
	 * @param viewWidth View width in pixels.
	 * @param viewHeight View height in pixels.
	 */
@SideOnly(Side.CLIENT)
public static void createLookingGlassView(World world, int dimension, int xCoord, int yCoord, int zCoord, int viewWidth, int viewHeight) {
    if (!Loader.isModLoaded("LookingGlass")) {
        return;
    }
    IWorldView lgView = mod_SecurityCraft.instance.getLGPanelRenderer().getApi().createWorldView(dimension, new ChunkCoordinates(xCoord, yCoord, zCoord), viewWidth, viewHeight);
    lgView.setAnimator(new CameraAnimatorSecurityCamera(lgView.getCamera(), xCoord, yCoord, zCoord, world.getBlockMetadata(xCoord, yCoord, zCoord)));
    if (!mod_SecurityCraft.instance.hasViewForCoords(xCoord + " " + yCoord + " " + zCoord + " " + dimension)) {
        mod_SecurityCraft.log("Inserting new view at" + Utils.getFormattedCoordinates(xCoord, yCoord, zCoord));
        ((ClientProxy) mod_SecurityCraft.serverProxy).worldViews.put(xCoord + " " + yCoord + " " + zCoord + " " + dimension, new IWorldViewHelper(lgView));
    }
}
Also used : ChunkCoordinates(net.minecraft.util.ChunkCoordinates) IWorldView(com.xcompwiz.lookingglass.api.view.IWorldView) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Aggregations

IWorldView (com.xcompwiz.lookingglass.api.view.IWorldView)1 SideOnly (cpw.mods.fml.relauncher.SideOnly)1 ChunkCoordinates (net.minecraft.util.ChunkCoordinates)1