当前位置: 首页>>代码示例>>Java>>正文


Java FMLClientHandler类代码示例

本文整理汇总了Java中cpw.mods.fml.client.FMLClientHandler的典型用法代码示例。如果您正苦于以下问题:Java FMLClientHandler类的具体用法?Java FMLClientHandler怎么用?Java FMLClientHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FMLClientHandler类属于cpw.mods.fml.client包,在下文中一共展示了FMLClientHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onPreGuiRender

import cpw.mods.fml.client.FMLClientHandler; //导入依赖的package包/类
@SubscribeEvent
public void onPreGuiRender(RenderGameOverlayEvent.Pre event)
{
    final Minecraft minecraft = FMLClientHandler.instance().getClient();
    final EntityClientPlayerMP player = minecraft.thePlayer;

    if (event.type == RenderGameOverlayEvent.ElementType.ALL)
    {
        if (player != null && player.ridingEntity != null && player.ridingEntity instanceof IIgnoreShift && ((IIgnoreShift) player.ridingEntity).shouldIgnoreShiftExit())
        {
            // Remove "Press shift to dismount" message when shift-exiting is disabled (not ideal, but the only option)
            String str = I18n.format("mount.onboard", new Object[] { GameSettings.getKeyDisplayString(minecraft.gameSettings.keyBindSneak.getKeyCode()) });
            if (minecraft.ingameGUI.recordPlaying.equals(str))
            {
                minecraft.ingameGUI.recordPlaying = "";
            }
        }
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:20,代码来源:TickHandlerClient.java

示例2: getSkyBrightness

import cpw.mods.fml.client.FMLClientHandler; //导入依赖的package包/类
public float getSkyBrightness(float par1)
{
    final float var2 = FMLClientHandler.instance().getClient().theWorld.getCelestialAngle(par1);
    float var3 = 1.0F - (MathHelper.sin(var2 * (float) Math.PI * 2.0F) * 2.0F + 0.25F);

    if (var3 < 0.0F)
    {
        var3 = 0.0F;
    }

    if (var3 > 1.0F)
    {
        var3 = 1.0F;
    }

    return var3 * var3 * 1F;
}
 
开发者ID:BlesseNtumble,项目名称:TRAPPIST-1,代码行数:18,代码来源:SkyProviderTrappistOneB.java

示例3: onScreenShotShield

import cpw.mods.fml.client.FMLClientHandler; //导入依赖的package包/类
@SubscribeEvent
public void onScreenShotShield(final @Nonnull ScreenShotShieldEvent.Post event) {
	if (Config.getConfig().notifyChat.get()) {
		final String mode = ScreenShotShieldRegistery.getListener(Config.getConfig().ssmode.get()).name();
		ChatBuilder.create("mchelishield.notification.chat.screenshot.message").useTranslation().setParams(mode).chatClient();
		ChatBuilder.create("mchelishield.notification.chat.screenshot.message.mode").useTranslation().setParams(mode).chatClient();
	}
	if (Config.getConfig().notifySound.get())
		FMLClientHandler.instance().getClient().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("mchelishield", "notification.sound"), 1.0F));
	if (Config.getConfig().notifyEffect.get())
		this.effectStrength = .75f;
	if (Config.getConfig().notifyOverlay.get()) {
		this.text = I18n.format("mchelishield.notification.overlay.screenshot.message");
		this.textStrength = 1f;
	}
}
 
开发者ID:Team-Fruit,项目名称:McHeliPrivacyShield,代码行数:17,代码来源:CoreHandler.java

示例4: onModListShield

import cpw.mods.fml.client.FMLClientHandler; //导入依赖的package包/类
@SubscribeEvent
public void onModListShield(final @Nonnull ModListShieldEvent.Post event) {
	if (Config.getConfig().notifyChat.get()) {
		final String mode = ModListShieldRegistery.getListener(Config.getConfig().mlmode.get()).name();
		ChatBuilder.create("mchelishield.notification.chat.modlist.message").useTranslation().setParams(mode).chatClient();
		ChatBuilder.create("mchelishield.notification.chat.modlist.message.mode").useTranslation().setParams(mode).chatClient();
	}
	if (Config.getConfig().notifySound.get())
		FMLClientHandler.instance().getClient().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("mchelishield", "notification.sound"), 1.0F));
	if (Config.getConfig().notifyEffect.get())
		this.effectStrength = .75f;
	if (Config.getConfig().notifyOverlay.get()) {
		this.text = I18n.format("mchelishield.notification.overlay.modlist.message");
		this.textStrength = 1f;
	}
}
 
开发者ID:Team-Fruit,项目名称:McHeliPrivacyShield,代码行数:17,代码来源:CoreHandler.java

示例5: renderTick

import cpw.mods.fml.client.FMLClientHandler; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void renderTick(TickEvent.RenderTickEvent event)
{
	Minecraft mc = FMLClientHandler.instance().getClient();
	World world = mc.theWorld;
	
	if (event.phase != TickEvent.Phase.START) {
	    if ((Minecraft.getMinecraft().renderViewEntity instanceof EntityPlayer)) {
	    	EntityPlayer player = (EntityPlayer)Minecraft.getMinecraft().renderViewEntity;

	        if ((player != null) && (mc.inGameHasFocus) && (Minecraft.isGuiEnabled())) {
	        	// If player have radiation detector on hotbar.
	        	if (isPlayerHasItemOnHotbar(player.inventory, ItemsHZDS.radiation_detector)) {
        			PlayerTracker tracker = TrackerManager.lookupTrackerFromUsername(mc.thePlayer.getCommandSenderName());
        			
        			if (tracker != null) {
        				renderRadiation(tracker);
        			}
        		}

	        }
	    }
	}
}
 
开发者ID:TwilightWingsStudio,项目名称:HazardsLib,代码行数:26,代码来源:ClientEventHandler.java

示例6: load

import cpw.mods.fml.client.FMLClientHandler; //导入依赖的package包/类
public boolean load(final IResourceManager manager, final ResourceLocation oldlocation) {
    ResourceLocation location = new ResourceLocation(this.baseIcon);
    location = this.completeResourceLocation(location);
    try {
        final int mipmapLevels = Minecraft.getMinecraft().gameSettings.mipmapLevels;
        final int anisotropicFiltering = Minecraft.getMinecraft().gameSettings.anisotropicFiltering;
        final IResource iresource = manager.getResource(location);
        final BufferedImage[] abufferedimage = new BufferedImage[1 + mipmapLevels];
        abufferedimage[0] = ImageIO.read(iresource.getInputStream());
        final AnimationMetadataSection animationmetadatasection = (AnimationMetadataSection)iresource.getMetadata("animation");
        abufferedimage[0] = this.processImage(abufferedimage[0], animationmetadatasection);
        this.loadSprite(abufferedimage, animationmetadatasection, anisotropicFiltering > 1.0f);
    }
    catch (RuntimeException runtimeexception) {
        FMLClientHandler.instance().trackBrokenTexture(location, runtimeexception.getMessage());
        return true;
    }
    catch (IOException ioexception1) {
        FMLClientHandler.instance().trackMissingTexture(location);
        return true;
    }
    return false;
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:24,代码来源:TextureDerived.java

示例7: renderCryogenicChamber

import cpw.mods.fml.client.FMLClientHandler; //导入依赖的package包/类
private void renderCryogenicChamber(ItemRenderType type, RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
{
    GL11.glPushMatrix();

    this.transform(type);

    FMLClientHandler.instance().getClient().renderEngine.bindTexture(ItemRendererMachine.chamberTexture0);
    this.model.renderPart("Main_Cylinder");

    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.1F, 0.6F, 0.5F, 0.4F);

    this.model.renderPart("Shield_Torus");

    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glPopMatrix();
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:20,代码来源:ItemRendererMachine.java

示例8: renderAludel

import cpw.mods.fml.client.FMLClientHandler; //导入依赖的package包/类
private void renderAludel(float x, float y, float z)
  {
      GL11.glPushMatrix();

      // Scale, Translate, Rotate
      GL11.glScalef(1F, 1F, 1F);
      GL11.glTranslatef(x + 1, y + 2F, z);
GL11.glRotatef(180, 0, 0, 5);

      // Bind texture
      FMLClientHandler.instance().getClient().renderEngine.bindTexture(testNothing);

      // Render
      model.render(0.0625F);

      GL11.glPopMatrix();
  }
 
开发者ID:gigabit101,项目名称:PrimitiveCraft,代码行数:18,代码来源:ItemRenderJug.java

示例9: actionPerformed

import cpw.mods.fml.client.FMLClientHandler; //导入依赖的package包/类
@Override
protected void actionPerformed(GuiButton par1GuiButton)
{
	if (!FMLClientHandler.instance().getClient().thePlayer.getGameProfile().getName().equals(this.launchController.getOwnerName()))
	{
		this.onIntruderInteraction();
		return;
	}
	
    if (par1GuiButton.enabled)
    {
        switch (par1GuiButton.id)
        {
        case 0:
            GalacticraftCore.packetPipeline.sendToServer(new PacketSimple(EnumSimplePacket.S_UPDATE_DISABLEABLE_BUTTON, new Object[] { this.launchController.xCoord, this.launchController.yCoord, this.launchController.zCoord, 0 }));
            break;
        case 6:
            GalacticraftCore.packetPipeline.sendToServer(new PacketSimple(EnumSimplePacket.S_UPDATE_DISABLEABLE_BUTTON, new Object[] { this.launchController.xCoord, this.launchController.yCoord, this.launchController.zCoord, 2 }));
        	break;
        default:
            break;
        }
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:25,代码来源:GuiLaunchController.java

示例10: onTextChanged

import cpw.mods.fml.client.FMLClientHandler; //导入依赖的package包/类
@Override
public void onTextChanged(GuiElementTextBox textBox, String newText)
{
	if (FMLClientHandler.instance().getClient().thePlayer.getGameProfile().getName().equals(this.launchController.getOwnerName()))
	{
     if (textBox.equals(this.frequency))
     {
         this.launchController.frequency = textBox.getIntegerValue();
         GalacticraftCore.packetPipeline.sendToServer(new PacketSimpleMars(EnumSimplePacketMars.S_UPDATE_ADVANCED_GUI, new Object[] { 0, this.launchController.xCoord, this.launchController.yCoord, this.launchController.zCoord, this.launchController.frequency }));
     }
     else if (textBox.equals(this.destinationFrequency))
     {
         this.launchController.destFrequency = textBox.getIntegerValue();
         GalacticraftCore.packetPipeline.sendToServer(new PacketSimpleMars(EnumSimplePacketMars.S_UPDATE_ADVANCED_GUI, new Object[] { 2, this.launchController.xCoord, this.launchController.yCoord, this.launchController.zCoord, this.launchController.destFrequency }));
     }
	}
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:18,代码来源:GuiLaunchController.java

示例11: renderMiner

import cpw.mods.fml.client.FMLClientHandler; //导入依赖的package包/类
protected void renderMiner(ItemRenderType type, RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
{
	boolean saveCullState = GL11.glIsEnabled(GL11.GL_CULL_FACE);
	GL11.glEnable(GL11.GL_CULL_FACE);
	GL11.glPushMatrix();

    this.transform(item, type);
    GL11.glScalef(0.06F, 0.06F, 0.06F);

    FMLClientHandler.instance().getClient().renderEngine.bindTexture(this.texture);
    this.modelMiner.renderAll();
    GL11.glTranslatef(1.875F, 0F, 0F);
 this.modellasergl.renderAll();
    GL11.glTranslatef(-3.75F, 0F, 0F);
 this.modellasergr.renderAll();
    GL11.glPopMatrix();
	if (!saveCullState) GL11.glDisable(GL11.GL_CULL_FACE);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:19,代码来源:ItemRendererAstroMiner.java

示例12: renderGrappleGun

import cpw.mods.fml.client.FMLClientHandler; //导入依赖的package包/类
private void renderGrappleGun(ItemRenderType type, RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
{
    if (type == ItemRenderType.INVENTORY)
    {
        GL11.glPushMatrix();
        GL11.glScalef(0.7F, 0.75F, 0.5F);
        GL11.glTranslatef(0.5F, -0.2F, -0.5F);
        OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glEnable(GL12.GL_RESCALE_NORMAL);
        RenderManager.instance.itemRenderer.renderItem(FMLClientHandler.instance().getClientPlayerEntity(), new ItemStack(Items.string, 1), 0, ItemRenderType.INVENTORY);
        GL11.glEnable(GL12.GL_RESCALE_NORMAL);
        GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glPopMatrix();
    }

    GL11.glPushMatrix();
    this.transform(type);

    FMLClientHandler.instance().getClient().renderEngine.bindTexture(ItemRendererGrappleHook.grappleTexture);
    ItemRendererGrappleHook.modelGrapple.renderAll();
    GL11.glPopMatrix();
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:26,代码来源:ItemRendererGrappleHook.java

示例13: renderBeamReceiver

import cpw.mods.fml.client.FMLClientHandler; //导入依赖的package包/类
private void renderBeamReceiver(ItemRenderType type, RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
{
    GL11.glPushMatrix();
    this.transform(type);

    GL11.glColor3f(1.0F, 1.0F, 1.0F);

    FMLClientHandler.instance().getClient().renderEngine.bindTexture(TileEntityBeamReceiverRenderer.receiverTexture);
    TileEntityBeamReceiverRenderer.receiverModel.renderPart("Main");
    TileEntityBeamReceiverRenderer.receiverModel.renderPart("Ring");

    GL11.glColor3f(0.6F, 0.3F, 0.0F);

    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_CULL_FACE);
    TileEntityBeamReceiverRenderer.receiverModel.renderPart("Receiver");
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_CULL_FACE);

    GL11.glPopMatrix();
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:22,代码来源:ItemRendererBeamReceiver.java

示例14: onDestroy

import cpw.mods.fml.client.FMLClientHandler; //导入依赖的package包/类
@Override
public void onDestroy(TileEntity callingBlock)
{
    final BlockVec3 thisBlock = new BlockVec3(this);

    this.worldObj.func_147480_a(thisBlock.x, thisBlock.y, thisBlock.z, true);

    for (int x = -1; x < 2; x++)
    {
        for (int z = -1; z < 2; z++)
        {
            if (this.worldObj.isRemote && this.worldObj.rand.nextDouble() < 0.1D)
            {
                FMLClientHandler.instance().getClient().effectRenderer.addBlockDestroyEffects(thisBlock.x + x, thisBlock.y, thisBlock.z + z, GCBlocks.landingPad, Block.getIdFromBlock(GCBlocks.landingPad) >> 12 & 255);
            }

            this.worldObj.func_147480_a(thisBlock.x + x, thisBlock.y, thisBlock.z + z, false);
        }
    }

    if (this.dockedEntity != null)
    {
        this.dockedEntity.onPadDestroyed();
        this.dockedEntity = null;
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:27,代码来源:TileEntityBuggyFueler.java

示例15: onDestroy

import cpw.mods.fml.client.FMLClientHandler; //导入依赖的package包/类
@Override
public void onDestroy(TileEntity callingBlock)
{
    final BlockVec3 thisBlock = new BlockVec3(this);

    for (int y = 1; y <= 2; y++)
    {
        for (int x = -1; x < 2; x++)
        {
            for (int z = -1; z < 2; z++)
            {
                if (this.worldObj.isRemote && this.worldObj.rand.nextDouble() < 0.1D)
                {
                    FMLClientHandler.instance().getClient().effectRenderer.addBlockDestroyEffects(thisBlock.x + (y == 2 ? x : 0), thisBlock.y + y, thisBlock.z + (y == 2 ? z : 0), GCBlocks.solarPanel, Block.getIdFromBlock(GCBlocks.solarPanel) >> 12 & 255);
                }

                this.worldObj.setBlockToAir(thisBlock.x + (y == 2 ? x : 0), thisBlock.y + y, thisBlock.z + (y == 2 ? z : 0));
            }
        }
    }

    this.worldObj.func_147480_a(thisBlock.x, thisBlock.y, thisBlock.z, true);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:24,代码来源:TileEntitySolar.java


注:本文中的cpw.mods.fml.client.FMLClientHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。