From 00402bd3a99c42b90646b1ceb49761bfbb460c9d Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Wed, 30 Nov 2016 00:31:41 -0500 Subject: [PATCH] WELP, Distraction Blocker kicked in --- plugin.yml | 2 +- .../commands/SetDickmode.java | 34 ------------------- .../listeners/PlotChangeListener.java | 27 ++++----------- .../components/easyuhc/EasyUHCComponent.java | 25 -------------- 4 files changed, 8 insertions(+), 80 deletions(-) delete mode 100644 src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java delete mode 100644 src/alisolarflare/components/easyuhc/EasyUHCComponent.java diff --git a/plugin.yml b/plugin.yml index ebb15ed..da90a29 100644 --- a/plugin.yml +++ b/plugin.yml @@ -17,7 +17,7 @@ commands: description: Creative Boundaries Gamemode 0 - allows players to return to survival cbgm1: description: Creative Boundaries Gamemode 1 - allows players to access creative within their towns. Creative is removed outside of towns so be careful - setdickmode: + setforceboundaries: description: Should players automatically return to creative when outside town borders? Dickmode says yes. joinminigame: description: Join a Button Minigame diff --git a/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java b/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java deleted file mode 100644 index f4c484b..0000000 --- a/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java +++ /dev/null @@ -1,34 +0,0 @@ -package alisolarflare.components.creativeboundaries.commands; - -import org.bukkit.entity.Player; - -import alisolarflare.architecture.commands.ModCommand; -import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; - -public class SetDickmode extends ModCommand{ - boolean dickMode; - - public SetDickmode(CreativeBoundariesComponent component){ - this.dickMode = component.dickmode; - } - - @Override - public boolean OnCommand(Player player, String label, String[] args) { - if(args.length < 1){ - player.sendMessage("You must use True, False, 1, or 0 as arguments!"); - return false; - } - String firstArgument = args[0]; - if(firstArgument.startsWith("t") || firstArgument.equals("1")){ - player.sendMessage("Dickmode has been turned on!"); - dickMode = true; - return true; - } - if(firstArgument.startsWith("f") || firstArgument.equals("0")){ - player.sendMessage("Dickmode has been turned off!"); - dickMode = false; - return true; - } - return false; - } -} diff --git a/src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java b/src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java index 856cf90..aa575e9 100644 --- a/src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java +++ b/src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java @@ -1,7 +1,5 @@ package alisolarflare.components.creativeboundaries.listeners; -import java.util.List; - import org.bukkit.GameMode; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -14,49 +12,39 @@ import com.palmergames.bukkit.towny.object.Town; import com.palmergames.bukkit.towny.object.TownBlock; import com.palmergames.bukkit.towny.object.TownyUniverse; -import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; +import alisolarflare.components.creativeboundaries.CreativeBoundariesAPI; public class PlotChangeListener implements Listener{ - private boolean dickmode; - private List cbCreatives; - - public PlotChangeListener(CreativeBoundariesComponent module){ - this.dickmode = module.dickmode; - this.cbCreatives = module.cbCreatives; - } @EventHandler public void onPlayerPlotChange(PlayerChangePlotEvent plotEvent){ Player player = plotEvent.getPlayer(); - if (dickmode == false){ + if (CreativeBoundariesAPI.getforceBoundaries() == false){ return; } if (plotEvent.getPlayer().getGameMode() != GameMode.CREATIVE){ return; } - if (!(cbCreatives.contains(plotEvent.getPlayer()))){ + if (!(CreativeBoundariesAPI.isCBCreative(player))){ return; } TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); if (tb == null) { - player.setGameMode(GameMode.SURVIVAL); player.sendMessage("You have left your town boundaries!"); - cbCreatives.remove(player); + CreativeBoundariesAPI.toSurvival(player); return; } Town town; try { town = tb.getTown(); } catch (NotRegisteredException e) { - player.setGameMode(GameMode.SURVIVAL); player.sendMessage("You have left your town boundaries!!"); - cbCreatives.remove(player); + CreativeBoundariesAPI.toSurvival(player); return; } if (town == null) { - player.setGameMode(GameMode.SURVIVAL); player.sendMessage("You have left your town boundaries!!!"); - cbCreatives.remove(player); + CreativeBoundariesAPI.toSurvival(player); return; } boolean townHasRes = false; @@ -66,9 +54,8 @@ public class PlotChangeListener implements Listener{ } } if (!townHasRes){ - player.setGameMode(GameMode.SURVIVAL); player.sendMessage("You have left your town boundaries!!!!"); - cbCreatives.remove(player); + CreativeBoundariesAPI.toSurvival(player); } } } diff --git a/src/alisolarflare/components/easyuhc/EasyUHCComponent.java b/src/alisolarflare/components/easyuhc/EasyUHCComponent.java deleted file mode 100644 index 1eeae35..0000000 --- a/src/alisolarflare/components/easyuhc/EasyUHCComponent.java +++ /dev/null @@ -1,25 +0,0 @@ -package alisolarflare.components.easyuhc; - -import org.bukkit.Location; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.architecture.Component; - -public class EasyUHCComponent extends Component{ - public Location lobbyLocation; - @Override - public void register(JavaPlugin plugin) { - - - -// registerCommand(plugin, new ActivatePowers()); -// registerCommand(plugin, new SetUHCLobby(this)); -// registerCommand(plugin, new SetWorldBorders()); -// registerCommand(plugin, new SetWorldBorders()); -// registerCommand(plugin, new SpreadPlayers()); -// registerCommand(plugin, new StartTimer()); -// registerCommand(plugin, new StartUHC()); -// registerCommand(plugin, new TeleportToUHC()); - - } -}