← Back to home ⛏️ Performance Core

Cobblestone Generator

The heart of every Skyblock island. WOSBlock's generator doesn't just drop cobblestone - it spawns weighted ores based on your island's Generator Level, with performance optimizations that keep TPS stable even when hundreds of generators are running simultaneously.

How It Works

Dynamic ore generation

When lava flows into water on your island, the standard cobblestone replacement is intercepted. Instead of always producing cobblestone, the plugin rolls against a weighted probability table based on your island's current Generator Level to determine which ore spawns.

⚡ O(1) Performance Optimization

BlockFromToEvent fires thousands of times per minute across a full server. Calculating random ore weights dynamically inside the event loop would cause catastrophic lag spikes. Instead, all generator chances are pre-calculated once at plugin initialization and cached into a flat 100-element array in memory (HashMap<Integer, Material[]>). Every lookup runs at O(1) - no file reads, no weight math, no garbage collection pressure inside the hot path.

Block Placement Optimization

When changing blocks inside the fluid generation event, the plugin passes false to the block state update flag. This disables unneeded neighbourhood physics checks, saving meaningful CPU time per event - especially critical at high population.

Weighted Ore Tables

Each Generator Level has a fully configurable ore probability table in config.yml. Lower levels produce mostly cobblestone. Higher levels introduce Iron, Coal, Gold, Lapis, Redstone, Diamond, and eventually Emerald with configured percentage chances.

Shared Island Instance

The Generator Level is tied to the island instance, not individual players. Every trusted co-op member mining blocks or consuming XP Scrolls contributes to the same shared generator level.

Leveling System

Two ways to level up

Generator XP accumulates on the island instance. Level up to unlock better ore probability tables and access higher-tier resources faster.

🔨 Mining XP

Every block or ore mined from the generator awards XP to the island instance. Rare ores award more XP than standard cobblestone. The Blast Mining enchantment multiplies XP gain by breaking multiple ores in one swing.

📜 Cobble Gen XP Scroll

Instantly injects a flat +1,000 XP directly into the island's generator level tracker. Duration: instant. The scroll is craftable using configurable mob drop ingredients and tradeable on the Auction House.

📊 Level Progression

Each level requires an increasing amount of XP and unlocks improved ore weights. All level thresholds and ore probability tables are fully configurable - server owners control the entire progression curve.

Blast Mining enchantment synergy

The Blast Mining (Vein Miner) pickaxe enchantment breaks up to 3 adjacent ores of the same type per swing. All broken blocks count toward Generator XP and island achievements - making it the single most valuable early-game investment for rapidly leveling the generator.