當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。