📄
pasted-code-1793901337214.txt
txt
17 lines
▶
Act as an expert Minecraft Java Mod Developer specializing in the Fabric API for version 1.21+.
I need to create a lightweight, highly optimized space exploration mod inspired by ultraFLIGHT and Space Engine, designed to run smoothly on systems allocated with only 4GB of RAM.
Core Architectural Requirements:
1. Space Dimension: Create a custom dimension that is a completely empty void (no blocks, no chunk generation) to save memory.
2. Math-Based Infinite Galaxy: Implement a pseudo-random galaxy system using a 3D coordinate seed matrix. When the player enters space, procedurally calculate positions for celestial bodies (stars, planets) mathematically without saving region files to the disk.
3. Seamless Flight Transition: Provide a basic code skeleton for a rideable vehicle entity (Rocket/Spaceship) that changes the player's dimension to 'Space' seamlessly when reaching Y=2048 in the overworld.
4. 4GB RAM Visual & Performance Optimization:
- Use aggressive Level of Detail (LOD) rendering logic. Distant planets must render as lightweight 2D billboard sprites or low-polygon vertex models, transitioning to 3D entities only when close.
- Disable tick updates, AI, and collision matrices for any celestial entity further than 150 blocks from the player.
Please generate the essential Fabric Java classes:
- ModDimensions.java (Setting up the custom light-weight void space)
- SpaceShipEntity.java (The vehicle entity with basic custom movement/controls logic)
- RenderLowRamPlanet.java (The rendering client class that shifts resolution based on camera distance)
Ensure the code uses official Mojang mappings and modern Fabric registry systems. Keep the code clean, modular, and heavily commented.
Build a minimal Fabric 1.21.11/Yarn project scaffold and a void-space dimension with deterministic, non-persisted celestial coordinates.
Add the spaceship entity transition at Y=2048 and a client-side distance-based planet LOD renderer.
Register the required dimension/entity content and include the assets/data needed to load them.
Created an Astral Void Fabric 1.21.11 project with the empty-space dimension, rideable spaceship entity, procedural planet LOD renderer, and planet texture.
Planet locations are generated from a 3D coordinate seed and aren’t saved as entities. They render as low-poly spheres within 150 blocks and billboards farther away, so celestial bodies have no AI, ticking, or collision.
The ship steers toward the rider’s view, uses sprint for thrust and sneak to brake, and transfers with its passengers to Space at Y=2048. Its renderer is currently a visual placeholder; the ship has no model yet.
The dimension uses an empty flat generator with features disabled. Minecraft still loads and may save empty chunks; a normal data-driven dimension can’t guarantee zero chunk generation or region files.
The code uses Yarn mappings, as required by this project’s 1.21.11 setup, rather than Mojang mappings.
package com.kodari.astralvoid;
import com.kodari.astralvoid.client.RenderLowRamPlanet;
import com.kodari.astralvoid.client.SpaceShipRenderer;
import com.kodari.astralvoid.entity.SpaceShipEntity;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;
public final class SpaceModClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
EntityRendererRegistry.register(SpaceShipEntity.TYPE, SpaceShipRenderer::new);
RenderLowRamPlanet.initialize();
}
}