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


Java EnumAction.block方法代码示例

本文整理汇总了Java中net.minecraft.item.EnumAction.block方法的典型用法代码示例。如果您正苦于以下问题:Java EnumAction.block方法的具体用法?Java EnumAction.block怎么用?Java EnumAction.block使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.item.EnumAction的用法示例。


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

示例1: doRender

import net.minecraft.item.EnumAction; //导入方法依赖的package包/类
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
 */
public void doRender(AbstractClientPlayer p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
    if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Pre(p_76986_1_, this, p_76986_9_))) return;
    GL11.glColor3f(1.0F, 1.0F, 1.0F);
    ItemStack itemstack = p_76986_1_.inventory.getCurrentItem();
    this.modelArmorChestplate.heldItemRight = this.modelArmor.heldItemRight = this.modelBipedMain.heldItemRight = itemstack != null ? 1 : 0;

    if (itemstack != null && p_76986_1_.getItemInUseCount() > 0)
    {
        EnumAction enumaction = itemstack.getItemUseAction();

        if (enumaction == EnumAction.block)
        {
            this.modelArmorChestplate.heldItemRight = this.modelArmor.heldItemRight = this.modelBipedMain.heldItemRight = 3;
        }
        else if (enumaction == EnumAction.bow)
        {
            this.modelArmorChestplate.aimedBow = this.modelArmor.aimedBow = this.modelBipedMain.aimedBow = true;
        }
    }

    this.modelArmorChestplate.isSneak = this.modelArmor.isSneak = this.modelBipedMain.isSneak = p_76986_1_.isSneaking();
    double d3 = p_76986_4_ - (double)p_76986_1_.yOffset;

    if (p_76986_1_.isSneaking() && !(p_76986_1_ instanceof EntityPlayerSP))
    {
        d3 -= 0.125D;
    }

    super.doRender((EntityLivingBase)p_76986_1_, p_76986_2_, d3, p_76986_6_, p_76986_8_, p_76986_9_);
    this.modelArmorChestplate.aimedBow = this.modelArmor.aimedBow = this.modelBipedMain.aimedBow = false;
    this.modelArmorChestplate.isSneak = this.modelArmor.isSneak = this.modelBipedMain.isSneak = false;
    this.modelArmorChestplate.heldItemRight = this.modelArmor.heldItemRight = this.modelBipedMain.heldItemRight = 0;
    net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Post(p_76986_1_, this, p_76986_9_));
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:42,代码来源:RenderPlayer.java

示例2: getItemUseAction

import net.minecraft.item.EnumAction; //导入方法依赖的package包/类
public EnumAction getItemUseAction(final ItemStack par1ItemStack) {
    return EnumAction.block;
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:4,代码来源:ItemEthericSword.java

示例3: isBlocking

import net.minecraft.item.EnumAction; //导入方法依赖的package包/类
public boolean isBlocking()
{
	return (isUsingItem()) && (this.itemInUse.getItem().getItemUseAction(this.itemInUse) == EnumAction.block);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:5,代码来源:EntityPlayer.java

示例4: getItemUseAction

import net.minecraft.item.EnumAction; //导入方法依赖的package包/类
/**
 * returns the action that specifies what animation to play when the items is being used
 */
public EnumAction getItemUseAction(ItemStack p_77661_1_)
{
    return EnumAction.block;
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:8,代码来源:ItemSnowWand.java


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