package com.hbm.explosion; import java.util.HashSet; import java.util.List; import com.hbm.blocks.ModBlocks; import com.hbm.util.ArmorUtil; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.passive.EntityOcelot; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.MathHelper; import net.minecraft.util.Vec3; import net.minecraft.world.World; public class ExplosionThermo { public static void freeze(World world, int x, int y, int z, int bombStartStrength) { int r = bombStartStrength * 2; int r2 = r*r; int r22 = r2/2; for (int xx = -r; xx < r; xx++) { int X = xx+x; int XX = xx*xx; for (int yy = -r; yy < r; yy++) { int Y = yy+y; int YY = XX+yy*yy; for (int zz = -r; zz < r; zz++) { int Z = zz+z; int ZZ = YY+zz*zz; if (ZZ list = world.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(x - radius, y - radius, z - radius, x + radius, y + radius, z + radius)); for(Entity e : list) { if(e.getDistance(x, y, z) <= radius) { if(!(e instanceof EntityPlayer && ArmorUtil.checkForAsbestos((EntityPlayer) e))) { if(e instanceof EntityLivingBase) ((EntityLivingBase) e).addPotionEffect(new PotionEffect(Potion.weakness.getId(), 15 * 20, 4)); e.setFire(10); } } } } }