mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2025-01-05 22:57:49 +01:00
Use registry to register WorldGuard flags
This commit is contained in:
parent
04f91aa55b
commit
816fe77f27
@ -1,4 +1,5 @@
|
||||
package com.Acrobot.ChestShop.Plugins;
|
||||
import com.sk89q.worldguard.WorldGuard;
|
||||
import com.sk89q.worldguard.protection.flags.Flags;
|
||||
import com.sk89q.worldguard.protection.flags.StateFlag;
|
||||
import com.sk89q.worldguard.protection.flags.registry.FlagConflictException;
|
||||
@ -12,7 +13,8 @@ public class WorldGuardFlags {
|
||||
static {
|
||||
StateFlag enableShop;
|
||||
try {
|
||||
enableShop = Flags.register(new StateFlag("allow-shop", false));
|
||||
enableShop = new StateFlag("allow-shop", false);
|
||||
WorldGuard.getInstance().getFlagRegistry().register(enableShop);
|
||||
} catch (FlagConflictException | IllegalStateException e) {
|
||||
enableShop = (StateFlag) Flags.get("allow-shop");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user