Act as an elite Minecraft Java systems engineer specializing in high-performance world generation, NMS-free chunk manipulation, and asynchronous thread safety using the PaperMC API for version 1.21.1.
I am building a completely production-ready, bulletproof world-generation and environmental management plugin named "UnstableUniverse", exactly reproducing the core mechanics, coordinates, and structural layouts seen on the Unstable SMP series.
CRITICAL ASSIGNMENT INSTRUCTIONS:
- Write fully realized, production-grade, compilable Java source code from top to bottom.
- You are strictly forbidden from omitting any code, truncating loops, using placeholders, or using shorthand syntax. Every single bracket, statement, initialization, loop body, and structural math formula must be written out completely.
- Do not include any ascii diagrams, visual text-art boxes, or graphic flowcharts. Output only raw code.
Implement the following comprehensive specifications exactly:
- TARGET BOUNDARY ENGINE & SYMMETRICAL MATH (OVERWORLD)
- The Overworld is mapped as expanding square rings in all directions (positive and negative). You must implement an explicit Chebyshev distance function: long getDistance(long x, long z) { return Math.max(Math.abs(x), Math.abs(z)); }. - All boundary checks in the populator must use this distance to guarantee the biomes wrap perfectly around the world center like nested boxes. - For distances 0 to 67,999 OR 120,001 to 249,999 OR 500,001 to 11,999,999, the populator must do absolutely nothing to the surface (allow standard Vanilla Overworld generation).
- ZONE 1: AMPLIFIED TERRAIN BOUNDARY (68,000 to 100,000 blocks - Overworld)
- When the chunk distance is between 68,000 and 100,000 blocks, modify the chunk's vertical generation scale to emulate fully Amplified terrain. - Implement a high-amplitude noise modifier or a linear vertical height multiplier that stretches natural terrain contours up to Y=320, creating massive, towering cliffs, extreme overhangs, and deep valleys. - To ensure it does not look like a flat chunk cut, implement a smoothing interpolation function at the 68,000 and 100,000 block thresholds so the amplified chaos transitions organically out of and back into normal vanilla terrain levels.
- ZONE 2: THE NATURAL MIST BIOME (100,000 to 120,000 blocks - Overworld)
- When the chunk distance is between 100,000 and 120,000 blocks, generate The Mist biome organically. - Do NOT make it look like a flat chunk cut. Read the vanilla block heights dynamically. - Terrain generation: Convert the natural surface blocks to Material.SNOW_BLOCK and Material.POWDER_SNOW. - Ice Spikes: Use a deterministic randomizer based on chunk coordinates to organically generate towering Material.PACKED_ICE spikes. CRITICAL: These spikes must NOT be perfectly straight vertical columns. You must implement a curved trajectory algorithm using X/Z coordinate offsets (using sine/cosine or angled vectors as Y increases) so the spikes tilt and curve organically to the side, blending smoothly into the natural hills. - Blue Fog Biome Manipulation: To achieve the signature thick blue fog, you must set the Biome of every block in these chunk columns to Biome.SOUL_SAND_VALLEY (or a functionally equivalent blue-fog biome), overriding the Overworld default so the client natively renders a thick blue atmospheric fog tint.
- ZONE 3: THE GREAT SEA (250,000 to 500,000 blocks - Overworld)
- When the chunk distance is between 250,000 and 500,000 blocks, override the terrain completely. - Erase all continental landmasses: Loop through every X and Z block in the chunk column. Set every single block above Y=63 to Material.AIR to create a desolate, endless ocean. - Force-generate a uniform oceanic basin: Set a flat seabed floor using Material.GRAVEL at Y=45. Fill every coordinate vacancy between Y=46 and Y=63 completely with static Material.WATER. Below Y=45 down to bedrock, replace everything with solid Material.STONE.
- ZONE 4: THE UNSTABLE FARLANDS (Starts at 12,000,000 blocks - Overworld)
- Implement the progressive generation router: If distance >= 12,000,000, subtract 12,000,000. Divide that remaining value by the gap size (500,000 blocks), cast it into an integer, and use it as the index to pull the active style. Clamp the index safely across the 15 verified styles. - Construct a complete switch-case for the styles using these precise visual layouts: - "REPEATING": Generates a perfectly flat, uniform grass runway lane between Y=63 and Y=70, bounded on its left and right sides by continuous, sharp, perfectly straight vertical cliff walls of sliced repeating terrain layers. - "CHUNKLANDS": Shims independent 16x16 chunk columns up or down using a pseudo-random integer height offset per chunk hash, forming wildly disjointed blocky cliff seams, step-cliffs, and fractured vertical elevations. - "FLOATING": Generates completely broken, fractured islands, trees, and terrain patches hovering detached mid-air over open void gaps, completely omitting any solid ocean or ground below them. - "CHERRY": Generates continuous, massive rolling mountain ridges entirely carpeted and buried under a solid, hyper-dense canopy of cherry leaves, logs, and pink petals. - "GRIDS": Mathematical wireframe generation. Constructs a repeating, uniform 3D grid lattice made entirely of thin 1-block wide intersecting lines of grass and stone, forming an empty geometric grid matrix floating in space. - "SPIKES": Spawns arrays of ultra-thin, needle-like stone pillars (1x1 or 2x2 blocks thick) shooting perfectly straight vertical lines from the ground level up into the sky limit, spaced apart uniformly like a massive cage. - "SAND": Classic Farlands porous structure composed entirely of sand and sandstone. Generates massive, towering vertical comb-like sheets and hollow grid block walls separated by deep vertical gaps. - "DECAY": Striped coordinate chunk corruption. Divides coordinates into parallel linear strips or rows (every 16 blocks wide). Modifies block composition entirely per row, alternating strips cleanly (e.g., a row of cobblestone, a row of red mushroom blocks, a row of mossy blocks, a row of trees) to create a distinct striped landscape pattern. - "SANDHILLS": Generates an infinite, smooth, repeating desert landscape of sweeping sand dunes, crests, and desert valleys using clean multi-sine wave height math. - "NORMAL": Classic 3D noise equation (scale: 684.412) creating a towering porous matrix of stone and dirt up to Y=210, pocketed with smooth looping Swiss-cheese cave tunnels. - "GRASSHILLS": Mathematical cone formulas creating sharp mountain pyramids made of grass and dirt shooting up to Y=310. - "FLOWERFIELD": A completely flat grass surface at Y=63 densely packed with a randomized grid sequence of all vanilla flowers. - "WARTSFIELD": Mutates all stone and dirt entirely into netherrack and soul sand, packed on the surface with solid rows of fully grown nether wart. - "WAVEYLANDS": Smooth double-sine wave functions offsetting the surface layer dynamically to make the ground roll like waves. - "DARKFOREST": Generates a solid horizontal canopy roof of dark oak wood and leaves at Y=100 that completely cuts off sky-light, leaving the ground below pitch black.
- GLOBAL DIMENSION OVERRIDE: THE UNDERWORLD (The Nether)
- The Underworld is exclusively generated in the Nether dimension. Your BlockPopulator must check the world environment (World.Environment.NETHER) before applying this logic. - When generating chunks in the Nether, completely overhaul the terrain to represent the Underworld lore: Replace all standard Material.NETHERRACK and Nether biomes with massive, sprawling caverns of Material.SOUL_SOIL, Material.SOUL_SAND, and Material.SMOOTH_BASALT using a noise-based mix. - To create the eerie atmosphere, use a randomizer to place Material.SOUL_FIRE extensively on exposed floor blocks across the dimension.
- THE MIST CONTROLLER & COMMAND UTILITIES
- Implement a BukkitRunnable ticking precisely on a 20-tick period. - It must evaluate all online players. If a player's distance is inside the natural Mist Biome ring (100k - 120k) OR if their Euclidean distance is within the manually configured "/mist set <radius>" boundary: 1. Apply non-ambient, particle-hidden PotionEffectType.BLINDNESS and PotionEffectType.DARKNESS for 40 ticks to heavily restrict view distance. 2. If the player is in the manual radius, use Paper API environment methods or send a packet to force the client to render a Blue Fog (simulating the Soul Sand Valley tint) to match the natural biome. - Code the "/mist set <radius>" command executor and TabCompleter completely. It must map the calling player's current X/Z location as the custom Mist center, update the config file safely, and return a clean success message.
Provide the entire plugin architecture layout completely implemented: The Main entry class, the Populator class, the Command and Tab completion executors, and the fully structured plugin.yml file.