本文整理匯總了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;
}