mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2025-02-18 02:51:19 +01:00
Clean cache after protection registration and fire post event
This commit is contained in:
parent
23ceaff2ed
commit
3fe35cd0a5
@ -11,6 +11,7 @@ import com.Acrobot.ChestShop.Security;
|
||||
import com.griefcraft.lwc.LWC;
|
||||
import com.griefcraft.model.Protection;
|
||||
import com.griefcraft.scripting.event.LWCProtectionRegisterEvent;
|
||||
import com.griefcraft.scripting.event.LWCProtectionRegistrationPostEvent;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.Container;
|
||||
import org.bukkit.block.Sign;
|
||||
@ -144,6 +145,9 @@ public class LightweightChestProtection implements Listener {
|
||||
|
||||
if (protection != null) {
|
||||
event.setProtected(true);
|
||||
protection.removeCache();
|
||||
lwc.getProtectionCache().addProtection(protection);
|
||||
lwc.getModuleLoader().dispatchEvent(new LWCProtectionRegistrationPostEvent(protection));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user