geforkt von Mirrors/Paper
87 Zeilen
3.0 KiB
Diff
87 Zeilen
3.0 KiB
Diff
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||
|
Date: Tue, 7 Jul 2020 10:52:34 -0700
|
||
|
Subject: [PATCH] More World API
|
||
|
|
||
|
|
||
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||
|
index 4f07a3385930b2f18dc642261a9d5ebe036ec932..8a9d367cfcf49f80f05633d16a7019798fc808ec 100644
|
||
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||
|
@@ -2533,6 +2533,75 @@ public class CraftWorld implements World {
|
||
|
return (nearest == null) ? null : new Location(this, nearest.getX(), nearest.getY(), nearest.getZ());
|
||
|
}
|
||
|
|
||
|
+ // Paper start
|
||
|
+ @Override
|
||
|
+ public Location locateNearestBiome(Location origin, Biome biome, int radius) {
|
||
|
+ return this.locateNearestBiome(origin, biome, radius, 8);
|
||
|
+ }
|
||
|
+
|
||
|
+ @Override
|
||
|
+ public Location locateNearestBiome(Location origin, Biome biome, int radius, int step) {
|
||
|
+ BlockPos originPos = new BlockPos(origin.getX(), origin.getY(), origin.getZ());
|
||
|
+ BlockPos nearest = getHandle().findNearestBiome(CraftBlock.biomeToBiomeBase(getHandle().registryAccess().registryOrThrow(Registry.BIOME_REGISTRY), biome), originPos, radius, step);
|
||
|
+ return (nearest == null) ? null : new Location(this, nearest.getX(), nearest.getY(), nearest.getZ());
|
||
|
+ }
|
||
|
+
|
||
|
+ @Override
|
||
|
+ public boolean isUltrawarm() {
|
||
|
+ return getHandle().dimensionType().ultraWarm();
|
||
|
+ }
|
||
|
+
|
||
|
+ @Override
|
||
|
+ public boolean isNatural() {
|
||
|
+ return getHandle().dimensionType().natural();
|
||
|
+ }
|
||
|
+
|
||
|
+ @Override
|
||
|
+ public double getCoordinateScale() {
|
||
|
+ return getHandle().dimensionType().coordinateScale();
|
||
|
+ }
|
||
|
+
|
||
|
+ @Override
|
||
|
+ public boolean hasSkylight() {
|
||
|
+ return getHandle().dimensionType().hasSkyLight();
|
||
|
+ }
|
||
|
+
|
||
|
+ @Override
|
||
|
+ public boolean hasBedrockCeiling() {
|
||
|
+ return getHandle().dimensionType().hasSkyLight();
|
||
|
+ }
|
||
|
+
|
||
|
+ @Override
|
||
|
+ public boolean isPiglinSafe() {
|
||
|
+ return getHandle().dimensionType().piglinSafe();
|
||
|
+ }
|
||
|
+
|
||
|
+ @Override
|
||
|
+ public boolean doesBedWork() {
|
||
|
+ return getHandle().dimensionType().bedWorks();
|
||
|
+ }
|
||
|
+
|
||
|
+ @Override
|
||
|
+ public boolean doesRespawnAnchorWork() {
|
||
|
+ return getHandle().dimensionType().respawnAnchorWorks();
|
||
|
+ }
|
||
|
+
|
||
|
+ @Override
|
||
|
+ public boolean hasRaids() {
|
||
|
+ return getHandle().dimensionType().hasRaids();
|
||
|
+ }
|
||
|
+
|
||
|
+ @Override
|
||
|
+ public boolean isFixedTime() {
|
||
|
+ return getHandle().dimensionType().hasFixedTime();
|
||
|
+ }
|
||
|
+
|
||
|
+ @Override
|
||
|
+ public Collection<org.bukkit.Material> getInfiniburn() {
|
||
|
+ return com.google.common.collect.Sets.newHashSet(com.google.common.collect.Iterators.transform(getHandle().dimensionType().infiniburn().getValues().iterator(), CraftMagicNumbers::getMaterial));
|
||
|
+ }
|
||
|
+ // Paper end
|
||
|
+
|
||
|
@Override
|
||
|
public Raid locateNearestRaid(Location location, int radius) {
|
||
|
Validate.notNull(location, "Location cannot be null");
|