Add Bed Respawns back in! Thanks @Vaht

This commit is contained in:
Eric Stokes 2011-09-01 19:18:56 -06:00
parent d09d340e0f
commit ad47ce7d1b
2 changed files with 11 additions and 2 deletions

View File

@ -1,5 +1,7 @@
package com.onarandombox.MultiverseCore.listeners;
import java.util.logging.Level;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.World;
@ -59,8 +61,6 @@ public class MVPlayerListener extends PlayerListener {
@Override
public void onPlayerRespawn(PlayerRespawnEvent event) {
// TODO: Reimplement bed respawning, needs to be a way to persist the bed location or something otherwise it's not very effective.
World world = event.getPlayer().getWorld();
// If it's not a World MV manages we stop.
@ -68,6 +68,11 @@ public class MVPlayerListener extends PlayerListener {
return;
}
if(event.isBedSpawn() && this.plugin.getConfig().getBoolean("bedrespawn", true)) {
this.plugin.log(Level.FINE, "Spawning " + event.getPlayer().getName() + " at their bed");
return;
}
// Get the MVWorld
MVWorld mvWorld = this.worldManager.getMVWorld(world.getName());
// Get the instance of the World the player should respawn at.

View File

@ -30,6 +30,10 @@ disableautoheal: false
# Players will be notified when they punch/shoot and it's not allowed.
fakepvp: false
# When this is enabled, users will spawn at their last bed slept at. If the bed is destroyed or obstructed,
# they will spawn according to your mvm respawn rules, and then whatever the server does.
bedrespawn: true
# This just signifies the version number so we can see what version of config you have.
# NEVER TOUCH THIS VALUE
version: 2.1