From e605f72b4b24a9f7867d6dc524500b18835f46cf Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Wed, 30 Nov 2016 10:57:10 -0500 Subject: [PATCH] Write GPowerAPI --- src/alisolarflare/AliPresents.java | 2 - .../components/gpowers/GPowerAPI.java | 90 +++++ .../components/gpowers/GPowerComponent.java | 9 +- .../components/gpowers/GPowerMemory.java | 52 --- .../components/gpowers/PoweredPlayer.java | 18 + .../components/gpowers/commands/GPower.java | 11 +- .../gpowers/enchant/EnchantingLoop.java | 107 ++---- .../gpowers/powerstate/PowerAll.java | 12 +- .../gpowers/powerstate/PowerDown.java | 11 +- .../gpowers/powerstate/PowerUp.java | 11 +- .../minigames/GameState.java | 3 +- .../minigames/MinigameComponent.java | 13 +- .../minigames/commands/JoinMinigame.java | 5 +- .../minigames/commands/LeaveMinigame.java | 5 +- .../minigames/commands/ListFighters.java | 5 +- .../minigames/commands/SetColourSpawn.java | 5 +- .../minigames/data/SpawnSet.java | 3 +- .../thebuttonrebirth/ButtonRebirthPlugin.java | 3 +- .../thebuttonrebirth/admin/CreateShrine.java | 11 +- .../thebuttonrebirth/commands/ShowBars.java | 3 +- .../listeners/CyclicalDisplayListener.java | 3 +- .../listeners/MidnightListener.java | 3 +- .../listeners/StealChestListener.java | 3 +- .../tasks/CheckChestTask.java | 338 +++++++++--------- .../tasks/CyclicalDisplayTask.java | 5 +- .../tasks/StealChestTask.java | 5 +- 26 files changed, 366 insertions(+), 370 deletions(-) create mode 100644 src/alisolarflare/components/gpowers/GPowerAPI.java delete mode 100644 src/alisolarflare/components/gpowers/GPowerMemory.java create mode 100644 src/alisolarflare/components/gpowers/PoweredPlayer.java rename src/{alisolarflare/components => graveyard}/minigames/GameState.java (52%) rename src/{alisolarflare/components => graveyard}/minigames/MinigameComponent.java (65%) rename src/{alisolarflare/components => graveyard}/minigames/commands/JoinMinigame.java (83%) rename src/{alisolarflare/components => graveyard}/minigames/commands/LeaveMinigame.java (85%) rename src/{alisolarflare/components => graveyard}/minigames/commands/ListFighters.java (80%) rename src/{alisolarflare/components => graveyard}/minigames/commands/SetColourSpawn.java (90%) rename src/{alisolarflare/components => graveyard}/minigames/data/SpawnSet.java (77%) diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index b135968..dcc97a9 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -14,7 +14,6 @@ import alisolarflare.components.gpowers.GPowerComponent; import alisolarflare.components.insurance.InsuranceComponent; import alisolarflare.components.magic.MagicComponent; import alisolarflare.components.metrics.MetricsComponent; -import alisolarflare.components.minigames.MinigameComponent; public class AliPresents extends JavaPlugin{ public void onEnable(){ @@ -32,7 +31,6 @@ public class AliPresents extends JavaPlugin{ new InsuranceComponent().register(this); new MagicComponent().register(this); new MetricsComponent().register(this); - new MinigameComponent().register(this); logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ")."); diff --git a/src/alisolarflare/components/gpowers/GPowerAPI.java b/src/alisolarflare/components/gpowers/GPowerAPI.java new file mode 100644 index 0000000..aa8bef0 --- /dev/null +++ b/src/alisolarflare/components/gpowers/GPowerAPI.java @@ -0,0 +1,90 @@ +package alisolarflare.components.gpowers; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import org.bukkit.Color; +import org.bukkit.entity.Player; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +public class GPowerAPI{ + public static final int defaultPowerLength = 300; + public static Map poweredPlayerList = new HashMap(); + + public static void addPlayer(Player player, String colour, boolean powerIsActive){ + poweredPlayerList.put(player.getUniqueId(), new PoweredPlayer(player.getUniqueId(), colour, true)); + } + public static void PowerUpPlayer(Player player){ + player.sendMessage("Powering up!"); + if(poweredPlayerList.containsKey(player.getUniqueId())){ + poweredPlayerList.get(player.getUniqueId()).isPowersActive = true; + player.sendMessage("Powered up!"); + }else{ + player.sendMessage("You must instantiate your power settings using /GPower"); + } + } + public static void PowerUpAllPlayers(){ + for (PoweredPlayer poweredPlayer : GPowerAPI.poweredPlayerList.values()){ + poweredPlayer.isPowersActive = true; + } + } + + public static void PowerDownPlayer(Player player){ + player.sendMessage("Powering down!"); + if (poweredPlayerList.containsKey(player.getUniqueId())){ + player.sendMessage("Powered down!"); + poweredPlayerList.get(player.getUniqueId()).isPowersActive = false; + }else{ + player.sendMessage("P down!"); + return; + } + + } + public static void activatePower(Player player){ + activatePower(player, poweredPlayerList.get(player.getUniqueId()).colour, defaultPowerLength); + } + public static void activatePower(Player player, String colour){ + activatePower(player, colour, defaultPowerLength); + } + public static void activatePower(Player player, String colour, int powerLength) { + //GREY + for (PotionEffect potionEffect : player.getActivePotionEffects()){ + player.removePotionEffect(potionEffect.getType()); + } + if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, powerLength, 0, true, false, Color.GRAY), true); + player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, powerLength+100, 0, true, false, Color.GRAY), true); + //RED + }else if (colour.startsWith("r")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, powerLength, 0, true, false, Color.RED), true); + //ORANGE + }else if (colour.startsWith("o")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, powerLength, 0, true, false, Color.ORANGE), true); + player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, powerLength, 0, true, false, Color.ORANGE), true); + //YELLOW + }else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15 && player.getLocation().getBlock().getLightFromBlocks() == 15){ + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, powerLength, 0, true, false, Color.YELLOW), true); + //GREEN + }else if (colour.startsWith("g") && !colour.startsWith("gra") && !colour.startsWith("grey")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, powerLength, 1, true, false, Color.GREEN), true); + player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, powerLength, 0, true, false, Color.GREEN), true); + //BLUE + }else if (colour.startsWith("b")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, powerLength, 1, true, false, Color.BLUE), true); + player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, powerLength, 0, true, false, Color.BLUE), true); + //PURPLE + }else if (colour.startsWith("p")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, powerLength, 0, true, false, Color.PURPLE), true); + //NULL + }else{ + } + } + public static boolean playerHasActivePowers(Player player){ + return poweredPlayerList.containsKey(player.getUniqueId()) && poweredPlayerList.get(player.getUniqueId()).isPowersActive; + } + + +} + diff --git a/src/alisolarflare/components/gpowers/GPowerComponent.java b/src/alisolarflare/components/gpowers/GPowerComponent.java index 978c30b..64d33cc 100644 --- a/src/alisolarflare/components/gpowers/GPowerComponent.java +++ b/src/alisolarflare/components/gpowers/GPowerComponent.java @@ -12,12 +12,11 @@ public class GPowerComponent extends Component { @Override public void register(JavaPlugin plugin) { - GPowerMemory gPowerMemory = new GPowerMemory(); - registerCommand(plugin, new GPower(gPowerMemory)); - registerCommand(plugin, new PowerUp(gPowerMemory)); - registerCommand(plugin, new PowerDown(gPowerMemory)); + registerCommand(plugin, new GPower()); + registerCommand(plugin, new PowerUp()); + registerCommand(plugin, new PowerDown()); - registerListener(plugin, new EnchantingLoop(plugin, gPowerMemory)); + registerListener(plugin, new EnchantingLoop(plugin)); } diff --git a/src/alisolarflare/components/gpowers/GPowerMemory.java b/src/alisolarflare/components/gpowers/GPowerMemory.java deleted file mode 100644 index 44e0089..0000000 --- a/src/alisolarflare/components/gpowers/GPowerMemory.java +++ /dev/null @@ -1,52 +0,0 @@ -package alisolarflare.components.gpowers; - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.bukkit.entity.Player; - -public class GPowerMemory{ - public Map poweredPlayerList = new HashMap(); - - public void configurePlayer(Player player, String colour, boolean powerIsActive){ - poweredPlayerList.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true)); - } - public void PowerUpPlayer(Player player){ - player.sendMessage("Powering up!"); - if(poweredPlayerList.containsKey(player.getUniqueId())){ - poweredPlayerList.get(player.getUniqueId()).isPowersActive = true; - player.sendMessage("Powered up!"); - }else{ - player.sendMessage("You must instantiate your power settings using /GPower"); - } - } - - public void PowerDownPlayer(Player player){ - player.sendMessage("Powering down!"); - if (poweredPlayerList.containsKey(player.getUniqueId())){ - player.sendMessage("Powered down!"); - poweredPlayerList.get(player.getUniqueId()).isPowersActive = false; - }else{ - player.sendMessage("P down!"); - return; - } - - } - - public class poweredPlayer{ - public UUID uuid; - public String colour; - public Boolean isPowersActive; - - public poweredPlayer(UUID uuid, String colour, Boolean activated){ - this.uuid = (uuid); - this.colour = (colour); - this.isPowersActive = (activated); - } - public String toString(){ - return "[UUID: "+ uuid.toString() + ", Colour: "+ colour+", IsActivated: "+isPowersActive + "]"; - } - } -} - diff --git a/src/alisolarflare/components/gpowers/PoweredPlayer.java b/src/alisolarflare/components/gpowers/PoweredPlayer.java new file mode 100644 index 0000000..27b0116 --- /dev/null +++ b/src/alisolarflare/components/gpowers/PoweredPlayer.java @@ -0,0 +1,18 @@ +package alisolarflare.components.gpowers; + +import java.util.UUID; + +public class PoweredPlayer{ + public UUID uuid; + public String colour; + public Boolean isPowersActive; + + public PoweredPlayer(UUID uuid, String colour, Boolean activated){ + this.uuid = (uuid); + this.colour = (colour); + this.isPowersActive = (activated); + } + public String toString(){ + return "[UUID: "+ uuid.toString() + ", Colour: "+ colour+", IsActivated: "+isPowersActive + "]"; + } +} diff --git a/src/alisolarflare/components/gpowers/commands/GPower.java b/src/alisolarflare/components/gpowers/commands/GPower.java index a4aed7d..3632f44 100644 --- a/src/alisolarflare/components/gpowers/commands/GPower.java +++ b/src/alisolarflare/components/gpowers/commands/GPower.java @@ -3,16 +3,9 @@ package alisolarflare.components.gpowers.commands; import org.bukkit.entity.Player; import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.gpowers.GPowerMemory; +import alisolarflare.components.gpowers.GPowerAPI; public class GPower extends PlayerCommand { - - private GPowerMemory gPowerMemory; - - public GPower(GPowerMemory gPowerMemory) { - this.gPowerMemory = gPowerMemory; - } - @Override public boolean OnCommand(Player player, String label, String[] args) { if (args.length < 2) { @@ -39,7 +32,7 @@ public class GPower extends PlayerCommand { } player.sendMessage("Terms Vaild!"); player.sendMessage("Saving Data: "+ player.getName() + "|" + colour + "|" + isActive); - gPowerMemory.configurePlayer(player, colour, isActive); + GPowerAPI.addPlayer(player, colour, isActive); return true; } diff --git a/src/alisolarflare/components/gpowers/enchant/EnchantingLoop.java b/src/alisolarflare/components/gpowers/enchant/EnchantingLoop.java index 2f22b0f..098d13b 100644 --- a/src/alisolarflare/components/gpowers/enchant/EnchantingLoop.java +++ b/src/alisolarflare/components/gpowers/enchant/EnchantingLoop.java @@ -1,75 +1,32 @@ -package alisolarflare.components.gpowers.enchant; - -import java.util.Map; -import java.util.UUID; - -import org.bukkit.Color; -import org.bukkit.Server; -import org.bukkit.entity.Player; -import org.bukkit.event.Listener; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.scheduler.BukkitRunnable; - -import alisolarflare.components.gpowers.GPowerMemory; -import alisolarflare.components.gpowers.GPowerMemory.poweredPlayer; - -public class EnchantingLoop extends BukkitRunnable implements Listener{ - private int powerLength = 300; - private Server server; - private Map poweredPlayerList; - - - public EnchantingLoop(JavaPlugin plugin, GPowerMemory gPowerMemory){ - this.server = plugin.getServer(); - this.poweredPlayerList = gPowerMemory.poweredPlayerList; - this.runTaskTimer(plugin, 0, 190); - } - - //REPEATS EVERY 5 SECONDS - @Override - public void run() { - //server.broadcastMessage("ping!"); - for (Player player : server.getOnlinePlayers()){ - if(poweredPlayerList.containsKey(player.getUniqueId()) && poweredPlayerList.get(player.getUniqueId()).isPowersActive){ - activatePower(player, poweredPlayerList.get(player.getUniqueId()).colour); - } - } - } - - private void activatePower(Player player, String colour) { - //GREY - for (PotionEffect potionEffect : player.getActivePotionEffects()){ - player.removePotionEffect(potionEffect.getType()); - } - if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ - player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, powerLength, 0, true, false, Color.GRAY), true); - player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, powerLength+100, 0, true, false, Color.GRAY), true); - //RED - }else if (colour.startsWith("r")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, powerLength, 0, true, false, Color.RED), true); - //ORANGE - }else if (colour.startsWith("o")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, powerLength, 0, true, false, Color.ORANGE), true); - player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, powerLength, 0, true, false, Color.ORANGE), true); - //YELLOW - }else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15 && player.getLocation().getBlock().getLightFromBlocks() == 15){ - player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, powerLength, 0, true, false, Color.YELLOW), true); - //GREEN - }else if (colour.startsWith("g") && !colour.startsWith("gra") && !colour.startsWith("grey")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, powerLength, 1, true, false, Color.GREEN), true); - player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, powerLength, 0, true, false, Color.GREEN), true); - //BLUE - }else if (colour.startsWith("b")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, powerLength, 1, true, false, Color.BLUE), true); - player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, powerLength, 0, true, false, Color.BLUE), true); - //PURPLE - }else if (colour.startsWith("p")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, powerLength, 0, true, false, Color.PURPLE), true); - //NULL - }else{ - } - } - -} +package alisolarflare.components.gpowers.enchant; + +import org.bukkit.Server; +import org.bukkit.entity.Player; +import org.bukkit.event.Listener; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.scheduler.BukkitRunnable; + +import alisolarflare.components.gpowers.GPowerAPI; + +public class EnchantingLoop extends BukkitRunnable implements Listener{ + private Server server; + + + public EnchantingLoop(JavaPlugin plugin){ + this.server = plugin.getServer(); + this.runTaskTimer(plugin, 0, 190); + } + + //REPEATS EVERY 5 SECONDS + @Override + public void run() { + for (Player player : server.getOnlinePlayers()){ + if(GPowerAPI.playerHasActivePowers(player)){ + GPowerAPI.activatePower(player); + } + } + } + + + +} diff --git a/src/alisolarflare/components/gpowers/powerstate/PowerAll.java b/src/alisolarflare/components/gpowers/powerstate/PowerAll.java index ae8380d..6fc8305 100644 --- a/src/alisolarflare/components/gpowers/powerstate/PowerAll.java +++ b/src/alisolarflare/components/gpowers/powerstate/PowerAll.java @@ -3,20 +3,12 @@ package alisolarflare.components.gpowers.powerstate; import org.bukkit.entity.Player; import alisolarflare.architecture.commands.ModCommand; -import alisolarflare.components.gpowers.GPowerMemory; -import alisolarflare.components.gpowers.GPowerMemory.poweredPlayer; +import alisolarflare.components.gpowers.GPowerAPI; public class PowerAll extends ModCommand{ - private GPowerMemory gPowerMemory; - - public PowerAll(GPowerMemory gPowerMemory) { - this.gPowerMemory = gPowerMemory; - } @Override public boolean OnCommand(Player player, String alias, String[] args) { - for (poweredPlayer poweredPlayer : gPowerMemory.poweredPlayerList.values()){ - poweredPlayer.isPowersActive = true; - } + GPowerAPI.PowerUpAllPlayers(); return true; } public String[] GetHelpText(String alias){ diff --git a/src/alisolarflare/components/gpowers/powerstate/PowerDown.java b/src/alisolarflare/components/gpowers/powerstate/PowerDown.java index 1e3bb45..6badc03 100644 --- a/src/alisolarflare/components/gpowers/powerstate/PowerDown.java +++ b/src/alisolarflare/components/gpowers/powerstate/PowerDown.java @@ -3,19 +3,12 @@ package alisolarflare.components.gpowers.powerstate; import org.bukkit.entity.Player; import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.gpowers.GPowerMemory; +import alisolarflare.components.gpowers.GPowerAPI; public class PowerDown extends PlayerCommand { - - private GPowerMemory gPowerMemory; - - public PowerDown(GPowerMemory gPowerMemory) { - this.gPowerMemory = gPowerMemory; - } - @Override public boolean OnCommand(Player player, String label, String[] args) { - gPowerMemory.PowerDownPlayer(player); + GPowerAPI.PowerDownPlayer(player); return true; } @Override diff --git a/src/alisolarflare/components/gpowers/powerstate/PowerUp.java b/src/alisolarflare/components/gpowers/powerstate/PowerUp.java index e62203a..50f89d3 100644 --- a/src/alisolarflare/components/gpowers/powerstate/PowerUp.java +++ b/src/alisolarflare/components/gpowers/powerstate/PowerUp.java @@ -3,19 +3,12 @@ package alisolarflare.components.gpowers.powerstate; import org.bukkit.entity.Player; import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.gpowers.GPowerMemory; +import alisolarflare.components.gpowers.GPowerAPI; public class PowerUp extends PlayerCommand { - - private GPowerMemory gPowerMemory; - - public PowerUp(GPowerMemory gPowerMemory) { - this.gPowerMemory = gPowerMemory; - } - @Override public boolean OnCommand(Player player, String label, String[] args) { - gPowerMemory.PowerUpPlayer(player); + GPowerAPI.PowerUpPlayer(player); return true; } @Override diff --git a/src/alisolarflare/components/minigames/GameState.java b/src/graveyard/minigames/GameState.java similarity index 52% rename from src/alisolarflare/components/minigames/GameState.java rename to src/graveyard/minigames/GameState.java index 7a5a953..36ad955 100644 --- a/src/alisolarflare/components/minigames/GameState.java +++ b/src/graveyard/minigames/GameState.java @@ -1,5 +1,6 @@ -package alisolarflare.components.minigames; +/*package graveyard.minigames; public enum GameState { Idle, FreeForAll, Heroes; } +*/ \ No newline at end of file diff --git a/src/alisolarflare/components/minigames/MinigameComponent.java b/src/graveyard/minigames/MinigameComponent.java similarity index 65% rename from src/alisolarflare/components/minigames/MinigameComponent.java rename to src/graveyard/minigames/MinigameComponent.java index 5b662e1..29f375d 100644 --- a/src/alisolarflare/components/minigames/MinigameComponent.java +++ b/src/graveyard/minigames/MinigameComponent.java @@ -1,4 +1,4 @@ -package alisolarflare.components.minigames; +/*package graveyard.minigames; import java.util.List; @@ -6,11 +6,11 @@ import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.architecture.Component; -import alisolarflare.components.minigames.commands.JoinMinigame; -import alisolarflare.components.minigames.commands.LeaveMinigame; -import alisolarflare.components.minigames.commands.ListFighters; -import alisolarflare.components.minigames.commands.SetColourSpawn; -import alisolarflare.components.minigames.data.SpawnSet; +import graveyard.minigames.commands.JoinMinigame; +import graveyard.minigames.commands.LeaveMinigame; +import graveyard.minigames.commands.ListFighters; +import graveyard.minigames.commands.SetColourSpawn; +import graveyard.minigames.data.SpawnSet; public class MinigameComponent extends Component{ public SpawnSet spawnSet; @@ -34,3 +34,4 @@ public class MinigameComponent extends Component{ } } } +*/ \ No newline at end of file diff --git a/src/alisolarflare/components/minigames/commands/JoinMinigame.java b/src/graveyard/minigames/commands/JoinMinigame.java similarity index 83% rename from src/alisolarflare/components/minigames/commands/JoinMinigame.java rename to src/graveyard/minigames/commands/JoinMinigame.java index 8dc07d2..f0a960b 100644 --- a/src/alisolarflare/components/minigames/commands/JoinMinigame.java +++ b/src/graveyard/minigames/commands/JoinMinigame.java @@ -1,11 +1,11 @@ -package alisolarflare.components.minigames.commands; +/*package graveyard.minigames.commands; import java.util.List; import org.bukkit.entity.Player; import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.minigames.MinigameComponent; +import graveyard.minigames.MinigameComponent; public class JoinMinigame extends PlayerCommand { private List fighterList; @@ -31,3 +31,4 @@ public class JoinMinigame extends PlayerCommand { }; } } +*/ \ No newline at end of file diff --git a/src/alisolarflare/components/minigames/commands/LeaveMinigame.java b/src/graveyard/minigames/commands/LeaveMinigame.java similarity index 85% rename from src/alisolarflare/components/minigames/commands/LeaveMinigame.java rename to src/graveyard/minigames/commands/LeaveMinigame.java index c7c5f9c..5a05279 100644 --- a/src/alisolarflare/components/minigames/commands/LeaveMinigame.java +++ b/src/graveyard/minigames/commands/LeaveMinigame.java @@ -1,11 +1,11 @@ -package alisolarflare.components.minigames.commands; +/*package graveyard.minigames.commands; import java.util.List; import org.bukkit.entity.Player; import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.minigames.MinigameComponent; +import graveyard.minigames.MinigameComponent; public class LeaveMinigame extends PlayerCommand { private List fighters; @@ -39,3 +39,4 @@ public class LeaveMinigame extends PlayerCommand { }; } } +*/ \ No newline at end of file diff --git a/src/alisolarflare/components/minigames/commands/ListFighters.java b/src/graveyard/minigames/commands/ListFighters.java similarity index 80% rename from src/alisolarflare/components/minigames/commands/ListFighters.java rename to src/graveyard/minigames/commands/ListFighters.java index 6904914..73b5d80 100644 --- a/src/alisolarflare/components/minigames/commands/ListFighters.java +++ b/src/graveyard/minigames/commands/ListFighters.java @@ -1,9 +1,9 @@ -package alisolarflare.components.minigames.commands; +/*package graveyard.minigames.commands; import org.bukkit.entity.Player; import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.minigames.MinigameComponent; +import graveyard.minigames.MinigameComponent; public class ListFighters extends PlayerCommand { private MinigameComponent component; @@ -24,3 +24,4 @@ public class ListFighters extends PlayerCommand { }; } } +*/ \ No newline at end of file diff --git a/src/alisolarflare/components/minigames/commands/SetColourSpawn.java b/src/graveyard/minigames/commands/SetColourSpawn.java similarity index 90% rename from src/alisolarflare/components/minigames/commands/SetColourSpawn.java rename to src/graveyard/minigames/commands/SetColourSpawn.java index bb29f3e..302ba1e 100644 --- a/src/alisolarflare/components/minigames/commands/SetColourSpawn.java +++ b/src/graveyard/minigames/commands/SetColourSpawn.java @@ -1,9 +1,9 @@ -package alisolarflare.components.minigames.commands; +/*package graveyard.minigames.commands; import org.bukkit.entity.Player; import alisolarflare.architecture.commands.ModCommand; -import alisolarflare.components.minigames.data.SpawnSet; +import graveyard.minigames.data.SpawnSet; public class SetColourSpawn extends ModCommand{ private SpawnSet spawnSet; @@ -62,3 +62,4 @@ public class SetColourSpawn extends ModCommand{ }; } } +*/ \ No newline at end of file diff --git a/src/alisolarflare/components/minigames/data/SpawnSet.java b/src/graveyard/minigames/data/SpawnSet.java similarity index 77% rename from src/alisolarflare/components/minigames/data/SpawnSet.java rename to src/graveyard/minigames/data/SpawnSet.java index be34825..1878177 100644 --- a/src/alisolarflare/components/minigames/data/SpawnSet.java +++ b/src/graveyard/minigames/data/SpawnSet.java @@ -1,4 +1,4 @@ -package alisolarflare.components.minigames.data; +/*package graveyard.minigames.data; import org.bukkit.Location; @@ -11,3 +11,4 @@ public class SpawnSet { public Location PSpawn; } +*/ \ No newline at end of file diff --git a/src/graveyard/thebuttonrebirth/ButtonRebirthPlugin.java b/src/graveyard/thebuttonrebirth/ButtonRebirthPlugin.java index 13e0096..35c07e6 100644 --- a/src/graveyard/thebuttonrebirth/ButtonRebirthPlugin.java +++ b/src/graveyard/thebuttonrebirth/ButtonRebirthPlugin.java @@ -1,4 +1,4 @@ -package graveyard.thebuttonrebirth; +/*package graveyard.thebuttonrebirth; import java.util.ArrayList; import java.util.List; @@ -68,3 +68,4 @@ public class ButtonRebirthPlugin extends JavaPlugin{ shrineCreator.createShrine(chestX, chestY, chestZ, 10, Material.BEDROCK); } } +*/ \ No newline at end of file diff --git a/src/graveyard/thebuttonrebirth/admin/CreateShrine.java b/src/graveyard/thebuttonrebirth/admin/CreateShrine.java index 3f973e1..7df84c0 100644 --- a/src/graveyard/thebuttonrebirth/admin/CreateShrine.java +++ b/src/graveyard/thebuttonrebirth/admin/CreateShrine.java @@ -1,4 +1,4 @@ -package graveyard.thebuttonrebirth.admin; +/*package graveyard.thebuttonrebirth.admin; import org.bukkit.Material; import org.bukkit.World; @@ -96,7 +96,7 @@ public class CreateShrine implements CommandExecutor{ sender.sendMessage("Error in CreateShrine Class: No world defined in config..."); sender.sendMessage("Defining world based on player location."); - /* + //Changes world variable in config file if (sender instanceof Player){ Player player = (Player) sender; @@ -107,14 +107,14 @@ public class CreateShrine implements CommandExecutor{ //Sends player the result of the change sender.sendMessage("World variable set to " + player.getWorld().getName() + "in config file"); } - */ + } - /* + if (!(player.hasPermission("Moderator") || player.hasPermission("Admin"))){ player.sendMessage(ChatColor.RED + "You must be in the group Moderator or Admin to access this command!"); return false; } - */ + chestX = plugin.getConfig().getInt("chestX"); chestY = plugin.getConfig().getInt("chestY"); chestZ = plugin.getConfig().getInt("chestZ"); @@ -126,3 +126,4 @@ public class CreateShrine implements CommandExecutor{ return false; } } +*/ \ No newline at end of file diff --git a/src/graveyard/thebuttonrebirth/commands/ShowBars.java b/src/graveyard/thebuttonrebirth/commands/ShowBars.java index 34f9a38..fd52cb7 100644 --- a/src/graveyard/thebuttonrebirth/commands/ShowBars.java +++ b/src/graveyard/thebuttonrebirth/commands/ShowBars.java @@ -1,4 +1,4 @@ -package graveyard.thebuttonrebirth.commands; +/*package graveyard.thebuttonrebirth.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; @@ -28,3 +28,4 @@ public class ShowBars implements CommandExecutor{ } } +*/ \ No newline at end of file diff --git a/src/graveyard/thebuttonrebirth/listeners/CyclicalDisplayListener.java b/src/graveyard/thebuttonrebirth/listeners/CyclicalDisplayListener.java index 68b6c13..11f1355 100644 --- a/src/graveyard/thebuttonrebirth/listeners/CyclicalDisplayListener.java +++ b/src/graveyard/thebuttonrebirth/listeners/CyclicalDisplayListener.java @@ -1,4 +1,4 @@ -package graveyard.thebuttonrebirth.listeners; +/*package graveyard.thebuttonrebirth.listeners; import org.bukkit.event.Listener; import org.bukkit.scheduler.BukkitTask; @@ -17,3 +17,4 @@ public class CyclicalDisplayListener implements Listener{ bukkitTask = cyclicalDisplayTask.runTaskTimer(this.plugin, 20, 20); } } +*/ \ No newline at end of file diff --git a/src/graveyard/thebuttonrebirth/listeners/MidnightListener.java b/src/graveyard/thebuttonrebirth/listeners/MidnightListener.java index 1e3b155..d8cfa04 100644 --- a/src/graveyard/thebuttonrebirth/listeners/MidnightListener.java +++ b/src/graveyard/thebuttonrebirth/listeners/MidnightListener.java @@ -1,4 +1,4 @@ -package graveyard.thebuttonrebirth.listeners; +/*package graveyard.thebuttonrebirth.listeners; import org.bukkit.event.Listener; import org.bukkit.scheduler.BukkitTask; @@ -17,3 +17,4 @@ public class MidnightListener implements Listener{ checkChestTask = new CheckChestTask(this.plugin).runTaskTimer(this.plugin, 20, 60); } } +*/ \ No newline at end of file diff --git a/src/graveyard/thebuttonrebirth/listeners/StealChestListener.java b/src/graveyard/thebuttonrebirth/listeners/StealChestListener.java index 1574add..1c6bd4d 100644 --- a/src/graveyard/thebuttonrebirth/listeners/StealChestListener.java +++ b/src/graveyard/thebuttonrebirth/listeners/StealChestListener.java @@ -1,4 +1,4 @@ -package graveyard.thebuttonrebirth.listeners; +/*package graveyard.thebuttonrebirth.listeners; import org.bukkit.event.Listener; import org.bukkit.scheduler.BukkitTask; @@ -16,3 +16,4 @@ public class StealChestListener implements Listener{ stealChestTask = new StealChestTask(this.plugin).runTaskTimer(this.plugin, 20, 20); } } +*/ \ No newline at end of file diff --git a/src/graveyard/thebuttonrebirth/tasks/CheckChestTask.java b/src/graveyard/thebuttonrebirth/tasks/CheckChestTask.java index dae0446..71b653c 100644 --- a/src/graveyard/thebuttonrebirth/tasks/CheckChestTask.java +++ b/src/graveyard/thebuttonrebirth/tasks/CheckChestTask.java @@ -1,169 +1,169 @@ -package graveyard.thebuttonrebirth.tasks; - -import java.time.Clock; -import java.time.LocalDateTime; - -import org.bukkit.ChatColor; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.Sound; -import org.bukkit.World; -import org.bukkit.block.Block; -import org.bukkit.block.Chest; -import org.bukkit.inventory.Inventory; -import org.bukkit.scheduler.BukkitRunnable; - -import graveyard.thebuttonrebirth.ButtonRebirthPlugin; -import graveyard.thebuttonrebirth.admin.CreateShrine; - -public class CheckChestTask extends BukkitRunnable{ - //Plugin - private final ButtonRebirthPlugin BRplugin; - private World world; - - //Chest - private int chestX; - private int chestY; - private int chestZ; - private Block chestBlock; - private Chest shrineChest; - private Inventory shrineInventory; - - //Time - private LocalDateTime currentTime; - private LocalDateTime configTime; - - private int minimumDiamondBlocks; - private int diamondsInserted; - - public CheckChestTask(ButtonRebirthPlugin initBRplugin){ - //INIT - plugin - this.BRplugin = initBRplugin; - - //INIT - chestX, chestY, chestZ - chestX = BRplugin.getConfig().getInt("chestX"); - chestY = BRplugin.getConfig().getInt("chestY"); - chestZ = BRplugin.getConfig().getInt("chestZ"); - - //INIT - World - world = BRplugin.getServer().getWorld(BRplugin.getConfig().getString("world")); - } - - @Override - public void run(){ - //run() activates every 20 server ticks. - - //CHECK - Plugin is Enabled - if (BRplugin.isEnabled() == false){ - this.cancel(); - } - //CHECK - World Exists - if (!(BRplugin.getServer().getWorlds().contains(BRplugin.getServer().getWorld(BRplugin.getConfig().getString("world"))))) { - BRplugin.logger.info("Error: Config world does not exist in Server."); - BRplugin.logger.info("Server Worlds: " + BRplugin.getServer().getWorlds().toString()); - BRplugin.logger.info("Config World: " + BRplugin.getConfig().getString("world")); - BRplugin.logger.info("Turning off Display..."); - this.cancel(); - return; - } - - //INIT - currentTime, configTime - currentTime = LocalDateTime.now(Clock.systemUTC()); - configTime = LocalDateTime.parse(BRplugin.getConfig().getString("lastCheckChestTime")); - - //TIME - Current Time after Config Time - if (currentTime.isAfter(configTime)){ - - //SANITIZE "world" - if (BRplugin.getConfig().getString("world") == null) BRplugin.getServer().broadcastMessage("Error: No world defined in config file."); - if (BRplugin.getServer().getWorlds() == null) BRplugin.getServer().broadcastMessage("Error: plugin.getServer().getWorlds() returns null"); - - //INIT - world, chestBlock - chestBlock = world.getBlockAt(chestX, chestY, chestZ); - - //SANITIZE - chestBlock - if (!(chestBlock.getType() == Material.CHEST)){ - damageShrine(); - reconstructShrine(); - return; - } - - //INIT - shrineChest, shrineInventory - shrineChest = (Chest) chestBlock.getState(); - shrineInventory = shrineChest.getInventory(); - - - //UPDATE - configTime - BRplugin.getConfig().set("lastCheckChestTime", currentTime.plusMinutes(BRplugin.getConfig().getInt("barDuration")).toString()); - BRplugin.saveConfig(); - - //INIT - minimumDiamondBlocks, diamondsInserted - minimumDiamondBlocks = BRplugin.getConfig().getInt("minimumDiamondBlocks"); - diamondsInserted = BRplugin.getConfig().getInt("diamondsInserted"); - - //CHECK - chest for diamonds - if(diamondsInserted > minimumDiamondBlocks || shrineInventory.contains(Material.DIAMOND_BLOCK, (minimumDiamondBlocks - diamondsInserted))){ - //INVENTORY SUCCESS - - //CHECK - First Time - if (minimumDiamondBlocks == 0){ - broadcastExperimentHasBegun(); - }else{ - broadcastButtonRefuled(); - } - - //UPDATE minimumDiamondBlocks - minimumDiamondBlocks++; - BRplugin.getConfig().set("minimumDiamondBlocks", minimumDiamondBlocks); - BRplugin.getConfig().set("diamondsInserted", 0); - BRplugin.saveConfig(); - }else{ - //INVENTORY FAILURE - damageShrine(); - } - - //RESET - shrine, shrineInventory - reconstructShrine(); - shrineInventory.clear(); - BRplugin.getConfig().set("diamondsInserted",0); - - }else{ - //currentTime is before config time. - //therefore wait. - } - - } - private void damageShrine(){ - //UPDATE - buttonHealth - int buttonHealth = BRplugin.getConfig().getInt("buttonHealth"); - buttonHealth--; - BRplugin.getConfig().set("buttonHealth", buttonHealth); - - //DISPLAY AND MAKE SOUND - BRplugin.getServer().broadcastMessage(ChatColor.DARK_RED + "--------------------------"); - BRplugin.getServer().broadcastMessage(ChatColor.DARK_RED + "----- BUTTON DAMAGED -----"); - BRplugin.getServer().broadcastMessage(ChatColor.DARK_RED + "--------------------------"); - BRplugin.getServer().broadcastMessage(ChatColor.RED + " " + buttonHealth + "s of Health left"); - world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_ENDERDRAGON_DEATH,50,1); - world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_LIGHTNING_THUNDER,50,1); - world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_GENERIC_EXPLODE,50,50); - } - private void reconstructShrine(){ - CreateShrine shrineConstructor= new CreateShrine(BRplugin); - shrineConstructor.createShrine(chestX, chestY, chestZ, 10, Material.BEDROCK); - } - private void broadcastExperimentHasBegun(){ - BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "------------------------------------"); - BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "----- THE EXPERIMENT HAS BEGUN -----"); - BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "------------------------------------"); - BRplugin.getServer().broadcastMessage(ChatColor.BLUE + " " + minimumDiamondBlocks + " Blocks required"); - world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_WITHER_SPAWN,50,10); - } - private void broadcastButtonRefuled(){ - BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "--------------------------"); - BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "----- BUTTON REFULED -----"); - BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "--------------------------"); - BRplugin.getServer().broadcastMessage(ChatColor.BLUE + " " + minimumDiamondBlocks + " Blocks required"); - world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_WITHER_SPAWN,50,10); - } -} +//package graveyard.thebuttonrebirth.tasks; +// +//import java.time.Clock; +//import java.time.LocalDateTime; +// +//import org.bukkit.ChatColor; +//import org.bukkit.Location; +//import org.bukkit.Material; +//import org.bukkit.Sound; +//import org.bukkit.World; +//import org.bukkit.block.Block; +//import org.bukkit.block.Chest; +//import org.bukkit.inventory.Inventory; +//import org.bukkit.scheduler.BukkitRunnable; +// +//import graveyard.thebuttonrebirth.ButtonRebirthPlugin; +//import graveyard.thebuttonrebirth.admin.CreateShrine; +// +//public class CheckChestTask extends BukkitRunnable{ +// //Plugin +// private final ButtonRebirthPlugin BRplugin; +// private World world; +// +// //Chest +// private int chestX; +// private int chestY; +// private int chestZ; +// private Block chestBlock; +// private Chest shrineChest; +// private Inventory shrineInventory; +// +// //Time +// private LocalDateTime currentTime; +// private LocalDateTime configTime; +// +// private int minimumDiamondBlocks; +// private int diamondsInserted; +// +// public CheckChestTask(ButtonRebirthPlugin initBRplugin){ +// //INIT - plugin +// this.BRplugin = initBRplugin; +// +// //INIT - chestX, chestY, chestZ +// chestX = BRplugin.getConfig().getInt("chestX"); +// chestY = BRplugin.getConfig().getInt("chestY"); +// chestZ = BRplugin.getConfig().getInt("chestZ"); +// +// //INIT - World +// world = BRplugin.getServer().getWorld(BRplugin.getConfig().getString("world")); +// } +// +// @Override +// public void run(){ +// //run() activates every 20 server ticks. +// +// //CHECK - Plugin is Enabled +// if (BRplugin.isEnabled() == false){ +// this.cancel(); +// } +// //CHECK - World Exists +// if (!(BRplugin.getServer().getWorlds().contains(BRplugin.getServer().getWorld(BRplugin.getConfig().getString("world"))))) { +// BRplugin.logger.info("Error: Config world does not exist in Server."); +// BRplugin.logger.info("Server Worlds: " + BRplugin.getServer().getWorlds().toString()); +// BRplugin.logger.info("Config World: " + BRplugin.getConfig().getString("world")); +// BRplugin.logger.info("Turning off Display..."); +// this.cancel(); +// return; +// } +// +// //INIT - currentTime, configTime +// currentTime = LocalDateTime.now(Clock.systemUTC()); +// configTime = LocalDateTime.parse(BRplugin.getConfig().getString("lastCheckChestTime")); +// +// //TIME - Current Time after Config Time +// if (currentTime.isAfter(configTime)){ +// +// //SANITIZE "world" +// if (BRplugin.getConfig().getString("world") == null) BRplugin.getServer().broadcastMessage("Error: No world defined in config file."); +// if (BRplugin.getServer().getWorlds() == null) BRplugin.getServer().broadcastMessage("Error: plugin.getServer().getWorlds() returns null"); +// +// //INIT - world, chestBlock +// chestBlock = world.getBlockAt(chestX, chestY, chestZ); +// +// //SANITIZE - chestBlock +// if (!(chestBlock.getType() == Material.CHEST)){ +// damageShrine(); +// reconstructShrine(); +// return; +// } +// +// //INIT - shrineChest, shrineInventory +// shrineChest = (Chest) chestBlock.getState(); +// shrineInventory = shrineChest.getInventory(); +// +// +// //UPDATE - configTime +// BRplugin.getConfig().set("lastCheckChestTime", currentTime.plusMinutes(BRplugin.getConfig().getInt("barDuration")).toString()); +// BRplugin.saveConfig(); +// +// //INIT - minimumDiamondBlocks, diamondsInserted +// minimumDiamondBlocks = BRplugin.getConfig().getInt("minimumDiamondBlocks"); +// diamondsInserted = BRplugin.getConfig().getInt("diamondsInserted"); +// +// //CHECK - chest for diamonds +// if(diamondsInserted > minimumDiamondBlocks || shrineInventory.contains(Material.DIAMOND_BLOCK, (minimumDiamondBlocks - diamondsInserted))){ +// //INVENTORY SUCCESS +// +// //CHECK - First Time +// if (minimumDiamondBlocks == 0){ +// broadcastExperimentHasBegun(); +// }else{ +// broadcastButtonRefuled(); +// } +// +// //UPDATE minimumDiamondBlocks +// minimumDiamondBlocks++; +// BRplugin.getConfig().set("minimumDiamondBlocks", minimumDiamondBlocks); +// BRplugin.getConfig().set("diamondsInserted", 0); +// BRplugin.saveConfig(); +// }else{ +// //INVENTORY FAILURE +// damageShrine(); +// } +// +// //RESET - shrine, shrineInventory +// reconstructShrine(); +// shrineInventory.clear(); +// BRplugin.getConfig().set("diamondsInserted",0); +// +// }else{ +// //currentTime is before config time. +// //therefore wait. +// } +// +// } +// private void damageShrine(){ +// //UPDATE - buttonHealth +// int buttonHealth = BRplugin.getConfig().getInt("buttonHealth"); +// buttonHealth--; +// BRplugin.getConfig().set("buttonHealth", buttonHealth); +// +// //DISPLAY AND MAKE SOUND +// BRplugin.getServer().broadcastMessage(ChatColor.DARK_RED + "--------------------------"); +// BRplugin.getServer().broadcastMessage(ChatColor.DARK_RED + "----- BUTTON DAMAGED -----"); +// BRplugin.getServer().broadcastMessage(ChatColor.DARK_RED + "--------------------------"); +// BRplugin.getServer().broadcastMessage(ChatColor.RED + " " + buttonHealth + "s of Health left"); +// world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_ENDERDRAGON_DEATH,50,1); +// world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_LIGHTNING_THUNDER,50,1); +// world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_GENERIC_EXPLODE,50,50); +// } +// private void reconstructShrine(){ +// CreateShrine shrineConstructor= new CreateShrine(BRplugin); +// shrineConstructor.createShrine(chestX, chestY, chestZ, 10, Material.BEDROCK); +// } +// private void broadcastExperimentHasBegun(){ +// BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "------------------------------------"); +// BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "----- THE EXPERIMENT HAS BEGUN -----"); +// BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "------------------------------------"); +// BRplugin.getServer().broadcastMessage(ChatColor.BLUE + " " + minimumDiamondBlocks + " Blocks required"); +// world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_WITHER_SPAWN,50,10); +// } +// private void broadcastButtonRefuled(){ +// BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "--------------------------"); +// BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "----- BUTTON REFULED -----"); +// BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "--------------------------"); +// BRplugin.getServer().broadcastMessage(ChatColor.BLUE + " " + minimumDiamondBlocks + " Blocks required"); +// world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_WITHER_SPAWN,50,10); +// } +//} diff --git a/src/graveyard/thebuttonrebirth/tasks/CyclicalDisplayTask.java b/src/graveyard/thebuttonrebirth/tasks/CyclicalDisplayTask.java index 5361af7..4c80a6f 100644 --- a/src/graveyard/thebuttonrebirth/tasks/CyclicalDisplayTask.java +++ b/src/graveyard/thebuttonrebirth/tasks/CyclicalDisplayTask.java @@ -1,4 +1,4 @@ -package graveyard.thebuttonrebirth.tasks; +/*package graveyard.thebuttonrebirth.tasks; import java.time.Clock; import java.time.Duration; @@ -213,7 +213,7 @@ public class CyclicalDisplayTask extends BukkitRunnable{ if (stack.getType() == Material.DIAMOND_BLOCK){ totalDiamonds += stack.getAmount(); } - }catch(Exception e){/*stack isn't a diamond block*/} + }catch(Exception e){stack isn't a diamond block} } diamondBar.setProgress((diamondsInserted+totalDiamonds)/(double)minimumDiamondBlocks); @@ -243,3 +243,4 @@ public class CyclicalDisplayTask extends BukkitRunnable{ currentBar = barCycleDuration * (bar); } } +*/ \ No newline at end of file diff --git a/src/graveyard/thebuttonrebirth/tasks/StealChestTask.java b/src/graveyard/thebuttonrebirth/tasks/StealChestTask.java index 1bc1239..ef1079e 100644 --- a/src/graveyard/thebuttonrebirth/tasks/StealChestTask.java +++ b/src/graveyard/thebuttonrebirth/tasks/StealChestTask.java @@ -1,4 +1,4 @@ -package graveyard.thebuttonrebirth.tasks; +/*package graveyard.thebuttonrebirth.tasks; import java.time.Clock; import java.time.LocalDateTime; @@ -135,7 +135,7 @@ public class StealChestTask extends BukkitRunnable{ totalDiamonds += (stack.getAmount() *1); } - }catch(Exception e){/*stack is empty*/} + }catch(Exception e){stack is empty} } shrineInventory.clear(); diamondsInserted += totalDiamonds; @@ -198,3 +198,4 @@ public class StealChestTask extends BukkitRunnable{ return closestPlayer; } } +*/ \ No newline at end of file