-
-
Notifications
You must be signed in to change notification settings - Fork 968
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support custom biomes in random teleport excluded biome list (#5703)
- Loading branch information
Showing
6 changed files
with
74 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
8 changes: 8 additions & 0 deletions
8
providers/BaseProviders/src/main/java/net/ess3/provider/BiomeKeyProvider.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,8 @@ | ||
package net.ess3.provider; | ||
|
||
import org.bukkit.NamespacedKey; | ||
import org.bukkit.block.Block; | ||
|
||
public interface BiomeKeyProvider extends Provider { | ||
NamespacedKey getBiomeKey(Block block); | ||
} |
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
19 changes: 19 additions & 0 deletions
19
providers/PaperProvider/src/main/java/net/ess3/provider/providers/PaperBiomeKeyProvider.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,19 @@ | ||
package net.ess3.provider.providers; | ||
|
||
import net.ess3.provider.BiomeKeyProvider; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.NamespacedKey; | ||
import org.bukkit.block.Block; | ||
|
||
@SuppressWarnings("deprecation") | ||
public class PaperBiomeKeyProvider implements BiomeKeyProvider { | ||
@Override | ||
public NamespacedKey getBiomeKey(final Block block) { | ||
return Bukkit.getUnsafe().getBiomeKey(block.getWorld(), block.getX(), block.getY(), block.getZ()); | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "Paper Biome Key Provider"; | ||
} | ||
} |