Search in sources :

Example 1 with ItemCameraMonitor

use of net.geforcemods.securitycraft.items.ItemCameraMonitor in project SecurityCraft by Geforce132.

the class ItemCameraMonitorRenderer method renderItem.

public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    if (type == ItemRenderType.FIRST_PERSON_MAP) {
        //Draw the base monitor texture.
        ((TextureManager) data[1]).bindTexture(new ResourceLocation("securitycraft:textures/gui/camera/cameraBackground.png"));
        Tessellator tessellator = Tessellator.instance;
        tessellator.startDrawingQuads();
        tessellator.addVertexWithUV(0 - 7, 128 + 7, 0.0D, 0.0D, 1.0D);
        tessellator.addVertexWithUV(128 + 7, 128 + 7, 0.0D, 1.0D, 1.0D);
        tessellator.addVertexWithUV(128 + 7, 0 - 7, 0.0D, 1.0D, 0.0D);
        tessellator.addVertexWithUV(0 - 7, 0 - 7, 0.0D, 0.0D, 0.0D);
        tessellator.draw();
        if (item != null && item.getItem() instanceof ItemCameraMonitor && ((ItemCameraMonitor) item.getItem()).hasCameraAdded(item.getTagCompound())) {
            CameraView view = ((ItemCameraMonitor) item.getItem()).getCameraView(item.getTagCompound());
            if (mod_SecurityCraft.instance.hasViewForCoords(view.toNBTString())) {
                IWorldView worldView = mod_SecurityCraft.instance.getViewFromCoords(view.toNBTString()).getView();
                if (worldView.isReady() && worldView.getTexture() != 0) {
                    //Bind the IWorldView texture then draw it.
                    GL11.glDisable(3008);
                    GL11.glDisable(2896);
                    GL11.glBindTexture(GL11.GL_TEXTURE_2D, worldView.getTexture());
                    tessellator.startDrawingQuads();
                    tessellator.addVertexWithUV(128 + 7, 0 - 7, 0.0D, 0.0D, 1.0D);
                    tessellator.addVertexWithUV(0 - 7, 0 - 7, 0.0D, -1.0D, 1.0D);
                    tessellator.addVertexWithUV(0 - 7, 128 + 7, 0.0D, -1.0D, 0.0D);
                    tessellator.addVertexWithUV(128 + 7, 128 + 7, 0.0D, 0.0D, 0.0D);
                    tessellator.draw();
                    GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0);
                    GL11.glEnable(3008);
                    GL11.glEnable(2896);
                //
                }
                //Update the camera.
                worldView.markDirty();
            }
        }
    }
}
Also used : TextureManager(net.minecraft.client.renderer.texture.TextureManager) Tessellator(net.minecraft.client.renderer.Tessellator) ItemCameraMonitor(net.geforcemods.securitycraft.items.ItemCameraMonitor) ResourceLocation(net.minecraft.util.ResourceLocation) CameraView(net.geforcemods.securitycraft.misc.CameraView) IWorldView(com.xcompwiz.lookingglass.api.view.IWorldView)

Example 2 with ItemCameraMonitor

use of net.geforcemods.securitycraft.items.ItemCameraMonitor in project SecurityCraft by Geforce132.

the class ConfigurationHandler method setupItems.

public void setupItems() {
    mod_SecurityCraft.codebreaker = new ItemCodebreaker().setCreativeTab(mod_SecurityCraft.tabSCTechnical).setUnlocalizedName("codebreaker");
    mod_SecurityCraft.keycardLV1 = new ItemKeycardBase(0).setUnlocalizedName("keycardLV1");
    mod_SecurityCraft.keycardLV2 = new ItemKeycardBase(1).setUnlocalizedName("keycardLV2");
    mod_SecurityCraft.keycardLV3 = new ItemKeycardBase(2).setUnlocalizedName("keycardLV3");
    mod_SecurityCraft.keycardLV4 = new ItemKeycardBase(4).setUnlocalizedName("keycardLV4");
    mod_SecurityCraft.keycardLV5 = new ItemKeycardBase(5).setUnlocalizedName("keycardLV5");
    mod_SecurityCraft.limitedUseKeycard = new ItemKeycardBase(3).setUnlocalizedName("limitedUseKeycard");
    mod_SecurityCraft.reinforcedDoorItem = new ItemReinforcedDoor().setUnlocalizedName("doorIndestructibleIronItem").setCreativeTab(mod_SecurityCraft.tabSCDecoration);
    mod_SecurityCraft.universalBlockRemover = new ItemUniversalBlockRemover().setMaxStackSize(1).setMaxDamage(476).setCreativeTab(mod_SecurityCraft.tabSCTechnical).setUnlocalizedName("universalBlockRemover");
    mod_SecurityCraft.remoteAccessMine = new ItemMineRemoteAccessTool().setCreativeTab(mod_SecurityCraft.tabSCTechnical).setUnlocalizedName("remoteAccessMine");
    mod_SecurityCraft.fWaterBucket = new ItemModifiedBucket(mod_SecurityCraft.bogusWaterFlowing).setCreativeTab(mod_SecurityCraft.tabSCTechnical).setUnlocalizedName("bucketFWater");
    mod_SecurityCraft.fLavaBucket = new ItemModifiedBucket(mod_SecurityCraft.bogusLavaFlowing).setCreativeTab(mod_SecurityCraft.tabSCTechnical).setUnlocalizedName("bucketFLava");
    mod_SecurityCraft.universalBlockModifier = new ItemUniversalBlockModifier().setMaxStackSize(1).setCreativeTab(mod_SecurityCraft.tabSCTechnical).setUnlocalizedName("universalBlockModifier");
    mod_SecurityCraft.redstoneModule = (ItemModule) new ItemModule(EnumCustomModules.REDSTONE, false).setUnlocalizedName("redstoneModule");
    mod_SecurityCraft.whitelistModule = (ItemModule) new ItemModule(EnumCustomModules.WHITELIST, true).setUnlocalizedName("whitelistModule");
    mod_SecurityCraft.blacklistModule = (ItemModule) new ItemModule(EnumCustomModules.BLACKLIST, true).setUnlocalizedName("blacklistModule");
    mod_SecurityCraft.harmingModule = (ItemModule) new ItemModule(EnumCustomModules.HARMING, false).setUnlocalizedName("harmingModule");
    mod_SecurityCraft.smartModule = (ItemModule) new ItemModule(EnumCustomModules.SMART, false).setUnlocalizedName("smartModule");
    mod_SecurityCraft.storageModule = (ItemModule) new ItemModule(EnumCustomModules.STORAGE, false).setUnlocalizedName("storageModule");
    mod_SecurityCraft.disguiseModule = (ItemModule) new ItemModule(EnumCustomModules.DISGUISE, false, true, GuiHandler.DISGUISE_MODULE, 0, 1).setUnlocalizedName("disguiseModule");
    mod_SecurityCraft.wireCutters = new Item().setMaxStackSize(1).setMaxDamage(476).setCreativeTab(mod_SecurityCraft.tabSCTechnical).setUnlocalizedName("wireCutters");
    mod_SecurityCraft.keyPanel = new ItemKeyPanel().setCreativeTab(mod_SecurityCraft.tabSCTechnical).setUnlocalizedName("keypadItem");
    mod_SecurityCraft.adminTool = new ItemAdminTool().setMaxStackSize(1).setUnlocalizedName("adminTool");
    mod_SecurityCraft.cameraMonitor = new ItemCameraMonitor().setMaxStackSize(1).setCreativeTab(mod_SecurityCraft.tabSCTechnical).setUnlocalizedName("cameraMonitor");
    mod_SecurityCraft.scManual = new ItemSCManual().setMaxStackSize(1).setCreativeTab(mod_SecurityCraft.tabSCTechnical).setUnlocalizedName("scManual");
    mod_SecurityCraft.taser = new ItemTaser().setMaxStackSize(1).setCreativeTab(mod_SecurityCraft.tabSCTechnical).setUnlocalizedName("taser");
    mod_SecurityCraft.universalOwnerChanger = new ItemUniversalOwnerChanger().setMaxStackSize(1).setMaxDamage(48).setCreativeTab(mod_SecurityCraft.tabSCTechnical).setUnlocalizedName("universalOwnerChanger");
    mod_SecurityCraft.universalBlockReinforcerLvL1 = new ItemUniversalBlockReinforcer(300).setMaxStackSize(1).setCreativeTab(mod_SecurityCraft.tabSCTechnical).setUnlocalizedName("universalBlockReinforcerLvL1");
    mod_SecurityCraft.universalBlockReinforcerLvL2 = new ItemUniversalBlockReinforcer(2700).setMaxStackSize(1).setCreativeTab(mod_SecurityCraft.tabSCTechnical).setUnlocalizedName("universalBlockReinforcerLvL2");
    mod_SecurityCraft.universalBlockReinforcerLvL3 = new ItemUniversalBlockReinforcer(0).setMaxStackSize(1).setCreativeTab(mod_SecurityCraft.tabSCTechnical).setUnlocalizedName("universalBlockReinforcerLvL3");
    mod_SecurityCraft.briefcase = new ItemBriefcase().setMaxStackSize(1).setCreativeTab(mod_SecurityCraft.tabSCTechnical).setUnlocalizedName("briefcase");
    mod_SecurityCraft.universalKeyChanger = new ItemUniversalKeyChanger().setMaxStackSize(1).setCreativeTab(mod_SecurityCraft.tabSCTechnical).setUnlocalizedName("universalKeyChanger");
    mod_SecurityCraft.scannerDoorItem = new ItemScannerDoor().setUnlocalizedName("scannerDoorItem").setCreativeTab(mod_SecurityCraft.tabSCDecoration);
}
Also used : ItemUniversalKeyChanger(net.geforcemods.securitycraft.items.ItemUniversalKeyChanger) ItemUniversalOwnerChanger(net.geforcemods.securitycraft.items.ItemUniversalOwnerChanger) ItemBriefcase(net.geforcemods.securitycraft.items.ItemBriefcase) ItemAdminTool(net.geforcemods.securitycraft.items.ItemAdminTool) ItemTaser(net.geforcemods.securitycraft.items.ItemTaser) Item(net.minecraft.item.Item) ItemSCManual(net.geforcemods.securitycraft.items.ItemSCManual) ItemUniversalBlockModifier(net.geforcemods.securitycraft.items.ItemUniversalBlockModifier) ItemReinforcedDoor(net.geforcemods.securitycraft.items.ItemReinforcedDoor) ItemCameraMonitor(net.geforcemods.securitycraft.items.ItemCameraMonitor) ItemUniversalBlockReinforcer(net.geforcemods.securitycraft.items.ItemUniversalBlockReinforcer) ItemUniversalBlockRemover(net.geforcemods.securitycraft.items.ItemUniversalBlockRemover) ItemScannerDoor(net.geforcemods.securitycraft.items.ItemScannerDoor) ItemMineRemoteAccessTool(net.geforcemods.securitycraft.items.ItemMineRemoteAccessTool) ItemKeyPanel(net.geforcemods.securitycraft.items.ItemKeyPanel) ItemModifiedBucket(net.geforcemods.securitycraft.items.ItemModifiedBucket) ItemModule(net.geforcemods.securitycraft.items.ItemModule) ItemCodebreaker(net.geforcemods.securitycraft.items.ItemCodebreaker) ItemKeycardBase(net.geforcemods.securitycraft.items.ItemKeycardBase)

Aggregations

ItemCameraMonitor (net.geforcemods.securitycraft.items.ItemCameraMonitor)2 IWorldView (com.xcompwiz.lookingglass.api.view.IWorldView)1 ItemAdminTool (net.geforcemods.securitycraft.items.ItemAdminTool)1 ItemBriefcase (net.geforcemods.securitycraft.items.ItemBriefcase)1 ItemCodebreaker (net.geforcemods.securitycraft.items.ItemCodebreaker)1 ItemKeyPanel (net.geforcemods.securitycraft.items.ItemKeyPanel)1 ItemKeycardBase (net.geforcemods.securitycraft.items.ItemKeycardBase)1 ItemMineRemoteAccessTool (net.geforcemods.securitycraft.items.ItemMineRemoteAccessTool)1 ItemModifiedBucket (net.geforcemods.securitycraft.items.ItemModifiedBucket)1 ItemModule (net.geforcemods.securitycraft.items.ItemModule)1 ItemReinforcedDoor (net.geforcemods.securitycraft.items.ItemReinforcedDoor)1 ItemSCManual (net.geforcemods.securitycraft.items.ItemSCManual)1 ItemScannerDoor (net.geforcemods.securitycraft.items.ItemScannerDoor)1 ItemTaser (net.geforcemods.securitycraft.items.ItemTaser)1 ItemUniversalBlockModifier (net.geforcemods.securitycraft.items.ItemUniversalBlockModifier)1 ItemUniversalBlockReinforcer (net.geforcemods.securitycraft.items.ItemUniversalBlockReinforcer)1 ItemUniversalBlockRemover (net.geforcemods.securitycraft.items.ItemUniversalBlockRemover)1 ItemUniversalKeyChanger (net.geforcemods.securitycraft.items.ItemUniversalKeyChanger)1 ItemUniversalOwnerChanger (net.geforcemods.securitycraft.items.ItemUniversalOwnerChanger)1 CameraView (net.geforcemods.securitycraft.misc.CameraView)1