Fixed error message /transferclaim offline player.

This commit is contained in:
ryanhamshire 2015-04-23 21:11:19 -07:00
parent baf29ae38f
commit bdf720281e
2 changed files with 8 additions and 6 deletions

View File

@ -31,6 +31,7 @@ import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import me.ryanhamshire.GriefPrevention.DataStore.NoTransferException;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.ChatColor;
@ -1033,7 +1034,7 @@ public class GriefPrevention extends JavaPlugin
{
this.dataStore.changeClaimOwner(claim, newOwnerID);
}
catch(Exception e)
catch(NoTransferException e)
{
GriefPrevention.sendMessage(player, TextMode.Instr, Messages.TransferTopLevel);
return true;

View File

@ -292,15 +292,16 @@ public class PlayerData
int totalBlocks = this.accruedClaimBlocks + this.getBonusClaimBlocks() + GriefPrevention.instance.dataStore.getGroupBonusBlocks(this.playerID);
if(totalBlocks < totalClaimsArea)
{
Player player = GriefPrevention.instance.getServer().getPlayer(this.playerID);
GriefPrevention.AddLogEntry(player.getName() + "has more claimed land than blocks available. Adding blocks to fix.", CustomLogEntryTypes.Debug);
GriefPrevention.AddLogEntry("Total blocks: " + totalBlocks + " Total claimed area: " + totalClaimsArea, CustomLogEntryTypes.Debug);
OfflinePlayer player = GriefPrevention.instance.getServer().getOfflinePlayer(this.playerID);
GriefPrevention.AddLogEntry(player.getName() + "has more claimed land than blocks available. Adding blocks to fix.", CustomLogEntryTypes.Debug, true);
GriefPrevention.AddLogEntry("Total blocks: " + totalBlocks + " Total claimed area: " + totalClaimsArea, CustomLogEntryTypes.Debug, true);
for(Claim claim : this.claims)
{
GriefPrevention.AddLogEntry(
GriefPrevention.getfriendlyLocationString(claim.getLesserBoundaryCorner()) + " // "
+ GriefPrevention.getfriendlyLocationString(claim.getGreaterBoundaryCorner()) + " = "
+ claim.getArea());
+ claim.getArea()
, CustomLogEntryTypes.Debug, true);
}
//try to fix it by adding to accrued blocks