Начинающий
- Статус
- Оффлайн
- Регистрация
- 13 Авг 2024
- Сообщения
- 89
- Реакции
- 0
сливаю вам жоскей хрей бипас на мсп
Java:
package ru.hachclient.feature.impl.player;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.network.protocol.game.ServerboundPlayerActionPacket;
import net.minecraft.network.protocol.game.ServerboundPlayerCommandPacket;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.PickaxeItem;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.levelgen.Column;
import net.minecraft.world.phys.Vec3;
import ru.hachclient.Hachclient;
import ru.hachclient.events.impl.EventInput;
import ru.hachclient.events.impl.EventRender;
import ru.hachclient.events.impl.EventUpdate;
import ru.hachclient.feature.Feature;
import ru.hachclient.feature.FeatureCategory;
import ru.hachclient.fonts.Fonts;
import ru.hachclient.settings.impl.BooleanSetting;
import ru.hachclient.settings.impl.MultiBooleanSetting;
import ru.hachclient.settings.impl.NumberSetting;
import ru.hachclient.utils.chat.ChatUtil;
import ru.hachclient.utils.color.ClientColors;
import ru.hachclient.utils.math.MathUtil;
import ru.hachclient.utils.render.RenderUtil;
import java.awt.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Random;
public class XRay extends Feature {
public XRay() {
super("XRay","Подсвечивает руды", FeatureCategory.Player);
addSettings(delay, radius, skip, ores);
}
@Override
protected void onDisabled() {
super.onDisabled();
scannedNow = false;
ore.clear();
bipased.clear();
}
@Override
protected void onEnabled() {
super.onEnabled();
lastScan = mc.player.position();
}
NumberSetting delay = new NumberSetting("Задержка",25F,0F,50F,0.1F);
NumberSetting radius = new NumberSetting("Радиус",10F,1F,50F,0.1F);
NumberSetting skip = new NumberSetting("Пропуск",4F,0F,7F,1);
MultiBooleanSetting ores = new MultiBooleanSetting("Руды",
new BooleanSetting("Алмазная руда",false),
new BooleanSetting("Лазурит",false),
new BooleanSetting("Изумрудная руда",false),
new BooleanSetting("Золотая руда",false)
);
ArrayList<BlockPos> bipased = new ArrayList<>();
ArrayList<BlockPos> ore = new ArrayList<>();
boolean scan = false, scannedNow = false;
BlockPos current = new BlockPos(0,0,0);
Vec3 lastScan = Vec3.ZERO;
int lastSlot = 0;
public void onInput(EventInput e) {
if (!scannedNow) {
e.cancel();
e.setStrafe(0);
e.setForward(0);
mc.player.input.forwardImpulse = 0;
mc.player.input.leftImpulse = 0;
mc.player.getDeltaMovement().x = 0;
mc.player.getDeltaMovement().z = 0;
}
}
public void onUpdate(EventUpdate event) {
if(mc.player.position().distanceTo(lastScan) > mc.gameMode.getPickRange() + 2) {
scannedNow = false;
lastScan = mc.player.position();
bipased.clear();
}
if(!scannedNow) {
if(mc.player.getMainHandItem().getItem() instanceof PickaxeItem) {
lastSlot = mc.player.getInventory().selected;
mc.player.getInventory().selected = (mc.player.getInventory().selected + 1) % 8;
}
}
if (!scan && !scannedNow) {
scan = true;
new Thread(() -> {
float r = mc.gameMode.getPickRange();
int startX = (int) (mc.player.getBlockX() - r);
int startY = (int) (mc.player.getBlockY() - r);
int startZ = (int) (mc.player.getBlockZ() - r);
int endX = (int) (mc.player.getBlockX() + r);
int endY = (int) (mc.player.getBlockY() + r);
int endZ = (int) (mc.player.getBlockZ() + r);
for (int x = startX; x < endX; x += (int) skip.get()) {
for (int y = startY; y < endY; y += (int) skip.get()) {
for (int z = startZ; z < endZ; z += (int) skip.get()) {
BlockPos pos = new BlockPos(x, y, z);
Block block = mc.level.getBlockState(pos).getBlock();
boolean isValid =
(block == Blocks.LAPIS_ORE || block == Blocks.DEEPSLATE_LAPIS_ORE) && ores.get(1) ||
(block == Blocks.DIAMOND_ORE || block == Blocks.DEEPSLATE_DIAMOND_ORE) && ores.get(0) ||
(block == Blocks.EMERALD_ORE || block == Blocks.DEEPSLATE_EMERALD_ORE) && ores.get(2) ||
(block == Blocks.GOLD_ORE || block == Blocks.DEEPSLATE_GOLD_ORE) && ores.get(3);
if(!isValid)
continue;
try {
Thread.sleep((long) (delay.get()*10));
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
bipased.add(pos);
current = pos;
mc.getConnection().send(new ServerboundPlayerActionPacket(ServerboundPlayerActionPacket.Action.START_DESTROY_BLOCK, pos.below(), Direction.values()[new Random().nextInt(0,Direction.values().length-1)],0));
mc.getConnection().send(new ServerboundPlayerActionPacket(ServerboundPlayerActionPacket.Action.START_DESTROY_BLOCK, pos, Direction.values()[new Random().nextInt(0,Direction.values().length-1)],0));
}
}
}
for (int x = startX; x < endX; x++) {
for (int y = startY; y < endY; y++) {
for (int z = startZ; z < endZ; z++) {
BlockPos pos = new BlockPos(x, y, z);
Block block = mc.level.getBlockState(pos).getBlock();
if(mc.player.position().distanceTo(new Vec3(pos.getX(),pos.getY(),pos.getZ())) > r + 2)
continue;
if ((block == Blocks.LAPIS_ORE || block == Blocks.DEEPSLATE_LAPIS_ORE) && ores.get(1)) {
ore.add(pos);
}
if ((block == Blocks.DIAMOND_ORE || block == Blocks.DEEPSLATE_DIAMOND_ORE) && ores.get(0)) {
ore.add(pos);
}
if ((block == Blocks.EMERALD_ORE || block == Blocks.DEEPSLATE_EMERALD_ORE) && ores.get(2)) {
ore.add(pos);
}
if ((block == Blocks.GOLD_ORE || block == Blocks.DEEPSLATE_GOLD_ORE) && ores.get(3)) {
ore.add(pos);
}
}
}
}
scannedNow = true;
scan = false;
mc.player.getInventory().selected = lastSlot;
}).start();
}
if (mc.player.tickCount % 20 == 0) {
Iterator<BlockPos> blockPosIterator = ore.iterator();
while (blockPosIterator.hasNext()) {
BlockPos pos = blockPosIterator.next();
Block block = mc.level.getBlockState(pos).getBlock();
boolean isValid =
(block == Blocks.LAPIS_ORE || block == Blocks.DEEPSLATE_LAPIS_ORE) && ores.get(1) ||
(block == Blocks.DIAMOND_ORE || block == Blocks.DEEPSLATE_DIAMOND_ORE) && ores.get(0) ||
(block == Blocks.EMERALD_ORE || block == Blocks.DEEPSLATE_EMERALD_ORE) && ores.get(2) ||
(block == Blocks.GOLD_ORE || block == Blocks.DEEPSLATE_GOLD_ORE) && ores.get(3);
if(!isValid)
blockPosIterator.remove();
}
}
}
public void onRender(EventRender event) {
if(event.is2D()) {
Fonts.getSfSemiBold(17).drawCenterString("Найдено "+ore.size()+" руд.",wm.getGuiScaledWidth()/2F,wm.getGuiScaledHeight()/2F + 30, ClientColors.FORE_COLOR);
}
if(event.is3D()) {
if (!scannedNow)
RenderUtil.drawBlock(current.getCenter(), Hachclient.getInstance().getThemeManager().getColor(0));
else {
for (BlockPos bip : ore) {
Block block = mc.level.getBlockState(bip).getBlock();
if (block.defaultBlockState().isAir())
continue;
RenderUtil.drawBlock(bip.getCenter(), colorFblock(block));
}
}
}
}
private Color colorFblock(Block block) {
if (block == Blocks.DIAMOND_ORE || block == Blocks.DEEPSLATE_DIAMOND_ORE) {
return new Color(100,100,255);
}
if (block == Blocks.EMERALD_ORE || block == Blocks.DEEPSLATE_EMERALD_ORE) {
return new Color(100,255,100);
}
if (block == Blocks.LAPIS_ORE || block == Blocks.DEEPSLATE_LAPIS_ORE) {
return new Color(0,0,255);
}
if (block == Blocks.GOLD_ORE || block == Blocks.DEEPSLATE_GOLD_ORE) {
return new Color(255,255,100);
}
return new Color(0,0,0);
}
}