-
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve speed of ocean generator recalculation (#617)
* Improve speed of ocean generator recalculation * Add missing files (??) * Add missing newline * Fix compilation * Ignore material dynamically * Replace return with continue * Remove unused import * Update src/main/java/com/iridium/iridiumskyblock/api/IridiumSkyblockAPI.java Co-authored-by: Peaches_MLG <[email protected]>
- Loading branch information
1 parent
7146507
commit 4241e49
Showing
7 changed files
with
87 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/main/java/com/iridium/iridiumskyblock/generators/IridiumChunkGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.iridium.iridiumskyblock.generators; | ||
|
||
import com.iridium.iridiumcore.dependencies.xseries.XMaterial; | ||
import org.bukkit.World; | ||
import org.bukkit.generator.ChunkGenerator; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
/** | ||
* Base class for all IridiumSkyblock chunk generators. | ||
*/ | ||
public abstract class IridiumChunkGenerator extends ChunkGenerator { | ||
|
||
/** | ||
* Returns what a made with this generator is mainly consisting of.<p> | ||
* Used for performance improvements. | ||
* | ||
* @param world the world that should be checked | ||
* @return the most used material of the chunk generator in this generator | ||
*/ | ||
public abstract XMaterial getMainMaterial(@Nullable World world); | ||
|
||
/** | ||
* Returns whether the main material returned by {@link IridiumChunkGenerator#getMainMaterial(World)} | ||
* should be ignored. | ||
* | ||
* @return if the main material should be ignored | ||
*/ | ||
public boolean ignoreMainMaterial() { | ||
return getMainMaterial(null) == XMaterial.AIR; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters