use of net.minecraft.util.math.Box in project BleachHack by BleachDrinker420.
the class AutoBedrockBreak method dirtyPlace.
private boolean dirtyPlace(BlockPos pos, int slot, Direction dir) {
Vec3d hitPos = Vec3d.ofCenter(pos).add(dir.getOffsetX() * 0.5, dir.getOffsetY() * 0.5, dir.getOffsetZ() * 0.5);
if (mc.player.getEyePos().distanceTo(hitPos) >= 4.75 || !mc.world.getOtherEntities(null, new Box(pos)).isEmpty()) {
return false;
}
Hand hand = InventoryUtils.selectSlot(slot);
if (hand != null) {
mc.interactionManager.interactBlock(mc.player, mc.world, hand, new BlockHitResult(hitPos, dir, pos, false));
return true;
}
return false;
}
use of net.minecraft.util.math.Box in project BleachHack by BleachDrinker420.
the class HoleESP method onRender.
@BleachSubscribe
public void onRender(EventWorldRender.Post event) {
if (getSetting(1).asToggle().getState()) {
int bottomMode = getSetting(1).asToggle().getChild(0).asMode().getMode();
Direction[] excludeDirs = ArrayUtils.remove(Direction.values(), 0);
if (bottomMode == 0 || bottomMode == 2) {
int alpha = (int) (getSetting(1).asToggle().getChild(2).asSlider().getValueFloat() * 255);
holes.forEach((pos, color) -> Renderer.drawBoxFill(pos, QuadColor.single(color[0], color[1], color[2], alpha), excludeDirs));
}
if (bottomMode == 0 || bottomMode == 1) {
holes.forEach((pos, color) -> Renderer.drawBoxOutline(pos, QuadColor.single(color[0], color[1], color[2], 255), getSetting(1).asToggle().getChild(1).asSlider().getValueFloat(), excludeDirs));
}
}
if (getSetting(2).asToggle().getState()) {
int sideMode = getSetting(2).asToggle().getChild(0).asMode().getMode();
float height = getSetting(2).asToggle().getChild(3).asSlider().getValueFloat();
int alpha = (int) (getSetting(2).asToggle().getChild(2).asSlider().getValueFloat() * 255);
Direction[] excludeDirs = new Direction[] { Direction.UP, Direction.DOWN };
if (sideMode == 0 || sideMode == 1) {
CardinalDirection gradientDir = sideMode == 0 ? CardinalDirection.NORTH : CardinalDirection.SOUTH;
holes.forEach((pos, color) -> Renderer.drawBoxFill(new Box(pos, pos.add(1, 0, 1)).stretch(0, height, 0), QuadColor.gradient(color[0], color[1], color[2], alpha, color[0], color[1], color[2], 0, gradientDir), excludeDirs));
} else {
if (sideMode == 2 || sideMode == 4) {
holes.forEach((pos, color) -> Renderer.drawBoxFill(new Box(pos, pos.add(1, 0, 1)).stretch(0, height, 0), QuadColor.single(color[0], color[1], color[2], alpha), excludeDirs));
}
if (sideMode == 2 || sideMode == 3) {
holes.forEach((pos, color) -> Renderer.drawBoxOutline(new Box(pos, pos.add(1, 0, 1)).stretch(0, height, 0), QuadColor.single(color[0], color[1], color[2], 255), getSetting(2).asToggle().getChild(1).asSlider().getValueFloat(), excludeDirs));
}
}
}
}
use of net.minecraft.util.math.Box in project BleachHack by BleachDrinker420.
the class ClickTp method onWorldRender.
@BleachSubscribe
public void onWorldRender(EventWorldRender.Post event) {
if (pos != null && dir != null) {
int[] col = getSetting(4).asColor().getRGBArray();
Renderer.drawBoxBoth(new Box(pos.getX() + (dir == Direction.EAST ? 0.95 : 0), pos.getY() + (dir == Direction.UP ? 0.95 : 0), pos.getZ() + (dir == Direction.SOUTH ? 0.95 : 0), pos.getX() + (dir == Direction.WEST ? 0.05 : 1), pos.getY() + (dir == Direction.DOWN ? 0.05 : 1), pos.getZ() + (dir == Direction.NORTH ? 0.05 : 1)), QuadColor.single(col[0], col[1], col[2], 128), 2.5f);
}
}
use of net.minecraft.util.math.Box in project BleachHack by BleachDrinker420.
the class CrystalAura method canPlace.
private boolean canPlace(BlockPos basePos) {
BlockState baseState = mc.world.getBlockState(basePos);
if (baseState.getBlock() != Blocks.BEDROCK && baseState.getBlock() != Blocks.OBSIDIAN)
return false;
boolean oldPlace = getSetting(4).asToggle().getChild(1).asToggle().getState();
BlockPos placePos = basePos.up();
if (!mc.world.isAir(placePos) || (oldPlace && !mc.world.isAir(placePos.up())))
return false;
return mc.world.getOtherEntities(null, new Box(placePos, placePos.up(oldPlace ? 2 : 1))).isEmpty();
}
use of net.minecraft.util.math.Box in project bewitchment by MoriyaShiine.
the class MakeEntitiesWetRitualFunction method start.
@Override
public void start(ServerWorld world, BlockPos glyphPos, BlockPos effectivePos, Inventory inventory, boolean catFamiliar) {
int radius = catFamiliar ? 9 : 3;
world.getEntitiesByClass(Entity.class, new Box(effectivePos).expand(radius), Entity::isAlive).forEach(entity -> BWComponents.ADDITIONAL_WATER_DATA_COMPONENT.get(entity).setWetTimer(6000 * (catFamiliar ? 3 : 1)));
BWUtil.getBlockPoses(effectivePos, radius, currentPos -> world.getBlockState(currentPos).getBlock() instanceof AbstractFireBlock).forEach(foundPos -> world.setBlockState(foundPos, Blocks.AIR.getDefaultState()));
super.start(world, glyphPos, effectivePos, inventory, catFamiliar);
}
Aggregations