Send ShopDestroyedEvent for sign edits that break a shop

This commit is contained in:
Phoenix616 2023-06-13 00:22:30 +01:00
parent 7203ec17cd
commit 978f1270f5
No known key found for this signature in database
GPG Key ID: 40E2321E71738EB0
1 changed files with 5 additions and 0 deletions

View File

@ -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;
}