mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2025-01-09 16:47:36 +01:00
Add LWC protection removal
This commit is contained in:
parent
87d768a524
commit
2c94175a23
@ -5,6 +5,7 @@ import com.Acrobot.ChestShop.Configuration.Properties;
|
||||
import com.Acrobot.ChestShop.Events.Protection.ProtectBlockEvent;
|
||||
import com.Acrobot.ChestShop.Events.Protection.ProtectionCheckEvent;
|
||||
import com.Acrobot.ChestShop.Events.ShopCreatedEvent;
|
||||
import com.Acrobot.ChestShop.Events.ShopDestroyedEvent;
|
||||
import com.Acrobot.ChestShop.Security;
|
||||
import com.griefcraft.lwc.LWC;
|
||||
import com.griefcraft.model.Protection;
|
||||
@ -104,4 +105,23 @@ public class LightweightChestProtection implements Listener {
|
||||
event.setProtected(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onShopRemove(ShopDestroyedEvent event) {
|
||||
Protection signProtection = lwc.findProtection(event.getSign().getBlock());
|
||||
|
||||
if (signProtection != null) {
|
||||
signProtection.remove();
|
||||
}
|
||||
|
||||
if (event.getChest() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Protection chestProtection = lwc.findProtection(event.getChest().getBlock());
|
||||
|
||||
if (chestProtection != null) {
|
||||
chestProtection.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user