Подпишитесь на наш Telegram-канал, чтобы всегда быть в курсе важных обновлений! Перейти

Вопрос Del

  • Автор темы Автор темы Relly2
  • Дата начала Дата начала
Как сделать что бы нюкер ломал еще алмазы нормально лазурит и тд и что бы игрок автомотически бегал и добывал руду
Код:
Expand Collapse Copy
package im.expensive.functions.impl.render;

import com.google.common.eventbus.Subscribe;
import im.expensive.events.WorldEvent;
import im.expensive.functions.api.Category;
import im.expensive.functions.api.Function;
import im.expensive.functions.api.FunctionRegister;
import im.expensive.functions.settings.impl.SliderSetting;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.vector.Vector3d;
import net.optifine.render.RenderUtils;

import java.util.HashSet;
import java.util.Set;

@FunctionRegister(name= "Nuker", type = Category.Player)
public class Nuker extends Function {
final SliderSetting range1 = new SliderSetting("Диапозон", 2.0f, 1.0f, 5.0f, 0.1f);
long last = 0L;
final Set<Block> blocks = new HashSet<>();
BlockPos Render = null;
BlockPos block = null;
float interval = 40.0f;

public Nuker() {
this.addSettings(this.range1);
blocks.add(Blocks.IRON_ORE);
blocks.add(Blocks.DIAMOND_ORE);
blocks.add(Blocks.GOLD_ORE);
blocks.add(Blocks.REDSTONE_WIRE);

}

protected float[] rotations(PlayerEntity player) {
return new float[0];
}

@Subscribe
    private void onWorld(WorldEvent worldEvent) {
int range = Math.round(range1.get());
long scan = Math.round(interval);
Vector3d positionVec = mc.player.getPositionVec();
if (block == null || mc.world.getBlockState(block).getBlock() == Blocks.AIR) {
for (int x = -range; x <= range; ++x) {
for (int z = -range; z <= range; ++z) {
for (int y = -4; y <= 4; ++y) {
BlockPos target = new BlockPos(positionVec.x + x, positionVec.y + y, positionVec.z + z);
if (target == null) {
continue;
}
Block pos = mc.world.getBlockState(target).getBlock();
if (blocks.contains(pos) && pos.getDefaultState().getBlockHardness(mc.world, target) > 0) {
double distance = positionVec.distanceTo(new Vector3d(target.getX(), target.getY(), target.getZ()));
if (distance <= range) {
if (System.currentTimeMillis() - last >= scan) {
mc.playerController.onPlayerDamageBlock(target, Direction.UP);
last = System.currentTimeMillis();
block = target;
Render = target;
return;
}
}
}
}
}
}
} else {
if (block != null) {
double distance = positionVec.distanceTo(new Vector3d(block.getX(), block.getY(), block.getZ()));
if (distance > range) {
block = null;
Render = null;
} else {
if (System.currentTimeMillis() - last >= scan) {
mc.playerController.onPlayerDamageBlock(block, Direction.UP);
last = System.currentTimeMillis();
}
}
} if (block != null && mc.world.getBlockState(block).getBlock() == Blocks.AIR) {
block = null;
Render = null;
}
}
//ЗАДАЛБАЛИ ЭТИ NULL NULL NULL NULL NULL NULL ОШИБКА ОШИБА NULL NULL NULL NULL
    }

@Subscribe
    private void render(WorldEvent world) {
//хз че за метад даун писал какойта + нихуя не рендерит
        if (Render != null) {
RenderUtils.drawBlockBox(Render, 0xFFFF0000);
}
}
}
Мозгами работать, по сути баритон там, а так в моем софтике есть такое, мол ходит по автошахте и нюкером ломает)
Какого хуя у тебя в рендере нюкер забыл
 
Мозгами работать, по сути баритон там, а так в моем софтике есть такое, мол ходит по автошахте и нюкером ломает)
Какого хуя у тебя в рендере нюкер забыл
я его спаситил с одной темки он там и находился
 
Назад
Сверху Снизу