expose Npc#setWorld in the api

This commit is contained in:
Pyrbu 2024-08-19 17:45:42 +02:00
parent d7c0870546
commit 5c99681561
2 changed files with 17 additions and 0 deletions

View file

@ -38,6 +38,18 @@ public interface Npc extends PropertyHolder {
*/
void setLocation(NpcLocation location);
/**
* Sets the world of this NPC
* @param world The bukkit world to set
*/
void setWorld(World world);
/**
* Sets the world of this NPC
* @param name The name world to set
*/
void setWorld(String name);
/**
* Gets the hologram of this NPC
* @return The {@link Hologram} of this NPC

View file

@ -236,6 +236,11 @@ public class NpcImpl extends Viewable implements Npc {
this.worldName = world.getName();
}
public void setWorld(String name) {
delete();
this.worldName = name;
}
public void swingHand(boolean offHand) {
for (Player viewer : getViewers()) entity.swingHand(viewer, offHand);
}