當前位置: 首頁>>代碼示例>>Java>>正文


Java EnumAction.BOW屬性代碼示例

本文整理匯總了Java中net.minecraft.item.EnumAction.BOW屬性的典型用法代碼示例。如果您正苦於以下問題:Java EnumAction.BOW屬性的具體用法?Java EnumAction.BOW怎麽用?Java EnumAction.BOW使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在net.minecraft.item.EnumAction的用法示例。


在下文中一共展示了EnumAction.BOW屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getItemUseAction

@Override
public EnumAction getItemUseAction(ItemStack stack) {
	switch (getSpell(stack).getCastingType()) {
	case INSTANT:
		return EnumAction.NONE;
	case MELEE:
		return EnumAction.NONE;
	case CONTINUOUS:
		return EnumAction.BOW;
	case CHARGED:
		return EnumAction.BOW;
	}
	return EnumAction.NONE;
}
 
開發者ID:the-realest-stu,項目名稱:Infernum,代碼行數:14,代碼來源:ItemSpellPage.java

示例2: getItemUseAction

@Nonnull
@Override
public EnumAction getItemUseAction(ItemStack stack) {
	boolean anyNotContinuous = false;
	for (Module module : SpellUtils.getModules(stack))
		if (!(module instanceof IContinuousModule && module.getChargeupTime() <= 0)) {
			anyNotContinuous = true;
			break;
		}
	return anyNotContinuous ? EnumAction.NONE : EnumAction.BOW;
}
 
開發者ID:TeamWizardry,項目名稱:Wizardry,代碼行數:11,代碼來源:ItemStaff.java

示例3: onItemRightClick

@Nonnull
@Override
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, @Nonnull EnumHand hand) {
	ItemStack stack = player.getHeldItem(hand);
	if (getItemUseAction(stack) == EnumAction.BOW) {
		if (world.isRemote && (Minecraft.getMinecraft().currentScreen != null)) {
			return new ActionResult<>(EnumActionResult.FAIL, stack);
		} else {
			player.setActiveHand(hand);
			return new ActionResult<>(EnumActionResult.PASS, stack);
		}
	} else return new ActionResult<>(EnumActionResult.FAIL, stack);
}
 
開發者ID:TeamWizardry,項目名稱:Wizardry,代碼行數:13,代碼來源:ItemSyringe.java

示例4: getItemUseAction

@Override
public EnumAction getItemUseAction(ItemStack stack) {
	return EnumAction.BOW;
}
 
開發者ID:PorPit,項目名稱:MineCamera,代碼行數:4,代碼來源:ItemCamera.java

示例5: getItemUseAction

@Override
public EnumAction getItemUseAction(ItemStack par1ItemStack)
{
    return EnumAction.BOW;
}
 
開發者ID:iChun,項目名稱:Torched,代碼行數:5,代碼來源:ItemTorchGun.java

示例6: getItemUseAction

@Override
public EnumAction getItemUseAction(ItemStack stack)
{
	return EnumAction.BOW;
}
 
開發者ID:TeamMelodium,項目名稱:Melodium,代碼行數:5,代碼來源:ItemTempSpellCaster.java

示例7: setModelVisibilities

private void setModelVisibilities(AbstractClientPlayer clientPlayer)
{
    ModelPlayer modelplayer = this.getMainModel();

    if (clientPlayer.isSpectator())
    {
        modelplayer.setInvisible(false);
        modelplayer.bipedHead.showModel = true;
        modelplayer.bipedHeadwear.showModel = true;
    }
    else
    {
        ItemStack itemstack = clientPlayer.inventory.getCurrentItem();
        modelplayer.setInvisible(true);
        modelplayer.bipedHeadwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.HAT);
        modelplayer.bipedBodyWear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.JACKET);
        modelplayer.bipedLeftLegwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.LEFT_PANTS_LEG);
        modelplayer.bipedRightLegwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.RIGHT_PANTS_LEG);
        modelplayer.bipedLeftArmwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.LEFT_SLEEVE);
        modelplayer.bipedRightArmwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.RIGHT_SLEEVE);
        modelplayer.heldItemLeft = 0;
        modelplayer.aimedBow = false;
        modelplayer.isSneak = clientPlayer.isSneaking();

        if (itemstack == null)
        {
            modelplayer.heldItemRight = 0;
        }
        else
        {
            modelplayer.heldItemRight = 1;

            if (clientPlayer.getItemInUseCount() > 0)
            {
                EnumAction enumaction = itemstack.getItemUseAction();

                if (enumaction == EnumAction.BLOCK)
                {
                    modelplayer.heldItemRight = 3;
                }
                else if (enumaction == EnumAction.BOW)
                {
                    modelplayer.aimedBow = true;
                }
            }
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:48,代碼來源:RenderPlayer.java

示例8: getItemUseAction

/**
 * returns the action that specifies what animation to play when the items is being used
 */
public EnumAction getItemUseAction(ItemStack itemstack)
{
    return EnumAction.BOW;
}
 
開發者ID:TwilightWingsStudio,項目名稱:CompositeGear,代碼行數:7,代碼來源:ItemCGBow.java

示例9: setModelVisibilities

private void setModelVisibilities(AbstractClientPlayer clientPlayer)
{
    ModelPlayer modelplayer = this.getMainModel();

    if (clientPlayer.isSpectator())
    {
        modelplayer.setInvisible(false);
        modelplayer.bipedHead.showModel = true;
        modelplayer.bipedHeadwear.showModel = true;
    }
    else
    {
        ItemStack itemstack = clientPlayer.getHeldItemMainhand();
        ItemStack itemstack1 = clientPlayer.getHeldItemOffhand();
        modelplayer.setInvisible(true);
        modelplayer.bipedHeadwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.HAT);
        modelplayer.bipedBodyWear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.JACKET);
        modelplayer.bipedLeftLegwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.LEFT_PANTS_LEG);
        modelplayer.bipedRightLegwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.RIGHT_PANTS_LEG);
        modelplayer.bipedLeftArmwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.LEFT_SLEEVE);
        modelplayer.bipedRightArmwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.RIGHT_SLEEVE);
        modelplayer.isSneak = clientPlayer.isSneaking();
        ModelBiped.ArmPose modelbiped$armpose = ModelBiped.ArmPose.EMPTY;
        ModelBiped.ArmPose modelbiped$armpose1 = ModelBiped.ArmPose.EMPTY;

        if (!itemstack.func_190926_b())
        {
            modelbiped$armpose = ModelBiped.ArmPose.ITEM;

            if (clientPlayer.getItemInUseCount() > 0)
            {
                EnumAction enumaction = itemstack.getItemUseAction();

                if (enumaction == EnumAction.BLOCK)
                {
                    modelbiped$armpose = ModelBiped.ArmPose.BLOCK;
                }
                else if (enumaction == EnumAction.BOW)
                {
                    modelbiped$armpose = ModelBiped.ArmPose.BOW_AND_ARROW;
                }
            }
        }

        if (!itemstack1.func_190926_b())
        {
            modelbiped$armpose1 = ModelBiped.ArmPose.ITEM;

            if (clientPlayer.getItemInUseCount() > 0)
            {
                EnumAction enumaction1 = itemstack1.getItemUseAction();

                if (enumaction1 == EnumAction.BLOCK)
                {
                    modelbiped$armpose1 = ModelBiped.ArmPose.BLOCK;
                }
            }
        }

        if (clientPlayer.getPrimaryHand() == EnumHandSide.RIGHT)
        {
            modelplayer.rightArmPose = modelbiped$armpose;
            modelplayer.leftArmPose = modelbiped$armpose1;
        }
        else
        {
            modelplayer.rightArmPose = modelbiped$armpose1;
            modelplayer.leftArmPose = modelbiped$armpose;
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:71,代碼來源:RenderPlayer.java

示例10: getItemUseAction

/**
 * returns the action that specifies what animation to play when the items
 * is being used
 */
@Override
public EnumAction getItemUseAction(ItemStack par1ItemStack) {
	return EnumAction.BOW;
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:8,代碼來源:TNTCannon.java

示例11: setModelVisibilities

private void setModelVisibilities(AbstractClientPlayer clientPlayer)
{
    ModelPlayer modelplayer = this.getMainModel();

    if (clientPlayer.isSpectator())
    {
        modelplayer.setInvisible(false);
        modelplayer.bipedHead.showModel = true;
        modelplayer.bipedHeadwear.showModel = true;
    }
    else
    {
        ItemStack itemstack = clientPlayer.getHeldItemMainhand();
        ItemStack itemstack1 = clientPlayer.getHeldItemOffhand();
        modelplayer.setInvisible(true);
        modelplayer.bipedHeadwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.HAT);
        modelplayer.bipedBodyWear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.JACKET);
        modelplayer.bipedLeftLegwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.LEFT_PANTS_LEG);
        modelplayer.bipedRightLegwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.RIGHT_PANTS_LEG);
        modelplayer.bipedLeftArmwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.LEFT_SLEEVE);
        modelplayer.bipedRightArmwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.RIGHT_SLEEVE);
        modelplayer.isSneak = clientPlayer.isSneaking();
        ModelBiped.ArmPose modelbiped$armpose = ModelBiped.ArmPose.EMPTY;
        ModelBiped.ArmPose modelbiped$armpose1 = ModelBiped.ArmPose.EMPTY;

        if (itemstack != null)
        {
            modelbiped$armpose = ModelBiped.ArmPose.ITEM;

            if (clientPlayer.getItemInUseCount() > 0)
            {
                EnumAction enumaction = itemstack.getItemUseAction();

                if (enumaction == EnumAction.BLOCK)
                {
                    modelbiped$armpose = ModelBiped.ArmPose.BLOCK;
                }
                else if (enumaction == EnumAction.BOW)
                {
                    modelbiped$armpose = ModelBiped.ArmPose.BOW_AND_ARROW;
                }
            }
        }

        if (itemstack1 != null)
        {
            modelbiped$armpose1 = ModelBiped.ArmPose.ITEM;

            if (clientPlayer.getItemInUseCount() > 0)
            {
                EnumAction enumaction1 = itemstack1.getItemUseAction();

                if (enumaction1 == EnumAction.BLOCK)
                {
                    modelbiped$armpose1 = ModelBiped.ArmPose.BLOCK;
                }
                // FORGE: fix MC-88356 allow offhand to use bow and arrow animation
                else if (enumaction1 == EnumAction.BOW)
                {
                    modelbiped$armpose1 = ModelBiped.ArmPose.BOW_AND_ARROW;
                }
            }
        }

        if (clientPlayer.getPrimaryHand() == EnumHandSide.RIGHT)
        {
            modelplayer.rightArmPose = modelbiped$armpose;
            modelplayer.leftArmPose = modelbiped$armpose1;
        }
        else
        {
            modelplayer.rightArmPose = modelbiped$armpose1;
            modelplayer.leftArmPose = modelbiped$armpose;
        }
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:76,代碼來源:RenderPlayer.java

示例12: getItemUseAction

@Override
public EnumAction getItemUseAction(ItemStack stack) {
    return EnumAction.BOW;
}
 
開發者ID:DaedalusGame,項目名稱:BetterWithAddons,代碼行數:4,代碼來源:ItemTanto.java

示例13: setModelVisibilities

private void setModelVisibilities(EntityMinionBase clientPlayer)
{
	ModelMinionBase modelplayer = this.getMainModel();
	ItemStack itemstack = clientPlayer.getHeldItemMainhand();
    ItemStack itemstack1 = clientPlayer.getHeldItemOffhand();
    modelplayer.setInvisible(true);
    modelplayer.bipedHeadwear.showModel = true;//clientPlayer.isWearing(EnumPlayerModelParts.HAT);
    modelplayer.bipedBodyWear.showModel = true;//clientPlayer.isWearing(EnumPlayerModelParts.JACKET);
    modelplayer.bipedLeftLegwear.showModel = true;//clientPlayer.isWearing(EnumPlayerModelParts.LEFT_PANTS_LEG);
    modelplayer.bipedRightLegwear.showModel = true;//clientPlayer.isWearing(EnumPlayerModelParts.RIGHT_PANTS_LEG);
    modelplayer.bipedLeftArmwear.showModel = true;//clientPlayer.isWearing(EnumPlayerModelParts.LEFT_SLEEVE);
    modelplayer.bipedRightArmwear.showModel = true;//clientPlayer.isWearing(EnumPlayerModelParts.RIGHT_SLEEVE);
    modelplayer.leftArmPose = ModelBiped.ArmPose.EMPTY;
    modelplayer.isSneak = clientPlayer.isSneaking();

    ModelBiped.ArmPose modelbiped$armpose = ModelBiped.ArmPose.EMPTY;
    ModelBiped.ArmPose modelbiped$armpose1 = ModelBiped.ArmPose.EMPTY;

    if (itemstack != null)
    {
        modelbiped$armpose = ModelBiped.ArmPose.ITEM;

        if (clientPlayer.getItemInUseCount() > 0)
        {
            EnumAction enumaction = itemstack.getItemUseAction();

            if (enumaction == EnumAction.BLOCK)
            {
                modelbiped$armpose = ModelBiped.ArmPose.BLOCK;
            }
            else if (enumaction == EnumAction.BOW)
            {
                modelbiped$armpose = ModelBiped.ArmPose.BOW_AND_ARROW;
            }
        }
    }

    if (itemstack1 != null)
    {
        modelbiped$armpose1 = ModelBiped.ArmPose.ITEM;

        if (clientPlayer.getItemInUseCount() > 0)
        {
            EnumAction enumaction1 = itemstack1.getItemUseAction();

            if (enumaction1 == EnumAction.BLOCK)
            {
                modelbiped$armpose1 = ModelBiped.ArmPose.BLOCK;
            }
        }
    }

    if (clientPlayer.getPrimaryHand() == EnumHandSide.RIGHT)
    {
        modelplayer.rightArmPose = modelbiped$armpose;
        modelplayer.leftArmPose = modelbiped$armpose1;
    }
    else
    {
        modelplayer.rightArmPose = modelbiped$armpose1;
        modelplayer.leftArmPose = modelbiped$armpose;
    }
}
 
開發者ID:Alec-WAM,項目名稱:CrystalMod,代碼行數:63,代碼來源:RenderMinionBase.java

示例14: getItemUseAction

@Override
public EnumAction getItemUseAction(ItemStack itemstack)
{
	return EnumAction.BOW;
}
 
開發者ID:BubbleTrouble14,項目名稱:ARKCraft,代碼行數:5,代碼來源:ItemSpear.java

示例15: getItemUseAction

@Override public EnumAction getItemUseAction(ItemStack stack) {
	return EnumAction.BOW;
}
 
開發者ID:Szewek,項目名稱:Minecraft-Flux,代碼行數:3,代碼來源:ItemUpChip.java


注:本文中的net.minecraft.item.EnumAction.BOW屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。