forked from RepoMirrors/kami-blue
code style
This commit is contained in:
parent
28b57e65ed
commit
298eed48f4
|
@ -56,9 +56,7 @@ public class AutoFeetPlace extends Module {
|
|||
private boolean missingObiDisable = false;
|
||||
|
||||
private static EnumFacing getPlaceableSide(BlockPos pos) {
|
||||
|
||||
for (EnumFacing side : EnumFacing.values()) {
|
||||
|
||||
BlockPos neighbour = pos.offset(side);
|
||||
|
||||
if (!mc.world.getBlockState(neighbour).getBlock().canCollideCheck(mc.world.getBlockState(neighbour), false)) {
|
||||
|
@ -69,16 +67,12 @@ public class AutoFeetPlace extends Module {
|
|||
if (!blockState.getMaterial().isReplaceable()) {
|
||||
return side;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onEnable() {
|
||||
|
||||
if (mc.player == null) {
|
||||
this.disable();
|
||||
return;
|
||||
|
@ -89,15 +83,11 @@ public class AutoFeetPlace extends Module {
|
|||
// save initial player hand
|
||||
playerHotbarSlot = mc.player.inventory.currentItem;
|
||||
lastHotbarSlot = -1;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDisable() {
|
||||
|
||||
if (mc.player == null) {
|
||||
return;
|
||||
}
|
||||
if (mc.player == null) return;
|
||||
|
||||
// load initial player hand
|
||||
if (lastHotbarSlot != playerHotbarSlot && playerHotbarSlot != -1) {
|
||||
|
@ -113,12 +103,10 @@ public class AutoFeetPlace extends Module {
|
|||
lastHotbarSlot = -1;
|
||||
|
||||
missingObiDisable = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
|
||||
if (mc.player == null || ModuleManager.isModuleEnabled("Freecam")) {
|
||||
return;
|
||||
}
|
||||
|
@ -161,7 +149,6 @@ public class AutoFeetPlace extends Module {
|
|||
int blocksPlaced = 0;
|
||||
|
||||
while (blocksPlaced < blocksPerTick.getValue()) {
|
||||
|
||||
if (offsetStep >= maxSteps) {
|
||||
offsetStep = 0;
|
||||
break;
|
||||
|
@ -175,11 +162,9 @@ public class AutoFeetPlace extends Module {
|
|||
}
|
||||
|
||||
offsetStep++;
|
||||
|
||||
}
|
||||
|
||||
if (blocksPlaced > 0) {
|
||||
|
||||
if (lastHotbarSlot != playerHotbarSlot && playerHotbarSlot != -1) {
|
||||
mc.player.inventory.currentItem = playerHotbarSlot;
|
||||
lastHotbarSlot = playerHotbarSlot;
|
||||
|
@ -189,7 +174,6 @@ public class AutoFeetPlace extends Module {
|
|||
mc.player.connection.sendPacket(new CPacketEntityAction(mc.player, CPacketEntityAction.Action.STOP_SNEAKING));
|
||||
isSneaking = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
totalTicksRunning++;
|
||||
|
@ -201,11 +185,9 @@ public class AutoFeetPlace extends Module {
|
|||
}
|
||||
this.disable();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private boolean placeBlock(BlockPos pos) {
|
||||
|
||||
// check if block is already placed
|
||||
Block block = mc.world.getBlockState(pos).getBlock();
|
||||
if (!(block instanceof BlockAir) && !(block instanceof BlockLiquid)) {
|
||||
|
@ -266,15 +248,12 @@ public class AutoFeetPlace extends Module {
|
|||
((NoBreakAnimation) ModuleManager.getModuleByName("NoBreakAnimation")).resetMining();
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
private int findObiInHotbar() {
|
||||
|
||||
// search blocks in hotbar
|
||||
int slot = -1;
|
||||
for (int i = 0; i < 9; i++) {
|
||||
|
||||
// filter out non-block items
|
||||
ItemStack stack = mc.player.inventory.getStackInSlot(i);
|
||||
|
||||
|
@ -287,11 +266,8 @@ public class AutoFeetPlace extends Module {
|
|||
slot = i;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return slot;
|
||||
|
||||
}
|
||||
|
||||
private enum Mode {
|
||||
|
@ -299,7 +275,6 @@ public class AutoFeetPlace extends Module {
|
|||
}
|
||||
|
||||
private static class Offsets {
|
||||
|
||||
private static final Vec3d[] SURROUND = {
|
||||
new Vec3d(1, 0, 0),
|
||||
new Vec3d(0, 0, 1),
|
||||
|
@ -322,7 +297,5 @@ public class AutoFeetPlace extends Module {
|
|||
new Vec3d(0, -1, -1),
|
||||
new Vec3d(0, -1, 0)
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -66,11 +66,8 @@ public class AutoTrap extends Module {
|
|||
private boolean missingObiDisable = false;
|
||||
|
||||
private static EnumFacing getPlaceableSide(BlockPos pos) {
|
||||
|
||||
for (EnumFacing side : EnumFacing.values()) {
|
||||
|
||||
BlockPos neighbour = pos.offset(side);
|
||||
|
||||
if (!mc.world.getBlockState(neighbour).getBlock().canCollideCheck(mc.world.getBlockState(neighbour), false)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -79,20 +76,14 @@ public class AutoTrap extends Module {
|
|||
if (!blockState.getMaterial().isReplaceable()) {
|
||||
return side;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onEnable() {
|
||||
|
||||
if (mc.player == null) {
|
||||
this.disable();
|
||||
return;
|
||||
}
|
||||
if (mc.player == null) return;
|
||||
|
||||
firstRun = true;
|
||||
|
||||
|
@ -104,10 +95,7 @@ public class AutoTrap extends Module {
|
|||
|
||||
@Override
|
||||
protected void onDisable() {
|
||||
|
||||
if (mc.player == null) {
|
||||
return;
|
||||
}
|
||||
if (mc.player == null) return;
|
||||
|
||||
if (lastHotbarSlot != playerHotbarSlot && playerHotbarSlot != -1) {
|
||||
mc.player.inventory.currentItem = playerHotbarSlot;
|
||||
|
@ -122,20 +110,13 @@ public class AutoTrap extends Module {
|
|||
lastHotbarSlot = -1;
|
||||
|
||||
missingObiDisable = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if (mc.player == null) return;
|
||||
|
||||
if (mc.player == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!activeInFreecam.getValue() && ModuleManager.isModuleEnabled("Freecam")) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!activeInFreecam.getValue() && ModuleManager.isModuleEnabled("Freecam")) return;
|
||||
|
||||
if (firstRun) {
|
||||
if (findObiInHotbar() == -1) {
|
||||
|
@ -170,22 +151,15 @@ public class AutoTrap extends Module {
|
|||
|
||||
List<Vec3d> placeTargets = new ArrayList<>();
|
||||
|
||||
if (cage.getValue().equals(Cage.TRAP)) {
|
||||
Collections.addAll(placeTargets, Offsets.TRAP);
|
||||
}
|
||||
if (cage.getValue().equals(Cage.TRAP)) Collections.addAll(placeTargets, Offsets.TRAP);
|
||||
|
||||
if (cage.getValue().equals(Cage.CRYSTALEXA)) {
|
||||
Collections.addAll(placeTargets, Offsets.CRYSTALEXA);
|
||||
}
|
||||
if (cage.getValue().equals(Cage.CRYSTALEXA)) Collections.addAll(placeTargets, Offsets.CRYSTALEXA);
|
||||
|
||||
if (cage.getValue().equals(Cage.CRYSTALFULL)) {
|
||||
Collections.addAll(placeTargets, Offsets.CRYSTALFULL);
|
||||
}
|
||||
if (cage.getValue().equals(Cage.CRYSTALFULL)) Collections.addAll(placeTargets, Offsets.CRYSTALFULL);
|
||||
|
||||
int blocksPlaced = 0;
|
||||
|
||||
while (blocksPlaced < blocksPerTick.getValue()) {
|
||||
|
||||
if (offsetStep >= placeTargets.size()) {
|
||||
offsetStep = 0;
|
||||
break;
|
||||
|
@ -197,13 +171,10 @@ public class AutoTrap extends Module {
|
|||
if (placeBlockInRange(targetPos, range.getValue())) {
|
||||
blocksPlaced++;
|
||||
}
|
||||
|
||||
offsetStep++;
|
||||
|
||||
}
|
||||
|
||||
if (blocksPlaced > 0) {
|
||||
|
||||
if (lastHotbarSlot != playerHotbarSlot && playerHotbarSlot != -1) {
|
||||
mc.player.inventory.currentItem = playerHotbarSlot;
|
||||
lastHotbarSlot = playerHotbarSlot;
|
||||
|
@ -213,7 +184,6 @@ public class AutoTrap extends Module {
|
|||
mc.player.connection.sendPacket(new CPacketEntityAction(mc.player, CPacketEntityAction.Action.STOP_SNEAKING));
|
||||
isSneaking = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (missingObiDisable) {
|
||||
|
@ -223,11 +193,9 @@ public class AutoTrap extends Module {
|
|||
}
|
||||
this.disable();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private boolean placeBlockInRange(BlockPos pos, double range) {
|
||||
|
||||
// check if block is already placed
|
||||
Block block = mc.world.getBlockState(pos).getBlock();
|
||||
if (!(block instanceof BlockAir) && !(block instanceof BlockLiquid)) {
|
||||
|
@ -280,9 +248,7 @@ public class AutoTrap extends Module {
|
|||
isSneaking = true;
|
||||
}
|
||||
|
||||
if (rotate.getValue()) {
|
||||
faceVectorPacketInstant(hitVec);
|
||||
}
|
||||
if (rotate.getValue()) faceVectorPacketInstant(hitVec);
|
||||
|
||||
mc.playerController.processRightClickBlock(mc.player, mc.world, neighbour, opposite, hitVec, EnumHand.MAIN_HAND);
|
||||
mc.player.swingArm(EnumHand.MAIN_HAND);
|
||||
|
@ -295,17 +261,13 @@ public class AutoTrap extends Module {
|
|||
if (ModuleManager.getModuleByName("NoBreakAnimation").isEnabled()) {
|
||||
((NoBreakAnimation) ModuleManager.getModuleByName("NoBreakAnimation")).resetMining();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
private int findObiInHotbar() {
|
||||
|
||||
// search blocks in hotbar
|
||||
int slot = -1;
|
||||
for (int i = 0; i < 9; i++) {
|
||||
|
||||
// filter out non-block items
|
||||
ItemStack stack = mc.player.inventory.getStackInSlot(i);
|
||||
|
||||
|
@ -318,52 +280,32 @@ public class AutoTrap extends Module {
|
|||
slot = i;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return slot;
|
||||
|
||||
}
|
||||
|
||||
private void findClosestTarget() {
|
||||
|
||||
List<EntityPlayer> playerList = mc.world.playerEntities;
|
||||
|
||||
closestTarget = null;
|
||||
|
||||
for (EntityPlayer target : playerList) {
|
||||
if (target == mc.player) continue;
|
||||
|
||||
if (target == mc.player) {
|
||||
continue;
|
||||
}
|
||||
if (mc.player.getDistance(target) > range.getValue() + 3) continue;
|
||||
|
||||
if (mc.player.getDistance(target) > range.getValue() + 3) {
|
||||
continue;
|
||||
}
|
||||
if (!EntityUtil.isLiving(target)) continue;
|
||||
|
||||
if (!EntityUtil.isLiving(target)) {
|
||||
continue;
|
||||
}
|
||||
if ((target).getHealth() <= 0) continue;
|
||||
|
||||
if ((target).getHealth() <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Friends.isFriend(target.getName())) {
|
||||
continue;
|
||||
}
|
||||
if (Friends.isFriend(target.getName())) continue;
|
||||
|
||||
if (closestTarget == null) {
|
||||
closestTarget = target;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (mc.player.getDistance(target) < mc.player.getDistance(closestTarget)) {
|
||||
closestTarget = target;
|
||||
}
|
||||
|
||||
if (mc.player.getDistance(target) < mc.player.getDistance(closestTarget)) closestTarget = target;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -379,7 +321,6 @@ public class AutoTrap extends Module {
|
|||
}
|
||||
|
||||
private static class Offsets {
|
||||
|
||||
private static final Vec3d[] TRAP = {
|
||||
new Vec3d(0, 0, -1),
|
||||
new Vec3d(1, 0, 0),
|
||||
|
@ -434,7 +375,5 @@ public class AutoTrap extends Module {
|
|||
new Vec3d(0, 3, -1),
|
||||
new Vec3d(0, 3, 0)
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ import net.minecraft.util.math.Vec3d;
|
|||
*/
|
||||
@Module.Info(name = "Surround", category = Module.Category.COMBAT, description = "Surrounds you with obsidian to take less damage")
|
||||
public class Surround extends Module {
|
||||
|
||||
private Setting<Boolean> autoDisable = register(Settings.b("Disable on place", true));
|
||||
private Setting<Boolean> spoofRotations = register(Settings.b("Spoof Rotations", true));
|
||||
private Setting<Boolean> spoofHotbar = register(Settings.b("Spoof Hotbar", true));
|
||||
|
@ -49,6 +50,7 @@ public class Surround extends Module {
|
|||
private enum DebugMsgs {
|
||||
NONE, IMPORTANT, ALL
|
||||
}
|
||||
|
||||
private enum AutoCenter {
|
||||
OFF, TP
|
||||
}
|
||||
|
@ -81,7 +83,6 @@ public class Surround extends Module {
|
|||
placeBlock(new BlockPos(basePos.add(offset.x, offset.y, offset.z)));
|
||||
++offsetStep;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,7 +104,6 @@ public class Surround extends Module {
|
|||
|
||||
public void onEnable() {
|
||||
if (mc.player == null) return;
|
||||
|
||||
/* Autocenter */
|
||||
BlockPos centerPos = mc.player.getPosition();
|
||||
playerPos = mc.player.getPositionVector();
|
||||
|
@ -142,7 +142,6 @@ public class Surround extends Module {
|
|||
if (debugMsgs.getValue().equals(DebugMsgs.ALL)) {
|
||||
Command.sendChatMessage("[Surround] Saving initial Slot = " + playerHotbarSlot);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void onDisable() {
|
||||
|
@ -158,7 +157,6 @@ public class Surround extends Module {
|
|||
Wrapper.getPlayer().inventory.currentItem = playerHotbarSlot;
|
||||
}
|
||||
}
|
||||
|
||||
playerHotbarSlot = -1;
|
||||
lastHotbarSlot = -1;
|
||||
}
|
||||
|
@ -185,7 +183,6 @@ public class Surround extends Module {
|
|||
if (autoDisable.getValue()) {
|
||||
disable();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void placeBlock(BlockPos blockPos) {
|
||||
|
@ -285,7 +282,6 @@ public class Surround extends Module {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static boolean canBeClicked(BlockPos pos) {
|
||||
|
@ -319,6 +315,4 @@ public class Surround extends Module {
|
|||
private static Vec3d getEyesPos() {
|
||||
return new Vec3d(Wrapper.getPlayer().posX, Wrapper.getPlayer().posY + (double) Wrapper.getPlayer().getEyeHeight(), Wrapper.getPlayer().posZ);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue