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:
parent
94b3abb0f5
commit
c081eb24ff
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user