Fix tp-animals-only flag
This commit is contained in:
1 parent
dd67127956
commit
012aebc80d
2 files changed
+2
-2
No files matched your search
@@ -26,7 +26,7 @@ public final class HorseTp extends JavaPlugin {
|
||||
FlagRegistry registry = WorldGuard.getInstance().getFlagRegistry();
|
||||
try {
|
||||
// create a flag with the name "my-custom-flag", defaulting to true
|
||||
StateFlag flag = new StateFlag("horse-can-tp", true);
|
||||
StateFlag flag = new StateFlag("tp-animals-only", true);
|
||||
registry.register(flag);
|
||||
HorseTpFlag = flag; // only set our field if there was no error
|
||||
} catch (FlagConflictException e) {
|
||||
|
||||
@@ -56,7 +56,7 @@ public class OnPlayerTeleport implements Listener {
|
||||
ApplicableRegionSet set = query.getApplicableRegions(worldGuardPlayerLocation);
|
||||
|
||||
// check if the horse-can-tp flag is set to DENY
|
||||
if (!set.testState(localPlayer, HorseTp.getHorseTpFlag())) {
|
||||
if (set.testState(localPlayer, HorseTp.getHorseTpFlag())) {
|
||||
// only stop the tp if the player is in a minecart or boat
|
||||
// Otherwise, a protected area could be flooded with boats and minecarts
|
||||
// that can't be destroyed by non-admins
|
||||
|
||||
Reference in new issue
Block a user