• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RenderSpecificHandEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: renderItem

import net.minecraftforge.client.event.RenderSpecificHandEvent; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void renderItem(RenderSpecificHandEvent event) {
	Minecraft minecraft = Minecraft.getMinecraft();
	if (event.getHand() == EnumHand.MAIN_HAND) {
		if (minecraft.gameSettings.thirdPersonView != 0
				|| minecraft.player.getHeldItem(EnumHand.MAIN_HAND).func_190916_E() <= 0
				|| minecraft.player.getHeldItem(EnumHand.MAIN_HAND).getItem() != InfernumItems.KNOWLEDGE_BOOK) {
			reset();
			return;
		}
		if ((minecraft.player.getHeldItem(EnumHand.OFF_HAND).equals(ItemStack.field_190927_a))) {
			event.setCanceled(true);
			try {
				ticksOpen++;
				doRender(event.getPartialTicks(), minecraft.player.getHeldItem(event.getHand()));
			} catch (Throwable throwable) {

			}
		} else {
			reset();
		}
	}
}
 
开发者ID:the-realest-stu,项目名称:Infernum,代码行数:25,代码来源:RenderKnowledgeTome.java


示例2: onRenderHand

import net.minecraftforge.client.event.RenderSpecificHandEvent; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
  @SubscribeEvent(priority = EventPriority.HIGHEST)
  public void onRenderHand(RenderSpecificHandEvent event)
  {
Minecraft.getMinecraft();
AbstractClientPlayer abstractclientplayer = (AbstractClientPlayer) CrystalMod.proxy.getClientPlayer();
ExtendedPlayer ePlayer = ExtendedPlayerProvider.getExtendedPlayer(abstractclientplayer);
if(ePlayer !=null && ePlayer.getPlayerDisguiseUUID() !=null)
      {
	boolean flag = event.getHand() == EnumHand.MAIN_HAND;
       EnumHandSide enumhandside = flag ? abstractclientplayer.getPrimaryHand() : abstractclientplayer.getPrimaryHand().opposite();
      

       if (ItemStackTools.isNullStack(event.getItemStack()))
       {
           if (flag && !abstractclientplayer.isInvisible())
           {
           	event.setCanceled(true);
           	GlStateManager.pushMatrix();
               renderArmFirstPerson(event.getEquipProgress(), event.getSwingProgress(), enumhandside, ePlayer.isMini());
               GlStateManager.popMatrix();
           }
       }
      }
  }
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:26,代码来源:DisguiseClientHandler.java


示例3: onRenderHand

import net.minecraftforge.client.event.RenderSpecificHandEvent; //导入依赖的package包/类
@SubscribeEvent
public static void onRenderHand(RenderSpecificHandEvent ev)
{
	EntityPlayer player = Minecraft.getMinecraft().player;
	if (!player.isSneaking() && ev.getItemStack().getItem() instanceof ItemParchment)
	{

		float f = player.getSwingProgress(ev.getPartialTicks());
		float f1 = player.prevRotationPitch
				+ (player.rotationPitch - player.prevRotationPitch) * ev.getPartialTicks();

		ItemRenderer itemrenderer = Minecraft.getMinecraft().getItemRenderer();

		float prevEquipProgress = ev.getHand() == EnumHand.MAIN_HAND ? itemrenderer.prevEquippedProgressMainHand
				: itemrenderer.prevEquippedProgressOffHand;
		float equipProgress = ev.getHand() == EnumHand.MAIN_HAND ? itemrenderer.equippedProgressMainHand
				: itemrenderer.equippedProgressOffHand;
		float f5 = 1.0F - (prevEquipProgress + (equipProgress - prevEquipProgress) * ev.getPartialTicks());

		GlStateManager.pushMatrix();
		GlStateManager.pushAttrib();

		if (ev.getHand() == EnumHand.MAIN_HAND && player.getHeldItemOffhand().isEmpty())
		{
			GLHelper.renderParchmentFirstPerson(f1, f5, f, ev.getItemStack());
		} else
		{
			EnumHandSide enumhandside = ev.getHand() == EnumHand.MAIN_HAND ? player.getPrimaryHand()
					: player.getPrimaryHand().opposite();
			GLHelper.renderParchmentFirstPersonSide(f5, enumhandside, f, ev.getItemStack());
		}

		GlStateManager.popAttrib();
		GlStateManager.popMatrix();
		ev.setCanceled(true);
	}
}
 
开发者ID:raphydaphy,项目名称:ArcaneMagic,代码行数:38,代码来源:ClientEvents.java


示例4: renderSpecificHand

import net.minecraftforge.client.event.RenderSpecificHandEvent; //导入依赖的package包/类
@SubscribeEvent
public void renderSpecificHand(RenderSpecificHandEvent event) {
	EntityPlayer player=Minecraft.getMinecraft().player;
	if((event.getItemStack().getItem() instanceof ItemCloak && !WeaponsCapability.get(player).isFeign() 
			&& ((ItemCloak)event.getItemStack().getItem()).isFeignDeath(event.getItemStack(), player))) {
		event.setCanceled(true);
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:9,代码来源:TF2EventsClient.java


示例5: onRenderSpecificHand

import net.minecraftforge.client.event.RenderSpecificHandEvent; //导入依赖的package包/类
public static void onRenderSpecificHand(RenderSpecificHandEvent event)
{
    if(event.getHand() == EnumHand.MAIN_HAND && event.getItemStack().isEmpty())
    {
        ItemStack is = Minecraft.getMinecraft().player.getHeldItem(EnumHand.OFF_HAND);
        if(!is.isEmpty() && ItemHandler.isItemDualHanded(is))
        {
            event.setCanceled(true);
        }
    }
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:12,代码来源:ItemRenderingHelper.java


示例6: renderSpecificFirstPersonHand

import net.minecraftforge.client.event.RenderSpecificHandEvent; //导入依赖的package包/类
public static boolean renderSpecificFirstPersonHand(EnumHand hand, float partialTicks, float interpPitch, float swingProgress, float equipProgress, ItemStack stack)
{
    return MinecraftForge.EVENT_BUS.post(new RenderSpecificHandEvent(hand, partialTicks, interpPitch, swingProgress, equipProgress, stack));
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:5,代码来源:ForgeHooksClient.java


示例7: onRenderHand

import net.minecraftforge.client.event.RenderSpecificHandEvent; //导入依赖的package包/类
@SubscribeEvent
public void onRenderHand(RenderSpecificHandEvent event)
{
	PlayerGloveRenderer.renderItemFirstPerson(Minecraft.getMinecraft().thePlayer, event.getPartialTicks(), event.getInterpolatedPitch(), event.getHand(), event.getSwingProgress(), event.getItemStack(), event.getEquipProgress());
}
 
开发者ID:Modding-Legacy,项目名称:Aether-Legacy,代码行数:6,代码来源:AetherClientEvents.java


示例8: onRenderSpecificHand

import net.minecraftforge.client.event.RenderSpecificHandEvent; //导入依赖的package包/类
@SubscribeEvent
@SideOnly(Side.CLIENT)
public static void onRenderSpecificHand(RenderSpecificHandEvent event) { 
	if (projectionState)
		AlchemyEventSystem.markEventCanceled(event);
}
 
开发者ID:NekoCaffeine,项目名称:Alchemy,代码行数:7,代码来源:SingleProjection.java


示例9: onRenderSpecificHand

import net.minecraftforge.client.event.RenderSpecificHandEvent; //导入依赖的package包/类
@SubscribeEvent
public void onRenderSpecificHand(RenderSpecificHandEvent event)
{
    ItemRenderingHelper.onRenderSpecificHand(event);
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:6,代码来源:EventHandlerClient.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java LinearLocation类代码示例发布时间:2022-05-23
下一篇:
Java OWLDataUnionOf类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap