本文整理汇总了Java中net.minecraft.entity.item.EntityArmorStand类的典型用法代码示例。如果您正苦于以下问题:Java EntityArmorStand类的具体用法?Java EntityArmorStand怎么用?Java EntityArmorStand使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EntityArmorStand类属于net.minecraft.entity.item包,在下文中一共展示了EntityArmorStand类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import net.minecraft.entity.item.EntityArmorStand; //导入依赖的package包/类
public boolean apply(Entity p_apply_1_)
{
if (!p_apply_1_.isEntityAlive())
{
return false;
}
else if (!(p_apply_1_ instanceof EntityLivingBase))
{
return false;
}
else
{
EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
return entitylivingbase.getEquipmentInSlot(EntityLiving.getArmorPosition(this.armor)) != null ? false : (entitylivingbase instanceof EntityLiving ? ((EntityLiving)entitylivingbase).canPickUpLoot() : (entitylivingbase instanceof EntityArmorStand ? true : entitylivingbase instanceof EntityPlayer));
}
}
示例2: apply
import net.minecraft.entity.item.EntityArmorStand; //导入依赖的package包/类
public boolean apply(@Nullable Entity p_apply_1_)
{
if (!p_apply_1_.isEntityAlive())
{
return false;
}
else if (!(p_apply_1_ instanceof EntityLivingBase))
{
return false;
}
else
{
EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
return !entitylivingbase.getItemStackFromSlot(EntityLiving.getSlotForItemStack(this.armor)).func_190926_b() ? false : (entitylivingbase instanceof EntityLiving ? ((EntityLiving)entitylivingbase).canPickUpLoot() : (entitylivingbase instanceof EntityArmorStand ? true : entitylivingbase instanceof EntityPlayer));
}
}
示例3: apply
import net.minecraft.entity.item.EntityArmorStand; //导入依赖的package包/类
public boolean apply(@Nullable Entity p_apply_1_)
{
if (!p_apply_1_.isEntityAlive())
{
return false;
}
else if (!(p_apply_1_ instanceof EntityLivingBase))
{
return false;
}
else
{
EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
return entitylivingbase.getItemStackFromSlot(EntityLiving.getSlotForItemStack(this.armor)) != null ? false : (entitylivingbase instanceof EntityLiving ? ((EntityLiving)entitylivingbase).canPickUpLoot() : (entitylivingbase instanceof EntityArmorStand ? true : entitylivingbase instanceof EntityPlayer));
}
}
示例4: render
import net.minecraft.entity.item.EntityArmorStand; //导入依赖的package包/类
@Override
public void render(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
if(entity instanceof EntityArmorStand) {
// Hack so helmets look right on armor stand
netHeadYaw = 0;
}
headOuter.showModel = slot == EntityEquipmentSlot.HEAD;
body.showModel = slot == EntityEquipmentSlot.CHEST;
armR.showModel = slot == EntityEquipmentSlot.CHEST;
armL.showModel = slot == EntityEquipmentSlot.CHEST;
skirt.showModel = slot == EntityEquipmentSlot.LEGS;
hideLeg(legR,slot);
hideLeg(legL,slot);
bipedHeadwear.showModel = false;
bipedHead = headOuter;
bipedBody = slot == EntityEquipmentSlot.LEGS ? skirt : body;
bipedRightArm = armR;
bipedLeftArm = armL;
bipedRightLeg = legR;
bipedLeftLeg = legL;
super.render(entity,limbSwing,limbSwingAmount,ageInTicks,netHeadYaw,headPitch,scale);
}
示例5: handleEntityCollision
import net.minecraft.entity.item.EntityArmorStand; //导入依赖的package包/类
@Override
public boolean handleEntityCollision(World worldIn, BlockPos pos,IBlockState state, Entity entityIn) {
if(!worldIn.isRemote){
if((entityIn instanceof EntityLivingBase) && !(entityIn instanceof EntityPlayer)&&!(entityIn instanceof EntityArmorStand)){
ResourceLocation entID = EntityList.getKey(entityIn);
//check if a spawn egg exists TODO also config blacklist?
if(EntityList.ENTITY_EGGS.get(entID)!=null){
ItemStack egg = new ItemStack(Items.SPAWN_EGG);
NBTTagCompound entityTag = new NBTTagCompound();
entityTag.setString("id", entID.toString());
egg.setTagInfo("EntityTag", entityTag);
Utils.spawnItemCentered(worldIn, pos, egg);
this.onPatternBroken();//kill the rune
entityIn.setDead();//kill the entity
}else{
worldIn.getClosestPlayer(pos.getX(),pos.getY(),pos.getZ(), 16, false).sendMessage(new TextComponentTranslation(NO_SPAWN_EGG));
}
}
}
return true;
}
示例6: acceptStack
import net.minecraft.entity.item.EntityArmorStand; //导入依赖的package包/类
/**
* Checks whether the given entity accepts an item for a certain slot
*
* @param entity the entity
* @param slot the slot to check
* @param stack the item to check
* @return whether the entity accepts that item for the slot
*/
private static boolean acceptStack(Entity entity, EntityEquipmentSlot slot, ItemStack stack) {
if (entity instanceof EntityArmorStand || entity instanceof EntityLiving) {
if (stack != ItemStack.EMPTY && !EntityLiving.isItemStackInSlot(slot, stack) && slot != EntityEquipmentSlot.HEAD) return false;
else return true;
}
else if (entity instanceof EntityPlayer) {
if (slot.getSlotType() == EntityEquipmentSlot.Type.ARMOR && stack != ItemStack.EMPTY && stack.getItem() != null) {
if (!(stack.getItem() instanceof ItemArmor) && !(stack.getItem() instanceof ItemElytra)) {
if (slot != EntityEquipmentSlot.HEAD) return false;
else return true;
}
else if (EntityLiving.getSlotForItemStack(stack) != slot) return false;
else return true;
}
else return true;
}
else return true;
}
示例7: onEntityInteractSpecific
import net.minecraft.entity.item.EntityArmorStand; //导入依赖的package包/类
@SubscribeEvent
public void onEntityInteractSpecific(PlayerInteractEvent.EntityInteractSpecific event) {
if (armorStandSwap) {
//added for https://www.twitch.tv/darkphan
if (event.getWorld().isRemote) {
return;
} //server side only
if (event.getTarget() == null || event.getTarget() instanceof EntityArmorStand == false) {
return;
}
EntityArmorStand entityStand = (EntityArmorStand) event.getTarget();
EntityPlayer player = event.getEntityPlayer();
if (player.isSneaking() == false) {
return;
} //bc when not sneaking, we do the normal single item version
event.setCanceled(true);//which means we need to now cancel that normal version and do our own
for (EntityEquipmentSlot slot : armorStandEquipment) {
ItemStack itemPlayer = player.getItemStackFromSlot(slot);
ItemStack itemArmorstand = entityStand.getItemStackFromSlot(slot);
player.setItemStackToSlot(slot, itemArmorstand);
entityStand.setItemStackToSlot(slot, itemPlayer);
}
}
}
示例8: render
import net.minecraft.entity.item.EntityArmorStand; //导入依赖的package包/类
@Override
public void render (Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float partialTicks) {
this.addModelParts();
GlStateManager.pushMatrix();
// Fix for armor stands being annoying
if (entity instanceof EntityArmorStand) {
netHeadYaw = 0;
GlStateManager.translate(0F, 0.15F, 0F);
}
this.syncModel(entity, partialTicks);
super.render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, partialTicks);
GlStateManager.popMatrix();
}
示例9: setRotationAngles
import net.minecraft.entity.item.EntityArmorStand; //导入依赖的package包/类
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity entityIn)
{
super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, entityIn);
if (entityIn instanceof EntityArmorStand)
{
EntityArmorStand entityarmorstand = (EntityArmorStand)entityIn;
this.bipedLeftArm.showModel = entityarmorstand.getShowArms();
this.bipedRightArm.showModel = entityarmorstand.getShowArms();
this.standBase.showModel = !entityarmorstand.hasNoBasePlate();
this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F, 0.0F);
this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F, 0.0F);
this.standRightSide.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX();
this.standRightSide.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY();
this.standRightSide.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ();
this.standLeftSide.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX();
this.standLeftSide.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY();
this.standLeftSide.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ();
this.standWaist.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX();
this.standWaist.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY();
this.standWaist.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ();
float f = (entityarmorstand.getLeftLegRotation().getX() + entityarmorstand.getRightLegRotation().getX()) / 2.0F;
float f1 = (entityarmorstand.getLeftLegRotation().getY() + entityarmorstand.getRightLegRotation().getY()) / 2.0F;
float f2 = (entityarmorstand.getLeftLegRotation().getZ() + entityarmorstand.getRightLegRotation().getZ()) / 2.0F;
this.standBase.rotateAngleX = 0.0F;
this.standBase.rotateAngleY = 0.017453292F * -entityIn.rotationYaw;
this.standBase.rotateAngleZ = 0.0F;
}
}
示例10: setRotationAngles
import net.minecraft.entity.item.EntityArmorStand; //导入依赖的package包/类
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity entityIn)
{
if (entityIn instanceof EntityArmorStand)
{
EntityArmorStand entityarmorstand = (EntityArmorStand)entityIn;
this.bipedHead.rotateAngleX = 0.017453292F * entityarmorstand.getHeadRotation().getX();
this.bipedHead.rotateAngleY = 0.017453292F * entityarmorstand.getHeadRotation().getY();
this.bipedHead.rotateAngleZ = 0.017453292F * entityarmorstand.getHeadRotation().getZ();
this.bipedHead.setRotationPoint(0.0F, 1.0F, 0.0F);
this.bipedBody.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX();
this.bipedBody.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY();
this.bipedBody.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ();
this.bipedLeftArm.rotateAngleX = 0.017453292F * entityarmorstand.getLeftArmRotation().getX();
this.bipedLeftArm.rotateAngleY = 0.017453292F * entityarmorstand.getLeftArmRotation().getY();
this.bipedLeftArm.rotateAngleZ = 0.017453292F * entityarmorstand.getLeftArmRotation().getZ();
this.bipedRightArm.rotateAngleX = 0.017453292F * entityarmorstand.getRightArmRotation().getX();
this.bipedRightArm.rotateAngleY = 0.017453292F * entityarmorstand.getRightArmRotation().getY();
this.bipedRightArm.rotateAngleZ = 0.017453292F * entityarmorstand.getRightArmRotation().getZ();
this.bipedLeftLeg.rotateAngleX = 0.017453292F * entityarmorstand.getLeftLegRotation().getX();
this.bipedLeftLeg.rotateAngleY = 0.017453292F * entityarmorstand.getLeftLegRotation().getY();
this.bipedLeftLeg.rotateAngleZ = 0.017453292F * entityarmorstand.getLeftLegRotation().getZ();
this.bipedLeftLeg.setRotationPoint(1.9F, 11.0F, 0.0F);
this.bipedRightLeg.rotateAngleX = 0.017453292F * entityarmorstand.getRightLegRotation().getX();
this.bipedRightLeg.rotateAngleY = 0.017453292F * entityarmorstand.getRightLegRotation().getY();
this.bipedRightLeg.rotateAngleZ = 0.017453292F * entityarmorstand.getRightLegRotation().getZ();
this.bipedRightLeg.setRotationPoint(-1.9F, 11.0F, 0.0F);
copyModelAngles(this.bipedHead, this.bipedHeadwear);
}
}
示例11: rotateCorpse
import net.minecraft.entity.item.EntityArmorStand; //导入依赖的package包/类
protected void rotateCorpse(EntityArmorStand entityLiving, float p_77043_2_, float p_77043_3_, float partialTicks)
{
GlStateManager.rotate(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F);
float f = (float)(entityLiving.world.getTotalWorldTime() - entityLiving.punchCooldown) + partialTicks;
if (f < 5.0F)
{
GlStateManager.rotate(MathHelper.sin(f / 1.5F * (float)Math.PI) * 3.0F, 0.0F, 1.0F, 0.0F);
}
}
示例12: doRender
import net.minecraft.entity.item.EntityArmorStand; //导入依赖的package包/类
/**
* Renders the desired {@code T} type Entity.
*/
public void doRender(EntityArmorStand entity, double x, double y, double z, float entityYaw, float partialTicks)
{
if (entity.hasMarker())
{
this.renderMarker = true;
}
super.doRender(entity, x, y, z, entityYaw, partialTicks);
if (entity.hasMarker())
{
this.renderMarker = false;
}
}
示例13: setRotationAngles
import net.minecraft.entity.item.EntityArmorStand; //导入依赖的package包/类
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
if (entityIn instanceof EntityArmorStand)
{
EntityArmorStand entityarmorstand = (EntityArmorStand)entityIn;
this.bipedLeftArm.showModel = entityarmorstand.getShowArms();
this.bipedRightArm.showModel = entityarmorstand.getShowArms();
this.standBase.showModel = !entityarmorstand.hasNoBasePlate();
this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F, 0.0F);
this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F, 0.0F);
this.standRightSide.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX();
this.standRightSide.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY();
this.standRightSide.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ();
this.standLeftSide.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX();
this.standLeftSide.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY();
this.standLeftSide.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ();
this.standWaist.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX();
this.standWaist.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY();
this.standWaist.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ();
this.standBase.rotateAngleX = 0.0F;
this.standBase.rotateAngleY = 0.017453292F * -entityIn.rotationYaw;
this.standBase.rotateAngleZ = 0.0F;
}
}
示例14: setRotationAngles
import net.minecraft.entity.item.EntityArmorStand; //导入依赖的package包/类
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
if (entityIn instanceof EntityArmorStand)
{
EntityArmorStand entityarmorstand = (EntityArmorStand)entityIn;
this.bipedHead.rotateAngleX = 0.017453292F * entityarmorstand.getHeadRotation().getX();
this.bipedHead.rotateAngleY = 0.017453292F * entityarmorstand.getHeadRotation().getY();
this.bipedHead.rotateAngleZ = 0.017453292F * entityarmorstand.getHeadRotation().getZ();
this.bipedHead.setRotationPoint(0.0F, 1.0F, 0.0F);
this.bipedBody.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX();
this.bipedBody.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY();
this.bipedBody.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ();
this.bipedLeftArm.rotateAngleX = 0.017453292F * entityarmorstand.getLeftArmRotation().getX();
this.bipedLeftArm.rotateAngleY = 0.017453292F * entityarmorstand.getLeftArmRotation().getY();
this.bipedLeftArm.rotateAngleZ = 0.017453292F * entityarmorstand.getLeftArmRotation().getZ();
this.bipedRightArm.rotateAngleX = 0.017453292F * entityarmorstand.getRightArmRotation().getX();
this.bipedRightArm.rotateAngleY = 0.017453292F * entityarmorstand.getRightArmRotation().getY();
this.bipedRightArm.rotateAngleZ = 0.017453292F * entityarmorstand.getRightArmRotation().getZ();
this.bipedLeftLeg.rotateAngleX = 0.017453292F * entityarmorstand.getLeftLegRotation().getX();
this.bipedLeftLeg.rotateAngleY = 0.017453292F * entityarmorstand.getLeftLegRotation().getY();
this.bipedLeftLeg.rotateAngleZ = 0.017453292F * entityarmorstand.getLeftLegRotation().getZ();
this.bipedLeftLeg.setRotationPoint(1.9F, 11.0F, 0.0F);
this.bipedRightLeg.rotateAngleX = 0.017453292F * entityarmorstand.getRightLegRotation().getX();
this.bipedRightLeg.rotateAngleY = 0.017453292F * entityarmorstand.getRightLegRotation().getY();
this.bipedRightLeg.rotateAngleZ = 0.017453292F * entityarmorstand.getRightLegRotation().getZ();
this.bipedRightLeg.setRotationPoint(-1.9F, 11.0F, 0.0F);
copyModelAngles(this.bipedHead, this.bipedHeadwear);
}
}
示例15: rotateCorpse
import net.minecraft.entity.item.EntityArmorStand; //导入依赖的package包/类
protected void rotateCorpse(EntityArmorStand entityLiving, float p_77043_2_, float p_77043_3_, float partialTicks)
{
GlStateManager.rotate(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F);
float f = (float)(entityLiving.worldObj.getTotalWorldTime() - entityLiving.punchCooldown) + partialTicks;
if (f < 5.0F)
{
GlStateManager.rotate(MathHelper.sin(f / 1.5F * (float)Math.PI) * 3.0F, 0.0F, 1.0F, 0.0F);
}
}