Deprecates `WorldCore#getSpawner(CreatureSpawner)`

It is a hussle to implement this method in every NMS version and doesn't provide much value.


Related to:
* e7bb4bf7634cfb27199fa88e047d138a896a229e
* 1cd96b10c5
This commit is contained in:
Christian Koop 2023-05-06 21:16:11 +02:00
parent 7c09845789
commit 0906cbf9c8
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
3 changed files with 14 additions and 0 deletions

View File

@ -10,6 +10,10 @@ import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
public interface WorldCore {
/**
* @deprecated Use {@link #getSpawner(Location)} instead
*/
@Deprecated
SSpawner getSpawner(CreatureSpawner spawner);
SSpawner getSpawner(Location location);

View File

@ -26,6 +26,11 @@ import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
public class WorldCoreImpl implements WorldCore {
@Override
public SSpawner getSpawner(CreatureSpawner spawner) {
return new SSpawnerImpl(spawner.getLocation());
}
@Override
public SSpawner getSpawner(Location location) {
return new SSpawnerImpl(location);

View File

@ -27,6 +27,11 @@ import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
public class WorldCoreImpl implements WorldCore {
@Override
public SSpawner getSpawner(CreatureSpawner spawner) {
return new SSpawnerImpl(spawner.getLocation());
}
@Override
public SSpawner getSpawner(Location location) {
return new SSpawnerImpl(location);