mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2025-02-16 02:11:18 +01:00
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.Events.PreShopCreationEvent;
|
||||
import com.Acrobot.ChestShop.Events.ShopCreatedEvent;
|
||||
import com.Acrobot.ChestShop.Listeners.Block.Break.SignBreak;
|
||||
import com.Acrobot.ChestShop.Signs.ChestShopSign;
|
||||
import com.Acrobot.ChestShop.UUIDs.NameManager;
|
||||
import com.Acrobot.ChestShop.Utils.uBlock;
|
||||
@ -41,6 +42,10 @@ public class SignCreate implements Listener {
|
||||
String[] lines = StringUtil.stripColourCodes(event.getLines());
|
||||
|
||||
if (!ChestShopSign.isValidPreparedSign(lines)) {
|
||||
// Check if a valid shop already existed previously
|
||||
if (ChestShopSign.isValid(sign)) {
|
||||
SignBreak.sendShopDestroyedEvent(sign, event.getPlayer());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user