Renamed directory to anticope

This commit is contained in:
stormybytes
2021-10-24 09:50:26 +07:00
parent f9753eba09
commit d8c1ad1881
110 changed files with 233 additions and 243 deletions

View File

@@ -0,0 +1,37 @@
package anticope.rejects.utils;
import meteordevelopment.meteorclient.utils.Utils;
import net.minecraft.block.BlockState;
import net.minecraft.fluid.FluidState;
import net.minecraft.util.math.BlockPos;
import java.util.Optional;
public class TntDamage {
public static int calculate(BlockPos bp) {
if (!Utils.canUpdate()) return 0;
int score = 0;
for(int j = -5; j <= 5; ++j) {
for(int k = -5; k <= 5; ++k) {
for(int l = -5; l <= 5; ++l) {
BlockPos blockPos = new BlockPos(j, k, l);
BlockState blockState = Utils.mc.world.getBlockState(blockPos);
FluidState fluidState = Utils.mc.world.getFluidState(blockPos);
float h = 2.8F;
Optional<Float> optional = blockState.isAir() && fluidState.isEmpty() ? Optional.empty() : Optional.of(Math.max(blockState.getBlock().getBlastResistance(), fluidState.getBlastResistance()));;
if (optional.isPresent()) {
h -= (optional.get() + 0.3F) * 0.3F;
}
if (h > 0.0F) {
score++;
}
}
}
}
return score;
}
}