From 42169b64d902f557add3875892429d1e4d557abc Mon Sep 17 00:00:00 2001 From: Etzelia Date: Fri, 5 Jul 2019 16:43:29 +0200 Subject: [PATCH 1/9] Update to 1.14.3 (#13) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index eb19c43..4c63696 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ org.spigotmc spigot-api - 1.13.1-R0.1-SNAPSHOT + 1.14.3-R0.1-SNAPSHOT provided From bed3b002b0a85109ae8f27a0bfc99a1bb2cf6421 Mon Sep 17 00:00:00 2001 From: Etzelia Date: Tue, 1 Oct 2019 21:21:20 +0200 Subject: [PATCH 2/9] Fix OreAlert (#15) --- pom.xml | 2 +- .../minecraftmanager/MinecraftManager.java | 12 +- .../listeners/BlockBreakListener.java | 67 +---------- .../minecraftmanager/objects/OreAlert.java | 108 ++++++++++++++++++ 4 files changed, 112 insertions(+), 77 deletions(-) diff --git a/pom.xml b/pom.xml index 4c63696..a829446 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ org.spigotmc spigot-api - 1.14.3-R0.1-SNAPSHOT + 1.14.4-R0.1-SNAPSHOT provided diff --git a/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java b/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java index dea8c98..314d9ed 100644 --- a/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java +++ b/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java @@ -31,7 +31,6 @@ public class MinecraftManager extends JavaPlugin implements IMinecraftManager { private static Map applyMode = new HashMap<>(); private static Map applyQuestion = new HashMap<>(); private static Map applications = new HashMap<>(); - private static List diamonds = new ArrayList<>(); private static Rules rules; private static List banOptions; private static OreAlert oreAlert; @@ -90,13 +89,14 @@ public class MinecraftManager extends JavaPlugin implements IMinecraftManager { getServer().getPluginManager().registerEvents(commandPreprocessListener, this); oreAlert = new OreAlert(this); + Bukkit.getScheduler().runTaskAsynchronously(this, () -> oreAlert.monitor()); Bukkit.getConsoleSender().sendMessage("MinecraftManager has started successfully."); } } public void onDisable() { - + oreAlert.setRunning(false); } public void loadConfig() { @@ -158,14 +158,6 @@ public class MinecraftManager extends JavaPlugin implements IMinecraftManager { applications.put(uuid, application); } - public static boolean addDiamond(String location) { - if (diamonds.contains(location)) { - return false; - } - diamonds.add(location); - return true; - } - public static Rules getRules() { return rules; } diff --git a/src/main/java/xyz/etztech/minecraftmanager/listeners/BlockBreakListener.java b/src/main/java/xyz/etztech/minecraftmanager/listeners/BlockBreakListener.java index a82838c..15eb06f 100644 --- a/src/main/java/xyz/etztech/minecraftmanager/listeners/BlockBreakListener.java +++ b/src/main/java/xyz/etztech/minecraftmanager/listeners/BlockBreakListener.java @@ -1,20 +1,14 @@ package xyz.etztech.minecraftmanager.listeners; -import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockBreakEvent; -import org.bukkit.event.player.PlayerLoginEvent; -import xyz.etztech.minecraftmanager.MCMAPI; import xyz.etztech.minecraftmanager.MinecraftManager; import xyz.etztech.minecraftmanager.objects.OreAlert; -import java.util.ArrayList; -import java.util.List; - public class BlockBreakListener implements Listener { private MinecraftManager plugin; @@ -30,68 +24,9 @@ public class BlockBreakListener implements Listener { Block block = event.getBlock(); Player player = event.getPlayer(); if (Material.DIAMOND_ORE == block.getType()) { - if (MinecraftManager.addDiamond(getLocationString(block))) { - //plugin.log("[OreAlert]: " + event.getPlayer().getName()); - plugin.getOreAlert().addStrike(player.getUniqueId()); - plugin.getOreAlert().purge(player.getUniqueId(), plugin.getConfig().getInt("orealert.purge", 30)); - - int alertable = plugin.getOreAlert().getStrikes(player.getUniqueId()); - - double start = (double) alertable / plugin.getConfig().getInt("orealert.notify.start", 5); - // Start - if (start == 1) { - plugin.getOreAlert().alert(player.getName(), alertable, true); - } else if (start > 1) { - // Ping - if (alertable % plugin.getConfig().getInt("orealert.notify.ping", 5) == 0) { - plugin.getOreAlert().alert(player.getName(), alertable, true); - // Alert - } else if (alertable % plugin.getConfig().getInt("orealert.notify.each", 1) == 0) { - plugin.getOreAlert().alert(player.getName(), alertable, false); - } - } - - } - - Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> { - for (Block radiusBlock : getBlocks(block, 5)) { - if (Material.DIAMOND_ORE == radiusBlock.getType()) { - MinecraftManager.addDiamond(getLocationString(radiusBlock)); - } - } - }); - + plugin.getOreAlert().getQueue().add(new OreAlert.Strike(player, block)); } } } - private List getBlocks(Block start, int radius) { - if (radius < 0) { - return new ArrayList(0); - } - int iterations = (radius * 2) + 1; - List blocks = new ArrayList(iterations * iterations * iterations); - for (int x = -radius; x <= radius; x++) { - for (int y = -radius; y <= radius; y++) { - for (int z = -radius; z <= radius; z++) { - blocks.add(start.getRelative(x, y, z)); - } - } - } - return blocks; - } - - private String getLocationString(Block block) { - int X = block.getX(); - int Y = block.getY(); - int Z = block.getZ(); - - String x = String.valueOf(X); - String y = String.valueOf(Y); - String z = String.valueOf(Z); - - return x + y + z; - } - - } diff --git a/src/main/java/xyz/etztech/minecraftmanager/objects/OreAlert.java b/src/main/java/xyz/etztech/minecraftmanager/objects/OreAlert.java index 258ccb5..9b40c5c 100644 --- a/src/main/java/xyz/etztech/minecraftmanager/objects/OreAlert.java +++ b/src/main/java/xyz/etztech/minecraftmanager/objects/OreAlert.java @@ -3,6 +3,8 @@ package xyz.etztech.minecraftmanager.objects; import org.apache.commons.lang.StringUtils; import org.bukkit.Bukkit; import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.block.Block; import org.bukkit.entity.Player; import xyz.etztech.core.web.CoreWeb; import xyz.etztech.minecraftmanager.MinecraftManager; @@ -11,6 +13,9 @@ import java.util.*; public class OreAlert { private Map> players = new HashMap<>(); + private List diamonds = new ArrayList<>(); + private List queue = new ArrayList<>(); + private boolean running; private MinecraftManager plugin; @@ -18,6 +23,18 @@ public class OreAlert { this.plugin = plugin; } + public List getQueue() { + return this.queue; + } + + public boolean isRunning() { + return running; + } + + public void setRunning(boolean running) { + this.running = running; + } + public void addStrike(UUID uuid) { ArrayList strikes = players.getOrDefault(uuid, new ArrayList<>()); strikes.add(new Date()); @@ -61,6 +78,97 @@ public class OreAlert { players.put(uuid, purged); } + public boolean addDiamond(String location) { + if (diamonds.contains(location)) { + return false; + } + diamonds.add(location); + return true; + } + public void monitor() { + Strike strike; + running = true; + while (running) { + if (queue.size() > 0) { + strike = queue.get(0); + if (addDiamond(getLocationString(strike.getBlock()))) { + addStrike(strike.getPlayer().getUniqueId()); + purge(strike.getPlayer().getUniqueId(), plugin.getConfig().getInt("orealert.purge", 30)); + + int alertable = getStrikes(strike.getPlayer().getUniqueId()); + + double start = (double) alertable / plugin.getConfig().getInt("orealert.notify.start", 5); + // Start + if (start == 1) { + alert(strike.getPlayer().getName(), alertable, true); + } else if (start > 1) { + // Ping + if (alertable % plugin.getConfig().getInt("orealert.notify.ping", 5) == 0) { + alert(strike.getPlayer().getName(), alertable, true); + // Alert + } else if (alertable % plugin.getConfig().getInt("orealert.notify.each", 1) == 0) { + alert(strike.getPlayer().getName(), alertable, false); + } + } + + for (Block radiusBlock : getBlocks(strike.getBlock(), 5)) { + if (Material.DIAMOND_ORE == radiusBlock.getType()) { + addDiamond(getLocationString(radiusBlock)); + } + } + + } + queue.remove(0); + } + } + } + + private List getBlocks(Block start, int radius) { + if (radius < 0) { + return new ArrayList<>(0); + } + int iterations = (radius * 2) + 1; + List blocks = new ArrayList(iterations * iterations * iterations); + for (int x = -radius; x <= radius; x++) { + for (int y = -radius; y <= radius; y++) { + for (int z = -radius; z <= radius; z++) { + blocks.add(start.getRelative(x, y, z)); + } + } + } + return blocks; + } + + private String getLocationString(Block block) { + int X = block.getX(); + int Y = block.getY(); + int Z = block.getZ(); + + String x = String.valueOf(X); + String y = String.valueOf(Y); + String z = String.valueOf(Z); + + return x + y + z; + } + + public static class Strike { + private Player player; + private Block block; + + public Strike(Player player, Block block) { + this.player = player; + this.block = block; + } + + public Player getPlayer() { + return player; + } + + public Block getBlock() { + return block; + } + } + } From 33953fd989385a8815d96bb953fb0c5df08e07b6 Mon Sep 17 00:00:00 2001 From: ZeroHD Date: Sun, 20 Oct 2019 04:05:02 +0200 Subject: [PATCH 3/9] Switched from using an async task to using a timer task (#16) --- .../minecraftmanager/MinecraftManager.java | 6 +- .../minecraftmanager/objects/OreAlert.java | 60 ++++++++----------- 2 files changed, 25 insertions(+), 41 deletions(-) diff --git a/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java b/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java index 314d9ed..20f3cbe 100644 --- a/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java +++ b/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java @@ -89,16 +89,12 @@ public class MinecraftManager extends JavaPlugin implements IMinecraftManager { getServer().getPluginManager().registerEvents(commandPreprocessListener, this); oreAlert = new OreAlert(this); - Bukkit.getScheduler().runTaskAsynchronously(this, () -> oreAlert.monitor()); + Bukkit.getScheduler().runTaskTimer(this, () -> oreAlert.monitor(), 0, 20); Bukkit.getConsoleSender().sendMessage("MinecraftManager has started successfully."); } } - public void onDisable() { - oreAlert.setRunning(false); - } - public void loadConfig() { config = Bukkit.getPluginManager().getPlugin("MinecraftManager").getConfig(); } diff --git a/src/main/java/xyz/etztech/minecraftmanager/objects/OreAlert.java b/src/main/java/xyz/etztech/minecraftmanager/objects/OreAlert.java index 9b40c5c..e9b7f42 100644 --- a/src/main/java/xyz/etztech/minecraftmanager/objects/OreAlert.java +++ b/src/main/java/xyz/etztech/minecraftmanager/objects/OreAlert.java @@ -15,7 +15,6 @@ public class OreAlert { private Map> players = new HashMap<>(); private List diamonds = new ArrayList<>(); private List queue = new ArrayList<>(); - private boolean running; private MinecraftManager plugin; @@ -27,14 +26,6 @@ public class OreAlert { return this.queue; } - public boolean isRunning() { - return running; - } - - public void setRunning(boolean running) { - this.running = running; - } - public void addStrike(UUID uuid) { ArrayList strikes = players.getOrDefault(uuid, new ArrayList<>()); strikes.add(new Date()); @@ -89,39 +80,36 @@ public class OreAlert { public void monitor() { Strike strike; - running = true; - while (running) { - if (queue.size() > 0) { - strike = queue.get(0); - if (addDiamond(getLocationString(strike.getBlock()))) { - addStrike(strike.getPlayer().getUniqueId()); - purge(strike.getPlayer().getUniqueId(), plugin.getConfig().getInt("orealert.purge", 30)); + if (queue.size() > 0) { + strike = queue.get(0); + if (addDiamond(getLocationString(strike.getBlock()))) { + addStrike(strike.getPlayer().getUniqueId()); + purge(strike.getPlayer().getUniqueId(), plugin.getConfig().getInt("orealert.purge", 30)); - int alertable = getStrikes(strike.getPlayer().getUniqueId()); + int alertable = getStrikes(strike.getPlayer().getUniqueId()); - double start = (double) alertable / plugin.getConfig().getInt("orealert.notify.start", 5); - // Start - if (start == 1) { + double start = (double) alertable / plugin.getConfig().getInt("orealert.notify.start", 5); + // Start + if (start == 1) { + alert(strike.getPlayer().getName(), alertable, true); + } else if (start > 1) { + // Ping + if (alertable % plugin.getConfig().getInt("orealert.notify.ping", 5) == 0) { alert(strike.getPlayer().getName(), alertable, true); - } else if (start > 1) { - // Ping - if (alertable % plugin.getConfig().getInt("orealert.notify.ping", 5) == 0) { - alert(strike.getPlayer().getName(), alertable, true); - // Alert - } else if (alertable % plugin.getConfig().getInt("orealert.notify.each", 1) == 0) { - alert(strike.getPlayer().getName(), alertable, false); - } + // Alert + } else if (alertable % plugin.getConfig().getInt("orealert.notify.each", 1) == 0) { + alert(strike.getPlayer().getName(), alertable, false); } - - for (Block radiusBlock : getBlocks(strike.getBlock(), 5)) { - if (Material.DIAMOND_ORE == radiusBlock.getType()) { - addDiamond(getLocationString(radiusBlock)); - } - } - } - queue.remove(0); + + for (Block radiusBlock : getBlocks(strike.getBlock(), 5)) { + if (Material.DIAMOND_ORE == radiusBlock.getType()) { + addDiamond(getLocationString(radiusBlock)); + } + } + } + queue.remove(0); } } From e64f2119c56aaf73996e8ffd8ea2d26d547de0bb Mon Sep 17 00:00:00 2001 From: ZeroHD Date: Mon, 4 Nov 2019 17:59:48 +0100 Subject: [PATCH 4/9] Set the OreAlert task to run every tick. (#17) --- .../java/xyz/etztech/minecraftmanager/MinecraftManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java b/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java index 20f3cbe..dda1169 100644 --- a/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java +++ b/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java @@ -89,7 +89,7 @@ public class MinecraftManager extends JavaPlugin implements IMinecraftManager { getServer().getPluginManager().registerEvents(commandPreprocessListener, this); oreAlert = new OreAlert(this); - Bukkit.getScheduler().runTaskTimer(this, () -> oreAlert.monitor(), 0, 20); + Bukkit.getScheduler().runTaskTimer(this, () -> oreAlert.monitor(), 0, 1); Bukkit.getConsoleSender().sendMessage("MinecraftManager has started successfully."); } From b621e922d3272417d03834aa6a0339c1049326a7 Mon Sep 17 00:00:00 2001 From: ZeroHD Date: Wed, 13 Nov 2019 23:52:21 +0100 Subject: [PATCH 5/9] Reverted OreAlert changes and fixed the original issue (#18) --- .../minecraftmanager/MinecraftManager.java | 14 ++- .../listeners/BlockBreakListener.java | 61 +++++++++++- .../minecraftmanager/objects/OreAlert.java | 96 ------------------- 3 files changed, 72 insertions(+), 99 deletions(-) diff --git a/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java b/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java index dda1169..dea8c98 100644 --- a/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java +++ b/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java @@ -31,6 +31,7 @@ public class MinecraftManager extends JavaPlugin implements IMinecraftManager { private static Map applyMode = new HashMap<>(); private static Map applyQuestion = new HashMap<>(); private static Map applications = new HashMap<>(); + private static List diamonds = new ArrayList<>(); private static Rules rules; private static List banOptions; private static OreAlert oreAlert; @@ -89,12 +90,15 @@ public class MinecraftManager extends JavaPlugin implements IMinecraftManager { getServer().getPluginManager().registerEvents(commandPreprocessListener, this); oreAlert = new OreAlert(this); - Bukkit.getScheduler().runTaskTimer(this, () -> oreAlert.monitor(), 0, 1); Bukkit.getConsoleSender().sendMessage("MinecraftManager has started successfully."); } } + public void onDisable() { + + } + public void loadConfig() { config = Bukkit.getPluginManager().getPlugin("MinecraftManager").getConfig(); } @@ -154,6 +158,14 @@ public class MinecraftManager extends JavaPlugin implements IMinecraftManager { applications.put(uuid, application); } + public static boolean addDiamond(String location) { + if (diamonds.contains(location)) { + return false; + } + diamonds.add(location); + return true; + } + public static Rules getRules() { return rules; } diff --git a/src/main/java/xyz/etztech/minecraftmanager/listeners/BlockBreakListener.java b/src/main/java/xyz/etztech/minecraftmanager/listeners/BlockBreakListener.java index 15eb06f..7f54d1e 100644 --- a/src/main/java/xyz/etztech/minecraftmanager/listeners/BlockBreakListener.java +++ b/src/main/java/xyz/etztech/minecraftmanager/listeners/BlockBreakListener.java @@ -7,7 +7,9 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockBreakEvent; import xyz.etztech.minecraftmanager.MinecraftManager; -import xyz.etztech.minecraftmanager.objects.OreAlert; + +import java.util.ArrayList; +import java.util.List; public class BlockBreakListener implements Listener { @@ -24,9 +26,64 @@ public class BlockBreakListener implements Listener { Block block = event.getBlock(); Player player = event.getPlayer(); if (Material.DIAMOND_ORE == block.getType()) { - plugin.getOreAlert().getQueue().add(new OreAlert.Strike(player, block)); + if (MinecraftManager.addDiamond(getLocationString(block))) { + //plugin.log("[OreAlert]: " + event.getPlayer().getName()); + plugin.getOreAlert().addStrike(player.getUniqueId()); + plugin.getOreAlert().purge(player.getUniqueId(), plugin.getConfig().getInt("orealert.purge", 30)); + + int alertable = plugin.getOreAlert().getStrikes(player.getUniqueId()); + + double start = (double) alertable / plugin.getConfig().getInt("orealert.notify.start", 5); + // Start + if (start == 1) { + plugin.getOreAlert().alert(player.getName(), alertable, true); + } else if (start > 1) { + // Ping + if (alertable % plugin.getConfig().getInt("orealert.notify.ping", 5) == 0) { + plugin.getOreAlert().alert(player.getName(), alertable, true); + // Alert + } else if (alertable % plugin.getConfig().getInt("orealert.notify.each", 1) == 0) { + plugin.getOreAlert().alert(player.getName(), alertable, false); + } + } + + } + for (Block radiusBlock : getBlocks(block, 5)) { + if (Material.DIAMOND_ORE == radiusBlock.getType()) { + MinecraftManager.addDiamond(getLocationString(radiusBlock)); + } + } } } } + private List getBlocks(Block start, int radius) { + if (radius < 0) { + return new ArrayList(0); + } + int iterations = (radius * 2) + 1; + List blocks = new ArrayList(iterations * iterations * iterations); + for (int x = -radius; x <= radius; x++) { + for (int y = -radius; y <= radius; y++) { + for (int z = -radius; z <= radius; z++) { + blocks.add(start.getRelative(x, y, z)); + } + } + } + return blocks; + } + + private String getLocationString(Block block) { + int X = block.getX(); + int Y = block.getY(); + int Z = block.getZ(); + + String x = String.valueOf(X); + String y = String.valueOf(Y); + String z = String.valueOf(Z); + + return x + y + z; + } + + } diff --git a/src/main/java/xyz/etztech/minecraftmanager/objects/OreAlert.java b/src/main/java/xyz/etztech/minecraftmanager/objects/OreAlert.java index e9b7f42..258ccb5 100644 --- a/src/main/java/xyz/etztech/minecraftmanager/objects/OreAlert.java +++ b/src/main/java/xyz/etztech/minecraftmanager/objects/OreAlert.java @@ -3,8 +3,6 @@ package xyz.etztech.minecraftmanager.objects; import org.apache.commons.lang.StringUtils; import org.bukkit.Bukkit; import org.bukkit.ChatColor; -import org.bukkit.Material; -import org.bukkit.block.Block; import org.bukkit.entity.Player; import xyz.etztech.core.web.CoreWeb; import xyz.etztech.minecraftmanager.MinecraftManager; @@ -13,8 +11,6 @@ import java.util.*; public class OreAlert { private Map> players = new HashMap<>(); - private List diamonds = new ArrayList<>(); - private List queue = new ArrayList<>(); private MinecraftManager plugin; @@ -22,10 +18,6 @@ public class OreAlert { this.plugin = plugin; } - public List getQueue() { - return this.queue; - } - public void addStrike(UUID uuid) { ArrayList strikes = players.getOrDefault(uuid, new ArrayList<>()); strikes.add(new Date()); @@ -69,94 +61,6 @@ public class OreAlert { players.put(uuid, purged); } - public boolean addDiamond(String location) { - if (diamonds.contains(location)) { - return false; - } - diamonds.add(location); - return true; - } - public void monitor() { - Strike strike; - if (queue.size() > 0) { - strike = queue.get(0); - if (addDiamond(getLocationString(strike.getBlock()))) { - addStrike(strike.getPlayer().getUniqueId()); - purge(strike.getPlayer().getUniqueId(), plugin.getConfig().getInt("orealert.purge", 30)); - - int alertable = getStrikes(strike.getPlayer().getUniqueId()); - - double start = (double) alertable / plugin.getConfig().getInt("orealert.notify.start", 5); - // Start - if (start == 1) { - alert(strike.getPlayer().getName(), alertable, true); - } else if (start > 1) { - // Ping - if (alertable % plugin.getConfig().getInt("orealert.notify.ping", 5) == 0) { - alert(strike.getPlayer().getName(), alertable, true); - // Alert - } else if (alertable % plugin.getConfig().getInt("orealert.notify.each", 1) == 0) { - alert(strike.getPlayer().getName(), alertable, false); - } - } - - for (Block radiusBlock : getBlocks(strike.getBlock(), 5)) { - if (Material.DIAMOND_ORE == radiusBlock.getType()) { - addDiamond(getLocationString(radiusBlock)); - } - } - - } - queue.remove(0); - } - } - - private List getBlocks(Block start, int radius) { - if (radius < 0) { - return new ArrayList<>(0); - } - int iterations = (radius * 2) + 1; - List blocks = new ArrayList(iterations * iterations * iterations); - for (int x = -radius; x <= radius; x++) { - for (int y = -radius; y <= radius; y++) { - for (int z = -radius; z <= radius; z++) { - blocks.add(start.getRelative(x, y, z)); - } - } - } - return blocks; - } - - private String getLocationString(Block block) { - int X = block.getX(); - int Y = block.getY(); - int Z = block.getZ(); - - String x = String.valueOf(X); - String y = String.valueOf(Y); - String z = String.valueOf(Z); - - return x + y + z; - } - - public static class Strike { - private Player player; - private Block block; - - public Strike(Player player, Block block) { - this.player = player; - this.block = block; - } - - public Player getPlayer() { - return player; - } - - public Block getBlock() { - return block; - } - } - } From f5f69eb35a13d26c7a6c057f1cfd946ae919eee4 Mon Sep 17 00:00:00 2001 From: Etz Elia Date: Thu, 11 Jun 2020 22:03:44 +0200 Subject: [PATCH 6/9] Add 'LICENSE' (#19) Add 'LICENSE' Reviewed-by: ZeroHD --- LICENSE | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..82b4eb1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,7 @@ +Copyright 2020 Etzelia + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file From 7a63f21c789db608ece676edf71eccb928d67c37 Mon Sep 17 00:00:00 2001 From: ZeroHD Date: Sun, 19 Jul 2020 17:13:28 +0200 Subject: [PATCH 7/9] Allow the blocks OreAlert tracks to be configured (#21) Allow OreAlert tracked blocks to be configured + Each block is tracked separately + Set api-version to 1.16 to allow for new material support + Bumped spigot api version to 1.16 Co-authored-by: Joey Hines Reviewed-on: https://git.etztech.xyz/MMS/MinecraftManagerPlugin/pulls/21 Reviewed-by: Etzelia --- pom.xml | 2 +- .../minecraftmanager/MinecraftManager.java | 34 ++++++++++++++----- .../listeners/BlockBreakListener.java | 21 +++++++----- .../minecraftmanager/objects/OreAlert.java | 27 ++++++++------- .../objects/PlayerOreStrikeList.java | 33 ++++++++++++++++++ src/main/resources/config.yml | 3 ++ src/main/resources/plugin.yml | 2 ++ 7 files changed, 91 insertions(+), 31 deletions(-) create mode 100644 src/main/java/xyz/etztech/minecraftmanager/objects/PlayerOreStrikeList.java diff --git a/pom.xml b/pom.xml index a829446..1cb6492 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ org.spigotmc spigot-api - 1.14.4-R0.1-SNAPSHOT + 1.16.1-R0.1-SNAPSHOT provided diff --git a/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java b/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java index dea8c98..76c0623 100644 --- a/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java +++ b/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java @@ -1,6 +1,8 @@ package xyz.etztech.minecraftmanager; import org.bukkit.Bukkit; +import org.bukkit.Material; +import org.bukkit.block.Block; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; @@ -16,10 +18,7 @@ import xyz.etztech.minecraftmanager.objects.Question; import xyz.etztech.minecraftmanager.objects.Rules; import java.io.File; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.logging.Logger; public class MinecraftManager extends JavaPlugin implements IMinecraftManager { @@ -31,7 +30,7 @@ public class MinecraftManager extends JavaPlugin implements IMinecraftManager { private static Map applyMode = new HashMap<>(); private static Map applyQuestion = new HashMap<>(); private static Map applications = new HashMap<>(); - private static List diamonds = new ArrayList<>(); + private static Map> oreStrikes = new HashMap<>(); private static Rules rules; private static List banOptions; private static OreAlert oreAlert; @@ -113,6 +112,11 @@ public class MinecraftManager extends JavaPlugin implements IMinecraftManager { } rules = new Rules(config); banOptions = config.getStringList("ban.options"); + oreStrikes.clear(); + + for (String block_type: config.getStringList("orealert.blocks")) { + oreStrikes.put(block_type, new LinkedList<>()); + } } @@ -158,14 +162,26 @@ public class MinecraftManager extends JavaPlugin implements IMinecraftManager { applications.put(uuid, application); } - public static boolean addDiamond(String location) { - if (diamonds.contains(location)) { + public static boolean addStrike(Material material, String location) { + List strikeList = oreStrikes.get(material.toString()); + + if (strikeList.contains(location)) { return false; } - diamonds.add(location); - return true; + else { + strikeList.add(location); + return true; + } } + public static boolean isTracked(Material material) { + String blockType = material.toString(); + List strikeList = oreStrikes.get(blockType); + + return strikeList != null; + } + + public static Rules getRules() { return rules; } diff --git a/src/main/java/xyz/etztech/minecraftmanager/listeners/BlockBreakListener.java b/src/main/java/xyz/etztech/minecraftmanager/listeners/BlockBreakListener.java index 7f54d1e..3c14004 100644 --- a/src/main/java/xyz/etztech/minecraftmanager/listeners/BlockBreakListener.java +++ b/src/main/java/xyz/etztech/minecraftmanager/listeners/BlockBreakListener.java @@ -2,6 +2,7 @@ package xyz.etztech.minecraftmanager.listeners; import org.bukkit.Material; import org.bukkit.block.Block; +import org.bukkit.block.BlockState; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; @@ -24,33 +25,35 @@ public class BlockBreakListener implements Listener { if (plugin.getConfig().getBoolean("orealert.enabled", true)) { Block block = event.getBlock(); + Material blockMaterial = event.getBlock().getBlockData().getMaterial(); Player player = event.getPlayer(); - if (Material.DIAMOND_ORE == block.getType()) { - if (MinecraftManager.addDiamond(getLocationString(block))) { + + if (MinecraftManager.isTracked(blockMaterial)) { + if (MinecraftManager.addStrike(blockMaterial, getLocationString(block))) { //plugin.log("[OreAlert]: " + event.getPlayer().getName()); - plugin.getOreAlert().addStrike(player.getUniqueId()); + plugin.getOreAlert().addStrike(player.getUniqueId(), blockMaterial); plugin.getOreAlert().purge(player.getUniqueId(), plugin.getConfig().getInt("orealert.purge", 30)); - int alertable = plugin.getOreAlert().getStrikes(player.getUniqueId()); + int alertable = plugin.getOreAlert().getStrikes(player.getUniqueId(), blockMaterial); double start = (double) alertable / plugin.getConfig().getInt("orealert.notify.start", 5); // Start if (start == 1) { - plugin.getOreAlert().alert(player.getName(), alertable, true); + plugin.getOreAlert().alert(player.getName(), blockMaterial, alertable, true); } else if (start > 1) { // Ping if (alertable % plugin.getConfig().getInt("orealert.notify.ping", 5) == 0) { - plugin.getOreAlert().alert(player.getName(), alertable, true); + plugin.getOreAlert().alert(player.getName(), blockMaterial, alertable, true); // Alert } else if (alertable % plugin.getConfig().getInt("orealert.notify.each", 1) == 0) { - plugin.getOreAlert().alert(player.getName(), alertable, false); + plugin.getOreAlert().alert(player.getName(), blockMaterial, alertable, false); } } } for (Block radiusBlock : getBlocks(block, 5)) { - if (Material.DIAMOND_ORE == radiusBlock.getType()) { - MinecraftManager.addDiamond(getLocationString(radiusBlock)); + if (MinecraftManager.isTracked(radiusBlock.getType())) { + MinecraftManager.addStrike(radiusBlock.getType(), getLocationString(radiusBlock)); } } } diff --git a/src/main/java/xyz/etztech/minecraftmanager/objects/OreAlert.java b/src/main/java/xyz/etztech/minecraftmanager/objects/OreAlert.java index 258ccb5..29d5265 100644 --- a/src/main/java/xyz/etztech/minecraftmanager/objects/OreAlert.java +++ b/src/main/java/xyz/etztech/minecraftmanager/objects/OreAlert.java @@ -3,6 +3,8 @@ package xyz.etztech.minecraftmanager.objects; import org.apache.commons.lang.StringUtils; import org.bukkit.Bukkit; import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.block.Block; import org.bukkit.entity.Player; import xyz.etztech.core.web.CoreWeb; import xyz.etztech.minecraftmanager.MinecraftManager; @@ -10,7 +12,7 @@ import xyz.etztech.minecraftmanager.MinecraftManager; import java.util.*; public class OreAlert { - private Map> players = new HashMap<>(); + private Map players = new HashMap<>(); private MinecraftManager plugin; @@ -18,19 +20,21 @@ public class OreAlert { this.plugin = plugin; } - public void addStrike(UUID uuid) { - ArrayList strikes = players.getOrDefault(uuid, new ArrayList<>()); - strikes.add(new Date()); - players.put(uuid, strikes); + public void addStrike(UUID uuid, Material material) { + PlayerOreStrikeList playerStrikes = players.getOrDefault(uuid, new PlayerOreStrikeList()); + + playerStrikes.addStrike(material); + + players.put(uuid, playerStrikes); } - public int getStrikes(UUID uuid) { - return players.getOrDefault(uuid, new ArrayList<>()).size(); + public int getStrikes(UUID uuid, Material material) { + return players.getOrDefault(uuid, new PlayerOreStrikeList()).strikeCount(material); } - public void alert(String username, int strikes, boolean ping) { + public void alert(String username, Material material, int strikes, boolean ping) { // has found diamond ore veins. - String message = username + " has found " + strikes + " diamond ore veins."; + String message = username + " has found " + strikes + " " + material.name() + " veins."; for (Player player : Bukkit.getOnlinePlayers()) { if (player.hasPermission("minecraftmanager.orealert")) { @@ -56,9 +60,8 @@ public class OreAlert { Date cutoff = new Date(); // Cutoff to minutes, subtract purge, back to milliseconds cutoff.setTime(((cutoff.getTime()/1000/60) - purge)*60*1000); - ArrayList purged = players.getOrDefault(uuid, new ArrayList<>()); - purged.removeIf(date -> date.before(cutoff)); - players.put(uuid, purged); + PlayerOreStrikeList strikeList = players.getOrDefault(uuid, new PlayerOreStrikeList()); + strikeList.purge(cutoff); } diff --git a/src/main/java/xyz/etztech/minecraftmanager/objects/PlayerOreStrikeList.java b/src/main/java/xyz/etztech/minecraftmanager/objects/PlayerOreStrikeList.java new file mode 100644 index 0000000..f1b71e9 --- /dev/null +++ b/src/main/java/xyz/etztech/minecraftmanager/objects/PlayerOreStrikeList.java @@ -0,0 +1,33 @@ +package xyz.etztech.minecraftmanager.objects; + +import org.bukkit.Material; + +import java.util.*; + +public class PlayerOreStrikeList { + private Map> strikes = new HashMap<>(); + + public PlayerOreStrikeList() { + } + + public void addStrike(Material material) { + ArrayList oreStrikes = getStrikes(material); + oreStrikes.add(new Date()); + strikes.put(material, oreStrikes); + } + + public int strikeCount(Material material) { + return getStrikes(material).size(); + } + + public ArrayList getStrikes(Material material) { + return strikes.getOrDefault(material, new ArrayList<>()); + } + + public void purge(Date cutoff) { + strikes.forEach((block, list) -> { + list.removeIf(date -> date.before(cutoff)); + strikes.put(block, list); + }); + } +} diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index f496671..7c61245 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -76,6 +76,9 @@ django: # OreAlert, for pinging based on diamond ore strikes orealert: enabled: true + blocks: + - diamond_ore + - ancient_debris # How long until we purge a node strike, in minutes purge: 30 notify: diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 3469daa..cb0a970 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -4,6 +4,8 @@ description: ${description} author: ${author} website: ${url} main: ${mainClass} +api-version: 1.16 + commands: minecraftmanager: description: Base MCM command From e16e1be1ca8ac1e9d687eb55bff4c82292b8816f Mon Sep 17 00:00:00 2001 From: Etzelia Date: Fri, 31 Jul 2020 15:02:31 +0200 Subject: [PATCH 8/9] Remove OreAlert (#23) Remove OA from configs Signed-off-by: Etzelia Remove OreAlert Signed-off-by: Etzelia Reviewed-on: https://git.etztech.xyz/MMS/MinecraftManagerPlugin/pulls/23 Reviewed-by: ZeroHD --- .../minecraftmanager/MinecraftManager.java | 17 +--- .../listeners/BlockBreakListener.java | 92 ------------------- .../minecraftmanager/objects/OreAlert.java | 69 -------------- src/main/resources/config.yml | 18 ---- src/main/resources/plugin.yml | 3 - 5 files changed, 4 insertions(+), 195 deletions(-) delete mode 100644 src/main/java/xyz/etztech/minecraftmanager/listeners/BlockBreakListener.java delete mode 100644 src/main/java/xyz/etztech/minecraftmanager/objects/OreAlert.java diff --git a/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java b/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java index 76c0623..00d77c7 100644 --- a/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java +++ b/src/main/java/xyz/etztech/minecraftmanager/MinecraftManager.java @@ -2,23 +2,23 @@ package xyz.etztech.minecraftmanager; import org.bukkit.Bukkit; import org.bukkit.Material; -import org.bukkit.block.Block; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; import xyz.etztech.core.api.IMinecraftManager; import xyz.etztech.minecraftmanager.command.*; import xyz.etztech.minecraftmanager.listeners.AsyncPlayerChatListener; -import xyz.etztech.minecraftmanager.listeners.BlockBreakListener; import xyz.etztech.minecraftmanager.listeners.CommandPreprocessListener; import xyz.etztech.minecraftmanager.listeners.SessionListener; import xyz.etztech.minecraftmanager.objects.Application; -import xyz.etztech.minecraftmanager.objects.OreAlert; import xyz.etztech.minecraftmanager.objects.Question; import xyz.etztech.minecraftmanager.objects.Rules; import java.io.File; -import java.util.*; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; import java.util.logging.Logger; public class MinecraftManager extends JavaPlugin implements IMinecraftManager { @@ -33,7 +33,6 @@ public class MinecraftManager extends JavaPlugin implements IMinecraftManager { private static Map> oreStrikes = new HashMap<>(); private static Rules rules; private static List banOptions; - private static OreAlert oreAlert; // API private static boolean logOverride = false; @@ -83,13 +82,9 @@ public class MinecraftManager extends JavaPlugin implements IMinecraftManager { getServer().getPluginManager().registerEvents(chatListener, this); SessionListener sessionListener = new SessionListener(this); getServer().getPluginManager().registerEvents(sessionListener, this); - BlockBreakListener blockBreakListener = new BlockBreakListener(this); - getServer().getPluginManager().registerEvents(blockBreakListener, this); CommandPreprocessListener commandPreprocessListener = new CommandPreprocessListener(this); getServer().getPluginManager().registerEvents(commandPreprocessListener, this); - oreAlert = new OreAlert(this); - Bukkit.getConsoleSender().sendMessage("MinecraftManager has started successfully."); } } @@ -210,10 +205,6 @@ public class MinecraftManager extends JavaPlugin implements IMinecraftManager { return logOverride; } - public OreAlert getOreAlert() { - return oreAlert; - } - @Override public void logOverride(boolean override) { logOverride = override; diff --git a/src/main/java/xyz/etztech/minecraftmanager/listeners/BlockBreakListener.java b/src/main/java/xyz/etztech/minecraftmanager/listeners/BlockBreakListener.java deleted file mode 100644 index 3c14004..0000000 --- a/src/main/java/xyz/etztech/minecraftmanager/listeners/BlockBreakListener.java +++ /dev/null @@ -1,92 +0,0 @@ -package xyz.etztech.minecraftmanager.listeners; - -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.block.BlockState; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.block.BlockBreakEvent; -import xyz.etztech.minecraftmanager.MinecraftManager; - -import java.util.ArrayList; -import java.util.List; - -public class BlockBreakListener implements Listener { - - private MinecraftManager plugin; - - public BlockBreakListener(MinecraftManager minecraftManager) { - this.plugin = minecraftManager; - } - - @EventHandler - public void onBlockBreak(BlockBreakEvent event) { - - if (plugin.getConfig().getBoolean("orealert.enabled", true)) { - Block block = event.getBlock(); - Material blockMaterial = event.getBlock().getBlockData().getMaterial(); - Player player = event.getPlayer(); - - if (MinecraftManager.isTracked(blockMaterial)) { - if (MinecraftManager.addStrike(blockMaterial, getLocationString(block))) { - //plugin.log("[OreAlert]: " + event.getPlayer().getName()); - plugin.getOreAlert().addStrike(player.getUniqueId(), blockMaterial); - plugin.getOreAlert().purge(player.getUniqueId(), plugin.getConfig().getInt("orealert.purge", 30)); - - int alertable = plugin.getOreAlert().getStrikes(player.getUniqueId(), blockMaterial); - - double start = (double) alertable / plugin.getConfig().getInt("orealert.notify.start", 5); - // Start - if (start == 1) { - plugin.getOreAlert().alert(player.getName(), blockMaterial, alertable, true); - } else if (start > 1) { - // Ping - if (alertable % plugin.getConfig().getInt("orealert.notify.ping", 5) == 0) { - plugin.getOreAlert().alert(player.getName(), blockMaterial, alertable, true); - // Alert - } else if (alertable % plugin.getConfig().getInt("orealert.notify.each", 1) == 0) { - plugin.getOreAlert().alert(player.getName(), blockMaterial, alertable, false); - } - } - - } - for (Block radiusBlock : getBlocks(block, 5)) { - if (MinecraftManager.isTracked(radiusBlock.getType())) { - MinecraftManager.addStrike(radiusBlock.getType(), getLocationString(radiusBlock)); - } - } - } - } - } - - private List getBlocks(Block start, int radius) { - if (radius < 0) { - return new ArrayList(0); - } - int iterations = (radius * 2) + 1; - List blocks = new ArrayList(iterations * iterations * iterations); - for (int x = -radius; x <= radius; x++) { - for (int y = -radius; y <= radius; y++) { - for (int z = -radius; z <= radius; z++) { - blocks.add(start.getRelative(x, y, z)); - } - } - } - return blocks; - } - - private String getLocationString(Block block) { - int X = block.getX(); - int Y = block.getY(); - int Z = block.getZ(); - - String x = String.valueOf(X); - String y = String.valueOf(Y); - String z = String.valueOf(Z); - - return x + y + z; - } - - -} diff --git a/src/main/java/xyz/etztech/minecraftmanager/objects/OreAlert.java b/src/main/java/xyz/etztech/minecraftmanager/objects/OreAlert.java deleted file mode 100644 index 29d5265..0000000 --- a/src/main/java/xyz/etztech/minecraftmanager/objects/OreAlert.java +++ /dev/null @@ -1,69 +0,0 @@ -package xyz.etztech.minecraftmanager.objects; - -import org.apache.commons.lang.StringUtils; -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.entity.Player; -import xyz.etztech.core.web.CoreWeb; -import xyz.etztech.minecraftmanager.MinecraftManager; - -import java.util.*; - -public class OreAlert { - private Map players = new HashMap<>(); - - private MinecraftManager plugin; - - public OreAlert(MinecraftManager plugin) { - this.plugin = plugin; - } - - public void addStrike(UUID uuid, Material material) { - PlayerOreStrikeList playerStrikes = players.getOrDefault(uuid, new PlayerOreStrikeList()); - - playerStrikes.addStrike(material); - - players.put(uuid, playerStrikes); - } - - public int getStrikes(UUID uuid, Material material) { - return players.getOrDefault(uuid, new PlayerOreStrikeList()).strikeCount(material); - } - - public void alert(String username, Material material, int strikes, boolean ping) { - // has found diamond ore veins. - String message = username + " has found " + strikes + " " + material.name() + " veins."; - - for (Player player : Bukkit.getOnlinePlayers()) { - if (player.hasPermission("minecraftmanager.orealert")) { - player.sendMessage(ChatColor.AQUA + message); - } - } - - // Webhook - String webhook = plugin.getConfig().getString("orealert.notify.webhook", ""); - if (StringUtils.isNotEmpty(webhook)) { - String content = message; - if (ping) { - content = "@here " + message; - } - Map data = new HashMap<>(); - data.put("username", "OreAlert"); - data.put("content", content); - CoreWeb.asyncPost(plugin, webhook, data); - } - } - - public void purge(UUID uuid, int purge) { - Date cutoff = new Date(); - // Cutoff to minutes, subtract purge, back to milliseconds - cutoff.setTime(((cutoff.getTime()/1000/60) - purge)*60*1000); - PlayerOreStrikeList strikeList = players.getOrDefault(uuid, new PlayerOreStrikeList()); - strikeList.purge(cutoff); - } - - - -} diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 7c61245..8501634 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -72,21 +72,3 @@ django: url: "http://localhost:8000/api/" # MCM API password - defined in your Django settings api: "Testing1" - -# OreAlert, for pinging based on diamond ore strikes -orealert: - enabled: true - blocks: - - diamond_ore - - ancient_debris - # How long until we purge a node strike, in minutes - purge: 30 - notify: - # How many veins found within the above purge minutes to notify - start: 5 - # After the initial alert, how many should be found in addition before more alerts? - each: 1 - # After the initial alert, how many should be found in addition before more pings? - ping: 5 - # Webhook to send to - webhook: '' diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index cb0a970..2b28469 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -50,9 +50,6 @@ permissions: minecraftmanager.staff: description: Who should get staff messages default: op - minecraftmanager.orealert: - description: Who should get OreAlert messages - default: op minecraftmanager.register: description: Who is allowed to register for the MCM web application default: op From 39d59b8804e1ec14207bdb0ad3196124c93b65bb Mon Sep 17 00:00:00 2001 From: Etzelia Date: Sun, 6 Sep 2020 16:47:10 -0500 Subject: [PATCH 9/9] Change question phrasing Signed-off-by: Etzelia --- .../java/xyz/etztech/minecraftmanager/objects/Question.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/xyz/etztech/minecraftmanager/objects/Question.java b/src/main/java/xyz/etztech/minecraftmanager/objects/Question.java index 1419762..f550fdc 100644 --- a/src/main/java/xyz/etztech/minecraftmanager/objects/Question.java +++ b/src/main/java/xyz/etztech/minecraftmanager/objects/Question.java @@ -5,11 +5,11 @@ import org.apache.commons.lang.StringUtils; public enum Question { ONE("How old are you?", "Your answer must be numeric."), - TWO("What type of player are you?", "Your answer must be under 300 characters long."), + TWO("How do you typically enjoy playing Minecraft?", "Your answer must be under 300 characters long."), THREE1("Have you ever been banned? Please answer just 'yes' or 'no'.", "Your answer must be just 'yes' or 'no'."), THREE2("Oof. That's okay, it's happened to plenty of people. Do you mind letting us know why?", "Your answer must be under 300 characters long."), - FOUR("Were you referred to our server by someone?", "Your answer must be under 50 characters long."), - FIVE("Have you read the rules thoroughly?", "Your answer must be under 10 characters long."), + FOUR("How did you find out about our server?", "Your answer must be under 50 characters long."), + FIVE("Last question! Have you read the rules thoroughly?", "Your answer must be under 10 characters long."), COMPLETE("All done! Staff should be reviewing your application any second now!", ""); public static final String READ_RULES = "Are you sure? Maybe you should read them again...";