mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-20 14:53:49 -07:00
Added the SPAWN_CHANGE event, which occurs when a world's spawn is changed.
This event includes the world who's spawn changed and its previous spawn location. To listen for this event: PluginManager pm = getServer().getPluginManager(); YourWorldListener worldListener = new YourWorldListener(this); pm.registerEvent(Event.Type.SPAWN_CHANGE, worldListener, Priority.Normal, this); To use this event: public class YourWorldListener extends WorldListener { @Override public void onSpawnChange(SpawnChangeEvent event) { World world = event.getWorld(); Location previousLocation = event.getPreviousLocation(); } } By: William Bowers <william.bowers@gmail.com>
This commit is contained in:
@@ -379,6 +379,12 @@ public final class JavaPluginLoader implements PluginLoader {
|
||||
((WorldListener) listener).onChunkUnload((ChunkUnloadEvent) event);
|
||||
}
|
||||
};
|
||||
case SPAWN_CHANGE:
|
||||
return new EventExecutor() {
|
||||
public void execute(Listener listener, Event event) {
|
||||
((WorldListener) listener).onSpawnChange((SpawnChangeEvent) event);
|
||||
}
|
||||
};
|
||||
case WORLD_SAVE:
|
||||
return new EventExecutor() {
|
||||
public void execute(Listener listener, Event event) {
|
||||
|
Reference in New Issue
Block a user