Timofeycool

Мод для Minecraft Java Edition (Fabric 1.20.1) — «Инвертированная камера» (или «Мир наизнанку»).

Режим включается по горячей клавише. При включении:

  1. Все блоки, кроме воздуха (air, cave_air, void_air), перестают рендериться — становятся полностью прозрачными/невидимыми.
  2. Каждый блок воздуха (air, cave_air, void_air) в загруженных чанках рендерится как непрозрачный полный куб заданного цвета (по умолчанию светло-серый, можно менять в конфиге).

- Рендеринг происходит для всех координат, где в мире стоит блок воздуха, в пределах рендер-дистанции. - Никаких ограничений по окружению: воздух рисуется и под землёй, и в пещерах, и на поверхности, и высоко в небе вплоть до верхней границы мира.

  1. Игрок получает режим свободного полёта без коллизий (спектатор/noclip), чтобы легко осматривать получившуюся «негативную» скульптуру мира.
  2. (Опционально) Добавить рёбра/сетку на грани кубов воздуха, чтобы было легче воспринимать форму пустот.

Итог: ты видишь мир как сплошную серую массу (воздух), в которой зияют дыры в форме гор, построек, деревьев и земли. Это полная инверсия — «пространство стало твёрдым, материя стала пустотой».

Реализация через миксины: в рендере чанка для каждого блока проверять, является ли он воздухом. Если да — добавлять в буфер модель полного куба. Если нет — пропускать.

Kodari AI
KodariJul 2 at 7:16 pm 2

I’ll create the “InvertedCamera” mod — a Fabric 1.20.1 client-side mod that inverts world rendering, turning air into solid colored cubes and hiding all other blocks, with spectator mode on toggle.

InvertedCamera
A Fabric 1.20.1 client-side mod that inverts Minecraft world rendering. Toggleable via hotkey: all non-air blocks become invisible while every air block renders as a solid colored cube (configurable color, default light gray). Player automatically enters spectator/noclip mode for free-flight inspection. Optional wireframe edges on air cubes improve spatial perception. Creates a surreal "negative space" visualization of the world — caves, mountains, and builds appear as hollow voids in a solid mass.

Let me build all files now.

InvertedCamera
A Fabric 1.20.1 client-side mod that inverts Minecraft world rendering. Toggleable via hotkey: all non-air blocks become invisible while every air block renders as a solid colored cube (configurable color, default light gray). Player automatically enters spectator/noclip mode for free-flight inspection. Optional wireframe edges on air cubes improve spatial perception. Creates a surreal "negative space" visualization of the world — caves, mountains, and builds appear as hollow voids in a solid mass.
Timofeycool

Удали из мода весь функционал, связанный с полетом, noclip и spectator. Мод должен только изменять рендер: скрывать все не-воздушные блоки и отображать блоки воздуха как сплошные цветные кубы. Не изменяй управление игроком, физику, режим игры, сетевое взаимодействие и не отправляй никаких дополнительных пакетов на сервер. Оставь только клиентский рендер через Fabric API и Mixin.

Kodari AI
KodariJul 2 at 7:43 pm 2

Now I’ll strip out all player-control code. Changes needed:

  1. Delete ClientPlayerEntityMixin.java

  2. Strip player state from InvertedCameraMod.java

  3. Strip player state management from HotkeyHandler.java

  4. Remove mixin from invertedcamera.mixins.json

Timofeycool

Проведи полный рефакторинг рендера мода. Сейчас вместо инверсии мира отображается почти пустой экран. Исправь логику так, чтобы:

все не-воздушные блоки не рендерились; все блоки minecraft:air, minecraft:cave_air и minecraft:void_air отображались как непрозрачные полные кубы; использовался стандартный пайплайн рендера чанков Fabric/Minecraft 1.20.1; воздух добавлялся в меш чанка при его построении, а не рисовался отдельными вызовами каждый кадр; рендер автоматически перестраивался при изменении чанков; не рисовались внутренние грани между соседними воздушными блоками (face culling), чтобы избежать миллионов лишних полигонов; исправить все ошибки, из-за которых вместо кубов воздуха отображается пустое небо; оставить горячую клавишу включения/выключения режима и совместимость с Fabric Loader для Minecraft 1.20.1.,

Kodari AI
KodariJul 2 at 7:53 pm 3

I’ll read the current files, then redesign the rendering from scratch using a ChunkRendererRegion mixin that swaps block states at the lookup level — the correct approach for 1.20.1 chunk building.

Now I have a complete picture. Let me design the proper approach:

Architecture: The key insight is to intercept at ChunkRendererRegion.getBlockState() — the class that provides block states during chunk building. When inverted mode is active:

  • Air (air, cave_air, void_air) → return a custom block state (InvertedAirBlock) that renders as a full colored cube

  • Non-air → return Blocks.AIR, which the chunk builder naturally skips

This uses the standard chunk pipeline end-to-end. Face culling works automatically because adjacent swapped air blocks are the same opaque block, so the chunk builder culls shared faces. Rebuilds happen on chunk changes naturally.

For the colored cube, I’ll create a custom BakedModel that generates quads with the color baked in — no texture files needed.

Let me implement everything now.

Now I have a complete picture of the current broken state. The mod uses a per-frame Tessellator approach with no face culling, and cancels all chunk rendering — leading to empty sky. Here’s the redesign:

Architecture: Intercept ChunkRendererRegion.getBlockState() — the method called during chunk mesh building. When inverted:

  • Air variants → return InvertedAirBlock (a full opaque cube with configurable color tint)

  • Non-air → return Blocks.AIR (chunk builder naturally skips it)

This uses the standard chunk building pipeline end-to-end. Face culling works automatically because adjacent swapped blocks are the same opaque block. Chunk rebuilds happen naturally. No per-frame overhead.

Let me create all files

The filesystem is read-only — file operations via <create>/<update> tags handle directory creation. Let me rewrite the entire mod now.

New architecture:

  1. InvertedAirBlock — extends Block, full opaque cube with colour-tinted through model

  2. ChunkRendererRegionMixin — swaps block states at the chunk build source

  3. WorldRendererMixin — only cancels non-solid layers (no custom Tessellator calls)

  4. Strip InvertedWorldRenderer.java entirely (replaced by chunk pipeline)

  5. HotkeyHandler — no player state, just toggle + rebuild chunks

  6. InvertedCameraMod — clean init, chunk rebuild on toggle

Also need to remove old model dir structure if exists

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
14 618
src/main/java/com/invertedcamera/InvertedCameraMod.java
package com.invertedcamera;

import com.invertedcamera.client.HotkeyHandler;
import com.invertedcamera.client.InvertedWorldRenderer;
import com.invertedcamera.config.ConfigManager;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientEntityEvents;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class InvertedCameraMod implements ClientModInitializer {
    public static final Logger LOGGER = LoggerFactory.getLogger("InvertedCamera");

    public static boolean inverted = false;

    // Saved player state for restoration
    public static boolean savedFlying = false;
    public static boolean savedAllowFlying = false;
    public static boolean savedNoGravity = false;

    public static boolean isInverted() {
        return inverted;
    }

    @Override
    public void onInitializeClient() {
        ConfigManager.load();
        HotkeyHandler.register();

        // Rebuild mesh when player joins a world (chunks are fresh)
        ClientEntityEvents.ENTITY_LOAD.register((entity, world) -> {
            if (entity == net.minecraft.client.MinecraftClient.getInstance().player) {
                InvertedWorldRenderer.markDirty();
            }
        });

        // Periodically mark dirty to catch chunk changes
        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            if (inverted && client.world != null && client.player != null) {
                // Every 2 seconds (40 ticks), rebuild the mesh to catch chunk changes
                // This is a simple approach; a more sophisticated one would listen to chunk events
                if ((client.world.getTime() % 40) == 0) {
                    InvertedWorldRenderer.markDirty();
                }
            }
        });

        LOGGER.info("Inverted Camera initialized");
    }
}