More World API
This commit is contained in:
@@ -2130,6 +2130,28 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
|||||||
return new CraftStructureSearchResult(CraftStructure.minecraftToBukkit(found.getSecond().value()), CraftLocation.toBukkit(found.getFirst(), this));
|
return new CraftStructureSearchResult(CraftStructure.minecraftToBukkit(found.getSecond().value()), CraftLocation.toBukkit(found.getFirst(), this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Paper start
|
||||||
|
@Override
|
||||||
|
public double getCoordinateScale() {
|
||||||
|
return getHandle().dimensionType().coordinateScale();
|
||||||
|
}
|
||||||
|
|
||||||
|
@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(net.minecraft.core.registries.BuiltInRegistries.BLOCK.getTagOrEmpty(this.getHandle().dimensionType().infiniburn()).iterator(), blockHolder -> CraftBlockType.minecraftToBukkit(blockHolder.value())));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendGameEvent(Entity sourceEntity, org.bukkit.GameEvent gameEvent, Vector position) {
|
||||||
|
getHandle().gameEvent(sourceEntity != null ? ((CraftEntity) sourceEntity).getHandle(): null, net.minecraft.core.registries.BuiltInRegistries.GAME_EVENT.get(org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(gameEvent.getKey())).orElseThrow(), org.bukkit.craftbukkit.util.CraftVector.toBlockPos(position));
|
||||||
|
}
|
||||||
|
// Paper end
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BiomeSearchResult locateNearestBiome(Location origin, int radius, Biome... biomes) {
|
public BiomeSearchResult locateNearestBiome(Location origin, int radius, Biome... biomes) {
|
||||||
return this.locateNearestBiome(origin, radius, 32, 64, biomes);
|
return this.locateNearestBiome(origin, radius, 32, 64, biomes);
|
||||||
|
|||||||
@@ -12,4 +12,13 @@ public final class CraftVector {
|
|||||||
public static net.minecraft.world.phys.Vec3 toNMS(org.bukkit.util.Vector bukkit) {
|
public static net.minecraft.world.phys.Vec3 toNMS(org.bukkit.util.Vector bukkit) {
|
||||||
return new net.minecraft.world.phys.Vec3(bukkit.getX(), bukkit.getY(), bukkit.getZ());
|
return new net.minecraft.world.phys.Vec3(bukkit.getX(), bukkit.getY(), bukkit.getZ());
|
||||||
}
|
}
|
||||||
|
// Paper start
|
||||||
|
public static org.bukkit.util.Vector toBukkit(net.minecraft.core.BlockPos blockPosition) {
|
||||||
|
return new org.bukkit.util.Vector(blockPosition.getX(), blockPosition.getY(), blockPosition.getZ());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static net.minecraft.core.BlockPos toBlockPos(org.bukkit.util.Vector bukkit) {
|
||||||
|
return net.minecraft.core.BlockPos.containing(bukkit.getX(), bukkit.getY(), bukkit.getZ());
|
||||||
|
}
|
||||||
|
// Paper end
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user