я это перепастил но чет он не хочет работать толи я криворукий
@ModuleAnnotation(name = "NoClip", desc = "Позволяет ходить сквозь блоки", type = Type.Player)
public class NoClipModule extends Module {
public static BooleanSetting destroyBlocks = new BooleanSetting("Destroy-Block", true);
private final ModeSetting mode = new ModeSetting("Mode", "Default", "Default", "Sunrise");
private BooleanSetting checkFlag = new BooleanSetting("Check Flag", false);
/* 27 */ public static SliderSetting slotSwap = new SliderSetting("Slot-Swap", 1.0F, 0.0F, 8.0F, 1.0F, () -> Boolean.valueOf(destroyBlocks.get()));
/* 28 */ public TimerUtility timerHelper = new TimerUtility();
/* */ public int itemIndex;
/* */ private boolean swap;
/* */ private long swapDelay;
/* 32 */ private final List<Integer> lastItem = new ArrayList<>();
/* */
@EventTarget
public void move(EventMove move) {
if (!collisionPredict(move.to())) {
if (move.isCollidedHorizontal())
move.setIgnoreHorizontalCollision();
if (move.motion().y > 0 || mc.player.isSneaking()) {
move.setIgnoreVerticalCollision();
}
move.motion().y = Math.min(move.motion().y, mode.is("Default") ? 0.39 : 99999);
}
}
@EventTarget
/* */ public void onInteractBlock(EventInteractBlock eventInteractBlock) {
/* 48 */ if (mc.objectMouseOver != null && mc.objectMouseOver.getBlockPos() != null) {
/* 49 */ List<Integer> bestItem = new ArrayList<>();
/* 50 */ float bestSpeed = 1.0F;
/* 51 */ Block block = Minecraft.world.getBlockState(mc.objectMouseOver.getBlockPos()).getBlock();
/* 52 */ for (int i = 0; i < 9; i++) {
/* 53 */ ItemStack item = Minecraft.player.inventory.getStackInSlot(i);
/* 54 */ float speed = item.getDestroySpeed(block.getDefaultState());
/* 55 */ if (Minecraft.player.inventory.getStackInSlot(i).getMaxDamage() - Minecraft.player.inventory.getStackInSlot(i).getItemDamage() > 1)
/* */ {
/* 57 */ if (speed > bestSpeed) {
/* 58 */ bestSpeed = speed;
/* 59 */ bestItem.add(Integer.valueOf(i));
/* */ } }
/* */ }
/* 62 */ if (destroyBlocks.get() &&
/* 63 */ !bestItem.isEmpty()) {
/* 64 */ this.lastItem.add(Integer.valueOf(Minecraft.player.inventory.currentItem));
/* 65 */ Minecraft.player.inventory.currentItem = ((Integer)bestItem.get(0)).intValue();
/* 66 */ this.itemIndex = ((Integer)bestItem.get(0)).intValue();
/* 67 */ this.swap = true;
/* 68 */ this.swapDelay = System.currentTimeMillis();
/* */ }
/* */ }
/* */ }
/* */
/* */ @EventTarget
/* */ public void onUpdate(EventUpdate eventUpdate) {
/* 75 */ if (this.swap && !this.lastItem.isEmpty() && System.currentTimeMillis() >= this.swapDelay + 300L &&
/* 76 */ destroyBlocks.get()) {
/* 77 */ Minecraft.player.inventory.currentItem = ((Integer)this.lastItem.get(0)).intValue();
/* 78 */ this.itemIndex = ((Integer)this.lastItem.get(0)).intValue();
/* 79 */ this.lastItem.clear();
/* 80 */ this.swap = false;
/* */ }
/* */ }
/* */
/* */
/* */ @EventTarget
/* */ public void onUpdate2(EventUpdate eventUpdate) {
/* 87 */ float f = Minecraft.player.rotationYaw * 0.017453292F;
/* 88 */ double speed = 0.7D;
/* 89 */ double x = -(MathHelper.sin(f) * speed);
/* 90 */ double z = MathHelper.cos(f) * speed;
/* 91 */ if (destroyBlocks.get() && this.timerHelper.hasTimeElapsed((long)Minecraft.player.getDigSpeed(Minecraft.world.getBlockState(new BlockPos(Minecraft.player.posX + x, Minecraft.player.posY + 0.4D, Minecraft.player.posZ + z))))) {
/* 92 */ Minecraft.player.swingArm(EnumHand.MAIN_HAND);
/* 93 */ Utility.mc.playerController.onPlayerDamageBlock(new BlockPos(Minecraft.player.posX + x, Minecraft.player.posY + 0.4D, Minecraft.player.posZ + z), Minecraft.player.getHorizontalFacing());
/* 94 */ this.timerHelper.reset();
/* */ }
/* */ }
/* */
/* */
/* */ public void onEnable() {
/* 100 */ super.onEnable();
/* */ }
/* */
/* */
public boolean collisionPredict(Vec3d to) {
boolean prevCollision = mc.world
.getCollisionBoxes(mc.player, mc.player.getEntityBoundingBox().contract(0.0625D)).isEmpty();
Vec3d backUp = new Vec3d(mc.player.posX, mc.player.posY, mc.player.posZ);
mc.player.setPosition(to.x, to.y, to.z);
boolean collision = mc.world.getCollisionBoxes(mc.player, mc.player.getEntityBoundingBox().contract(0.0625D))
.isEmpty() && prevCollision;
mc.player.setPosition(backUp.x, backUp.y, backUp.z);
return collision;
}
@EventTarget
public void onAction(EventFlag e) {
if (checkFlag.get()) {
Notifications.notify("Flag Detector", "Module " + name + " has been disabled due flags", Notifications.Notify.NotifyType.ERROR, 1);
toggle();
}
}
@Override
public void onDisable() {
super.onDisable();
}
}