Don't refund for non-finished signs (Fixes #141)

This commit is contained in:
Phoenix616 2018-06-23 15:01:41 +01:00
parent 247b2d239e
commit 1cb481097c
1 changed files with 7 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import com.Acrobot.ChestShop.Events.Economy.CurrencySubtractEvent;
import com.Acrobot.ChestShop.Events.ShopDestroyedEvent;
import com.Acrobot.ChestShop.Permission;
import com.Acrobot.ChestShop.UUIDs.NameManager;
import org.bukkit.ChatColor;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
@ -18,6 +19,8 @@ import java.math.BigDecimal;
import java.util.UUID;
import static com.Acrobot.ChestShop.Permission.NOFEE;
import static com.Acrobot.ChestShop.Signs.ChestShopSign.AUTOFILL_CODE;
import static com.Acrobot.ChestShop.Signs.ChestShopSign.ITEM_LINE;
import static com.Acrobot.ChestShop.Signs.ChestShopSign.NAME_LINE;
/**
@ -32,6 +35,10 @@ public class ShopRefundListener implements Listener {
return;
}
if (ChatColor.stripColor(event.getSign().getLine(ITEM_LINE)).equals(AUTOFILL_CODE)) {
return;
}
Account account = NameManager.getAccountFromShortName(event.getSign().getLine(NAME_LINE));
if (account == null) {
return;