ну это клан апгрейт прашу указать миня если будит 2к прасмотров на пасте сливаю автофарм рабочий в один класс SS package im.nucker.functions.impl.misc; import com.google.common.eventbus.Subscribe; import im.nucker.events.EventUpdate; import im.nucker.functions.api.FunctionRegister; import im.nucker.functions.api.Function; import net.minecraft.block.Blocks; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.player.ClientPlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.util.Direction; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.RayTraceResult.Type; import net.minecraft.util.math.vector.Vector3d; import java.lang.reflect.Field; @FunctionRegister(name = "ClanUpgrader", type = im.nucker.functions.api.Category.Misc) public class ClanUpgrader extends Function { private static final Minecraft mc = Minecraft.getInstance(); private static int REDSTONE_SLOT = -1; public ClanUpgrader() { } @Subscribe private void onUpdate(EventUpdate event) { if (mc.world != null && mc.player != null) { if (REDSTONE_SLOT == -1) { REDSTONE_SLOT = findRedstoneSlot(); if (REDSTONE_SLOT == -1) { System.out.println("No redstone found in hotbar"); return; } } BlockPos playerPos = mc.player.getPosition(); BlockPos blockBelow = playerPos.down(); if (mc.player.isOnGround()) { mc.player.jump(); } if (mc.world.getBlockState(blockBelow).isAir()) { mc.player.rotationPitch = 90.0F; this.placeRedstoneDust(blockBelow); } else if (mc.world.getBlockState(blockBelow).getBlock() == Blocks.REDSTONE_WIRE) { for (int i = 0; i < 10; i++) { // Разрушение блока 10 раз для ускорения mc.playerController.onPlayerDamageBlock(blockBelow, mc.player.getHorizontalFacing()); } } } } private void placeRedstoneDust(BlockPos blockPos) { ClientPlayerEntity player = mc.player; if (player != null) { if (player.inventory.currentItem != REDSTONE_SLOT) { player.inventory.currentItem = REDSTONE_SLOT; } RayTraceResult rayTrace = mc.objectMouseOver; if (rayTrace != null && rayTrace.getType() == Type.BLOCK) { BlockPos targetPos = ((BlockRayTraceResult) rayTrace).getPos(); Direction targetFace = ((BlockRayTraceResult) rayTrace).getFace(); BlockRayTraceResult blockRay = new BlockRayTraceResult(new Vector3d(targetPos.getX(), targetPos.getY(), targetPos.getZ()), targetFace, targetPos, false); for (int i = 0; i < 10; i++) { // Установка блока 10 раз для ускорения mc.playerController.processRightClickBlock(player, mc.world, Hand.MAIN_HAND, blockRay); } } } } private static int findRedstoneSlot() { for (int i = 0; i < 9; ++i) { ItemStack stack = mc.player.inventory.getStackInSlot(i); if (!stack.isEmpty() && stack.getItem() == Items.REDSTONE) { return i; } } return -1; } public boolean onEnable() { super.onEnable(); setRightClickDelay(0); // Уменьшаем задержку клика до 0 return false; } public void onDisable() { super.onDisable(); setRightClickDelay(4); // Восстанавливаем стандартную задержку } // Использование рефлексии для изменения rightClickDelayTimer private void setRightClickDelay(int value) { try { Field rightClickDelayTimerField = Minecraft.class.getDeclaredField("rightClickDelayTimer"); rightClickDelayTimerField.setAccessible(true); // Даем доступ к приватному полю rightClickDelayTimerField.setInt(mc, value); } catch (NoSuchFieldException | IllegalAccessException e) { e.printStackTrace(); } } }