function createXRay() {
// Инициализация (если не существует)
window.MC_CHEAT = window.MC_CHEAT || {};
window.MC_CHEAT.xrayMode = window.MC_CHEAT.xrayMode || 'box';
if (!window.bot?.entity) return;
const me = window.bot.entity;
const worldRenderer = window.appViewer?.backend?.soundSystem?.worldRenderer;
if (!worldRenderer) return;
const scene = worldRenderer.scene;
const oreColors = {
'diamond_ore': 0x00ffff, 'deepslate_diamond_ore': 0x00ffff,
'emerald_ore': 0x00ff00, 'deepslate_emerald_ore': 0x00ff00,
'gold_ore': 0xffff00, 'nether_gold_ore': 0xffff00,
'iron_ore': 0xff8888, 'deepslate_iron_ore': 0xff8888,
'coal_ore': 0x444444, 'deepslate_coal_ore': 0x444444,
'redstone_ore': 0xff0000, 'deepslate_redstone_ore': 0xff0000,
'lapis_ore': 0x0000ff, 'deepslate_lapis_ore': 0x0000ff,
'copper_ore': 0xff8800, 'deepslate_copper_ore': 0xff8800,
'nether_quartz_ore': 0xffffff, 'ancient_debris': 0x8b0000,
};
if (window.xrayInterval) clearInterval(window.xrayInterval);
if (window.xrayMeshes) window.xrayMeshes.forEach(mesh => scene.remove(mesh));
window.xrayMeshes = [];
function updateXRay() {
window.xrayMeshes.forEach(mesh => scene.remove(mesh));
window.xrayMeshes = [];
const radius = 20;
for (let x = -radius; x <= radius; x++) {
for (let y = -radius; y <= radius; y++) {
for (let z = -radius; z <= radius; z++) {
const pos = me.position.offset(x, y, z);
const block = window.bot.blockAt(pos);
if (block && block.name && oreColors[block.name]) {
const color = oreColors[block.name];
const boxGeometry = new THREE.BoxGeometry(1, 1, 1);
const boxMaterial = new THREE.MeshBasicMaterial({
color: color,
transparent: true,
opacity: window.MC_CHEAT.xrayMode === 'chams' ? 0.8 : 0.6,
depthTest: false,
depthWrite: false
});
const mesh = new THREE.Mesh(boxGeometry, boxMaterial);
mesh.position.set(
block.position.x - me.position.x + 0.5,
block.position.y - me.position.y - 1.13,
block.position.z - me.position.z + 0.5
);
scene.add(mesh);
window.xrayMeshes.push(mesh);
}
}
}
}
}
window.xrayInterval = setInterval(updateXRay, 250);
updateXRay();
console.log('X-Ray (' + window.MC_CHEAT.xrayMode + ') включён!');
}
createXRay();