Merge branch 'master' of github.com:Herocraft/Multiverse-Core

This commit is contained in:
Eric Stokes 2011-09-16 18:35:22 -06:00
commit b76da91013
2 changed files with 20 additions and 10 deletions

View File

@ -659,10 +659,12 @@ public class MVWorld {
config.setProperty("worlds." + this.name + ".gamemode", this.gameMode.toString());
saveConfig();
for(Player p : this.plugin.getServer().getWorld(this.getName()).getPlayers()) {
if (this.plugin.getConfig().getBoolean("enforcegamemodes", true)) {
for (Player p : this.plugin.getServer().getWorld(this.getName()).getPlayers()) {
this.plugin.log(Level.FINER, "Setting " + p.getName() + "'s GameMode to " + this.gameMode.toString());
this.plugin.getPlayerListener().handleGameMode(p, this);
}
}
return true;
}

View File

@ -70,9 +70,11 @@ public class MVPlayerListener extends PlayerListener {
return;
}
if(event.isBedSpawn() && this.plugin.getConfig().getBoolean("bedrespawn", true)) {
if (event.isBedSpawn() && this.plugin.getConfig().getBoolean("bedrespawn", true)) {
// Handle the Players GameMode setting for the new world.
if (this.plugin.getConfig().getBoolean("enforcegamemodes", true)) {
this.handleGameMode(event.getPlayer(), event.getRespawnLocation().getWorld());
}
this.plugin.log(Level.FINE, "Spawning " + event.getPlayer().getName() + " at their bed");
return;
}
@ -98,8 +100,10 @@ public class MVPlayerListener extends PlayerListener {
event.setRespawnLocation(respawnEvent.getPlayersRespawnLocation());
// Handle the Players GameMode setting for the new world.
if (this.plugin.getConfig().getBoolean("enforcegamemodes", true)) {
this.handleGameMode(event.getPlayer(), respawnEvent.getPlayersRespawnLocation().getWorld());
}
}
private Location getMostAccurateRespawnLocation(World w) {
MVWorld mvw = this.worldManager.getMVWorld(w.getName());
@ -118,8 +122,10 @@ public class MVPlayerListener extends PlayerListener {
event.getPlayer().sendMessage("If you just wanna see all of the Multiverse Help, type: " + ChatColor.GREEN + "/mv");
}
// Handle the Players GameMode setting for the new world.
if (this.plugin.getConfig().getBoolean("enforcegamemodes", true)) {
this.handleGameMode(event.getPlayer(), event.getPlayer().getWorld());
}
}
@Override
public void onPlayerQuit(PlayerQuitEvent event) {
@ -151,7 +157,9 @@ public class MVPlayerListener extends PlayerListener {
// Only check payments if it's a different world:
if (!event.getTo().getWorld().equals(event.getFrom().getWorld())) {
// Handle the Players GameMode setting for the new world.
if (this.plugin.getConfig().getBoolean("enforcegamemodes", true)) {
this.handleGameMode(event.getPlayer(), toWorld);
}
// If the player does not have to pay, return now.
if (toWorld.isExempt(event.getPlayer())) {