mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-02 16:59:56 +01:00
Add default and none respawn styles
This commit is contained in:
parent
81315ba7a4
commit
c43362bb5e
@ -84,11 +84,26 @@ public class MVPlayerListener extends PlayerListener {
|
||||
// TODO: Handle Alternate Respawn from config
|
||||
|
||||
MVPlayerSession ps = this.plugin.getPlayerSession(event.getPlayer());
|
||||
Location newrespawn = ps.getRespawnWorld().getSpawnLocation();
|
||||
MVRespawnEvent mvevent = new MVRespawnEvent(newrespawn, event.getPlayer(), this.plugin.configMV.getString("notchrespawnstyle", "none"));
|
||||
//Location newrespawn = ps.getRespawnWorld().getSpawnLocation();
|
||||
Location newrespawn = event.getPlayer().getWorld().getSpawnLocation();
|
||||
String respawnStyle = this.plugin.configMV.getString("notchrespawnstyle", "none");
|
||||
String defaultWorld = this.plugin.configMV.getString("defaultspawnworld", "world");
|
||||
|
||||
if (respawnStyle.equalsIgnoreCase("none")) {
|
||||
event.setRespawnLocation(newrespawn);
|
||||
} else if (respawnStyle.equalsIgnoreCase("default")) {
|
||||
|
||||
if(this.plugin.isMVWorld(defaultWorld)) {
|
||||
event.setRespawnLocation(this.plugin.getServer().getWorld(defaultWorld).getSpawnLocation());
|
||||
} else {
|
||||
event.setRespawnLocation(newrespawn);
|
||||
}
|
||||
} else {
|
||||
MVRespawnEvent mvevent = new MVRespawnEvent(newrespawn, event.getPlayer(), respawnStyle);
|
||||
this.plugin.getServer().getPluginManager().callEvent(mvevent);
|
||||
event.setRespawnLocation(mvevent.getPlayersRespawnLocation());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||
|
Loading…
Reference in New Issue
Block a user