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);
}
}
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();
}
}
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);
}
}
}
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);
}
}
}
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);
}
}
}
}
Aggregations