Ore gen v2 (#16)

* Fix typo in island gui

* Add glow for challenges that are completed.

* Enhance ore generators to generate the ore when the block is broken.

* Fix worlds not unloading.

* Fix generating ore for obsidian.
This commit is contained in:
destro174 2024-04-21 18:47:40 +02:00 committed by GitHub
parent 94b3abb0f5
commit c081eb24ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -26,7 +26,7 @@ public class CobbestoneGeneratorListener implements Listener {
@EventHandler(ignoreCancelled = true)
public void onBockForm(BlockFormEvent blockFormEvent) {
Block block = blockFormEvent.getNewState().getBlock();
Block block = blockFormEvent.getBlock();
if (block.getType() == Material.OBSIDIAN)
return;
@ -43,9 +43,11 @@ public class CobbestoneGeneratorListener implements Listener {
@EventHandler(ignoreCancelled = true)
public void onBlockBreak(BlockBreakEvent event) {
Block block = event.getBlock();
if(!block.hasMetadata(GENERATOR_METADATA_KEY)) {
if(!block.hasMetadata(GENERATOR_METADATA_KEY))
return;
if (block.getType() == Material.OBSIDIAN)
return;
}
Island island = Island.getIsland(block.getWorld().getUID());
Material generatedMaterial = plugin.generatorHandler().generateOre(island, block.getType());

View File

@ -86,6 +86,7 @@ public class MasterWorldGenerator {
return;
}
newIsland.setDifficulty(Difficulty.NORMAL);
newIsland.setKeepSpawnInMemory(false);
newIsland.setGameRule(GameRule.DO_INSOMNIA, false);
// TODO Load a schematic into this world?
// Currently random islands are generated by CometIslandGenerator()
@ -119,6 +120,7 @@ public class MasterWorldGenerator {
return null;
}
newIsland.setKeepSpawnInMemory(false);
newIsland.setDifficulty(Difficulty.NORMAL); // TODO - island options to set difficulty
return newIsland;
}