Java 类net.minecraft.entity.IEntityMultiPart 实例源码

项目:Uranium    文件:CauldronHooks.java   
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;
}
项目:DecompiledMinecraft    文件:EntityDragonPart.java   
public EntityDragonPart(IEntityMultiPart parent, String partName, float base, float sizeHeight)
{
    super(parent.getWorld());
    this.setSize(base, sizeHeight);
    this.entityDragonObj = parent;
    this.partName = partName;
}
项目:DecompiledMinecraft    文件:EntityDragonPart.java   
public EntityDragonPart(IEntityMultiPart parent, String partName, float base, float sizeHeight)
{
    super(parent.getWorld());
    this.setSize(base, sizeHeight);
    this.entityDragonObj = parent;
    this.partName = partName;
}
项目:BaseClient    文件:EntityDragonPart.java   
public EntityDragonPart(IEntityMultiPart parent, String partName, float base, float sizeHeight)
{
    super(parent.getWorld());
    this.setSize(base, sizeHeight);
    this.entityDragonObj = parent;
    this.partName = partName;
}
项目:BaseClient    文件:EntityDragonPart.java   
public EntityDragonPart(IEntityMultiPart parent, String partName, float base, float sizeHeight)
{
    super(parent.getWorld());
    this.setSize(base, sizeHeight);
    this.entityDragonObj = parent;
    this.partName = partName;
}
项目:Backmemed    文件:EntityDragonPart.java   
public EntityDragonPart(IEntityMultiPart parent, String partName, float base, float sizeHeight)
{
    super(parent.getWorld());
    this.setSize(base, sizeHeight);
    this.entityDragonObj = parent;
    this.partName = partName;
}
项目:CustomWorldGen    文件:EntityDragonPart.java   
public EntityDragonPart(IEntityMultiPart parent, String partName, float base, float sizeHeight)
{
    super(parent.getWorld());
    this.setSize(base, sizeHeight);
    this.entityDragonObj = parent;
    this.partName = partName;
}
项目:ThermosRebased    文件:CauldronHooks.java   
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;
}
项目:Thermos    文件:CauldronHooks.java   
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;
}
项目:KCauldron    文件:CauldronHooks.java   
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;
}
项目:Cauldron-Reloaded    文件:CauldronHooks.java   
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;
}
项目:FFoKC    文件:CauldronHooks.java   
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;
}
项目:Resilience-Client-Source    文件:EntityDragonPart.java   
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;
}
项目:ExpandedRailsMod    文件:EntityDragonPart.java   
public EntityDragonPart(IEntityMultiPart parent, String partName, float base, float sizeHeight)
{
    super(parent.getWorld());
    this.setSize(base, sizeHeight);
    this.entityDragonObj = parent;
    this.partName = partName;
}
项目:Cauldron    文件:EntityDragonPart.java   
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_;
}
项目:Cauldron    文件:EntityDragonPart.java   
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_;
}
项目:RuneCraftery    文件:EntityDragonPart.java   
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;
}
项目:BetterNutritionMod    文件:EntityDragonPart.java   
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;
}
项目:RuneCraftery    文件:EntityDragonPart.java   
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_;
}
项目:AgeCraft-Old    文件:ItemRockTool.java   
@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;
}