本文整理汇总了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_));
}
示例2: getItemUseAction
import net.minecraft.item.EnumAction; //导入方法依赖的package包/类
public EnumAction getItemUseAction(final ItemStack par1ItemStack) {
return EnumAction.block;
}
示例3: isBlocking
import net.minecraft.item.EnumAction; //导入方法依赖的package包/类
public boolean isBlocking()
{
return (isUsingItem()) && (this.itemInUse.getItem().getItemUseAction(this.itemInUse) == EnumAction.block);
}
示例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;
}