mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 17:01:56 +01:00
Implemented the new SpawnChangeEvent in CraftWorld.setSpawnLocation()
By: William Bowers <william.bowers@gmail.com>
This commit is contained in:
parent
7deee386c8
commit
3547e8a410
1 changed files with 7 additions and 0 deletions
|
@ -11,6 +11,7 @@ import java.util.Random;
|
||||||
import net.minecraft.server.*;
|
import net.minecraft.server.*;
|
||||||
|
|
||||||
import org.bukkit.entity.Arrow;
|
import org.bukkit.entity.Arrow;
|
||||||
|
import org.bukkit.event.world.SpawnChangeEvent;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.Boat;
|
import org.bukkit.entity.Boat;
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
|
@ -72,7 +73,13 @@ public class CraftWorld implements World {
|
||||||
|
|
||||||
public boolean setSpawnLocation(int x, int y, int z) {
|
public boolean setSpawnLocation(int x, int y, int z) {
|
||||||
try {
|
try {
|
||||||
|
Location previousLocation = getSpawnLocation();
|
||||||
world.q.a(x, y, z);
|
world.q.a(x, y, z);
|
||||||
|
|
||||||
|
// Notify anyone who's listening.
|
||||||
|
SpawnChangeEvent event = new SpawnChangeEvent(this, previousLocation);
|
||||||
|
server.getPluginManager().callEvent(event);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue