mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Added the ability for players to "spawn" at their home location, when enabled it moves a player after they have died and revived to their home location.
This commit is contained in:
parent
30d6b1ac51
commit
6a122fb0aa
@ -86,8 +86,14 @@ public class vMinecraftListener extends PluginListener {
|
|||||||
//Use: Checks for exploits and runs the commands
|
//Use: Checks for exploits and runs the commands
|
||||||
//=====================================================================
|
//=====================================================================
|
||||||
public boolean onHealthChange(Player player,int oldValue,int newValue){
|
public boolean onHealthChange(Player player,int oldValue,int newValue){
|
||||||
if (player.getHealth() > 1){
|
if (player.getHealth() > 1 && vMinecraftUsers.getProfile(player).isDead()){
|
||||||
vMinecraftUsers.getProfile(player).isDead(false);
|
vMinecraftUsers.getProfile(player).isDead(false);
|
||||||
|
if(vMinecraftSettings.getInstance().playerspawn())
|
||||||
|
{
|
||||||
|
Warp home = null;
|
||||||
|
home = etc.getDataSource().getHome(player.getName());
|
||||||
|
player.teleportTo(home.Location);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ public class vMinecraftSettings {
|
|||||||
ignore = false,
|
ignore = false,
|
||||||
colors = false,
|
colors = false,
|
||||||
nick = false,
|
nick = false,
|
||||||
|
playerspawn = false,
|
||||||
freeze = false,
|
freeze = false,
|
||||||
cmdFabulous = false,
|
cmdFabulous = false,
|
||||||
cmdPromote = false,
|
cmdPromote = false,
|
||||||
@ -85,6 +86,8 @@ public class vMinecraftSettings {
|
|||||||
writer.write("FFF=true\r\n");
|
writer.write("FFF=true\r\n");
|
||||||
writer.write("\r\n");
|
writer.write("\r\n");
|
||||||
writer.write("#Admin Settings\r\n");
|
writer.write("#Admin Settings\r\n");
|
||||||
|
writer.write("#Enables or disables players spawning to their home location");
|
||||||
|
writer.write("playerspawn=true\r\n");
|
||||||
writer.write("#Enables or disables the admin only chat\r\n");
|
writer.write("#Enables or disables the admin only chat\r\n");
|
||||||
writer.write("adminchat=true\r\n");
|
writer.write("adminchat=true\r\n");
|
||||||
writer.write("#Lets non admins use admin chat if they have the /adminchat command permission\r\n");
|
writer.write("#Lets non admins use admin chat if they have the /adminchat command permission\r\n");
|
||||||
@ -150,6 +153,7 @@ public class vMinecraftSettings {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
adminChat = properties.getBoolean("adminchat",true);
|
adminChat = properties.getBoolean("adminchat",true);
|
||||||
|
playerspawn = properties.getBoolean("playerspawn",true);
|
||||||
greentext = properties.getBoolean("QuotesAreGreen",true);
|
greentext = properties.getBoolean("QuotesAreGreen",true);
|
||||||
FFF = properties.getBoolean("FFF",true);
|
FFF = properties.getBoolean("FFF",true);
|
||||||
quakeColors = properties.getBoolean("ColoredChat",true);
|
quakeColors = properties.getBoolean("ColoredChat",true);
|
||||||
@ -213,6 +217,7 @@ public class vMinecraftSettings {
|
|||||||
public boolean ignore() {return ignore;}
|
public boolean ignore() {return ignore;}
|
||||||
public boolean colors() {return colors;}
|
public boolean colors() {return colors;}
|
||||||
public boolean nick() {return nick;}
|
public boolean nick() {return nick;}
|
||||||
|
public boolean playerspawn() {return playerspawn;}
|
||||||
public boolean freeze() {return freeze;}
|
public boolean freeze() {return freeze;}
|
||||||
public boolean cmdFabulous() {return cmdFabulous;}
|
public boolean cmdFabulous() {return cmdFabulous;}
|
||||||
public boolean cmdPromote() {return cmdPromote;}
|
public boolean cmdPromote() {return cmdPromote;}
|
||||||
|
Loading…
Reference in New Issue
Block a user