Also use registry to get the allow-shop flag

This commit is contained in:
Phoenix616 2019-05-06 18:19:33 +01:00
parent 2e0c5a3cac
commit 619ac17cd5

View File

@ -1,6 +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;
@ -16,7 +15,7 @@ public class WorldGuardFlags {
enableShop = new StateFlag("allow-shop", false);
WorldGuard.getInstance().getFlagRegistry().register(enableShop);
} catch (FlagConflictException | IllegalStateException e) {
enableShop = (StateFlag) Flags.get("allow-shop");
enableShop = (StateFlag) WorldGuard.getInstance().getFlagRegistry().get("allow-shop");
}
ENABLE_SHOP = enableShop;
}