From 4a8c38e1c8f5874c71fae2f58618ed4cff44a604 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Tue, 26 Apr 2016 15:33:52 +1000 Subject: [PATCH] Add fountain reset command --- .../core/brawl/fountain/Fountain.java | 6 +++++ .../fountain/command/FountainCommand.java | 1 + .../brawl/fountain/command/ResetCommand.java | 25 +++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/brawl/fountain/command/ResetCommand.java diff --git a/Plugins/Mineplex.Core/src/mineplex/core/brawl/fountain/Fountain.java b/Plugins/Mineplex.Core/src/mineplex/core/brawl/fountain/Fountain.java index 39dad23a7..3cceeaf27 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/brawl/fountain/Fountain.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/brawl/fountain/Fountain.java @@ -92,4 +92,10 @@ public class Fountain { return _counter.getCount(); } + + public void reset() + { + _counter.reset(); + updateVisuals(); + } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/brawl/fountain/command/FountainCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/brawl/fountain/command/FountainCommand.java index 65c306ed3..470487ce8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/brawl/fountain/command/FountainCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/brawl/fountain/command/FountainCommand.java @@ -16,6 +16,7 @@ public class FountainCommand extends MultiCommandBase AddCommand(new AddCommand(plugin)); AddCommand(new GuiCommand(plugin)); + AddCommand(new ResetCommand(plugin)); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/brawl/fountain/command/ResetCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/brawl/fountain/command/ResetCommand.java new file mode 100644 index 000000000..c72dff6cc --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/brawl/fountain/command/ResetCommand.java @@ -0,0 +1,25 @@ +package mineplex.core.brawl.fountain.command; + +import mineplex.core.brawl.fountain.FountainManager; +import mineplex.core.command.CommandBase; +import mineplex.core.common.Rank; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilPlayer; +import org.bukkit.entity.Player; + +/** + * @author Shaun Bennett + */ +public class ResetCommand extends CommandBase +{ + public ResetCommand(FountainManager plugin) + { + super(plugin, Rank.DEVELOPER, "reset"); + } + + @Override + public void Execute(Player caller, String[] args) + { + Plugin.getGemFountain().reset(); + } +}