mirror of
https://github.com/TotalFreedomMC/TF-WorldGuardExtraFlagsPlugin.git
synced 2024-12-28 10:04:50 +00:00
Moved WG handlers to WG module
This fixes the error given when using unsupported version of WG and gives message saying that you are using unsupported version of WG instead
This commit is contained in:
parent
adbe09ad82
commit
7d12cdb0e1
22 changed files with 340 additions and 190 deletions
|
@ -71,17 +71,17 @@
|
||||||
<version>7.0.0-beta-02</version>
|
<version>7.0.0-beta-02</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.boydti</groupId>
|
|
||||||
<artifactId>fawe-api</artifactId>
|
|
||||||
<version>18.07.27-3ed2e57-1163-20.5.2</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.ess3</groupId>
|
<groupId>net.ess3</groupId>
|
||||||
<artifactId>Essentials</artifactId>
|
<artifactId>Essentials</artifactId>
|
||||||
<version>2.13-SNAPSHOT</version>
|
<version>2.13-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.boydti</groupId>
|
||||||
|
<artifactId>fawe-api</artifactId>
|
||||||
|
<version>18.07.27-3ed2e57-1163-20.5.2</version>
|
||||||
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.comphenix.protocol</groupId>
|
<groupId>com.comphenix.protocol</groupId>
|
||||||
|
|
|
@ -7,12 +7,10 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
||||||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||||
import com.sk89q.worldguard.protection.flags.registry.FlagRegistry;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.goldtreeservers.worldguardextraflags.essentials.EssentialsHelper;
|
import net.goldtreeservers.worldguardextraflags.essentials.EssentialsHelper;
|
||||||
import net.goldtreeservers.worldguardextraflags.fawe.FAWEHelper;
|
import net.goldtreeservers.worldguardextraflags.fawe.FAWEHelper;
|
||||||
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.listeners.BlockListener;
|
import net.goldtreeservers.worldguardextraflags.listeners.BlockListener;
|
||||||
import net.goldtreeservers.worldguardextraflags.listeners.EntityListener;
|
import net.goldtreeservers.worldguardextraflags.listeners.EntityListener;
|
||||||
import net.goldtreeservers.worldguardextraflags.listeners.EntityListenerOnePointNine;
|
import net.goldtreeservers.worldguardextraflags.listeners.EntityListenerOnePointNine;
|
||||||
|
@ -23,20 +21,6 @@ import net.goldtreeservers.worldguardextraflags.listeners.WorldListener;
|
||||||
import net.goldtreeservers.worldguardextraflags.protocollib.ProtocolLibHelper;
|
import net.goldtreeservers.worldguardextraflags.protocollib.ProtocolLibHelper;
|
||||||
import net.goldtreeservers.worldguardextraflags.utils.SupportedFeatures;
|
import net.goldtreeservers.worldguardextraflags.utils.SupportedFeatures;
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.WorldGuardUtils;
|
import net.goldtreeservers.worldguardextraflags.wg.WorldGuardUtils;
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.handlers.BlockedEffectsFlagHandler;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.handlers.CommandOnEntryFlagHandler;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.handlers.CommandOnExitFlagHandler;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.handlers.ConsoleCommandOnEntryFlagHandler;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.handlers.ConsoleCommandOnExitFlagHandler;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.handlers.FlyFlagHandler;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.handlers.GiveEffectsFlagHandler;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.handlers.GlideFlagHandler;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.handlers.GodmodeFlagHandler;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.handlers.PlaySoundsFlagHandler;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.handlers.TeleportOnEntryFlagHandler;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.handlers.TeleportOnExitFlagHandler;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.handlers.WalkSpeedFlagHandler;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.wrappers.AbstractSessionManagerWrapper;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.wrappers.WorldGuardCommunicator;
|
import net.goldtreeservers.worldguardextraflags.wg.wrappers.WorldGuardCommunicator;
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.wrappers.v6.WorldGuardSixCommunicator;
|
import net.goldtreeservers.worldguardextraflags.wg.wrappers.v6.WorldGuardSixCommunicator;
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.wrappers.v7.WorldGuardSevenCommunicator;
|
import net.goldtreeservers.worldguardextraflags.wg.wrappers.v7.WorldGuardSevenCommunicator;
|
||||||
|
@ -75,7 +59,7 @@ public class WorldGuardExtraFlagsPlugin extends JavaPlugin
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.worldGuardCommunicator.onLoad();
|
this.worldGuardCommunicator.onLoad(this);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -83,37 +67,6 @@ public class WorldGuardExtraFlagsPlugin extends JavaPlugin
|
||||||
|
|
||||||
throw new RuntimeException("Failed to load WorldGuard communicator", e);
|
throw new RuntimeException("Failed to load WorldGuard communicator", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
FlagRegistry flagRegistry = this.worldGuardCommunicator.getFlagRegistry();
|
|
||||||
flagRegistry.register(Flags.TELEPORT_ON_ENTRY);
|
|
||||||
flagRegistry.register(Flags.TELEPORT_ON_EXIT);
|
|
||||||
flagRegistry.register(Flags.COMMAND_ON_ENTRY);
|
|
||||||
flagRegistry.register(Flags.COMMAND_ON_EXIT);
|
|
||||||
flagRegistry.register(Flags.CONSOLE_COMMAND_ON_ENTRY);
|
|
||||||
flagRegistry.register(Flags.CONSOLE_COMMAND_ON_EXIT);
|
|
||||||
flagRegistry.register(Flags.WALK_SPEED);
|
|
||||||
flagRegistry.register(Flags.KEEP_INVENTORY);
|
|
||||||
flagRegistry.register(Flags.KEEP_EXP);
|
|
||||||
flagRegistry.register(Flags.CHAT_PREFIX);
|
|
||||||
flagRegistry.register(Flags.CHAT_SUFFIX);
|
|
||||||
flagRegistry.register(Flags.BLOCKED_EFFECTS);
|
|
||||||
flagRegistry.register(Flags.GODMODE);
|
|
||||||
flagRegistry.register(Flags.RESPAWN_LOCATION);
|
|
||||||
flagRegistry.register(Flags.WORLDEDIT);
|
|
||||||
flagRegistry.register(Flags.GIVE_EFFECTS);
|
|
||||||
flagRegistry.register(Flags.FLY);
|
|
||||||
flagRegistry.register(Flags.PLAY_SOUNDS);
|
|
||||||
flagRegistry.register(Flags.MYTHICMOB_EGGS);
|
|
||||||
flagRegistry.register(Flags.FROSTWALKER);
|
|
||||||
flagRegistry.register(Flags.NETHER_PORTALS);
|
|
||||||
flagRegistry.register(Flags.ALLOW_BLOCK_PLACE);
|
|
||||||
flagRegistry.register(Flags.DENY_BLOCK_PLACE);
|
|
||||||
flagRegistry.register(Flags.ALLOW_BLOCK_BREAK);
|
|
||||||
flagRegistry.register(Flags.DENY_BLOCK_BREAK);
|
|
||||||
flagRegistry.register(Flags.GLIDE);
|
|
||||||
flagRegistry.register(Flags.CHUNK_UNLOAD);
|
|
||||||
flagRegistry.register(Flags.ITEM_DURABILITY);
|
|
||||||
flagRegistry.register(Flags.JOIN_LOCATION);
|
|
||||||
|
|
||||||
//Soft dependencies, due to some compatibility issues or add flags related to a plugin
|
//Soft dependencies, due to some compatibility issues or add flags related to a plugin
|
||||||
try
|
try
|
||||||
|
@ -168,7 +121,7 @@ public class WorldGuardExtraFlagsPlugin extends JavaPlugin
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.worldGuardCommunicator.onEnable();
|
this.worldGuardCommunicator.onEnable(this);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -176,21 +129,6 @@ public class WorldGuardExtraFlagsPlugin extends JavaPlugin
|
||||||
|
|
||||||
throw new RuntimeException("Failed to enable WorldGuard communicator", e);
|
throw new RuntimeException("Failed to enable WorldGuard communicator", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractSessionManagerWrapper sessionManager = this.worldGuardCommunicator.getSessionManager();
|
|
||||||
sessionManager.registerHandler(TeleportOnEntryFlagHandler.FACTORY);
|
|
||||||
sessionManager.registerHandler(TeleportOnExitFlagHandler.FACTORY);
|
|
||||||
sessionManager.registerHandler(CommandOnEntryFlagHandler.FACTORY);
|
|
||||||
sessionManager.registerHandler(CommandOnExitFlagHandler.FACTORY);
|
|
||||||
sessionManager.registerHandler(ConsoleCommandOnEntryFlagHandler.FACTORY);
|
|
||||||
sessionManager.registerHandler(ConsoleCommandOnExitFlagHandler.FACTORY);
|
|
||||||
sessionManager.registerHandler(WalkSpeedFlagHandler.FACTORY);
|
|
||||||
sessionManager.registerHandler(BlockedEffectsFlagHandler.FACTORY);
|
|
||||||
sessionManager.registerHandler(GodmodeFlagHandler.FACTORY);
|
|
||||||
sessionManager.registerHandler(GiveEffectsFlagHandler.FACTORY);
|
|
||||||
sessionManager.registerHandler(FlyFlagHandler.FACTORY);
|
|
||||||
sessionManager.registerHandler(PlaySoundsFlagHandler.FACTORY);
|
|
||||||
sessionManager.registerHandler(GlideFlagHandler.FACTORY);
|
|
||||||
|
|
||||||
this.getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
|
this.getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
|
||||||
this.getServer().getPluginManager().registerEvents(new BlockListener(this), this);
|
this.getServer().getPluginManager().registerEvents(new BlockListener(this), this);
|
||||||
|
|
10
WG/pom.xml
10
WG/pom.xml
|
@ -18,6 +18,10 @@
|
||||||
<id>sk89q-repo</id>
|
<id>sk89q-repo</id>
|
||||||
<url>https://maven.sk89q.com/repo/</url>
|
<url>https://maven.sk89q.com/repo/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>ess-repo</id>
|
||||||
|
<url>http://repo.ess3.net/content/groups/essentials</url>
|
||||||
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -51,5 +55,11 @@
|
||||||
<version>7.0.0-beta-02</version>
|
<version>7.0.0-beta-02</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.ess3</groupId>
|
||||||
|
<artifactId>Essentials</artifactId>
|
||||||
|
<version>2.13-SNAPSHOT</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
|
@ -8,6 +8,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
|
@ -15,7 +16,6 @@ import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||||
import com.sk89q.worldguard.session.MoveType;
|
import com.sk89q.worldguard.session.MoveType;
|
||||||
import com.sk89q.worldguard.session.Session;
|
import com.sk89q.worldguard.session.Session;
|
||||||
import com.sk89q.worldguard.session.handler.Handler;
|
|
||||||
|
|
||||||
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
||||||
import net.goldtreeservers.worldguardextraflags.flags.data.PotionEffectDetails;
|
import net.goldtreeservers.worldguardextraflags.flags.data.PotionEffectDetails;
|
||||||
|
@ -24,21 +24,30 @@ import net.goldtreeservers.worldguardextraflags.wg.wrappers.HandlerWrapper;
|
||||||
|
|
||||||
public class BlockedEffectsFlagHandler extends HandlerWrapper
|
public class BlockedEffectsFlagHandler extends HandlerWrapper
|
||||||
{
|
{
|
||||||
public static final Factory FACTORY = new Factory();
|
public static final Factory FACTORY(Plugin plugin)
|
||||||
public static class Factory extends Handler.Factory<BlockedEffectsFlagHandler>
|
{
|
||||||
|
return new Factory(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Factory extends HandlerWrapper.Factory<BlockedEffectsFlagHandler>
|
||||||
{
|
{
|
||||||
@Override
|
public Factory(Plugin plugin)
|
||||||
|
{
|
||||||
|
super(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public BlockedEffectsFlagHandler create(Session session)
|
public BlockedEffectsFlagHandler create(Session session)
|
||||||
{
|
{
|
||||||
return new BlockedEffectsFlagHandler(session);
|
return new BlockedEffectsFlagHandler(this.getPlugin(), session);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private HashMap<PotionEffectType, PotionEffectDetails> removedEffects;
|
private HashMap<PotionEffectType, PotionEffectDetails> removedEffects;
|
||||||
|
|
||||||
protected BlockedEffectsFlagHandler(Session session)
|
protected BlockedEffectsFlagHandler(Plugin plugin, Session session)
|
||||||
{
|
{
|
||||||
super(session);
|
super(plugin, session);
|
||||||
|
|
||||||
this.removedEffects = new HashMap<>();
|
this.removedEffects = new HashMap<>();
|
||||||
}
|
}
|
|
@ -6,35 +6,43 @@ import java.util.Set;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||||
import com.sk89q.worldguard.session.MoveType;
|
import com.sk89q.worldguard.session.MoveType;
|
||||||
import com.sk89q.worldguard.session.Session;
|
import com.sk89q.worldguard.session.Session;
|
||||||
import com.sk89q.worldguard.session.handler.Handler;
|
|
||||||
|
|
||||||
import net.goldtreeservers.worldguardextraflags.WorldGuardExtraFlagsPlugin;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.WorldGuardUtils;
|
import net.goldtreeservers.worldguardextraflags.wg.WorldGuardUtils;
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.wrappers.HandlerWrapper;
|
import net.goldtreeservers.worldguardextraflags.wg.wrappers.HandlerWrapper;
|
||||||
|
|
||||||
public class CommandOnEntryFlagHandler extends HandlerWrapper
|
public class CommandOnEntryFlagHandler extends HandlerWrapper
|
||||||
{
|
{
|
||||||
public static final Factory FACTORY = new Factory();
|
public static final Factory FACTORY(Plugin plugin)
|
||||||
public static class Factory extends Handler.Factory<CommandOnEntryFlagHandler>
|
{
|
||||||
|
return new Factory(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Factory extends HandlerWrapper.Factory<CommandOnEntryFlagHandler>
|
||||||
{
|
{
|
||||||
@Override
|
public Factory(Plugin plugin)
|
||||||
|
{
|
||||||
|
super(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public CommandOnEntryFlagHandler create(Session session)
|
public CommandOnEntryFlagHandler create(Session session)
|
||||||
{
|
{
|
||||||
return new CommandOnEntryFlagHandler(session);
|
return new CommandOnEntryFlagHandler(this.getPlugin(), session);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Collection<Set<String>> lastCommands;
|
private Collection<Set<String>> lastCommands;
|
||||||
|
|
||||||
protected CommandOnEntryFlagHandler(Session session)
|
protected CommandOnEntryFlagHandler(Plugin plugin, Session session)
|
||||||
{
|
{
|
||||||
super(session);
|
super(plugin, session);
|
||||||
|
|
||||||
this.lastCommands = new ArrayList<>();
|
this.lastCommands = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
@ -50,7 +58,7 @@ public class CommandOnEntryFlagHandler extends HandlerWrapper
|
||||||
{
|
{
|
||||||
for(String command : commands_)
|
for(String command : commands_)
|
||||||
{
|
{
|
||||||
WorldGuardExtraFlagsPlugin.getPlugin().getServer().dispatchCommand(player, command.substring(1).replace("%username%", player.getName())); //TODO: Make this better
|
this.getPlugin().getServer().dispatchCommand(player, command.substring(1).replace("%username%", player.getName())); //TODO: Make this better
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
|
@ -6,35 +6,43 @@ import java.util.Set;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||||
import com.sk89q.worldguard.session.MoveType;
|
import com.sk89q.worldguard.session.MoveType;
|
||||||
import com.sk89q.worldguard.session.Session;
|
import com.sk89q.worldguard.session.Session;
|
||||||
import com.sk89q.worldguard.session.handler.Handler;
|
|
||||||
|
|
||||||
import net.goldtreeservers.worldguardextraflags.WorldGuardExtraFlagsPlugin;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.WorldGuardUtils;
|
import net.goldtreeservers.worldguardextraflags.wg.WorldGuardUtils;
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.wrappers.HandlerWrapper;
|
import net.goldtreeservers.worldguardextraflags.wg.wrappers.HandlerWrapper;
|
||||||
|
|
||||||
public class CommandOnExitFlagHandler extends HandlerWrapper
|
public class CommandOnExitFlagHandler extends HandlerWrapper
|
||||||
{
|
{
|
||||||
public static final Factory FACTORY = new Factory();
|
public static final Factory FACTORY(Plugin plugin)
|
||||||
public static class Factory extends Handler.Factory<CommandOnExitFlagHandler>
|
{
|
||||||
|
return new Factory(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Factory extends HandlerWrapper.Factory<CommandOnExitFlagHandler>
|
||||||
{
|
{
|
||||||
@Override
|
public Factory(Plugin plugin)
|
||||||
|
{
|
||||||
|
super(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public CommandOnExitFlagHandler create(Session session)
|
public CommandOnExitFlagHandler create(Session session)
|
||||||
{
|
{
|
||||||
return new CommandOnExitFlagHandler(session);
|
return new CommandOnExitFlagHandler(this.getPlugin(), session);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Collection<Set<String>> lastCommands;
|
private Collection<Set<String>> lastCommands;
|
||||||
|
|
||||||
protected CommandOnExitFlagHandler(Session session)
|
protected CommandOnExitFlagHandler(Plugin plugin, Session session)
|
||||||
{
|
{
|
||||||
super(session);
|
super(plugin, session);
|
||||||
|
|
||||||
this.lastCommands = new ArrayList<>();
|
this.lastCommands = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
@ -68,7 +76,7 @@ public class CommandOnExitFlagHandler extends HandlerWrapper
|
||||||
{
|
{
|
||||||
for(String command : commands_)
|
for(String command : commands_)
|
||||||
{
|
{
|
||||||
WorldGuardExtraFlagsPlugin.getPlugin().getServer().dispatchCommand(player, command.substring(1).replace("%username%", player.getName())); //TODO: Make this better
|
this.getPlugin().getServer().dispatchCommand(player, command.substring(1).replace("%username%", player.getName())); //TODO: Make this better
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -6,35 +6,43 @@ import java.util.Set;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||||
import com.sk89q.worldguard.session.MoveType;
|
import com.sk89q.worldguard.session.MoveType;
|
||||||
import com.sk89q.worldguard.session.Session;
|
import com.sk89q.worldguard.session.Session;
|
||||||
import com.sk89q.worldguard.session.handler.Handler;
|
|
||||||
|
|
||||||
import net.goldtreeservers.worldguardextraflags.WorldGuardExtraFlagsPlugin;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.WorldGuardUtils;
|
import net.goldtreeservers.worldguardextraflags.wg.WorldGuardUtils;
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.wrappers.HandlerWrapper;
|
import net.goldtreeservers.worldguardextraflags.wg.wrappers.HandlerWrapper;
|
||||||
|
|
||||||
public class ConsoleCommandOnEntryFlagHandler extends HandlerWrapper
|
public class ConsoleCommandOnEntryFlagHandler extends HandlerWrapper
|
||||||
{
|
{
|
||||||
public static final Factory FACTORY = new Factory();
|
public static final Factory FACTORY(Plugin plugin)
|
||||||
public static class Factory extends Handler.Factory<ConsoleCommandOnEntryFlagHandler>
|
{
|
||||||
|
return new Factory(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Factory extends HandlerWrapper.Factory<ConsoleCommandOnEntryFlagHandler>
|
||||||
{
|
{
|
||||||
@Override
|
public Factory(Plugin plugin)
|
||||||
|
{
|
||||||
|
super(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ConsoleCommandOnEntryFlagHandler create(Session session)
|
public ConsoleCommandOnEntryFlagHandler create(Session session)
|
||||||
{
|
{
|
||||||
return new ConsoleCommandOnEntryFlagHandler(session);
|
return new ConsoleCommandOnEntryFlagHandler(this.getPlugin(), session);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Collection<Set<String>> lastCommands;
|
private Collection<Set<String>> lastCommands;
|
||||||
|
|
||||||
protected ConsoleCommandOnEntryFlagHandler(Session session)
|
protected ConsoleCommandOnEntryFlagHandler(Plugin plugin, Session session)
|
||||||
{
|
{
|
||||||
super(session);
|
super(plugin, session);
|
||||||
|
|
||||||
this.lastCommands = new ArrayList<>();
|
this.lastCommands = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
@ -50,7 +58,7 @@ public class ConsoleCommandOnEntryFlagHandler extends HandlerWrapper
|
||||||
{
|
{
|
||||||
for(String command : commands_)
|
for(String command : commands_)
|
||||||
{
|
{
|
||||||
WorldGuardExtraFlagsPlugin.getPlugin().getServer().dispatchCommand(WorldGuardExtraFlagsPlugin.getPlugin().getServer().getConsoleSender(), command.substring(1).replace("%username%", player.getName())); //TODO: Make this better
|
this.getPlugin().getServer().dispatchCommand(this.getPlugin().getServer().getConsoleSender(), command.substring(1).replace("%username%", player.getName())); //TODO: Make this better
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
|
@ -6,35 +6,43 @@ import java.util.Set;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||||
import com.sk89q.worldguard.session.MoveType;
|
import com.sk89q.worldguard.session.MoveType;
|
||||||
import com.sk89q.worldguard.session.Session;
|
import com.sk89q.worldguard.session.Session;
|
||||||
import com.sk89q.worldguard.session.handler.Handler;
|
|
||||||
|
|
||||||
import net.goldtreeservers.worldguardextraflags.WorldGuardExtraFlagsPlugin;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.WorldGuardUtils;
|
import net.goldtreeservers.worldguardextraflags.wg.WorldGuardUtils;
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.wrappers.HandlerWrapper;
|
import net.goldtreeservers.worldguardextraflags.wg.wrappers.HandlerWrapper;
|
||||||
|
|
||||||
public class ConsoleCommandOnExitFlagHandler extends HandlerWrapper
|
public class ConsoleCommandOnExitFlagHandler extends HandlerWrapper
|
||||||
{
|
{
|
||||||
public static final Factory FACTORY = new Factory();
|
public static final Factory FACTORY(Plugin plugin)
|
||||||
public static class Factory extends Handler.Factory<ConsoleCommandOnExitFlagHandler>
|
{
|
||||||
|
return new Factory(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Factory extends HandlerWrapper.Factory<ConsoleCommandOnExitFlagHandler>
|
||||||
{
|
{
|
||||||
@Override
|
public Factory(Plugin plugin)
|
||||||
|
{
|
||||||
|
super(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ConsoleCommandOnExitFlagHandler create(Session session)
|
public ConsoleCommandOnExitFlagHandler create(Session session)
|
||||||
{
|
{
|
||||||
return new ConsoleCommandOnExitFlagHandler(session);
|
return new ConsoleCommandOnExitFlagHandler(this.getPlugin(), session);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Collection<Set<String>> lastCommands;
|
private Collection<Set<String>> lastCommands;
|
||||||
|
|
||||||
protected ConsoleCommandOnExitFlagHandler(Session session)
|
protected ConsoleCommandOnExitFlagHandler(Plugin plugin, Session session)
|
||||||
{
|
{
|
||||||
super(session);
|
super(plugin, session);
|
||||||
|
|
||||||
this.lastCommands = new ArrayList<>();
|
this.lastCommands = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
@ -68,7 +76,7 @@ public class ConsoleCommandOnExitFlagHandler extends HandlerWrapper
|
||||||
{
|
{
|
||||||
for(String command : commands_)
|
for(String command : commands_)
|
||||||
{
|
{
|
||||||
WorldGuardExtraFlagsPlugin.getPlugin().getServer().dispatchCommand(WorldGuardExtraFlagsPlugin.getPlugin().getServer().getConsoleSender(), command.substring(1).replace("%username%", player.getName())); //TODO: Make this better
|
this.getPlugin().getServer().dispatchCommand(this.getPlugin().getServer().getConsoleSender(), command.substring(1).replace("%username%", player.getName())); //TODO: Make this better
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
|
@ -4,13 +4,13 @@ import java.util.Set;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||||
import com.sk89q.worldguard.protection.flags.StateFlag.State;
|
import com.sk89q.worldguard.protection.flags.StateFlag.State;
|
||||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||||
import com.sk89q.worldguard.session.MoveType;
|
import com.sk89q.worldguard.session.MoveType;
|
||||||
import com.sk89q.worldguard.session.Session;
|
import com.sk89q.worldguard.session.Session;
|
||||||
import com.sk89q.worldguard.session.handler.Handler;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
||||||
|
@ -19,22 +19,31 @@ import net.goldtreeservers.worldguardextraflags.wg.wrappers.HandlerWrapper;
|
||||||
|
|
||||||
public class FlyFlagHandler extends HandlerWrapper
|
public class FlyFlagHandler extends HandlerWrapper
|
||||||
{
|
{
|
||||||
public static final Factory FACTORY = new Factory();
|
public static final Factory FACTORY(Plugin plugin)
|
||||||
public static class Factory extends Handler.Factory<FlyFlagHandler>
|
{
|
||||||
|
return new Factory(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Factory extends HandlerWrapper.Factory<FlyFlagHandler>
|
||||||
{
|
{
|
||||||
@Override
|
public Factory(Plugin plugin)
|
||||||
|
{
|
||||||
|
super(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public FlyFlagHandler create(Session session)
|
public FlyFlagHandler create(Session session)
|
||||||
{
|
{
|
||||||
return new FlyFlagHandler(session);
|
return new FlyFlagHandler(this.getPlugin(), session);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Getter private Boolean currentValue;
|
@Getter private Boolean currentValue;
|
||||||
private Boolean originalFly;
|
private Boolean originalFly;
|
||||||
|
|
||||||
protected FlyFlagHandler(Session session)
|
protected FlyFlagHandler(Plugin plugin, Session session)
|
||||||
{
|
{
|
||||||
super(session);
|
super(plugin, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
|
@ -11,6 +11,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
|
@ -18,10 +19,8 @@ import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||||
import com.sk89q.worldguard.session.MoveType;
|
import com.sk89q.worldguard.session.MoveType;
|
||||||
import com.sk89q.worldguard.session.Session;
|
import com.sk89q.worldguard.session.Session;
|
||||||
import com.sk89q.worldguard.session.handler.Handler;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.goldtreeservers.worldguardextraflags.WorldGuardExtraFlagsPlugin;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
||||||
import net.goldtreeservers.worldguardextraflags.flags.data.PotionEffectDetails;
|
import net.goldtreeservers.worldguardextraflags.flags.data.PotionEffectDetails;
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.WorldGuardUtils;
|
import net.goldtreeservers.worldguardextraflags.wg.WorldGuardUtils;
|
||||||
|
@ -29,13 +28,22 @@ import net.goldtreeservers.worldguardextraflags.wg.wrappers.HandlerWrapper;
|
||||||
|
|
||||||
public class GiveEffectsFlagHandler extends HandlerWrapper
|
public class GiveEffectsFlagHandler extends HandlerWrapper
|
||||||
{
|
{
|
||||||
public static final Factory FACTORY = new Factory();
|
public static final Factory FACTORY(Plugin plugin)
|
||||||
public static class Factory extends Handler.Factory<GiveEffectsFlagHandler>
|
{
|
||||||
|
return new Factory(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Factory extends HandlerWrapper.Factory<GiveEffectsFlagHandler>
|
||||||
{
|
{
|
||||||
@Override
|
public Factory(Plugin plugin)
|
||||||
|
{
|
||||||
|
super(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public GiveEffectsFlagHandler create(Session session)
|
public GiveEffectsFlagHandler create(Session session)
|
||||||
{
|
{
|
||||||
return new GiveEffectsFlagHandler(session);
|
return new GiveEffectsFlagHandler(this.getPlugin(), session);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,9 +52,9 @@ public class GiveEffectsFlagHandler extends HandlerWrapper
|
||||||
|
|
||||||
@Getter private boolean supressRemovePotionPacket;
|
@Getter private boolean supressRemovePotionPacket;
|
||||||
|
|
||||||
protected GiveEffectsFlagHandler(Session session)
|
protected GiveEffectsFlagHandler(Plugin plugin, Session session)
|
||||||
{
|
{
|
||||||
super(session);
|
super(plugin, session);
|
||||||
|
|
||||||
this.removedEffects = new HashMap<>();
|
this.removedEffects = new HashMap<>();
|
||||||
this.givenEffects = new HashSet<>();
|
this.givenEffects = new HashSet<>();
|
||||||
|
@ -165,7 +173,7 @@ public class GiveEffectsFlagHandler extends HandlerWrapper
|
||||||
{
|
{
|
||||||
this.removedEffects.clear();
|
this.removedEffects.clear();
|
||||||
|
|
||||||
this.check(player, WorldGuardExtraFlagsPlugin.getPlugin().getWorldGuardCommunicator().getRegionContainer().createQuery().getApplicableRegions(player.getLocation()));
|
this.check(player, WorldGuardUtils.getCommunicator().getRegionContainer().createQuery().getApplicableRegions(player.getLocation()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drinkPotion(Player player, Collection<PotionEffect> effects)
|
public void drinkPotion(Player player, Collection<PotionEffect> effects)
|
||||||
|
@ -175,6 +183,6 @@ public class GiveEffectsFlagHandler extends HandlerWrapper
|
||||||
this.removedEffects.put(effect.getType(), new PotionEffectDetails(System.nanoTime() + (long)(effect.getDuration() / 20D * TimeUnit.SECONDS.toNanos(1L)), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles()));
|
this.removedEffects.put(effect.getType(), new PotionEffectDetails(System.nanoTime() + (long)(effect.getDuration() / 20D * TimeUnit.SECONDS.toNanos(1L)), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles()));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.check(player, WorldGuardExtraFlagsPlugin.getPlugin().getWorldGuardCommunicator().getRegionContainer().createQuery().getApplicableRegions(player.getLocation()));
|
this.check(player, WorldGuardUtils.getCommunicator().getRegionContainer().createQuery().getApplicableRegions(player.getLocation()));
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -4,13 +4,13 @@ import java.util.Set;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||||
import com.sk89q.worldguard.protection.flags.StateFlag.State;
|
import com.sk89q.worldguard.protection.flags.StateFlag.State;
|
||||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||||
import com.sk89q.worldguard.session.MoveType;
|
import com.sk89q.worldguard.session.MoveType;
|
||||||
import com.sk89q.worldguard.session.Session;
|
import com.sk89q.worldguard.session.Session;
|
||||||
import com.sk89q.worldguard.session.handler.Handler;
|
|
||||||
|
|
||||||
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.WorldGuardUtils;
|
import net.goldtreeservers.worldguardextraflags.wg.WorldGuardUtils;
|
||||||
|
@ -18,21 +18,30 @@ import net.goldtreeservers.worldguardextraflags.wg.wrappers.HandlerWrapper;
|
||||||
|
|
||||||
public class GlideFlagHandler extends HandlerWrapper
|
public class GlideFlagHandler extends HandlerWrapper
|
||||||
{
|
{
|
||||||
public static final Factory FACTORY = new Factory();
|
public static final Factory FACTORY(Plugin plugin)
|
||||||
public static class Factory extends Handler.Factory<GlideFlagHandler>
|
{
|
||||||
|
return new Factory(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Factory extends HandlerWrapper.Factory<GlideFlagHandler>
|
||||||
{
|
{
|
||||||
@Override
|
public Factory(Plugin plugin)
|
||||||
|
{
|
||||||
|
super(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public GlideFlagHandler create(Session session)
|
public GlideFlagHandler create(Session session)
|
||||||
{
|
{
|
||||||
return new GlideFlagHandler(session);
|
return new GlideFlagHandler(this.getPlugin(), session);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Boolean originalGlide;
|
private Boolean originalGlide;
|
||||||
|
|
||||||
protected GlideFlagHandler(Session session)
|
protected GlideFlagHandler(Plugin plugin, Session session)
|
||||||
{
|
{
|
||||||
super(session);
|
super(plugin, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
|
@ -4,40 +4,48 @@ import java.util.Set;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
|
import com.earth2me.essentials.Essentials;
|
||||||
import com.earth2me.essentials.User;
|
import com.earth2me.essentials.User;
|
||||||
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||||
import com.sk89q.worldguard.protection.flags.StateFlag.State;
|
import com.sk89q.worldguard.protection.flags.StateFlag.State;
|
||||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||||
import com.sk89q.worldguard.session.MoveType;
|
import com.sk89q.worldguard.session.MoveType;
|
||||||
import com.sk89q.worldguard.session.Session;
|
import com.sk89q.worldguard.session.Session;
|
||||||
import com.sk89q.worldguard.session.handler.Handler;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.goldtreeservers.worldguardextraflags.WorldGuardExtraFlagsPlugin;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.essentials.EssentialsHelper;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.WorldGuardUtils;
|
import net.goldtreeservers.worldguardextraflags.wg.WorldGuardUtils;
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.wrappers.HandlerWrapper;
|
import net.goldtreeservers.worldguardextraflags.wg.wrappers.HandlerWrapper;
|
||||||
|
|
||||||
public class GodmodeFlagHandler extends HandlerWrapper
|
public class GodmodeFlagHandler extends HandlerWrapper
|
||||||
{
|
{
|
||||||
public static final Factory FACTORY = new Factory();
|
public static final Factory FACTORY(Plugin plugin)
|
||||||
public static class Factory extends Handler.Factory<GodmodeFlagHandler>
|
{
|
||||||
|
return new Factory(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Factory extends HandlerWrapper.Factory<GodmodeFlagHandler>
|
||||||
{
|
{
|
||||||
@Override
|
public Factory(Plugin plugin)
|
||||||
|
{
|
||||||
|
super(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public GodmodeFlagHandler create(Session session)
|
public GodmodeFlagHandler create(Session session)
|
||||||
{
|
{
|
||||||
return new GodmodeFlagHandler(session);
|
return new GodmodeFlagHandler(this.getPlugin(), session);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Getter private Boolean isGodmodeEnabled;
|
@Getter private Boolean isGodmodeEnabled;
|
||||||
private Boolean originalEssentialsGodmode;
|
private Boolean originalEssentialsGodmode;
|
||||||
|
|
||||||
protected GodmodeFlagHandler(Session session)
|
protected GodmodeFlagHandler(Plugin plugin, Session session)
|
||||||
{
|
{
|
||||||
super(session);
|
super(plugin, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -67,10 +75,11 @@ public class GodmodeFlagHandler extends HandlerWrapper
|
||||||
this.isGodmodeEnabled = null;
|
this.isGodmodeEnabled = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
EssentialsHelper helper = WorldGuardExtraFlagsPlugin.getPlugin().getEssentialsHelper();
|
//For now at least
|
||||||
if (helper != null)
|
Plugin essentials = this.getPlugin().getServer().getPluginManager().getPlugin("Essentials");
|
||||||
|
if (essentials != null)
|
||||||
{
|
{
|
||||||
User user = helper.getEssentialsPlugin().getUser(player);
|
User user = ((Essentials)essentials).getUser(player);
|
||||||
|
|
||||||
if (this.isGodmodeEnabled != null)
|
if (this.isGodmodeEnabled != null)
|
||||||
{
|
{
|
|
@ -8,15 +8,14 @@ import java.util.Set;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||||
import com.sk89q.worldguard.session.MoveType;
|
import com.sk89q.worldguard.session.MoveType;
|
||||||
import com.sk89q.worldguard.session.Session;
|
import com.sk89q.worldguard.session.Session;
|
||||||
import com.sk89q.worldguard.session.handler.Handler;
|
|
||||||
|
|
||||||
import net.goldtreeservers.worldguardextraflags.WorldGuardExtraFlagsPlugin;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
||||||
import net.goldtreeservers.worldguardextraflags.flags.data.SoundData;
|
import net.goldtreeservers.worldguardextraflags.flags.data.SoundData;
|
||||||
import net.goldtreeservers.worldguardextraflags.utils.SupportedFeatures;
|
import net.goldtreeservers.worldguardextraflags.utils.SupportedFeatures;
|
||||||
|
@ -25,21 +24,30 @@ import net.goldtreeservers.worldguardextraflags.wg.wrappers.HandlerWrapper;
|
||||||
|
|
||||||
public class PlaySoundsFlagHandler extends HandlerWrapper
|
public class PlaySoundsFlagHandler extends HandlerWrapper
|
||||||
{
|
{
|
||||||
public static final Factory FACTORY = new Factory();
|
public static final Factory FACTORY(Plugin plugin)
|
||||||
public static class Factory extends Handler.Factory<PlaySoundsFlagHandler>
|
{
|
||||||
|
return new Factory(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Factory extends HandlerWrapper.Factory<PlaySoundsFlagHandler>
|
||||||
{
|
{
|
||||||
@Override
|
public Factory(Plugin plugin)
|
||||||
|
{
|
||||||
|
super(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public PlaySoundsFlagHandler create(Session session)
|
public PlaySoundsFlagHandler create(Session session)
|
||||||
{
|
{
|
||||||
return new PlaySoundsFlagHandler(session);
|
return new PlaySoundsFlagHandler(this.getPlugin(), session);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<String, BukkitRunnable> runnables;
|
private Map<String, BukkitRunnable> runnables;
|
||||||
|
|
||||||
protected PlaySoundsFlagHandler(Session session)
|
protected PlaySoundsFlagHandler(Plugin plugin, Session session)
|
||||||
{
|
{
|
||||||
super(session);
|
super(plugin, session);
|
||||||
|
|
||||||
this.runnables = new HashMap<>();
|
this.runnables = new HashMap<>();
|
||||||
}
|
}
|
||||||
|
@ -93,7 +101,8 @@ public class PlaySoundsFlagHandler extends HandlerWrapper
|
||||||
};
|
};
|
||||||
|
|
||||||
this.runnables.put(sound.getSound(), runnable);
|
this.runnables.put(sound.getSound(), runnable);
|
||||||
runnable.runTaskTimer(WorldGuardExtraFlagsPlugin.getPlugin(), 0L, sound.getInterval());
|
|
||||||
|
runnable.runTaskTimer(this.getPlugin(), 0L, sound.getInterval());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -5,14 +5,13 @@ import java.util.Set;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.metadata.FixedMetadataValue;
|
import org.bukkit.metadata.FixedMetadataValue;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||||
import com.sk89q.worldguard.session.MoveType;
|
import com.sk89q.worldguard.session.MoveType;
|
||||||
import com.sk89q.worldguard.session.Session;
|
import com.sk89q.worldguard.session.Session;
|
||||||
import com.sk89q.worldguard.session.handler.Handler;
|
|
||||||
|
|
||||||
import net.goldtreeservers.worldguardextraflags.WorldGuardExtraFlagsPlugin;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
||||||
import net.goldtreeservers.worldguardextraflags.we.WorldEditUtils;
|
import net.goldtreeservers.worldguardextraflags.we.WorldEditUtils;
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.WorldGuardUtils;
|
import net.goldtreeservers.worldguardextraflags.wg.WorldGuardUtils;
|
||||||
|
@ -20,19 +19,28 @@ import net.goldtreeservers.worldguardextraflags.wg.wrappers.HandlerWrapper;
|
||||||
|
|
||||||
public class TeleportOnEntryFlagHandler extends HandlerWrapper
|
public class TeleportOnEntryFlagHandler extends HandlerWrapper
|
||||||
{
|
{
|
||||||
public static final Factory FACTORY = new Factory();
|
public static final Factory FACTORY(Plugin plugin)
|
||||||
public static class Factory extends Handler.Factory<TeleportOnEntryFlagHandler>
|
{
|
||||||
|
return new Factory(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Factory extends HandlerWrapper.Factory<TeleportOnEntryFlagHandler>
|
||||||
{
|
{
|
||||||
@Override
|
public Factory(Plugin plugin)
|
||||||
|
{
|
||||||
|
super(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public TeleportOnEntryFlagHandler create(Session session)
|
public TeleportOnEntryFlagHandler create(Session session)
|
||||||
{
|
{
|
||||||
return new TeleportOnEntryFlagHandler(session);
|
return new TeleportOnEntryFlagHandler(this.getPlugin(), session);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected TeleportOnEntryFlagHandler(Session session)
|
protected TeleportOnEntryFlagHandler(Plugin plugin, Session session)
|
||||||
{
|
{
|
||||||
super(session);
|
super(plugin, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -43,7 +51,8 @@ public class TeleportOnEntryFlagHandler extends HandlerWrapper
|
||||||
Object location = WorldGuardUtils.queryValueUnchecked(player, to.getWorld(), entered, Flags.TELEPORT_ON_ENTRY);
|
Object location = WorldGuardUtils.queryValueUnchecked(player, to.getWorld(), entered, Flags.TELEPORT_ON_ENTRY);
|
||||||
if (location != null)
|
if (location != null)
|
||||||
{
|
{
|
||||||
player.setMetadata(WorldGuardUtils.PREVENT_TELEPORT_LOOP_META, new FixedMetadataValue(WorldGuardExtraFlagsPlugin.getPlugin(), true));
|
player.setMetadata(WorldGuardUtils.PREVENT_TELEPORT_LOOP_META, new FixedMetadataValue(this.getPlugin(), true));
|
||||||
|
|
||||||
player.teleport(WorldEditUtils.toLocation(location));
|
player.teleport(WorldEditUtils.toLocation(location));
|
||||||
|
|
||||||
return false;
|
return false;
|
|
@ -5,14 +5,13 @@ import java.util.Set;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.metadata.FixedMetadataValue;
|
import org.bukkit.metadata.FixedMetadataValue;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||||
import com.sk89q.worldguard.session.MoveType;
|
import com.sk89q.worldguard.session.MoveType;
|
||||||
import com.sk89q.worldguard.session.Session;
|
import com.sk89q.worldguard.session.Session;
|
||||||
import com.sk89q.worldguard.session.handler.Handler;
|
|
||||||
|
|
||||||
import net.goldtreeservers.worldguardextraflags.WorldGuardExtraFlagsPlugin;
|
|
||||||
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
||||||
import net.goldtreeservers.worldguardextraflags.we.WorldEditUtils;
|
import net.goldtreeservers.worldguardextraflags.we.WorldEditUtils;
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.WorldGuardUtils;
|
import net.goldtreeservers.worldguardextraflags.wg.WorldGuardUtils;
|
||||||
|
@ -20,19 +19,28 @@ import net.goldtreeservers.worldguardextraflags.wg.wrappers.HandlerWrapper;
|
||||||
|
|
||||||
public class TeleportOnExitFlagHandler extends HandlerWrapper
|
public class TeleportOnExitFlagHandler extends HandlerWrapper
|
||||||
{
|
{
|
||||||
public static final Factory FACTORY = new Factory();
|
public static final Factory FACTORY(Plugin plugin)
|
||||||
public static class Factory extends Handler.Factory<TeleportOnExitFlagHandler>
|
{
|
||||||
|
return new Factory(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Factory extends HandlerWrapper.Factory<TeleportOnExitFlagHandler>
|
||||||
{
|
{
|
||||||
@Override
|
public Factory(Plugin plugin)
|
||||||
|
{
|
||||||
|
super(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public TeleportOnExitFlagHandler create(Session session)
|
public TeleportOnExitFlagHandler create(Session session)
|
||||||
{
|
{
|
||||||
return new TeleportOnExitFlagHandler(session);
|
return new TeleportOnExitFlagHandler(this.getPlugin(), session);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected TeleportOnExitFlagHandler(Session session)
|
protected TeleportOnExitFlagHandler(Plugin plugin, Session session)
|
||||||
{
|
{
|
||||||
super(session);
|
super(plugin, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -43,7 +51,8 @@ public class TeleportOnExitFlagHandler extends HandlerWrapper
|
||||||
Object location = WorldGuardUtils.queryValueUnchecked(player, to.getWorld(), exited, Flags.TELEPORT_ON_EXIT);
|
Object location = WorldGuardUtils.queryValueUnchecked(player, to.getWorld(), exited, Flags.TELEPORT_ON_EXIT);
|
||||||
if (location != null)
|
if (location != null)
|
||||||
{
|
{
|
||||||
player.setMetadata(WorldGuardUtils.PREVENT_TELEPORT_LOOP_META, new FixedMetadataValue(WorldGuardExtraFlagsPlugin.getPlugin(), true));
|
player.setMetadata(WorldGuardUtils.PREVENT_TELEPORT_LOOP_META, new FixedMetadataValue(this.getPlugin(), true));
|
||||||
|
|
||||||
player.teleport(WorldEditUtils.toLocation(location));
|
player.teleport(WorldEditUtils.toLocation(location));
|
||||||
|
|
||||||
return false;
|
return false;
|
|
@ -4,12 +4,12 @@ import java.util.Set;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||||
import com.sk89q.worldguard.session.MoveType;
|
import com.sk89q.worldguard.session.MoveType;
|
||||||
import com.sk89q.worldguard.session.Session;
|
import com.sk89q.worldguard.session.Session;
|
||||||
import com.sk89q.worldguard.session.handler.Handler;
|
|
||||||
|
|
||||||
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
||||||
import net.goldtreeservers.worldguardextraflags.wg.WorldGuardUtils;
|
import net.goldtreeservers.worldguardextraflags.wg.WorldGuardUtils;
|
||||||
|
@ -17,21 +17,30 @@ import net.goldtreeservers.worldguardextraflags.wg.wrappers.HandlerWrapper;
|
||||||
|
|
||||||
public class WalkSpeedFlagHandler extends HandlerWrapper
|
public class WalkSpeedFlagHandler extends HandlerWrapper
|
||||||
{
|
{
|
||||||
public static final Factory FACTORY = new Factory();
|
public static final Factory FACTORY(Plugin plugin)
|
||||||
public static class Factory extends Handler.Factory<WalkSpeedFlagHandler>
|
{
|
||||||
|
return new Factory(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Factory extends HandlerWrapper.Factory<WalkSpeedFlagHandler>
|
||||||
{
|
{
|
||||||
@Override
|
public Factory(Plugin plugin)
|
||||||
|
{
|
||||||
|
super(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public WalkSpeedFlagHandler create(Session session)
|
public WalkSpeedFlagHandler create(Session session)
|
||||||
{
|
{
|
||||||
return new WalkSpeedFlagHandler(session);
|
return new WalkSpeedFlagHandler(this.getPlugin(), session);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Float originalWalkSpeed;
|
private Float originalWalkSpeed;
|
||||||
|
|
||||||
protected WalkSpeedFlagHandler(Session session)
|
protected WalkSpeedFlagHandler(Plugin plugin, Session session)
|
||||||
{
|
{
|
||||||
super(session);
|
super(plugin, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
|
@ -4,6 +4,7 @@ import java.util.Set;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||||
import com.sk89q.worldguard.LocalPlayer;
|
import com.sk89q.worldguard.LocalPlayer;
|
||||||
|
@ -15,11 +16,17 @@ import com.sk89q.worldguard.session.MoveType;
|
||||||
import com.sk89q.worldguard.session.Session;
|
import com.sk89q.worldguard.session.Session;
|
||||||
import com.sk89q.worldguard.session.handler.Handler;
|
import com.sk89q.worldguard.session.handler.Handler;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
public abstract class HandlerWrapper extends Handler
|
public abstract class HandlerWrapper extends Handler
|
||||||
{
|
{
|
||||||
protected HandlerWrapper(Session session)
|
@Getter private final Plugin plugin;
|
||||||
|
|
||||||
|
protected HandlerWrapper(Plugin plugin, Session session)
|
||||||
{
|
{
|
||||||
super(session);
|
super(session);
|
||||||
|
|
||||||
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initialize(Player player, Location current, ApplicableRegionSet set)
|
public void initialize(Player player, Location current, ApplicableRegionSet set)
|
||||||
|
@ -63,4 +70,14 @@ public abstract class HandlerWrapper extends Handler
|
||||||
{
|
{
|
||||||
return this.getInvincibility(((BukkitPlayer)localPlayer).getPlayer());
|
return this.getInvincibility(((BukkitPlayer)localPlayer).getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public abstract static class Factory<T extends HandlerWrapper> extends Handler.Factory<T>
|
||||||
|
{
|
||||||
|
@Getter private final Plugin plugin;
|
||||||
|
|
||||||
|
public Factory(Plugin plugin)
|
||||||
|
{
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package net.goldtreeservers.worldguardextraflags.wg.wrappers;
|
package net.goldtreeservers.worldguardextraflags.wg.wrappers;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||||
import com.sk89q.worldedit.extent.Extent;
|
import com.sk89q.worldedit.extent.Extent;
|
||||||
|
@ -10,10 +11,74 @@ import com.sk89q.worldguard.protection.flags.Flag;
|
||||||
import com.sk89q.worldguard.protection.flags.SetFlag;
|
import com.sk89q.worldguard.protection.flags.SetFlag;
|
||||||
import com.sk89q.worldguard.protection.flags.registry.FlagRegistry;
|
import com.sk89q.worldguard.protection.flags.registry.FlagRegistry;
|
||||||
|
|
||||||
|
import net.goldtreeservers.worldguardextraflags.flags.Flags;
|
||||||
|
import net.goldtreeservers.worldguardextraflags.wg.handlers.BlockedEffectsFlagHandler;
|
||||||
|
import net.goldtreeservers.worldguardextraflags.wg.handlers.CommandOnEntryFlagHandler;
|
||||||
|
import net.goldtreeservers.worldguardextraflags.wg.handlers.CommandOnExitFlagHandler;
|
||||||
|
import net.goldtreeservers.worldguardextraflags.wg.handlers.ConsoleCommandOnEntryFlagHandler;
|
||||||
|
import net.goldtreeservers.worldguardextraflags.wg.handlers.ConsoleCommandOnExitFlagHandler;
|
||||||
|
import net.goldtreeservers.worldguardextraflags.wg.handlers.FlyFlagHandler;
|
||||||
|
import net.goldtreeservers.worldguardextraflags.wg.handlers.GiveEffectsFlagHandler;
|
||||||
|
import net.goldtreeservers.worldguardextraflags.wg.handlers.GlideFlagHandler;
|
||||||
|
import net.goldtreeservers.worldguardextraflags.wg.handlers.GodmodeFlagHandler;
|
||||||
|
import net.goldtreeservers.worldguardextraflags.wg.handlers.PlaySoundsFlagHandler;
|
||||||
|
import net.goldtreeservers.worldguardextraflags.wg.handlers.TeleportOnEntryFlagHandler;
|
||||||
|
import net.goldtreeservers.worldguardextraflags.wg.handlers.TeleportOnExitFlagHandler;
|
||||||
|
import net.goldtreeservers.worldguardextraflags.wg.handlers.WalkSpeedFlagHandler;
|
||||||
|
|
||||||
public interface WorldGuardCommunicator
|
public interface WorldGuardCommunicator
|
||||||
{
|
{
|
||||||
public void onLoad() throws Exception;
|
default public void onLoad(Plugin plugin) throws Exception
|
||||||
public void onEnable() throws Exception;
|
{
|
||||||
|
FlagRegistry flagRegistry = this.getFlagRegistry();
|
||||||
|
flagRegistry.register(Flags.TELEPORT_ON_ENTRY);
|
||||||
|
flagRegistry.register(Flags.TELEPORT_ON_EXIT);
|
||||||
|
flagRegistry.register(Flags.COMMAND_ON_ENTRY);
|
||||||
|
flagRegistry.register(Flags.COMMAND_ON_EXIT);
|
||||||
|
flagRegistry.register(Flags.CONSOLE_COMMAND_ON_ENTRY);
|
||||||
|
flagRegistry.register(Flags.CONSOLE_COMMAND_ON_EXIT);
|
||||||
|
flagRegistry.register(Flags.WALK_SPEED);
|
||||||
|
flagRegistry.register(Flags.KEEP_INVENTORY);
|
||||||
|
flagRegistry.register(Flags.KEEP_EXP);
|
||||||
|
flagRegistry.register(Flags.CHAT_PREFIX);
|
||||||
|
flagRegistry.register(Flags.CHAT_SUFFIX);
|
||||||
|
flagRegistry.register(Flags.BLOCKED_EFFECTS);
|
||||||
|
flagRegistry.register(Flags.GODMODE);
|
||||||
|
flagRegistry.register(Flags.RESPAWN_LOCATION);
|
||||||
|
flagRegistry.register(Flags.WORLDEDIT);
|
||||||
|
flagRegistry.register(Flags.GIVE_EFFECTS);
|
||||||
|
flagRegistry.register(Flags.FLY);
|
||||||
|
flagRegistry.register(Flags.PLAY_SOUNDS);
|
||||||
|
flagRegistry.register(Flags.MYTHICMOB_EGGS);
|
||||||
|
flagRegistry.register(Flags.FROSTWALKER);
|
||||||
|
flagRegistry.register(Flags.NETHER_PORTALS);
|
||||||
|
flagRegistry.register(Flags.ALLOW_BLOCK_PLACE);
|
||||||
|
flagRegistry.register(Flags.DENY_BLOCK_PLACE);
|
||||||
|
flagRegistry.register(Flags.ALLOW_BLOCK_BREAK);
|
||||||
|
flagRegistry.register(Flags.DENY_BLOCK_BREAK);
|
||||||
|
flagRegistry.register(Flags.GLIDE);
|
||||||
|
flagRegistry.register(Flags.CHUNK_UNLOAD);
|
||||||
|
flagRegistry.register(Flags.ITEM_DURABILITY);
|
||||||
|
flagRegistry.register(Flags.JOIN_LOCATION);
|
||||||
|
}
|
||||||
|
|
||||||
|
default public void onEnable(Plugin plugin) throws Exception
|
||||||
|
{
|
||||||
|
AbstractSessionManagerWrapper sessionManager = this.getSessionManager();
|
||||||
|
sessionManager.registerHandler(TeleportOnEntryFlagHandler.FACTORY(plugin));
|
||||||
|
sessionManager.registerHandler(TeleportOnExitFlagHandler.FACTORY(plugin));
|
||||||
|
sessionManager.registerHandler(CommandOnEntryFlagHandler.FACTORY(plugin));
|
||||||
|
sessionManager.registerHandler(CommandOnExitFlagHandler.FACTORY(plugin));
|
||||||
|
sessionManager.registerHandler(ConsoleCommandOnEntryFlagHandler.FACTORY(plugin));
|
||||||
|
sessionManager.registerHandler(ConsoleCommandOnExitFlagHandler.FACTORY(plugin));
|
||||||
|
sessionManager.registerHandler(WalkSpeedFlagHandler.FACTORY(plugin));
|
||||||
|
sessionManager.registerHandler(BlockedEffectsFlagHandler.FACTORY(plugin));
|
||||||
|
sessionManager.registerHandler(GodmodeFlagHandler.FACTORY(plugin));
|
||||||
|
sessionManager.registerHandler(GiveEffectsFlagHandler.FACTORY(plugin));
|
||||||
|
sessionManager.registerHandler(FlyFlagHandler.FACTORY(plugin));
|
||||||
|
sessionManager.registerHandler(PlaySoundsFlagHandler.FACTORY(plugin));
|
||||||
|
sessionManager.registerHandler(GlideFlagHandler.FACTORY(plugin));
|
||||||
|
}
|
||||||
|
|
||||||
public FlagRegistry getFlagRegistry();
|
public FlagRegistry getFlagRegistry();
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ package net.goldtreeservers.worldguardextraflags.wg.wrappers.v6;
|
||||||
|
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
import com.sk89q.worldedit.BlockVector;
|
import com.sk89q.worldedit.BlockVector;
|
||||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||||
|
@ -27,15 +28,18 @@ public class WorldGuardSixCommunicator implements WorldGuardCommunicator
|
||||||
private AbstractRegionContainerWrapper regionContainer;
|
private AbstractRegionContainerWrapper regionContainer;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoad() throws Exception
|
public void onLoad(Plugin plugin) throws Exception
|
||||||
{
|
{
|
||||||
|
WorldGuardCommunicator.super.onLoad(plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() throws Exception
|
public void onEnable(Plugin plugin) throws Exception
|
||||||
{
|
{
|
||||||
this.sessionManager = new SessionManagerWrapper(WorldGuardPlugin.inst().getSessionManager());
|
this.sessionManager = new SessionManagerWrapper(WorldGuardPlugin.inst().getSessionManager());
|
||||||
this.regionContainer = new RegionContainerWrapper();
|
this.regionContainer = new RegionContainerWrapper();
|
||||||
|
|
||||||
|
WorldGuardCommunicator.super.onEnable(plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -2,6 +2,7 @@ package net.goldtreeservers.worldguardextraflags.wg.wrappers.v7;
|
||||||
|
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||||
import com.sk89q.worldedit.extent.Extent;
|
import com.sk89q.worldedit.extent.Extent;
|
||||||
|
@ -28,15 +29,18 @@ public class WorldGuardSevenCommunicator implements WorldGuardCommunicator
|
||||||
private AbstractRegionContainerWrapper regionContainer;
|
private AbstractRegionContainerWrapper regionContainer;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoad() throws Exception
|
public void onLoad(Plugin plugin) throws Exception
|
||||||
{
|
{
|
||||||
|
WorldGuardCommunicator.super.onLoad(plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() throws Exception
|
public void onEnable(Plugin plugin) throws Exception
|
||||||
{
|
{
|
||||||
this.sessionManager = new SessionManagerWrapper(WorldGuard.getInstance().getPlatform().getSessionManager());
|
this.sessionManager = new SessionManagerWrapper(WorldGuard.getInstance().getPlatform().getSessionManager());
|
||||||
this.regionContainer = new RegionContainerWrapper();
|
this.regionContainer = new RegionContainerWrapper();
|
||||||
|
|
||||||
|
WorldGuardCommunicator.super.onEnable(plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue