From e833a0c361c80dc26d957300a327b9fadd464cf7 Mon Sep 17 00:00:00 2001 From: ryanhamshire Date: Thu, 23 Apr 2015 21:17:45 -0700 Subject: [PATCH] (Continuation of previous.) --- src/me/ryanhamshire/GriefPrevention/DataStore.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/me/ryanhamshire/GriefPrevention/DataStore.java b/src/me/ryanhamshire/GriefPrevention/DataStore.java index 9707c08..664416a 100644 --- a/src/me/ryanhamshire/GriefPrevention/DataStore.java +++ b/src/me/ryanhamshire/GriefPrevention/DataStore.java @@ -299,12 +299,19 @@ public abstract class DataStore abstract void saveGroupBonusBlocks(String groupName, int amount); - synchronized public void changeClaimOwner(Claim claim, UUID newOwnerID) throws Exception + class NoTransferException extends Exception + { + NoTransferException(String message) + { + super(message); + } + } + synchronized public void changeClaimOwner(Claim claim, UUID newOwnerID) throws NoTransferException { //if it's a subdivision, throw an exception if(claim.parent != null) { - throw new Exception("Subdivisions can't be transferred. Only top-level claims may change owners."); + throw new NoTransferException("Subdivisions can't be transferred. Only top-level claims may change owners."); } //otherwise update information