//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package newcode.fun.module.impl.render;
import java.awt.Color;
import java.util.HashMap;
import java.util.Map;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.client.Minecraft;
import net.minecraft.util.math.BlockPos;
import newcode.fun.control.events.Event;
import newcode.fun.control.events.impl.render.EventRender;
import newcode.fun.module.TypeList;
import newcode.fun.module.api.Annotation;
import newcode.fun.module.api.Module;
import newcode.fun.utils.render.RenderUtils.Render3D;
@Annotation(
name = "AncientXray",
type = TypeList.Render,
desc = "Подсвечивает незер обломки"
)
public class AncientXray extends Module {
private final Map<BlockState, Integer> blocks = new HashMap();
public AncientXray() {
this.addBlock(Blocks.ANCIENT_DEBRIS.getDefaultState(), (new Color(255, 255, 255)).getRGB());
}
public boolean onEvent(Event event) {
if (event instanceof EventRender) {
this.handleRender();
}
return false;
}
private void handleRender() {
if (mc.world != null) {
Minecraft var10000 = mc;
if (Minecraft.player != null) {
var10000 = mc;
BlockPos playerPos = Minecraft.player.getPosition();
int range = 29;
for(int x = -range; x <= range; ++x) {
for(int y = -range; y <= range; ++y) {
for(int z = -range; z <= range; ++z) {
BlockPos pos = playerPos.add(x, y, z);
BlockState state = mc.world.getBlockState(pos);
Integer color = (Integer)this.blocks.get(state);
if (color != null) {
Render3D.drawBlockBox(pos, color);
}
}
}
}
return;
}
}
}
private void addBlock(BlockState blockState, int color) {
this.blocks.put(blockState, color);
}
}