use of me.wallhacks.spark.util.player.itemswitcher.itemswitchers.HardSolidBlockSwitchItem in project Spark-Client by Spark-Client-Development.
the class Surround method Place.
BlockInteractUtil.BlockPlaceResult Place(BlockPos x) {
ArrayList<EntityEnderCrystal> crystals = new ArrayList<EntityEnderCrystal>();
boolean isblocked = false;
List<Entity> l = mc.world.getEntitiesWithinAABBExcludingEntity(null, new AxisAlignedBB(x));
for (Entity e : l) {
if (!(e instanceof EntityItem) && !(e instanceof EntityXPOrb) && !e.isDead) {
isblocked = true;
if (e instanceof EntityEnderCrystal && (IgnoreCrystals.isOn() || BreakCrystals.isOn())) {
crystals.add((EntityEnderCrystal) e);
} else
return BlockInteractUtil.BlockPlaceResult.FAILED;
}
}
if (BreakCrystals.isOn())
for (EntityEnderCrystal entity : crystals) {
mc.player.connection.sendPacket(new CPacketUseEntity(entity));
mc.player.swingArm(EnumHand.MAIN_HAND);
}
BlockInteractUtil.BlockPlaceResult res = (BlockInteractUtil.tryPlaceBlock(x, allowNonObi.isOn() ? new HardSolidBlockSwitchItem() : new SpecBlockSwitchItem(Blocks.OBSIDIAN), Spark.switchManager.getModeFromString(switchingMode.getValue()), false, false, 4, blocksPerTick.getValue() > 1));
return res;
}
use of me.wallhacks.spark.util.player.itemswitcher.itemswitchers.HardSolidBlockSwitchItem in project Spark-Client by Spark-Client-Development.
the class Burrow method OnUpdate.
@SubscribeEvent
void OnUpdate(PlayerUpdateEvent event) {
BlockPos floored = PlayerUtil.getPlayerPosFloored(mc.player, 0.2);
BlockPos pos = floored.add(0, -1, 0);
if (mc.world.getBlockState(floored).getBlock().material.isSolid() && !mc.world.getBlockState(floored.add(0, 1, 0)).getBlock().material.isSolid()) {
if (bypass.isOn()) {
mc.player.motionY = 0;
} else if (KeepPlayer.isOn()) {
Vec3d Center = new Vec3d(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5);
double l_XDiff = Math.abs(Center.x - mc.player.posX);
double l_ZDiff = Math.abs(Center.z - mc.player.posZ);
if (l_XDiff <= 0.1 && l_ZDiff <= 0.1) {
Center = Vec3d.ZERO;
} else {
double l_MotionX = Center.x - mc.player.posX;
double l_MotionZ = Center.z - mc.player.posZ;
mc.player.motionX = l_MotionX * 0.6f;
mc.player.motionZ = l_MotionZ * 0.6f;
}
}
} else if (status > 20)
this.setEnabled(false);
if (status == 0) {
if (!mc.player.onGround) {
this.setEnabled(false);
return;
} else {
List<Entity> l = mc.world.getEntitiesWithinAABBExcludingEntity(mc.player, new AxisAlignedBB(floored));
for (Entity e : l) {
if (!(e instanceof EntityItem) && !e.isDead) {
this.setEnabled(false);
return;
}
}
}
if (Surround.instance.isPlacing())
return;
if (center.isOn()) {
Vec3d Center = new Vec3d(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5);
double l_XDiff = Math.abs(Center.x - mc.player.posX);
double l_ZDiff = Math.abs(Center.z - mc.player.posZ);
if (l_XDiff <= 0.1 && l_ZDiff <= 0.1) {
} else {
double l_MotionX = Center.x - mc.player.posX;
double l_MotionZ = Center.z - mc.player.posZ;
mc.player.motionX = l_MotionX / 2;
mc.player.motionZ = l_MotionZ / 2;
return;
}
}
EnumHand hand = Spark.switchManager.Switch(new SpecBlockSwitchItem(getUse()), ItemSwitcher.usedHand.Both);
if (UseOtherBlocks.isOn() && hand == null)
hand = Spark.switchManager.Switch(new HardSolidBlockSwitchItem(), ItemSwitcher.usedHand.Both);
if (hand == null) {
this.setEnabled(false);
return;
}
if (Rotate.isOn()) {
sendPlayerRot(90, 90, true);
}
if (OneTick.isOn())
status = 1;
}
if (status == 1) {
Spark.rotationManager.setCancelNextWalkingUpdate();
sendPlayerPos(mc.player.posX, mc.player.posY + 0.41999998688698, mc.player.posZ, false);
sendPlayerPos(mc.player.posX, mc.player.posY + 0.7531999805212, mc.player.posZ, false);
sendPlayerPos(mc.player.posX, mc.player.posY + 1.001335979, mc.player.posZ, false);
sendPlayerPos(mc.player.posX, mc.player.posY + 1.16610926, mc.player.posZ, false);
EnumHand hand = Spark.switchManager.Switch(new SpecBlockSwitchItem(getUse()), ItemSwitcher.usedHand.Both);
if (UseOtherBlocks.isOn() && hand == null)
hand = Spark.switchManager.Switch(new HardSolidBlockSwitchItem(), ItemSwitcher.usedHand.Both);
if (hand == null) {
this.setEnabled(false);
return;
}
if (!BlockInteractUtil.processRightClickBlock(pos, EnumFacing.UP, false, hand, new Vec3d(mc.player.posX, pos.getY() + 0.5, mc.player.posZ)))
return;
Spark.sendInfo("placing burrow block");
if (OneTick.isOn())
status = 2;
}
if (status == 2) {
Vec3i clip = getClip();
sendPlayerPos(mc.player.posX + clip.getX(), mc.player.posY + clip.getY(), mc.player.posZ + clip.getZ(), true);
}
status++;
}
Aggregations