cpw.mods.fml.client.FMLClientHandler Java Examples

The following examples show how to use cpw.mods.fml.client.FMLClientHandler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RenderItemDrone.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
private void render(float x, float y, float z, float scale){

        GL11.glPushMatrix();
        // GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glRotatef(-90F, 1F, 0, 0);
        // Scale, Translate, Rotate
        GL11.glScalef(scale, scale, scale);
        GL11.glTranslatef(x, y, z);
        GL11.glRotatef(-90F, 1F, 0, 0);

        // Bind texture
        FMLClientHandler.instance().getClient().getTextureManager().bindTexture(Textures.MODEL_DRONE);
        // Render
        model.render(null, 0, 0, 0, 0, 0, 1 / 16F);
        // GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glPopMatrix();
    }
 
Example #2
Source File: HUDHandler.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onKeyPress(KeyBinding key){
    Minecraft mc = FMLClientHandler.instance().getClient();
    if(mc.inGameHasFocus) {
        if(key == KeyHandler.getInstance().keybindOpenOptions) {
            ItemStack helmetStack = mc.thePlayer.inventory.armorInventory[3];
            if(helmetStack != null && helmetStack.getItem() == Itemss.pneumaticHelmet) {
                FMLCommonHandler.instance().showGuiScreen(GuiHelmetMainScreen.getInstance());
            }
        } else if(key == KeyHandler.getInstance().keybindHack && HackUpgradeRenderHandler.enabledForPlayer(mc.thePlayer)) {
            getSpecificRenderer(BlockTrackUpgradeHandler.class).hack();
            getSpecificRenderer(EntityTrackUpgradeHandler.class).hack();
        } else if(key == KeyHandler.getInstance().keybindDebuggingDrone && DroneDebugUpgradeHandler.enabledForPlayer(PneumaticCraft.proxy.getPlayer())) {
            getSpecificRenderer(EntityTrackUpgradeHandler.class).selectAsDebuggingTarget();
        }
    }
}
 
Example #3
Source File: ModelGasLift.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void renderStatic(float size, TileEntity te){
    Shape1.render(size);
    Shape2.render(size);
    Shape3.render(size);
    FMLClientHandler.instance().getClient().getTextureManager().bindTexture(Textures.MODEL_PRESSURE_TUBE);
    if(te != null) {
        boolean[] sidesConnected = ((TileEntityGasLift)te).sidesConnected;
        tubeRenderer.renderModel(size, sidesConnected);
        GL11.glScalef(1.0F, -1F, -1F);
        for(int i = 0; i < 6; i++) {
            if(sidesConnected[i]) {
                module.setDirection(ForgeDirection.getOrientation(i));
                module.renderDynamic(-0.5, -1.5, -0.5, 0, 0, false);
            }
        }
    } else {
        tubeRenderer.renderModel(size, new boolean[6]);
    }
}
 
Example #4
Source File: ModelGauge.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void renderDynamic(float size, TileEntity te, float partialTicks){
    Shape1.render(size);
    Shape2.render(size);

    float pressure = 0;
    float dangerPressure = 5;
    float critPressure = 7;
    if(gaugeModule != null && gaugeModule.getTube() != null) {
        TileEntityPneumaticBase base = (TileEntityPneumaticBase)((IPneumaticMachine)gaugeModule.getTube()).getAirHandler();
        pressure = base.getPressure(ForgeDirection.UNKNOWN);
        dangerPressure = base.DANGER_PRESSURE;
        critPressure = base.CRITICAL_PRESSURE;
    }
    GL11.glTranslated(0, 1, 0.378);
    double scale = 0.008D;
    GL11.glScaled(scale, scale, scale);
    GL11.glRotated(180, 0, 1, 0);
    GL11.glDisable(GL11.GL_LIGHTING);
    GuiUtils.drawPressureGauge(FMLClientHandler.instance().getClient().fontRenderer, -1, critPressure, dangerPressure, -1, pressure, 0, 0, 0);
    GL11.glEnable(GL11.GL_LIGHTING);
}
 
Example #5
Source File: RenderUtils.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
public void renderLiquid(FluidTankInfo info, RenderInfo renderInfo, World worldObj){
    if(info.fluid.getFluid().getBlock() != null) {
        renderInfo.baseBlock = info.fluid.getFluid().getBlock();
    } else {
        renderInfo.baseBlock = Blocks.water;
    }
    renderInfo.texture = info.fluid.getFluid().getIcon(info.fluid);
    FMLClientHandler.instance().getClient().getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
    // Tessellator.instance.setColorOpaque_I();
    int color = info.fluid.getFluid().getColor(info.fluid);
    int red = color >> 16 & 255;
    int green = color >> 8 & 255;
    int blue = color & 255;
    GL11.glColor4ub((byte)red, (byte)green, (byte)blue, (byte)255);
    RenderUtils.INSTANCE.renderBlock(renderInfo, worldObj, 0, 0, 0, false, true);
}
 
Example #6
Source File: RenderModelBase.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
private void render(float x, float y, float z, float scale){
    GL11.glPushMatrix();
    GL11.glRotatef(-90F, 1F, 0, 0);
    GL11.glScalef(scale, scale, scale);
    GL11.glTranslatef(x, y, z);
    GL11.glRotatef(-90F, 1F, 0, 0);
    if(model.getModelTexture(null) != null) FMLClientHandler.instance().getClient().getTextureManager().bindTexture(model.getModelTexture(null));
    //TODO refactor when all models are converted:
    if(model instanceof BaseModel) {
        GL11.glTranslated(0, 24 / 16D, 0);
        GL11.glScalef(0.0625F, 0.0625F, 0.0625F);
    }
    model.rotateModelBasedOnBlockMeta();
    model.renderDynamic(0.0625F, null, 0);
    model.renderStatic(1F / 16F, null);
    GL11.glPopMatrix();
}
 
Example #7
Source File: GuiHelmetMainOptions.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void actionPerformed(GuiButton button){
    switch(button.id){
        case 10:
            FMLClientHandler.instance().getClient().thePlayer.closeScreen();
            FMLCommonHandler.instance().showGuiScreen(new GuiMoveStat(renderHandler));
            break;
        case 11:
            FMLClientHandler.instance().getClient().thePlayer.closeScreen();
            renderHandler.testMessageStat = new GuiAnimatedStat(null, "Test Message, keep in mind messages can be long!", renderHandler.messagesStatX, renderHandler.messagesStatY, 0x7000AA00, null, renderHandler.messagesStatLeftSided);
            renderHandler.testMessageStat.openWindow();
            FMLCommonHandler.instance().showGuiScreen(new GuiMoveStat(renderHandler, renderHandler.testMessageStat));
            break;
        case 12:
            changingKeybinding = !changingKeybinding;
            updateKeybindingButtonText();
            break;
    }
}
 
Example #8
Source File: ClientProxy.java    From BigReactors with MIT License 6 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void registerIcons(TextureStitchEvent.Pre event) {
	if(event.map.getTextureType() == BeefIconManager.TERRAIN_TEXTURE) {
		BigReactors.registerNonBlockFluidIcons(event.map);
		GuiIcons.registerIcons(event.map);
		CommonBlockIcons.registerIcons(event.map);
	}
	// else if(event.map.textureType == BeefIconManager.ITEM_TEXTURE) { }

	// Reset any controllers which have TESRs which cache displaylists with UV data in 'em
	// This is necessary in case a texture pack changes UV coordinates on us
	Set<MultiblockControllerBase> controllers = MultiblockRegistry.getControllersFromWorld(FMLClientHandler.instance().getClient().theWorld);
	if(controllers != null) {
		for(MultiblockControllerBase controller: controllers) {
			if(controller instanceof MultiblockTurbine) {
				((MultiblockTurbine)controller).resetCachedRotors();
			}
		}
	}
}
 
Example #9
Source File: RenderItemCannonParts.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
private void render(float x, float y, float z, float scale){

        GL11.glPushMatrix();
        GL11.glRotatef(-90F, 1F, 0, 0);
        // GL11.glDisable(GL11.GL_LIGHTING);

        // Scale, Translate, Rotate
        GL11.glScalef(scale, scale, scale);
        GL11.glTranslatef(x, y, z);
        GL11.glRotatef(-90F, 1F, 0, 0);

        // Bind texture
        FMLClientHandler.instance().getClient().getTextureManager().bindTexture(Textures.MODEL_AIR_CANNON);

        // Render
        model.renderModel(1F / 16F, 0F, 00F, !cannonBase, cannonBase);

        // GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glPopMatrix();
    }
 
Example #10
Source File: MoCEntityFXUndead.java    From mocreaturesdev with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
{
	//func_98187_b = bindTexture(String)
	FMLClientHandler.instance().getClient().renderEngine.bindTexture(MoCreatures.proxy.MISC_TEXTURE + getCurrentTexture());
    float sizeFactor = 0.1F * this.particleScale;
    float var13 = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX);
    float var14 = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY);
    float var15 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ);
    float var16 = 1F;
    par1Tessellator.setColorOpaque_F(this.particleRed * var16, this.particleGreen * var16, this.particleBlue * var16);
    par1Tessellator.addVertexWithUV((double) (var13 - par3 * sizeFactor - par6 * sizeFactor), (double) (var14 - par4 * sizeFactor), (double) (var15 - par5 * sizeFactor - par7 * sizeFactor), 0D, 1D);
    par1Tessellator.addVertexWithUV((double) (var13 - par3 * sizeFactor + par6 * sizeFactor), (double) (var14 + par4 * sizeFactor), (double) (var15 - par5 * sizeFactor + par7 * sizeFactor), 1D, 1D);
    par1Tessellator.addVertexWithUV((double) (var13 + par3 * sizeFactor + par6 * sizeFactor), (double) (var14 + par4 * sizeFactor), (double) (var15 + par5 * sizeFactor + par7 * sizeFactor), 1D, 0D);
    par1Tessellator.addVertexWithUV((double) (var13 + par3 * sizeFactor - par6 * sizeFactor), (double) (var14 - par4 * sizeFactor), (double) (var15 + par5 * sizeFactor - par7 * sizeFactor), 0D, 0D);
   
}
 
Example #11
Source File: MoCEntityFXStar.java    From mocreaturesdev with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
{
	//func_98187_b = bindTexture(String)
	FMLClientHandler.instance().getClient().renderEngine.bindTexture(MoCreatures.proxy.MISC_TEXTURE + "fxstar.png");
    float sizeFactor = 0.1F * this.particleScale;
    float var13 = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX);
    float var14 = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY);
    float var15 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ);
    float var16 = 1.2F - ((float) Math.random() * 0.5F);
    par1Tessellator.setColorRGBA_F(this.particleRed * var16, this.particleGreen * var16, this.particleBlue * var16, 1.0F);
    par1Tessellator.addVertexWithUV((double) (var13 - par3 * sizeFactor - par6 * sizeFactor), (double) (var14 - par4 * sizeFactor), (double) (var15 - par5 * sizeFactor - par7 * sizeFactor), 0D, 1D);
    par1Tessellator.addVertexWithUV((double) (var13 - par3 * sizeFactor + par6 * sizeFactor), (double) (var14 + par4 * sizeFactor), (double) (var15 - par5 * sizeFactor + par7 * sizeFactor), 1D, 1D);
    par1Tessellator.addVertexWithUV((double) (var13 + par3 * sizeFactor + par6 * sizeFactor), (double) (var14 + par4 * sizeFactor), (double) (var15 + par5 * sizeFactor + par7 * sizeFactor), 1D, 0D);
    par1Tessellator.addVertexWithUV((double) (var13 + par3 * sizeFactor - par6 * sizeFactor), (double) (var14 - par4 * sizeFactor), (double) (var15 + par5 * sizeFactor - par7 * sizeFactor), 0D, 0D);
   
}
 
Example #12
Source File: MoCEntityFXVanish.java    From mocreaturesdev with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
{
    //func_98187_b() = bindTexture();
	FMLClientHandler.instance().getClient().renderEngine.bindTexture(MoCreatures.proxy.MISC_TEXTURE + "fxvanish.png");
    float scale = 0.1F * this.particleScale;
    float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX);
    float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY);
    float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ);
    float colorIntensity = 1.0F;
    par1Tessellator.setColorOpaque_F(this.particleRed * colorIntensity, this.particleGreen * colorIntensity, this.particleBlue * colorIntensity);//, 1.0F);

    par1Tessellator.addVertexWithUV((double) (xPos - par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos - par5 * scale - par7 * scale), 0D, 1D);
    par1Tessellator.addVertexWithUV((double) (xPos - par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos - par5 * scale + par7 * scale), 1D, 1D);
    par1Tessellator.addVertexWithUV((double) (xPos + par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos + par5 * scale + par7 * scale), 1D, 0D);
    par1Tessellator.addVertexWithUV((double) (xPos + par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos + par5 * scale - par7 * scale), 0D, 0D);

    
}
 
Example #13
Source File: GuiProgWidgetArea.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void actionPerformed(GuiButton button){
    if(button.id == 0 || button.id == 1) {
        invSearchGui = new GuiInventorySearcher(FMLClientHandler.instance().getClient().thePlayer);
        ItemStack gps = new ItemStack(Itemss.GPSTool);
        if(button.id == 0) {
            ItemGPSTool.setGPSLocation(gps, widget.x1, widget.y1, widget.z1);
        } else {
            ItemGPSTool.setGPSLocation(gps, widget.x2, widget.y2, widget.z2);
        }
        invSearchGui.setSearchStack(ItemGPSTool.getGPSLocation(gps) != null ? gps : null);
        FMLClientHandler.instance().showGuiScreen(invSearchGui);
        pointSearched = button.id;
    }
    super.actionPerformed(button);
}
 
Example #14
Source File: RenderPresent.java    From Chisel-2 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
	FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(Chisel.MOD_ID, ChiselBlocks.present.getModelTexture(item.getItemDamage()) + ".png"));
	switch (type) {
	case ENTITY:
		renderBlock(0.0F, 1.0F, 0.0F);
		break;
	case EQUIPPED:
		renderBlock(0.5F, 1.5F, 0.5F);
		break;
	case EQUIPPED_FIRST_PERSON:
		renderBlock(0.5F, 1.0F, 0.5F);
		break;
	case INVENTORY:
		renderInventory(1.0F, 1.0F, 1.0F);
		break;
	default:
		break;
	}
}
 
Example #15
Source File: GuiButtonSpecial.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void drawButton(Minecraft mc, int x, int y){
    if(thisVisible) super.drawButton(mc, x, y);

    if(visible) {
        if(renderedStacks != null) {
            int middleX = xPosition + width / 2;
            int startX = middleX - renderedStacks.length * 9 + 1;
            GL11.glEnable(GL12.GL_RESCALE_NORMAL);
            RenderHelper.enableGUIStandardItemLighting();
            for(int i = 0; i < renderedStacks.length; i++) {
                itemRenderer.renderItemAndEffectIntoGUI(FMLClientHandler.instance().getClient().fontRenderer, FMLClientHandler.instance().getClient().renderEngine, renderedStacks[i], startX + i * 18, yPosition + 2);
            }
            RenderHelper.disableStandardItemLighting();
            GL11.glDisable(GL12.GL_RESCALE_NORMAL);
        }
        if(resLoc != null) {
            mc.getTextureManager().bindTexture(resLoc);
            func_146110_a(xPosition + width / 2 - 8, yPosition + 2, 0, 0, 16, 16, 16, 16);
        }
        if(enabled && !thisVisible && x >= xPosition && y >= yPosition && x < xPosition + width && y < yPosition + height) {
            Gui.drawRect(xPosition, yPosition, xPosition + width, yPosition + height, invisibleHoverColor);
        }
    }
}
 
Example #16
Source File: TubeModule.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
public void renderDynamic(double x, double y, double z, float partialTicks, int renderPass, boolean itemRender){
    if(renderPass == 0) {
        GL11.glPushMatrix(); // start
        // GL11.glDisable(GL11.GL_TEXTURE_2D);
        // GL11.glEnable(GL11.GL_BLEND);
        // GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

        // GL11.glColor4f(0.82F, 0.56F, 0.09F, 1.0F);
        GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); // size
        GL11.glRotatef(0, 0.0F, 1.0F, 0.0F);

        GL11.glScalef(1.0F, -1F, -1F); // to make your block have a normal
                                       // positioning. comment out to see what
                                       // happens

        FMLClientHandler.instance().getClient().getTextureManager().bindTexture(getModel().getModelTexture(null));

        PneumaticCraftUtils.rotateMatrixByMetadata(dir.ordinal());
        renderModule();
        getModel().renderStatic(0.0625F, null);
        getModel().renderDynamic(0.0625F, null, partialTicks);
        GL11.glPopMatrix();
    }
}
 
Example #17
Source File: RenderItemAirCannon.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
private void render(float x, float y, float z, float scale){

        GL11.glPushMatrix();
        GL11.glRotatef(-90F, 1F, 0, 0);
        // GL11.glDisable(GL11.GL_LIGHTING);

        // Scale, Translate, Rotate
        GL11.glScalef(scale, scale, scale);
        GL11.glTranslatef(x, y, z);
        GL11.glRotatef(-90F, 1F, 0, 0);

        // Bind texture
        FMLClientHandler.instance().getClient().getTextureManager().bindTexture(Textures.MODEL_AIR_CANNON);

        // Render
        model.renderModel(1F / 16F, 0F, 00F, false, false);

        // GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glPopMatrix();
    }
 
Example #18
Source File: FWEntityFX.java    From NOVA-Core with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void renderParticle(Tessellator tess, float p_70539_2_, float x, float y, float z, float p_70539_6_, float p_70539_7_) {
	if (firstTick) {
		prevPosX = posX;
		prevPosY = posY;
		prevPosZ = posZ;
		prevRotationYaw = rotationYaw;
		prevRotationPitch = rotationPitch;
		setPosition(posX, posY, posZ);
		firstTick = false;
	}
	float f11 = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) p_70539_2_ - interpPosX);
	float f12 = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) p_70539_2_ - interpPosY);
	float f13 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) p_70539_2_ - interpPosZ);

	Tessellator.instance.draw();
	FWEntityRenderer.render(this, wrapped, f11, f12, f13);
	Tessellator.instance.startDrawingQuads();
	FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderUtility.particleResource);
}
 
Example #19
Source File: RenderItemPressureTube.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
private void render(float x, float y, float z, float scale, int itemDamage){
    GL11.glPushMatrix();
    // GL11.glDisable(GL11.GL_LIGHTING);
    // GL11.glDisable(GL11.GL_TEXTURE_2D);
    // GL11.glColor4f(0.82F, 0.56F, 0.09F, 1.0F);
    // Scale, Translate, Rotate
    GL11.glScalef(scale, scale, scale);
    GL11.glTranslatef(x, y, z);
    GL11.glRotatef(-90F, 1F, 0, 0);

    // Bind texture

    FMLClientHandler.instance().getClient().getTextureManager().bindTexture(advanced ? Textures.MODEL_ADVANCED_PRESSURE_TUBE : Textures.MODEL_PRESSURE_TUBE);

    // Render
    model.renderModel(1F / 16F, new boolean[]{true, true, false, false, false, false});

    // GL11.glEnable(GL11.GL_TEXTURE_2D);
    // GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glPopMatrix();
}
 
Example #20
Source File: ClientProxy.java    From NOVA-Core with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public Entity spawnParticle(net.minecraft.world.World world, Entity entity) {
	//Backward entity particle unwrapper
	if (entity instanceof BWEntityFX) {
		EntityFX entityFX = ((BWEntityFX) entity).createEntityFX();
		Vector3D position = entity.position();
		entityFX.posX = position.getX();
		entityFX.posY = position.getY();
		entityFX.posZ = position.getZ();
		FMLClientHandler.instance().getClient().effectRenderer.addEffect(entityFX);
		return EntityConverter.instance().toNova(entityFX);
	} else {
		FWEntityFX bwEntityFX = new FWEntityFX(world, entity);
		FMLClientHandler.instance().getClient().effectRenderer.addEffect(bwEntityFX);
		return bwEntityFX.wrapped;
	}
}
 
Example #21
Source File: GuiSecurityStationHacking.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
private void renderConsumables(int x, int y){
    stopWorms = 0;
    nukeViruses = 0;
    EntityPlayer player = FMLClientHandler.instance().getClient().thePlayer;
    for(ItemStack stack : player.inventory.mainInventory) {
        if(stack != null) {
            if(stack.getItem() == Itemss.stopWorm) stopWorms += stack.stackSize;
            if(stack.getItem() == Itemss.nukeVirus) nukeViruses += stack.stackSize;
        }
    }
    GuiUtils.drawItemStack(nukeVirus, 155, 30);
    GuiUtils.drawItemStack(stopWorm, 155, 55);
    fontRendererObj.drawString(PneumaticCraftUtils.convertAmountToString(nukeViruses), 155, 45, 0xFFFFFFFF);
    fontRendererObj.drawString(PneumaticCraftUtils.convertAmountToString(stopWorms), 155, 70, 0xFFFFFFFF);

}
 
Example #22
Source File: RenderItemPneumaticCilinder.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
private void render(float x, float y, float z, float scale){

        GL11.glPushMatrix();
        GL11.glRotatef(-90F, 1F, 0, 0);
        // GL11.glDisable(GL11.GL_LIGHTING);

        // Scale, Translate, Rotate
        GL11.glScalef(scale, scale, scale);
        GL11.glTranslatef(x, y, z);
        GL11.glRotatef(-90F, 1F, 0, 0);

        // Bind texture
        FMLClientHandler.instance().getClient().getTextureManager().bindTexture(Textures.MODEL_PNEUMATIC_CILINDER);

        // Render
        model.renderModel(1F / 16F);

        // GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glPopMatrix();
    }
 
Example #23
Source File: CapeHandler.java    From HexxitGear with GNU General Public License v3.0 6 votes vote down vote up
public static void readJoinUpdate(DataInputStream data) {
    try {
        capes = new HashMap<String, String>();

        int count = data.readByte();

        String playerName, capeUrl;
        for (int i = 0; i < count; i++) {
            playerName = data.readUTF();
            capeUrl = data.readUTF();
            capes.put(playerName, capeUrl);
            EntityPlayer player = HexxitGear.proxy.findPlayer(playerName);
            if (player != null) {
                player.cloakUrl = capes.get(playerName);
                FMLClientHandler.instance().getClient().renderEngine.obtainImageData(player.cloakUrl, null);
            }
        }
    } catch (IOException e) {
        e.printStackTrace();
    }

}
 
Example #24
Source File: GuiProgWidgetCoordinate.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void actionPerformed(GuiButton button){
    if(button.id == 0) {
        invSearchGui = new GuiInventorySearcher(FMLClientHandler.instance().getClient().thePlayer);
        ChunkPosition area = widget.getRawCoordinate();
        ItemStack gps = new ItemStack(Itemss.GPSTool);
        ItemGPSTool.setGPSLocation(gps, area.chunkPosX, area.chunkPosY, area.chunkPosZ);
        invSearchGui.setSearchStack(ItemGPSTool.getGPSLocation(gps) != null ? gps : null);
        FMLClientHandler.instance().showGuiScreen(invSearchGui);
    }
    super.actionPerformed(button);
}
 
Example #25
Source File: IGWMod.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@SubscribeEvent
public void notifyOutdatedIGW(TickEvent.PlayerTickEvent event){
    if(event.player.worldObj.isRemote && event.player == FMLClientHandler.instance().getClientPlayerEntity()) {
        event.player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.RED + "You are running an outdated version of IGW-Mod which will not work properly with PneumaticCraft!:( Please update!"));
        FMLCommonHandler.instance().bus().unregister(this);
    }
}
 
Example #26
Source File: GuiProgrammer.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
public GuiProgrammer(InventoryPlayer player, TileEntityProgrammer te){

        super(new ContainerProgrammer(player, te), te, Textures.GUI_PROGRAMMER);
        ySize = 256;
        xSize = 350;

        this.player = FMLClientHandler.instance().getClient().thePlayer;
    }
 
Example #27
Source File: NetworkConnectionAIHandler.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onSlotHack(int slot, boolean nuked){
    if(!simulating && station.getStackInSlot(slot) != null && station.getStackInSlot(slot).getItemDamage() == ItemNetworkComponents.NETWORK_IO_PORT) {
        FMLClientHandler.instance().getClient().thePlayer.closeScreen();
        FMLClientHandler.instance().getClient().thePlayer.addChatComponentMessage(new ChatComponentTranslation(EnumChatFormatting.RED + "Hacking unsuccessful! The Diagnostic Subroutine traced to your location!"));
        if(gui instanceof GuiSecurityStationHacking) ((GuiSecurityStationHacking)gui).removeUpdatesOnConnectionHandlers();
    }
}
 
Example #28
Source File: TerminalManagerClient.java    From OpenPeripheral-Addons with MIT License 5 votes vote down vote up
@SubscribeEvent
public void onDragParamsSet(GlassesSetDragParamsEvent evt) {
	GuiScreen gui = FMLClientHandler.instance().getClient().currentScreen;

	if (gui instanceof GuiCapture) {
		final GuiCapture capture = (GuiCapture)gui;
		long guid = capture.getGuid();
		if (guid == evt.guid) capture.setDragParameters(evt.threshold, evt.period);
	}
}
 
Example #29
Source File: ItemPneumaticArmor.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@SideOnly(Side.CLIENT)
public static RenderCoordWireframe getCoordTrackLocation(ItemStack helmetStack){
    if(helmetStack == null || !NBTUtil.hasTag(helmetStack, "CoordTracker")) return null;
    NBTTagCompound tag = NBTUtil.getCompoundTag(helmetStack, "CoordTracker");
    if(tag.getInteger("y") == -1 || FMLClientHandler.instance().getClient().theWorld.provider.dimensionId != tag.getInteger("dimID")) return null;
    return new RenderCoordWireframe(FMLClientHandler.instance().getClient().theWorld, tag.getInteger("x"), tag.getInteger("y"), tag.getInteger("z"));
}
 
Example #30
Source File: EventHandlerPneumaticCraft.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@SideOnly(Side.CLIENT)
private void warnPlayerIfNecessary(LivingSetAttackTargetEvent event){
    EntityPlayer player = FMLClientHandler.instance().getClient().thePlayer;
    if(event.target == player && (event.entityLiving instanceof EntityGolem || event.entityLiving instanceof EntityMob)) {
        ItemStack helmetStack = player.getCurrentArmor(3);
        if(helmetStack != null && helmetStack.getItem() == Itemss.pneumaticHelmet && ((IPressurizable)helmetStack.getItem()).getPressure(helmetStack) > 0 && ItemPneumaticArmor.getUpgrades(ItemMachineUpgrade.UPGRADE_ENTITY_TRACKER, helmetStack) > 0 && GuiKeybindCheckBox.trackedCheckboxes.get("pneumaticHelmet.upgrade.coreComponents").checked && GuiKeybindCheckBox.trackedCheckboxes.get("pneumaticHelmet.upgrade." + EntityTrackUpgradeHandler.UPGRADE_NAME).checked) {
            HUDHandler.instance().getSpecificRenderer(EntityTrackUpgradeHandler.class).warnIfNecessary(event.entityLiving);
        }
    } else {
        HUDHandler.instance().getSpecificRenderer(EntityTrackUpgradeHandler.class).removeTargetingEntity(event.entityLiving);
    }
}