Send ShopDestroyedEvent for sign edits that break a shop
This commit is contained in:
parent
7203ec17cd
commit
978f1270f5
|
@ -5,6 +5,7 @@ import com.Acrobot.Breeze.Utils.StringUtil;
|
||||||
import com.Acrobot.ChestShop.ChestShop;
|
import com.Acrobot.ChestShop.ChestShop;
|
||||||
import com.Acrobot.ChestShop.Events.PreShopCreationEvent;
|
import com.Acrobot.ChestShop.Events.PreShopCreationEvent;
|
||||||
import com.Acrobot.ChestShop.Events.ShopCreatedEvent;
|
import com.Acrobot.ChestShop.Events.ShopCreatedEvent;
|
||||||
|
import com.Acrobot.ChestShop.Listeners.Block.Break.SignBreak;
|
||||||
import com.Acrobot.ChestShop.Signs.ChestShopSign;
|
import com.Acrobot.ChestShop.Signs.ChestShopSign;
|
||||||
import com.Acrobot.ChestShop.UUIDs.NameManager;
|
import com.Acrobot.ChestShop.UUIDs.NameManager;
|
||||||
import com.Acrobot.ChestShop.Utils.uBlock;
|
import com.Acrobot.ChestShop.Utils.uBlock;
|
||||||
|
@ -41,6 +42,10 @@ public class SignCreate implements Listener {
|
||||||
String[] lines = StringUtil.stripColourCodes(event.getLines());
|
String[] lines = StringUtil.stripColourCodes(event.getLines());
|
||||||
|
|
||||||
if (!ChestShopSign.isValidPreparedSign(lines)) {
|
if (!ChestShopSign.isValidPreparedSign(lines)) {
|
||||||
|
// Check if a valid shop already existed previously
|
||||||
|
if (ChestShopSign.isValid(sign)) {
|
||||||
|
SignBreak.sendShopDestroyedEvent(sign, event.getPlayer());
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue