diff --git a/MODSRC/vazkii/botania/common/item/ItemLaputaShard.java b/MODSRC/vazkii/botania/common/item/ItemLaputaShard.java index 3d9f1bd1f..72a3e298b 100644 --- a/MODSRC/vazkii/botania/common/item/ItemLaputaShard.java +++ b/MODSRC/vazkii/botania/common/item/ItemLaputaShard.java @@ -56,14 +56,15 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet } public void spawnBurst(World world, int srcx, int srcy, int srcz) { - boolean pointy=world.rand.nextDouble()<.25; - double heightscale=world.rand.nextDouble()+.5; - spawnBurst(world,srcx,srcy,srcz,pointy,heightscale); + boolean pointy = world.rand.nextDouble() < 0.25; + double heightscale = world.rand.nextDouble() + 0.5; + spawnBurst(world, srcx, srcy, srcz, pointy, heightscale); } + public void spawnBurst(World world, int srcx, int srcy, int srcz, ItemStack lens) { - boolean pointy=ItemNBTHelper.getBoolean(lens, TAG_POINTY, false); - double heightscale=ItemNBTHelper.getDouble(lens, TAG_HEIGHTSCALE, 1); - spawnBurst(world,srcx,srcy,srcz,pointy,heightscale); + boolean pointy = ItemNBTHelper.getBoolean(lens, TAG_POINTY, false); + double heightscale = ItemNBTHelper.getDouble(lens, TAG_HEIGHTSCALE, 1); + spawnBurst(world, srcx, srcy, srcz, pointy, heightscale); } public void spawnBurst(World world, int srcx, int srcy, int srcz, boolean pointy, double heightscale) { int range = 14; @@ -76,7 +77,7 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet int y = srcy - range + j; int z = srcz - range + k; - if(inRange(x, y, z, srcx, srcy, srcz,range,heightscale,pointy)) { + if(inRange(x, y, z, srcx, srcy, srcz,range, heightscale, pointy)) { Block block = world.getBlock(x, y, z); if(!block.isAir(world, x, y, z) && !block.isReplaceable(world, x, y, z) && !(block instanceof BlockFalling) && block.getBlockHardness(world, x, y, z) != -1) { int id = Block.getIdFromBlock(block); @@ -112,14 +113,12 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet } } - private boolean inRange(int x,int y,int z,int srcx, int srcy, int srcz, int range, double heightscale, boolean pointy) - { - if(y>=srcy) + private boolean inRange(int x,int y,int z,int srcx, int srcy, int srcz, int range, double heightscale, boolean pointy) { + if(y >= srcy) return MathHelper.pointDistanceSpace(x, 0, z, srcx, 0, srcz) < range; else if(!pointy) return MathHelper.pointDistanceSpace(x, y/heightscale, z, srcx, srcy/heightscale, srcz) < range; - else - return MathHelper.pointDistanceSpace(x, 0, z, srcx, 0, srcz) < range-(srcy-y)/heightscale; + else return MathHelper.pointDistanceSpace(x, 0, z, srcx, 0, srcz) < range-(srcy-y)/heightscale; } public EntityManaBurst getBurst(World world, int x, int y, int z, ItemStack stack) { @@ -169,7 +168,7 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet int z = ItemNBTHelper.getInt(lens, TAG_Z, 0); if(y != -1) - spawnBurst(entity.worldObj, x, y, z,lens); + spawnBurst(entity.worldObj, x, y, z, lens); } else if(burst.getTicksExisted() == placeTicks) { int x = net.minecraft.util.MathHelper.floor_double(entity.posX); int y = net.minecraft.util.MathHelper.floor_double(entity.posY);