mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2025-01-22 23:01:20 +01:00
Added a check for existing protections in LWC
Fixes a bug where multiple protections are used
This commit is contained in:
parent
3bf60c061c
commit
b53751af32
@ -86,6 +86,13 @@ public class LightweightChestProtection implements Listener {
|
||||
|
||||
String worldName = block.getWorld().getName();
|
||||
|
||||
Protection existingProtection = lwc.getPhysicalDatabase().loadProtection(worldName, x, y, z);
|
||||
|
||||
if (existingProtection != null) {
|
||||
event.setProtected(true);
|
||||
return;
|
||||
}
|
||||
|
||||
Protection protection = lwc.getPhysicalDatabase().registerProtection(block.getTypeId(), Protection.Type.PRIVATE, worldName, event.getName(), "", x, y, z);
|
||||
|
||||
if (protection != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user