当前位置: 首页>>代码示例>>Java>>正文


Java IEntityMultiPart类代码示例

本文整理汇总了Java中net.minecraft.entity.IEntityMultiPart的典型用法代码示例。如果您正苦于以下问题:Java IEntityMultiPart类的具体用法?Java IEntityMultiPart怎么用?Java IEntityMultiPart使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IEntityMultiPart类属于net.minecraft.entity包,在下文中一共展示了IEntityMultiPart类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkBoundingBoxSize

import net.minecraft.entity.IEntityMultiPart; //导入依赖的package包/类
public static boolean checkBoundingBoxSize(Entity entity, AxisAlignedBB aabb)
{
    if (entity instanceof EntityLivingBase && (!(entity instanceof IBossDisplayData) || !(entity instanceof IEntityMultiPart))
            && !(entity instanceof EntityPlayer))
    {
        int logSize = MinecraftServer.cauldronConfig.largeBoundingBoxLogSize.getValue();
        if (logSize <= 0 || !MinecraftServer.cauldronConfig.checkEntityBoundingBoxes.getValue()) return false;
        int x = MathHelper.floor_double(aabb.minX);
        int x1 = MathHelper.floor_double(aabb.maxX + 1.0D);
        int y = MathHelper.floor_double(aabb.minY);
        int y1 = MathHelper.floor_double(aabb.maxY + 1.0D);
        int z = MathHelper.floor_double(aabb.minZ);
        int z1 = MathHelper.floor_double(aabb.maxZ + 1.0D);

        int size = Math.abs(x1 - x) * Math.abs(y1 - y) * Math.abs(z1 - z);
        if (size > MinecraftServer.cauldronConfig.largeBoundingBoxLogSize.getValue())
        {
            logWarning("Entity being removed for bounding box restrictions");
            logWarning("BB Size: {0} > {1} avg edge: {2}", size, logSize, aabb.getAverageEdgeLength());
            logWarning("Motion: ({0}, {1}, {2})", entity.motionX, entity.motionY, entity.motionZ);
            logWarning("Calculated bounding box: {0}", aabb);
            logWarning("Entity bounding box: {0}", entity.getBoundingBox());
            logWarning("Entity: {0}", entity);
            NBTTagCompound tag = new NBTTagCompound();
            entity.writeToNBT(tag);
            logWarning("Entity NBT: {0}", tag);
            logStack();
            entity.setDead();
            return true;
        }
    }

    return false;
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:35,代码来源:CauldronHooks.java

示例2: EntityDragonPart

import net.minecraft.entity.IEntityMultiPart; //导入依赖的package包/类
public EntityDragonPart(IEntityMultiPart parent, String partName, float base, float sizeHeight)
{
    super(parent.getWorld());
    this.setSize(base, sizeHeight);
    this.entityDragonObj = parent;
    this.partName = partName;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:8,代码来源:EntityDragonPart.java

示例3: EntityDragonPart

import net.minecraft.entity.IEntityMultiPart; //导入依赖的package包/类
public EntityDragonPart(IEntityMultiPart par1IEntityMultiPart, String par2Str, float par3, float par4)
{
    super(par1IEntityMultiPart.func_82194_d());
    this.setSize(par3, par4);
    this.entityDragonObj = par1IEntityMultiPart;
    this.field_146032_b = par2Str;
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:8,代码来源:EntityDragonPart.java

示例4: EntityDragonPart

import net.minecraft.entity.IEntityMultiPart; //导入依赖的package包/类
public EntityDragonPart(IEntityMultiPart p_i1697_1_, String p_i1697_2_, float p_i1697_3_, float p_i1697_4_)
{
    super(p_i1697_1_.func_82194_d());
    this.setSize(p_i1697_3_, p_i1697_4_);
    this.entityDragonObj = p_i1697_1_;
    this.field_146032_b = p_i1697_2_;
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:8,代码来源:EntityDragonPart.java

示例5: EntityDragonPart

import net.minecraft.entity.IEntityMultiPart; //导入依赖的package包/类
public EntityDragonPart(IEntityMultiPart par1IEntityMultiPart, String par2Str, float par3, float par4)
{
    super(par1IEntityMultiPart.func_82194_d());
    this.setSize(par3, par4);
    this.entityDragonObj = par1IEntityMultiPart;
    this.name = par2Str;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:8,代码来源:EntityDragonPart.java

示例6: EntityDragonPart

import net.minecraft.entity.IEntityMultiPart; //导入依赖的package包/类
public EntityDragonPart(IEntityMultiPart p_i1697_1_, String p_i1697_2_, float p_i1697_3_, float p_i1697_4_) {
   super(p_i1697_1_.func_82194_d());
   this.func_70105_a(p_i1697_3_, p_i1697_4_);
   this.field_70259_a = p_i1697_1_;
   this.field_70258_b = p_i1697_2_;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:7,代码来源:EntityDragonPart.java

示例7: onLeftClickEntity

import net.minecraft.entity.IEntityMultiPart; //导入依赖的package包/类
@Override
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
	if(entity.canAttackWithItem()) {
		if(!entity.hitByEntity(player)) {
			float damage = (float) getAttackDamage(stack);
			int i = 0;
			float extraDamage = 0.0F;
			if(entity instanceof EntityLivingBase) {
				extraDamage = EnchantmentHelper.getEnchantmentModifierLiving(player, (EntityLivingBase) entity);
				i += EnchantmentHelper.getKnockbackModifier(player, (EntityLivingBase) entity);
			}
			if(player.isSprinting()) {
				i++;
			}
			if(damage > 0.0F || extraDamage > 0.0F) {
				boolean criricalHit = player.fallDistance > 0.0F && !player.onGround && !player.isOnLadder() && !player.isInWater() && !player.isPotionActive(Potion.blindness) && player.ridingEntity == null && entity instanceof EntityLivingBase;
				if(criricalHit && damage > 0.0F) {
					damage *= 1.5F;
				}
				damage += extraDamage;
				boolean fire = false;
				int j = EnchantmentHelper.getFireAspectModifier(player);
				if(entity instanceof EntityLivingBase && j > 0 && !entity.isBurning()) {
					fire = true;
					entity.setFire(1);
				}
				boolean attack = entity.attackEntityFrom(DamageSource.causePlayerDamage(player), damage);
				if(attack) {
					if(i > 0) {
						entity.addVelocity((double) (-MathHelper.sin(player.rotationYaw * (float) Math.PI / 180.0F) * (float) i * 0.5F), 0.1D, (double) (MathHelper.cos(player.rotationYaw * (float) Math.PI / 180.0F) * (float) i * 0.5F));
						player.motionX *= 0.6D;
						player.motionZ *= 0.6D;
						player.setSprinting(false);
					}
					if(criricalHit) {
						player.onCriticalHit(entity);
					}
					if(extraDamage > 0.0F) {
						player.onEnchantmentCritical(entity);
					}
					if(damage >= 18.0F) {
						player.triggerAchievement(AchievementList.overkill);
					}
					player.setLastAttacker(entity);
					if(entity instanceof EntityLivingBase) {
						EnchantmentHelper.func_151384_a((EntityLivingBase) entity, player);
					}
				}

				ItemStack itemstack = player.getCurrentEquippedItem();
				Object object = entity;
				
				if(entity instanceof EntityDragonPart) {
					IEntityMultiPart entityMultipart = ((EntityDragonPart) entity).entityDragonObj;
					if(entityMultipart != null && entityMultipart instanceof EntityLivingBase) {
						object = (EntityLivingBase) entityMultipart;
					}
				}
				if(itemstack != null && object instanceof EntityLivingBase) {
					itemstack.hitEntity((EntityLivingBase) object, player);
					if(itemstack.stackSize <= 0) {
						player.destroyCurrentEquippedItem();
					}
				}
				if(entity instanceof EntityLivingBase) {
					player.addStat(StatList.damageDealtStat, Math.round(damage * 10.0F));
					if(j > 0 && attack) {
						entity.setFire(j * 4);
					} else if(fire) {
						entity.extinguish();
					}
				}
				player.addExhaustion(0.3F);
			}
		}
	}
	return true;
}
 
开发者ID:AgeCraft,项目名称:AgeCraft-Old,代码行数:79,代码来源:ItemRockTool.java


注:本文中的net.minecraft.entity.IEntityMultiPart类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。