Introducing Armadillo Scuttles and Patching Command
What’s New:
Armadillo Scuttles in Chest Loot Tables
- I've temporarily added Armadillo Scuttles to the chest loot tables for the overworld, giving players quick access to new update items.
Armadillos in Overworld Spawner Settings
- Armadillos have been permanently added to the Overworld entity list in Spawner Settings.
Introducing the /patch Command
- The new /patch command allows for the forced patching of files to their new versions, ideal for servers with default settings. It replaces old files with new ones containing updated materials or entities. For heavily modified files, manual updating is recommended.
New Items and Entities
- The new items introduced are ARMADILLO_SCUTE and WOLF_ARMOR, while the ARMADILLO entity has been added as well.
I plan to further enhance compatibility by adding support for specific versions to the /patch command in the future and their associated items and entities.
What’s New:
Pre-Generator Feature:
-
Built in async pregenerator feature that allows for efficient world generation. This feature is accessible through the /pregen command, with customizable parameters for chunks per cycle and print update delay.
-
Works best on paper servers, on none paper servers the async functionality will not be used. Recommend you go into your paper server paper-global.yml and update these.
chunk-system:
gen-parallelism: 'true'
io-threads: 12
worker-threads: 12
-
Adjust io-threads and worker-threads to match your CPU’s thread count. Default settings utilize only half.
-
Usage: /pregen chunksPerCycle PrintUpdate(DelayinMinutes)
- For "chunksPerCycle" It’s recommended to match the number of threads your system has. For example, 12 threads yielded 50-80 chunks per second on a 5600x CPU, depending on server activity and other system tasks.
-
I left some headroom on CPU usage to decrease the likelihood of unintended block updates. I don't recommend playing while the pregeneration is happening, you can just let it run for a while if you don't want to play in a server and just want to generate the world, about 24 hours should be good enough.
Command Updates:
- Removed the "/sgon" command, eliminating the need for user-triggered commands to turn on SkyGrid generation. It now starts automatically during the first boot or subsequent server restarts/reloads. This modification improves the user experience by providing a more user-friendly and automated approach to SkyGrid generation, making the plugin more intuitive for server administrators.
This update is all about making your life easier and your server more efficient. I have been testing pregen for the last two months, if you run into any issue, please let me know (here).
Biome generation, Fog feature Updates and performance improvements
Updated Generator for enhanced biome generation, Fog feature Improvements and performance improvements
- Added support for multiple biomes: Modified the code to support multiple biomes in the header of the material files. You can now specify multiple biomes separated by commas.
-OCEAN,COLD_OCEAN,DEEP_COLD_OCEAN,DEEP_FROZEN_OCEAN,DEEP_LUKEWARM_OCEAN,DEEP_OCEAN,FROZEN_OCEAN,LUKEWARM_OCEAN-
SAND:80
SANDSTONE:9.0
SEA_PICKLE:1.0
TUBE_CORAL:1.0
TUBE_CORAL_FAN:1.0
HORN_CORAL:1.0
HORN_CORAL_FAN:1.0
FIRE_CORAL:1.0
FIRE_CORAL_FAN:1.0
BUBBLE_CORAL:1.0
BUBBLE_CORAL_FAN:1.0
BRAIN_CORAL:1.0
BRAIN_CORAL_FAN:1.0
-WARM_OCEAN-
SAND:80
SANDSTONE:20
- Updated Generator: Previously, the biome generation was done once per chunk, but it has been updated to check the biome for every block generated in the grid. This change ensures more accurate biome-specific generation and avoids issues where biomes don't extend all the way underground.
- Generator optimizations: Optimized to improve performance. Changes include storing constant values in local variables, minimizing block data modifications inside the loop, and reducing exception handling to enhance efficiency.
- Updates to Fog feature: Improved user experience by changing how the resource pack is installed. Previously, the resource pack was installed every time a player joined the server while the plugin was enabled. Now, the resource pack is only asked to be installed when the fogon command is used. This change provides a better experience for users who do not use the fog feature but were previously asked to install the resource pack every time they joined.
These changes allow for more precise biome-based block generation and improve the overall performance of the plugin. The updates ensure that the generated biomes are accurately represented throughout the world, overcoming limitations of the previous chunk-based approach.
Full Overhaul
New Feature and Improvements
Check out the updated installation Instructions
- Generator Overhaul: Completely revamped the generator for a 2x efficiency boost. Eliminated unnecessary chunk clearing checks, relying entirely on the datapack for smoother operation. Moved away from reliance on files to keep track of data, the only files now needed are in the OreGenBlock folder and SkygridBlocks folder.
- Introduction of GrowthControl Class: Ensures regulated growth of sugarcane and cactus generated by the system. Includes optional log commands (toggleable with 'gclogson' and 'gclogsoff') for tracking controlled plants, enhancing server management. This maintains the integrity of the skygrid over time with minimal performance impact. Even under simulated heavy loads, such as a high 'randomtickspeed' for 300 players, no discernible TPS drop occurred.
- Built-in Fog Feature: Added a new fog feature accompanied by a texture pack. Admins can enable it using '/fogon' and disable with '/fogoff'. This feature allows lower render distances without disrupting immersion. Upon server connection, users will receive a prompt to install a datapack for the fog; failure to install may result in a white bar at the top when the fog feature is activated. The texture pack conceals this UI change, crucial for the feature to function properly, as it cannot be implemented directly into the server's datapack files due to its nature.
- Reworked Ore Generation: Enhanced control allowing customization of stone and cobblestone generation via a new yml format. Preserves existing txt files for those with modifications, enabling an easy port-over to the new format.
# Ore Replacement Chances
# This file is used to specify the chances of different ores being chosen for replacement
# when lava or water generates stone blocks in the world. The stone generate in the world can be replaced by any block you want as long as its in the bukkit materials list https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html
# Format: Material_Name:Percentage
# The percentage represents the chance (in whole numbers) of the ore being chosen
# for replacement out of the total replacements when lava or water generates stone.
# Each line represents one ore with its corresponding replacement chance.
# Lines starting with '#' are considered comments and will be ignored by the code.
# Example:
# DIAMOND_ORE:5
# This means that there is a 5% chance of a diamond ore block being chosen
# when lava or water generates a stone block.
# The total sum of percentages should be less than or equal to 100.
# If the sum exceeds 100, the probabilities will be scaled down proportionally
# to fit within the 0-100 range.
# For example, if the total sum of percentages exceeds 100 as follows:
# DIAMOND_ORE:40
# COAL_ORE:60
# IRON_ORE:30
# GOLD_ORE:20
# The total sum is 40 + 60 + 30 + 20 = 150, which exceeds 100.
# To fit within the 0-100 range, the probabilities will be scaled down proportionally:
# DIAMOND_ORE: 40 * (100 / 150) = 26 (approximately 27)
# COAL_ORE: 60 * (100 / 150) = 40
# IRON_ORE: 30 * (100 / 150) = 20
# GOLD_ORE: 20 * (100 / 150) = 13 (approximately 13)
# The adjusted probabilities now add up to 26 + 40 + 20 + 13 = 99, which is within the 0-100 range.
#For if the block generated though water and lava is stone
STONE:
STONE: 98
COAL_ORE: 0.3
COPPER_ORE: 0.4
DIAMOND_ORE: 0.1
EMERALD_ORE: 0.1
GOLD_ORE: 0.2
IRON_ORE: 0.4
LAPIS_ORE: 0.2
REDSTONE_ORE: 0.3
#For if the block generated though water and lava is cobblestone
COBBLESTONE:
DEEPSLATE: 98
DEEPSLATE_COAL_ORE: 0.3
DEEPSLATE_COPPER_ORE: 0.4
DEEPSLATE_DIAMOND_ORE: 0.1
DEEPSLATE_EMERALD_ORE: 0.1
DEEPSLATE_GOLD_ORE: 0.2
DEEPSLATE_IRON_ORE: 0.4
DEEPSLATE_LAPIS_ORE: 0.2
DEEPSLATE_REDSTONE_ORE: 0.3
General Fixes
Synchronized Chunk Clearing:
- Resolved an issue with out-of-sync chunk clearing between the Void Worldgen Data pack and the plugin's block placement, preventing blocks from being placed in chunks not yet processed by the data pack. Increased delay for chunk processing after loading to minimize potential conflicts, particularly during high server loads. Despite this mitigation, during periods of extreme overload, the generator and datapack may still go out of sync intermittently. To further reduce the chance of chunk errors during high loads, consider reducing player render distance. Typically, a reasonable distance is around 6 chunks, but further reduction may be necessary on less capable servers to maintain stability and prevent chunk-related issues.
Performance Optimization:
- Adjusted generator settings to optimize performance on less capable servers. Previously, block placements for the overworld covered a range from -64 to 256, while the nether and end were limited to 0 to 128. Modified block placements to unify the height across all dimensions, reducing load by restricting overworld block placements from -64 to 64, resulting in uniform grids of 128 blocks in height across all dimensions. This adjustment aims to alleviate server load, particularly in environments with higher user activity.
These adjustments aim to enhance synchronization between the plugin and the data pack, ensuring smoother block generation while optimizing server performance for a better user experience.
Chest Support Added
New Feature: Chest Support Added
Key Features:
- Flexible Loot Customization: Tailor chest loot settings with precision, specifying the items, percentages, and amounts.
- Tiered Loot Distribution: Items are distributed into tiers, adding variety and complexity to the loot. Each tier has its own set of items with different probabilities.
- Biome-Specific Chests: Customize chest loot for specific biomes, allowing for a more immersive and thematic distribution of items based on the environment.
- Easy Configuration: Edit the ChestSettings.yml file located in the SkygridBlocks folder to define the loot settings for each chest. Use compact or expanded formatting for easy customization.
How to Use:
- Update your plugin to the latest version.
- Configure Chests: Open the ChestSettings.yml file located in the plugin's SkygridBlocks folder.
- Customize Loot Settings: Define the loot settings for each chest in the configuration file. Use the provided examples as a guide.
# The available items for use can be found at https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html
# The available biomes can be found here: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/Biome.html
# In YAML, identifiers or keys (such as "Chest1" in your example) are subject to certain rules.
# - Do's -
# Alphanumeric Characters: Identifiers can contain letters (both uppercase and lowercase) and numbers. For example, "Chest1" is a valid identifier.
# Underscores: You can use underscores (_) in identifiers. For instance, "my_chest" is a valid identifier.
# Hyphens in Quoted Strings: If an identifier contains special characters or spaces, you can enclose it in single or double quotes. For example, "'Special Chest'" or "\"Special Chest\"" are valid.
# - Don'ts -
# Special Characters: Avoid using special characters like !, @, #, $, %, etc., in identifiers without enclosing them in quotes. For example, "Chest@123" should be written as "'Chest@123'" if you want to use special characters.
# Leading Spaces: Identifiers should not have leading spaces. For instance, " MyChest" with a space at the beginning is not a valid identifier.
# Trailing Spaces: Similarly, identifiers should not have trailing spaces. "MyChest " with a space at the end is not valid.
# Spaces in the Middle: While you can use spaces within identifiers if they are enclosed in quotes, it's generally a good practice to avoid spaces within identifiers for clarity. For example, "My Chest" is valid, but "MyChest" is more commonly used.
# Reserved Keywords: Avoid using YAML reserved keywords as identifiers. These keywords have special meaning in YAML and should not be used as keys. For example, "true," "false," and "null" are reserved keywords.
# Case Sensitivity: YAML is case-sensitive. "myChest" and "MyChest" would be considered as two different identifiers.
# ChestSettings: This is the top-level section of the YAML configuration and acts as the main container for all chest settings.
# Chest1: This represents the first chest configuration, which we'll be using as an example. The code will look for a chest configuration with the key "Chest1." The key can be whatever you want; it serves as an identifier.
# Items: Under the "Chest1" configuration, there is an "Items" section. The code will process the items listed here to determine what should be placed in the chest's inventory. Formatting: "- ITEM_NAME:PERCENTAGE:MAX_AMOUNT"
# Biomes: This section lists the biomes in which the chest's item configuration will apply. Formatting: "- BIOME_NAME"
Example with Expanded Formatting:
ChestSettings:
Chest1:
Items:
- MYCELIUM:30:5
- RED_MUSHROOM:20:5
- BROWN_MUSHROOM:20:5
- RED_MUSHROOM_BLOCK:10:5
- BROWN_MUSHROOM_BLOCK:10:5
- MUSHROOM_STEM:10:5
Biomes:
- MUSHROOM_FIELDS
# The YAML above will be interpreted as follows:
# For a chest located in the "MUSHROOM_FIELDS" biome, the code will use the specified item settings to randomly populate the chest's inventory. The percentage chances and amount ranges for each item will be considered when filling the chest.
# MYCELIUM:30:5 - This line specifies an item with the name "MYCELIUM" with a chance of 30% (percentage) of being placed in the chest, and the max amount of this item is 5. The code will randomly select a value between 1 and 5 for the number of MYCELIUM to place in the chest.
Example with Compact Formatting:
ChestSettings:
Chest1:
Items: [WOODEN_AXE:20:1, WOODEN_PICKAXE:20:1, CROSSBOW:20:1, ...]
Biomes: [BADLANDS, BAMBOO_JUNGLE, BIRCH_FOREST, ...]
# This is a more compact way of formatting the above. Both versions are valid.
# How to format item entries: [ITEM_NAME:PERCENTAGE:MAX_AMOUNT]. If there is more than one item, you can do [ITEM_NAME:PERCENTAGE:MAX_AMOUNT, ITEM_NAME:PERCENTAGE:MAX_AMOUNT].
# If you are doing multiple biomes, this is also a more compact way of formatting it.
# How to format biome entries: [BIOME_NAME]. If there is more than one biome, you can do [BIOME_NAME, BIOME_NAME].
Sample of 10 chest from the Overworld, Nether, and End with the included Pre-Configuration.
Spawner Support Added
New Feature: Customize Mob Spawner Settings
Elevate your Skygrid adventures with the new Spawner Support feature, offering complete control over mob spawner settings. Customize spawner attributes, including the types of entities, spawn rates, and other parameters.
Key Features:
- Fine-Tune Spawner Settings: Precisely adjust the spawner settings, specifying the entity, delay, max nearby entities, and more.
- Random Entity Selection: Set the spawn weights for entities to add unpredictability to your gameplay. The plugin will select entities randomly based on these weights.
- Worldwide Customization: Customize spawners for all biomes across all world dimensions, ensuring a seamless and immersive experience.
- Grid Block Inclusion: To enable the Spawner Support feature, be sure to add the SPAWNER block to your world.txt, world_nether.txt, or world_the_end.txt configuration in the SkygridBlocks folder. The Spawner code won't be called unless the SPAWNER block is added.
- Biome-Specific Spawners: Customize spawners for specific biomes at the block level, adding a new layer of customization. For example, if you specify the biome as "DEEP_DARK," you can configure spawners to spawn WARDEN entities exclusively in that biome.
How to Use:
- Update your plugin to the latest version.
- Configure Spawners: Open the SpawnerSettings.yml file located in the plugin's folder.
- Customize Settings: Define the settings for each spawner in the configuration file, specifying the entity, delay, max nearby entities, and more. You can use either of the following YML formatting styles, and they will both be read the same by the YML parser:
# The available entities for use can be found at https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/EntityType.html
# The available biomes can be found here: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/Biome.html
# Entities - Define entities and their chances of being chosen for the spawner. Formatting "- DOLPHIN:33.33"
# Biomes - List the biomes where this spawner will spawn. Formatting "- BEACH"
# Delay: - Set the spawner's delay. If set to -1, the delay will be randomized (randomly choose a delay between min and max spawn delays).
# MaxNearbyEntities - Set the maximum nearby entities (of the same type) allowed. Default value is 16.
# MaxSpawnDelay - The maximum spawn delay amount (in ticks). This value must be greater than 0 and less than or equal to MaxSpawnDelay. Default value is 800 ticks.
# MinSpawnDelay - The minimum spawn delay amount (in ticks). Default value is 200 ticks.
# PlayerRange - Set the range for player activation (given that there are players online). Default value is 16.
# SpawnCount - Set how many mobs attempt to spawn. Default value is 4.
# SpawnRange - Set the radius around which the spawner will attempt to spawn mobs in. Default value is 4.
Example with Expanded Formatting:
SpawnerSettings:
Spawner1:
Entities:
- SKELETON:100
- ZOMBIE:100
Biomes:
- FOREST
- PLAINS
Delay: -1
MaxNearbyEntities: 16
MaxSpawnDelay: 800
MinSpawnDelay: 200
PlayerRange: 16
SpawnCount: 4
SpawnRange: 4
Example with Compact Formatting:
SpawnerSettings:
Spawner1:
Entities: [SKELETON:100, ZOMBIE:100]
Biomes: [FOREST, PLAINS]
Delay: -1
MaxNearbyEntities: 16
MaxSpawnDelay: 800
MinSpawnDelay: 200
PlayerRange: 16
SpawnCount: 4
SpawnRange: 4
In these examples, "Spawner1" can spawn both SKELETON and ZOMBIE entities with equal chances.
Random Entity Selection: Create a list of entities with associated spawn weights to add unpredictability to your spawners.
Entities: [SKELETON:10, ZOMBIE:10, CREEPER:5]
In these examples, "Spawner1" can spawn both SKELETON and ZOMBIE entities with equal chances.
With Spawner Support, you have the freedom to tailor your spawner settings to your liking. Enjoy the flexibility to customize spawners for all biomes across all world dimensions, making your Skygrid experience truly unique. Stay tuned for more updates, as I am working on additional features such as chest support. Your feedback and suggestions are highly valued as we continue to improve the plugin.
Biome Generation Support
New Feature: Biome-Specific Block Generation
- Customize the block generation in your world based on different biomes. Specify unique block materials and percentages for each biome in the world.
- Enjoy a more immersive and dynamic Skygrid experience with biome-specific block generation.
How to Use:
- Update your plugin to the latest version.
- Configure Biome-Specific Blocks:
- Open the text files for each world dimension (e.g., world.txt, world_nether.txt, world_the_end.txt) located in the plugin's folder.
- Specify block materials and their respective percentages for each biome in your world.
For example:
DIRT:20
STONE:20
GRASS_BLOCK:20
-OCEAN-
SAND:50
WATER:50
-DESERT-
SAND:100
- In this example, when generating chunks in the "OCEAN" biome, there's a 50% chance of generating "SAND" blocks and a 50% chance of generating "WATER" blocks. In the "DESERT" biome, only "SAND" blocks will be generated. For the blocks above they will be generated on all biomes not specified in the file for that dimension. So, if you only want to have 1 custom biome with the rest having another variety of blocks you can do that.
- Biomes are signified by the -BIOME_NAME-, everything under the biome header will generate only in that biome, unless there is another biome under it like in the example above.
Here is another example,
-OCEAN-
SAND:80
SANDSTONE:9
SEA_PICKLE:1
TUBE_CORAL:1
TUBE_CORAL_FAN:1
HORN_CORAL:1
HORN_CORAL_FAN:1
FIRE_CORAL:1
FIRE_CORAL_FAN:1
BUBBLE_CORAL:1
BUBBLE_CORAL_FAN:1
BRAIN_CORAL:1
BRAIN_CORAL_FAN:1
- Supported biomes can be found here: Biomes
I hope this new feature adds a layer of depth to your Skygrid adventures. As always, we value your feedback and suggestions to further improve the plugin. Feel free to reach out with any questions or comments. Next features being worked on right now is spawner and chest support, no ETA.
Fixed "moved too quickly" Warnings
Issues:
- Warning spam when players used /tpr command
- Example: [99:99:99 WARN]: Go0fy_Go0ber moved too quickly! 999,999,999
Remedies:
- Resolved the issue of "moved too quickly" warnings spam by enhancing the block identification system, ensuring players are less likely to be teleported onto dangerous blocks.
Critical Update: Data Safety!
Issues:
- Thread Safety: The original code was not thread-safe, which could lead to data inconsistency when multiple threads access and modify the clearedChunks set simultaneously.
- Saving Chunks: The plugin needed to save cleared chunks periodically, but there was no mechanism to do so at regular intervals.
- Chunk Clearing: The code clears chunks in response to the ChunkLoadEvent, but it was necessary to ensure that the chunks were not cleared repeatedly.
Remedies:
-
Thread Safety: Used a ConcurrentHashMap.newKeySet() for the clearedChunks set to make it thread-safe. Additionally, I added the synchronized keyword to the saveClearedChunks method to ensure that the saving process is thread-safe.
-
Saving Chunks: Implemented a scheduled task using Bukkit's scheduler to call the saveClearedChunks method at regular intervals (e.g., every 5 seconds) to save cleared chunks.
-
Chunk Clearing: Introduced a check in the clearChunk method to ensure that chunks are not cleared again if they have already been cleared. This helps prevent repeated clearing of chunks in the same session.
By making these changes, the plugin should now handle data more safely and efficiently, especially in multi-threaded environments, and ensure that cleared chunks are saved periodically.