Only keep CustomDonatorEnd variable.
This commit is contained in:
@@ -61,7 +61,6 @@ public class AdminDonator implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
targetPlayer.setDonator(true);
|
targetPlayer.setDonator(true);
|
||||||
targetPlayer.updateNameTitleColor();
|
targetPlayer.updateNameTitleColor();
|
||||||
targetPlayer.getVariables().set("CustomDonator", true);
|
|
||||||
targetPlayer.getVariables().set("CustomDonatorEnd", System.currentTimeMillis() + donatorTime);
|
targetPlayer.getVariables().set("CustomDonatorEnd", System.currentTimeMillis() + donatorTime);
|
||||||
targetPlayer.sendMessage(activeChar.getName() + " has granted you donator status!");
|
targetPlayer.sendMessage(activeChar.getName() + " has granted you donator status!");
|
||||||
activeChar.sendMessage("You have granted donator status to " + targetPlayer.getName());
|
activeChar.sendMessage("You have granted donator status to " + targetPlayer.getName());
|
||||||
@@ -73,7 +72,6 @@ public class AdminDonator implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
targetPlayer.setDonator(false);
|
targetPlayer.setDonator(false);
|
||||||
targetPlayer.updateNameTitleColor();
|
targetPlayer.updateNameTitleColor();
|
||||||
targetPlayer.getVariables().set("CustomDonator", false);
|
|
||||||
targetPlayer.getVariables().remove("CustomDonatorEnd");
|
targetPlayer.getVariables().remove("CustomDonatorEnd");
|
||||||
targetPlayer.sendMessage(activeChar.getName() + " has revoked donator status from you!");
|
targetPlayer.sendMessage(activeChar.getName() + " has revoked donator status from you!");
|
||||||
activeChar.sendMessage("You have revoked donator status from " + targetPlayer.getName());
|
activeChar.sendMessage("You have revoked donator status from " + targetPlayer.getName());
|
||||||
|
|||||||
@@ -14531,8 +14531,14 @@ public class PlayerInstance extends Playable
|
|||||||
|
|
||||||
public void restoreCustomStatus()
|
public void restoreCustomStatus()
|
||||||
{
|
{
|
||||||
|
final long currentTime = System.currentTimeMillis();
|
||||||
|
if (getVariables().getLong("CustomDonatorEnd", 0) > currentTime)
|
||||||
|
{
|
||||||
|
setDonator(true);
|
||||||
|
}
|
||||||
|
|
||||||
final long heroEnd = getVariables().getLong("CustomHeroEnd", 0);
|
final long heroEnd = getVariables().getLong("CustomHeroEnd", 0);
|
||||||
if (getVariables().getBoolean("CustomHero", false) && ((heroEnd == 0) || (heroEnd > System.currentTimeMillis())))
|
if (getVariables().getBoolean("CustomHero", false) && ((heroEnd == 0) || (heroEnd > currentTime)))
|
||||||
{
|
{
|
||||||
setHero(true);
|
setHero(true);
|
||||||
}
|
}
|
||||||
@@ -14546,12 +14552,6 @@ public class PlayerInstance extends Playable
|
|||||||
{
|
{
|
||||||
setNoble(true);
|
setNoble(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
final long donatorEnd = getVariables().getLong("CustomDonatorEnd", 0);
|
|
||||||
if (getVariables().getBoolean("CustomDonator", false) && ((donatorEnd == 0) || (donatorEnd > System.currentTimeMillis())))
|
|
||||||
{
|
|
||||||
setDonator(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ public class AdminDonator implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
targetPlayer.setDonator(true);
|
targetPlayer.setDonator(true);
|
||||||
targetPlayer.updateNameTitleColor();
|
targetPlayer.updateNameTitleColor();
|
||||||
targetPlayer.getVariables().set("CustomDonator", true);
|
|
||||||
targetPlayer.getVariables().set("CustomDonatorEnd", System.currentTimeMillis() + donatorTime);
|
targetPlayer.getVariables().set("CustomDonatorEnd", System.currentTimeMillis() + donatorTime);
|
||||||
targetPlayer.sendMessage(activeChar.getName() + " has granted you donator status!");
|
targetPlayer.sendMessage(activeChar.getName() + " has granted you donator status!");
|
||||||
activeChar.sendMessage("You have granted donator status to " + targetPlayer.getName());
|
activeChar.sendMessage("You have granted donator status to " + targetPlayer.getName());
|
||||||
@@ -73,7 +72,6 @@ public class AdminDonator implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
targetPlayer.setDonator(false);
|
targetPlayer.setDonator(false);
|
||||||
targetPlayer.updateNameTitleColor();
|
targetPlayer.updateNameTitleColor();
|
||||||
targetPlayer.getVariables().set("CustomDonator", false);
|
|
||||||
targetPlayer.getVariables().remove("CustomDonatorEnd");
|
targetPlayer.getVariables().remove("CustomDonatorEnd");
|
||||||
targetPlayer.sendMessage(activeChar.getName() + " has revoked donator status from you!");
|
targetPlayer.sendMessage(activeChar.getName() + " has revoked donator status from you!");
|
||||||
activeChar.sendMessage("You have revoked donator status from " + targetPlayer.getName());
|
activeChar.sendMessage("You have revoked donator status from " + targetPlayer.getName());
|
||||||
|
|||||||
@@ -14886,8 +14886,14 @@ public class PlayerInstance extends Playable
|
|||||||
|
|
||||||
public void restoreCustomStatus()
|
public void restoreCustomStatus()
|
||||||
{
|
{
|
||||||
|
final long currentTime = System.currentTimeMillis();
|
||||||
|
if (getVariables().getLong("CustomDonatorEnd", 0) > currentTime)
|
||||||
|
{
|
||||||
|
setDonator(true);
|
||||||
|
}
|
||||||
|
|
||||||
final long heroEnd = getVariables().getLong("CustomHeroEnd", 0);
|
final long heroEnd = getVariables().getLong("CustomHeroEnd", 0);
|
||||||
if (getVariables().getBoolean("CustomHero", false) && ((heroEnd == 0) || (heroEnd > System.currentTimeMillis())))
|
if (getVariables().getBoolean("CustomHero", false) && ((heroEnd == 0) || (heroEnd > currentTime)))
|
||||||
{
|
{
|
||||||
setHero(true);
|
setHero(true);
|
||||||
}
|
}
|
||||||
@@ -14901,12 +14907,6 @@ public class PlayerInstance extends Playable
|
|||||||
{
|
{
|
||||||
setNoble(true);
|
setNoble(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
final long donatorEnd = getVariables().getLong("CustomDonatorEnd", 0);
|
|
||||||
if (getVariables().getBoolean("CustomDonator", false) && ((donatorEnd == 0) || (donatorEnd > System.currentTimeMillis())))
|
|
||||||
{
|
|
||||||
setDonator(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user