Search in sources :

Example 1 with Box

use of net.minecraft.util.math.Box in project Skyblocker by LifeIsAParadox.

the class DungeonBlaze method blazeRenderer.

public static void blazeRenderer(WorldRenderContext wrc) {
    QuadColor outlineColorRed = QuadColor.single(0.0F, 1.0F, 0.0F, 1f);
    QuadColor outlineColorGreen = QuadColor.single(1.0F, 0.0F, 0.0F, 1f);
    try {
        if (highestBlaze != null && lowestBlaze != null && highestBlaze.isAlive() && lowestBlaze.isAlive() && SkyblockerConfig.get().locations.dungeons.blazesolver) {
            /* Outline */
            if (highestBlaze.getY() < 69) {
                Box blaze = highestBlaze.getBoundingBox().expand(0.3, 0.9, 0.3).offset(0, -1.1, 0);
                RenderUtils.drawBoxOutline(blaze, outlineColorRed, 5f);
            }
            /* Outline */
            if (lowestBlaze.getY() > 69) {
                Box blaze = lowestBlaze.getBoundingBox().expand(0.3, 0.9, 0.3).offset(0, -1.1, 0);
                RenderUtils.drawBoxOutline(blaze, outlineColorRed, 5f);
            }
        }
    } catch (Exception e) {
        LOGGER.warn("[Skyblocker BlazeRenderer] " + e);
    }
}
Also used : QuadColor(me.xmrvizzy.skyblocker.utils.color.QuadColor) Box(net.minecraft.util.math.Box)

Example 2 with Box

use of net.minecraft.util.math.Box in project MCDoom by AzureDoom.

the class ArchvileEntity method updatePostDeath.

@Override
protected void updatePostDeath() {
    ++this.deathTime;
    if (!world.isClient) {
        float q = 200.0F;
        int k = MathHelper.floor(this.getX() - (double) q - 1.0D);
        int l = MathHelper.floor(this.getX() + (double) q + 1.0D);
        int t = MathHelper.floor(this.getY() - (double) q - 1.0D);
        int u = MathHelper.floor(this.getY() + (double) q + 1.0D);
        int v = MathHelper.floor(this.getZ() - (double) q - 1.0D);
        int w = MathHelper.floor(this.getZ() + (double) q + 1.0D);
        List<Entity> list = this.world.getOtherEntities(this, new Box((double) k, (double) t, (double) v, (double) l, (double) u, (double) w));
        for (int k2 = 0; k2 < list.size(); ++k2) {
            Entity entity = list.get(k2);
            if (entity.isAlive()) {
                entity.setGlowing(false);
            }
        }
    }
    if (this.deathTime == 50) {
        this.remove(Entity.RemovalReason.KILLED);
        this.dropXp();
    }
}
Also used : DoomFireEntity(mod.azure.doom.entity.projectiles.entity.DoomFireEntity) MerchantEntity(net.minecraft.entity.passive.MerchantEntity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) LivingEntity(net.minecraft.entity.LivingEntity) MobEntity(net.minecraft.entity.mob.MobEntity) Entity(net.minecraft.entity.Entity) DemonEntity(mod.azure.doom.entity.DemonEntity) Box(net.minecraft.util.math.Box)

Example 3 with Box

use of net.minecraft.util.math.Box in project MCDoom by AzureDoom.

the class TotemEntity method applyEffects.

private void applyEffects() {
    if (!this.world.isClient()) {
        Box axisalignedbb = (new Box(this.pos)).expand(40).stretch(0.0D, (double) this.world.getHeight(), 0.0D);
        List<DemonEntity> list = this.world.getNonSpectatingEntities(DemonEntity.class, axisalignedbb);
        for (DemonEntity entity : list) {
            entity.addStatusEffect(new StatusEffectInstance(StatusEffects.STRENGTH, 1000, 1));
            entity.addStatusEffect(new StatusEffectInstance(StatusEffects.SPEED, 1000, 1));
            entity.setGlowing(true);
        }
    }
}
Also used : DemonEntity(mod.azure.doom.entity.DemonEntity) StatusEffectInstance(net.minecraft.entity.effect.StatusEffectInstance) Box(net.minecraft.util.math.Box)

Example 4 with Box

use of net.minecraft.util.math.Box in project MCDoom by AzureDoom.

the class GladiatorEntity method baseTick.

@Override
public void baseTick() {
    super.baseTick();
    float q = 50.0F;
    int k = MathHelper.floor(this.getX() - (double) q - 1.0D);
    int l = MathHelper.floor(this.getX() + (double) q + 1.0D);
    int t = MathHelper.floor(this.getY() - (double) q - 1.0D);
    int u = MathHelper.floor(this.getY() + (double) q + 1.0D);
    int v = MathHelper.floor(this.getZ() - (double) q - 1.0D);
    int w = MathHelper.floor(this.getZ() + (double) q + 1.0D);
    List<Entity> list = this.world.getOtherEntities(this, new Box((double) k, (double) t, (double) v, (double) l, (double) u, (double) w));
    for (int x = 0; x < list.size(); ++x) {
        Entity entity = (Entity) list.get(x);
        if (entity instanceof GladiatorEntity && entity.age < 1) {
            entity.remove(Entity.RemovalReason.DISCARDED);
        }
    }
}
Also used : GladiatorMaceEntity(mod.azure.doom.entity.projectiles.entity.GladiatorMaceEntity) MerchantEntity(net.minecraft.entity.passive.MerchantEntity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) LivingEntity(net.minecraft.entity.LivingEntity) ProjectileEntity(net.minecraft.entity.projectile.ProjectileEntity) ServerPlayerEntity(net.minecraft.server.network.ServerPlayerEntity) HostileEntity(net.minecraft.entity.mob.HostileEntity) AreaEffectCloudEntity(net.minecraft.entity.AreaEffectCloudEntity) Entity(net.minecraft.entity.Entity) CustomFireballEntity(mod.azure.doom.entity.projectiles.CustomFireballEntity) DemonEntity(mod.azure.doom.entity.DemonEntity) Box(net.minecraft.util.math.Box)

Example 5 with Box

use of net.minecraft.util.math.Box in project MCDoom by AzureDoom.

the class IconofsinEntity method doDamage.

public void doDamage() {
    float q = 150.0F;
    int k = MathHelper.floor(this.getX() - (double) q - 1.0D);
    int l = MathHelper.floor(this.getX() + (double) q + 1.0D);
    int t = MathHelper.floor(this.getY() - (double) q - 1.0D);
    int u = MathHelper.floor(this.getY() + (double) q + 1.0D);
    int v = MathHelper.floor(this.getZ() - (double) q - 1.0D);
    int w = MathHelper.floor(this.getZ() + (double) q + 1.0D);
    List<Entity> list = this.world.getOtherEntities(this, new Box((double) k, (double) t, (double) v, (double) l, (double) u, (double) w));
    Vec3d vec3d = new Vec3d(this.getX(), this.getY(), this.getZ());
    for (int x = 0; x < list.size(); ++x) {
        Entity entity = (Entity) list.get(x);
        double y = (double) (MathHelper.sqrt((float) entity.squaredDistanceTo(vec3d)) / q);
        if (y <= 1.0D) {
            if (entity instanceof LivingEntity) {
                entity.damage(DamageSource.mobProjectile(this, this.getTarget()), 7);
            }
        }
    }
}
Also used : LivingEntity(net.minecraft.entity.LivingEntity) DoomFireEntity(mod.azure.doom.entity.projectiles.entity.DoomFireEntity) MerchantEntity(net.minecraft.entity.passive.MerchantEntity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) LivingEntity(net.minecraft.entity.LivingEntity) ServerPlayerEntity(net.minecraft.server.network.ServerPlayerEntity) Entity(net.minecraft.entity.Entity) DemonEntity(mod.azure.doom.entity.DemonEntity) Box(net.minecraft.util.math.Box) Vec3d(net.minecraft.util.math.Vec3d)

Aggregations

Box (net.minecraft.util.math.Box)133 Vec3d (net.minecraft.util.math.Vec3d)45 LivingEntity (net.minecraft.entity.LivingEntity)40 BlockPos (net.minecraft.util.math.BlockPos)39 PlayerEntity (net.minecraft.entity.player.PlayerEntity)34 Entity (net.minecraft.entity.Entity)32 Direction (net.minecraft.util.math.Direction)18 List (java.util.List)15 VoxelShape (net.minecraft.util.shape.VoxelShape)13 BlockState (net.minecraft.block.BlockState)12 Comparator (java.util.Comparator)11 PersistentProjectileEntity (net.minecraft.entity.projectile.PersistentProjectileEntity)11 World (net.minecraft.world.World)11 ArrayList (java.util.ArrayList)10 Random (java.util.Random)10 ItemStack (net.minecraft.item.ItemStack)10 BleachSubscribe (org.bleachhack.eventbus.BleachSubscribe)10 DemonEntity (mod.azure.doom.entity.DemonEntity)9 ServerPlayerEntity (net.minecraft.server.network.ServerPlayerEntity)8 BlockHitResult (net.minecraft.util.hit.BlockHitResult)8