Cleaned up and moved classes a bit
This commit is contained in:
parent
8d0cad1e7c
commit
b82cceb7dc
|
@ -0,0 +1,124 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Palette2">
|
||||
<group name="Swing">
|
||||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||
</item>
|
||||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||
<initial-values>
|
||||
<property name="text" value="Button" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="RadioButton" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="CheckBox" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="Label" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||
<preferred-size width="-1" height="20" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||
</item>
|
||||
</group>
|
||||
</component>
|
||||
</project>
|
2
pom.xml
2
pom.xml
|
@ -3,7 +3,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>cz.boosik</groupId>
|
||||
<artifactId>boosCooldowns</artifactId>
|
||||
<version>3.9.5</version>
|
||||
<version>3.9.6a</version>
|
||||
<name>boosCooldowns</name>
|
||||
<packaging>jar</packaging>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
package cz.boosik.boosCooldown;
|
||||
|
||||
import cz.boosik.boosCooldown.Listeners.*;
|
||||
import cz.boosik.boosCooldown.Managers.BoosConfigManager;
|
||||
import cz.boosik.boosCooldown.Managers.BoosLimitManager;
|
||||
import cz.boosik.boosCooldown.Runnables.BoosGlobalLimitResetRunnable;
|
||||
import net.milkbowl.vault.Vault;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
import org.bukkit.Bukkit;
|
||||
|
@ -94,7 +97,7 @@ public class BoosCoolDown extends JavaPlugin implements Runnable {
|
|||
}
|
||||
}
|
||||
|
||||
static void startLimitResetTimerGlobal(String key) {
|
||||
public static void startLimitResetTimerGlobal(String key) {
|
||||
YamlConfiguration confusers = BoosConfigManager.getConfusers();
|
||||
BukkitScheduler scheduler = Bukkit.getScheduler();
|
||||
String confTime = confusers.getString("global." + key + ".reset");
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package cz.boosik.boosCooldown;
|
||||
|
||||
import cz.boosik.boosCooldown.Managers.*;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cz.boosik.boosCooldown.Listeners;
|
||||
|
||||
import cz.boosik.boosCooldown.BoosConfigManager;
|
||||
import cz.boosik.boosCooldown.BoosWarmUpManager;
|
||||
import cz.boosik.boosCooldown.Managers.BoosConfigManager;
|
||||
import cz.boosik.boosCooldown.Managers.BoosWarmUpManager;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cz.boosik.boosCooldown.Listeners;
|
||||
|
||||
import cz.boosik.boosCooldown.BoosConfigManager;
|
||||
import cz.boosik.boosCooldown.BoosCoolDownManager;
|
||||
import cz.boosik.boosCooldown.Managers.BoosConfigManager;
|
||||
import cz.boosik.boosCooldown.Managers.BoosCoolDownManager;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cz.boosik.boosCooldown.Listeners;
|
||||
|
||||
import cz.boosik.boosCooldown.BoosConfigManager;
|
||||
import cz.boosik.boosCooldown.BoosWarmUpManager;
|
||||
import cz.boosik.boosCooldown.Managers.BoosConfigManager;
|
||||
import cz.boosik.boosCooldown.Managers.BoosWarmUpManager;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cz.boosik.boosCooldown.Listeners;
|
||||
|
||||
import cz.boosik.boosCooldown.BoosConfigManager;
|
||||
import cz.boosik.boosCooldown.BoosWarmUpManager;
|
||||
import cz.boosik.boosCooldown.Managers.BoosConfigManager;
|
||||
import cz.boosik.boosCooldown.Managers.BoosWarmUpManager;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cz.boosik.boosCooldown.Listeners;
|
||||
|
||||
import cz.boosik.boosCooldown.BoosConfigManager;
|
||||
import cz.boosik.boosCooldown.BoosWarmUpManager;
|
||||
import cz.boosik.boosCooldown.Managers.BoosConfigManager;
|
||||
import cz.boosik.boosCooldown.Managers.BoosWarmUpManager;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
@ -22,7 +22,6 @@ public class BoosPlayerMoveListener implements Listener {
|
|||
if (player != null
|
||||
&& !player.hasPermission("booscooldowns.nocancel.move")) {
|
||||
if (BoosWarmUpManager.hasWarmUps(player) && (event.getFrom().getX() != event.getTo().getX() || event.getFrom().getZ() != event.getTo().getZ() || event.getFrom().getY() != event.getTo().getY())) {
|
||||
BoosWarmUpManager.clearLocWorld(player);
|
||||
boosChat.sendMessageToPlayer(player,
|
||||
BoosConfigManager.getWarmUpCancelledByMoveMessage());
|
||||
BoosWarmUpManager.cancelWarmUps(player);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cz.boosik.boosCooldown.Listeners;
|
||||
|
||||
import cz.boosik.boosCooldown.BoosConfigManager;
|
||||
import cz.boosik.boosCooldown.BoosWarmUpManager;
|
||||
import cz.boosik.boosCooldown.Managers.BoosConfigManager;
|
||||
import cz.boosik.boosCooldown.Managers.BoosWarmUpManager;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cz.boosik.boosCooldown.Listeners;
|
||||
|
||||
import cz.boosik.boosCooldown.BoosConfigManager;
|
||||
import cz.boosik.boosCooldown.BoosWarmUpManager;
|
||||
import cz.boosik.boosCooldown.Managers.BoosConfigManager;
|
||||
import cz.boosik.boosCooldown.Managers.BoosWarmUpManager;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cz.boosik.boosCooldown.Listeners;
|
||||
|
||||
import cz.boosik.boosCooldown.BoosConfigManager;
|
||||
import cz.boosik.boosCooldown.Managers.BoosConfigManager;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cz.boosik.boosCooldown.Listeners;
|
||||
|
||||
import cz.boosik.boosCooldown.BoosConfigManager;
|
||||
import cz.boosik.boosCooldown.Managers.BoosConfigManager;
|
||||
import cz.boosik.boosCooldown.BoosCoolDown;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Sign;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package cz.boosik.boosCooldown;
|
||||
package cz.boosik.boosCooldown.Managers;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
class BoosAliasManager {
|
||||
public class BoosAliasManager {
|
||||
|
||||
public static String checkCommandAlias(String originalCommand,
|
||||
Set<String> aliases, Player player) {
|
|
@ -1,5 +1,6 @@
|
|||
package cz.boosik.boosCooldown;
|
||||
package cz.boosik.boosCooldown.Managers;
|
||||
|
||||
import cz.boosik.boosCooldown.BoosCoolDown;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.InvalidConfigurationException;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
@ -20,7 +21,7 @@ public class BoosConfigManager {
|
|||
private static File confusersFile;
|
||||
|
||||
@SuppressWarnings("static-access")
|
||||
BoosConfigManager(BoosCoolDown boosCoolDown) {
|
||||
public BoosConfigManager(BoosCoolDown boosCoolDown) {
|
||||
confFile = new File(boosCoolDown.getDataFolder(), "config.yml");
|
||||
if (confFile.exists()) {
|
||||
conf = new YamlConfiguration();
|
||||
|
@ -47,7 +48,7 @@ public class BoosConfigManager {
|
|||
}
|
||||
}
|
||||
|
||||
static void clear() {
|
||||
public static void clear() {
|
||||
ConfigurationSection userSection = confusers
|
||||
.getConfigurationSection("users");
|
||||
if (userSection == null)
|
||||
|
@ -87,7 +88,7 @@ public class BoosConfigManager {
|
|||
loadConfusers();
|
||||
}
|
||||
|
||||
static void clearSomething(String co, UUID uuid, String command) {
|
||||
public static void clearSomething(String co, UUID uuid, String command) {
|
||||
int pre2 = command.toLowerCase().hashCode();
|
||||
confusers.set("users." + uuid + "." + co + "." + pre2, 0);
|
||||
saveConfusers();
|
||||
|
@ -98,7 +99,7 @@ public class BoosConfigManager {
|
|||
return conf.getString("commands.aliases." + message);
|
||||
}
|
||||
|
||||
static Set<String> getAliases() {
|
||||
public static Set<String> getAliases() {
|
||||
Set<String> aliases = null;
|
||||
ConfigurationSection aliasesSection = conf
|
||||
.getConfigurationSection("commands.aliases");
|
||||
|
@ -109,7 +110,7 @@ public class BoosConfigManager {
|
|||
return aliases;
|
||||
}
|
||||
|
||||
static boolean getBlockInteractDuringWarmup() {
|
||||
public static boolean getBlockInteractDuringWarmup() {
|
||||
return conf.getBoolean("options.options.block_interact_during_warmup",
|
||||
false);
|
||||
}
|
||||
|
@ -120,21 +121,21 @@ public class BoosConfigManager {
|
|||
"&6Warm-ups have been cancelled due to changing gamemode.&f");
|
||||
}
|
||||
|
||||
static boolean getCancelWarmUpOnDamage() {
|
||||
public static boolean getCancelWarmUpOnDamage() {
|
||||
return conf
|
||||
.getBoolean("options.options.cancel_warmup_on_damage", false);
|
||||
}
|
||||
|
||||
static boolean getCancelWarmUpOnGameModeChange() {
|
||||
public static boolean getCancelWarmUpOnGameModeChange() {
|
||||
return conf.getBoolean(
|
||||
"options.options.cancel_warmup_on_gamemode_change", false);
|
||||
}
|
||||
|
||||
static boolean getCancelWarmupOnMove() {
|
||||
public static boolean getCancelWarmupOnMove() {
|
||||
return conf.getBoolean("options.options.cancel_warmup_on_move", false);
|
||||
}
|
||||
|
||||
static boolean getCancelWarmupOnSneak() {
|
||||
public static boolean getCancelWarmupOnSneak() {
|
||||
return conf.getBoolean("options.options.cancel_warmup_on_sneak", false);
|
||||
}
|
||||
|
||||
|
@ -143,7 +144,7 @@ public class BoosConfigManager {
|
|||
"&6Warm-ups have been cancelled due to sneaking.&f");
|
||||
}
|
||||
|
||||
static boolean getCancelWarmupOnSprint() {
|
||||
public static boolean getCancelWarmupOnSprint() {
|
||||
return conf
|
||||
.getBoolean("options.options.cancel_warmup_on_sprint", false);
|
||||
}
|
||||
|
@ -172,7 +173,7 @@ public class BoosConfigManager {
|
|||
return conf.getBoolean("options.options.clear_uses_on_death", false);
|
||||
}
|
||||
|
||||
static boolean getClearOnRestart() {
|
||||
public static boolean getClearOnRestart() {
|
||||
return conf.getBoolean("options.options.clear_on_restart", false);
|
||||
}
|
||||
|
||||
|
@ -204,11 +205,11 @@ public class BoosConfigManager {
|
|||
return groups;
|
||||
}
|
||||
|
||||
static boolean getCommandLogging() {
|
||||
public static boolean getCommandLogging() {
|
||||
return conf.getBoolean("options.options.command_logging", false);
|
||||
}
|
||||
|
||||
static Set<String> getCommands(Player player) {
|
||||
public static Set<String> getCommands(Player player) {
|
||||
String group = getCommandGroup(player);
|
||||
Set<String> commands = null;
|
||||
ConfigurationSection commandsSection = conf
|
||||
|
@ -219,11 +220,11 @@ public class BoosConfigManager {
|
|||
return commands;
|
||||
}
|
||||
|
||||
static YamlConfiguration getConfusers() {
|
||||
public static YamlConfiguration getConfusers() {
|
||||
return confusers;
|
||||
}
|
||||
|
||||
static int getCoolDown(String regexCommand, Player player) {
|
||||
public static int getCoolDown(String regexCommand, Player player) {
|
||||
int coolDown;
|
||||
String coolDownString = "";
|
||||
String group = getCommandGroup(player);
|
||||
|
@ -233,7 +234,7 @@ public class BoosConfigManager {
|
|||
return coolDown;
|
||||
}
|
||||
|
||||
static boolean getCooldownEnabled() {
|
||||
public static boolean getCooldownEnabled() {
|
||||
return conf.getBoolean("options.options.cooldowns_enabled", true);
|
||||
}
|
||||
|
||||
|
@ -250,7 +251,7 @@ public class BoosConfigManager {
|
|||
"commands.groups." + cool).getKeys(false);
|
||||
}
|
||||
|
||||
static String getInsufficientFundsMessage() {
|
||||
public static String getInsufficientFundsMessage() {
|
||||
return conf
|
||||
.getString(
|
||||
"options.messages.insufficient_funds",
|
||||
|
@ -263,7 +264,7 @@ public class BoosConfigManager {
|
|||
"&6You can't do this when command is warming-up!&f");
|
||||
}
|
||||
|
||||
static String getItemCostItem(String regexCommand, Player player) {
|
||||
public static String getItemCostItem(String regexCommand, Player player) {
|
||||
String item = "";
|
||||
String temp;
|
||||
String[] command;
|
||||
|
@ -277,7 +278,7 @@ public class BoosConfigManager {
|
|||
return item;
|
||||
}
|
||||
|
||||
static int getItemCostCount(String regexCommand, Player player) {
|
||||
public static int getItemCostCount(String regexCommand, Player player) {
|
||||
int count = 0;
|
||||
String temp;
|
||||
String[] command;
|
||||
|
@ -291,7 +292,7 @@ public class BoosConfigManager {
|
|||
return count;
|
||||
}
|
||||
|
||||
static int getLimit(String regexCommand, Player player) {
|
||||
public static int getLimit(String regexCommand, Player player) {
|
||||
int limit;
|
||||
String group = getCommandGroup(player);
|
||||
limit = conf.getInt("commands.groups." + group + "." + regexCommand
|
||||
|
@ -299,7 +300,7 @@ public class BoosConfigManager {
|
|||
return limit;
|
||||
}
|
||||
|
||||
static boolean getLimitEnabled() {
|
||||
public static boolean getLimitEnabled() {
|
||||
return conf.getBoolean("options.options.limits_enabled", true);
|
||||
}
|
||||
|
||||
|
@ -327,7 +328,7 @@ public class BoosConfigManager {
|
|||
return sharedCooldowns;
|
||||
}
|
||||
|
||||
static List<String> getSharedLimits(String pre, Player player) {
|
||||
public static List<String> getSharedLimits(String pre, Player player) {
|
||||
List<String> sharedLimits;
|
||||
String group = getCommandGroup(player);
|
||||
sharedLimits = conf.getStringList("commands.groups." + group + "."
|
||||
|
@ -335,7 +336,7 @@ public class BoosConfigManager {
|
|||
return sharedLimits;
|
||||
}
|
||||
|
||||
static String getMessage(String regexCommand, Player player) {
|
||||
public static String getMessage(String regexCommand, Player player) {
|
||||
String message = "";
|
||||
String group = getCommandGroup(player);
|
||||
message = conf.getString("commands.groups." + group + "."
|
||||
|
@ -381,7 +382,7 @@ public class BoosConfigManager {
|
|||
return effect;
|
||||
}
|
||||
|
||||
static double getPrice(String regexCommand, Player player) {
|
||||
public static double getPrice(String regexCommand, Player player) {
|
||||
double price;
|
||||
String group = getCommandGroup(player);
|
||||
price = conf.getDouble("commands.groups." + group + "." + regexCommand
|
||||
|
@ -389,15 +390,15 @@ public class BoosConfigManager {
|
|||
return price;
|
||||
}
|
||||
|
||||
static boolean getPriceEnabled() {
|
||||
public static boolean getPriceEnabled() {
|
||||
return conf.getBoolean("options.options.prices_enabled", true);
|
||||
}
|
||||
|
||||
static int getSaveInterval() {
|
||||
public static int getSaveInterval() {
|
||||
return conf.getInt("options.options.save_interval_in_minutes", 15);
|
||||
}
|
||||
|
||||
static boolean getSignCommands() {
|
||||
public static boolean getSignCommands() {
|
||||
return conf.getBoolean("options.options.command_signs", false);
|
||||
}
|
||||
|
||||
|
@ -418,7 +419,7 @@ public class BoosConfigManager {
|
|||
return conf.getString("options.units.seconds", "seconds");
|
||||
}
|
||||
|
||||
static int getWarmUp(String regexCommand, Player player) {
|
||||
public static int getWarmUp(String regexCommand, Player player) {
|
||||
int warmUp;
|
||||
String warmUpString = "";
|
||||
String group = getCommandGroup(player);
|
||||
|
@ -443,7 +444,7 @@ public class BoosConfigManager {
|
|||
"&6Warm-ups have been cancelled due to moving.&f");
|
||||
}
|
||||
|
||||
static boolean getWarmupEnabled() {
|
||||
public static boolean getWarmupEnabled() {
|
||||
return conf.getBoolean("options.options.warmups_enabled", true);
|
||||
}
|
||||
|
||||
|
@ -453,7 +454,7 @@ public class BoosConfigManager {
|
|||
"&6Wait&e &seconds& seconds&6 before command&e &command& &6has warmed up.&f");
|
||||
}
|
||||
|
||||
static void load() {
|
||||
public static void load() {
|
||||
try {
|
||||
conf.load(confFile);
|
||||
} catch (FileNotFoundException e) {
|
||||
|
@ -471,7 +472,7 @@ public class BoosConfigManager {
|
|||
}
|
||||
}
|
||||
|
||||
static void loadConfusers() {
|
||||
public static void loadConfusers() {
|
||||
try {
|
||||
confusers.load(confusersFile);
|
||||
} catch (FileNotFoundException e) {
|
||||
|
@ -489,12 +490,12 @@ public class BoosConfigManager {
|
|||
}
|
||||
}
|
||||
|
||||
static void reload() {
|
||||
public static void reload() {
|
||||
conf = new YamlConfiguration();
|
||||
load();
|
||||
}
|
||||
|
||||
static void saveConfusers() {
|
||||
public static void saveConfusers() {
|
||||
try {
|
||||
confFile.createNewFile();
|
||||
confusers.save(confusersFile);
|
||||
|
@ -505,8 +506,8 @@ public class BoosConfigManager {
|
|||
}
|
||||
}
|
||||
|
||||
static void setAddToConfigFile(String group, String command, String what,
|
||||
String value) {
|
||||
public static void setAddToConfigFile(String group, String command, String what,
|
||||
String value) {
|
||||
group = group.toLowerCase();
|
||||
command = command.toLowerCase();
|
||||
int value2;
|
||||
|
@ -530,7 +531,7 @@ public class BoosConfigManager {
|
|||
reload();
|
||||
}
|
||||
|
||||
static boolean getAutoSave() {
|
||||
public static boolean getAutoSave() {
|
||||
return conf.getBoolean(
|
||||
"options.options.auto_save_enabled_CAN_CAUSE_BIG_LAGS", false);
|
||||
}
|
||||
|
@ -540,12 +541,12 @@ public class BoosConfigManager {
|
|||
"&6Price of&e &command& &6was &e%s");
|
||||
}
|
||||
|
||||
static String getInsufficientItemsMessage() {
|
||||
public static String getInsufficientItemsMessage() {
|
||||
return conf.getString("options.messages.insufficient_items",
|
||||
"&6You have not enough items!&e &command& &6needs &e%s");
|
||||
}
|
||||
|
||||
static boolean getItemCostEnabled() {
|
||||
public static boolean getItemCostEnabled() {
|
||||
return conf.getBoolean("options.options.item_cost_enabled", true);
|
||||
}
|
||||
|
||||
|
@ -554,7 +555,7 @@ public class BoosConfigManager {
|
|||
"&6Price of&e &command& &6was &e%s");
|
||||
}
|
||||
|
||||
static int getXpPrice(String regexCommand, Player player) {
|
||||
public static int getXpPrice(String regexCommand, Player player) {
|
||||
int price;
|
||||
String group = getCommandGroup(player);
|
||||
price = conf.getInt("commands.groups." + group + "." + regexCommand
|
||||
|
@ -562,16 +563,16 @@ public class BoosConfigManager {
|
|||
return price;
|
||||
}
|
||||
|
||||
static boolean getXpPriceEnabled() {
|
||||
public static boolean getXpPriceEnabled() {
|
||||
return conf.getBoolean("options.options.xp_cost_enabled", true);
|
||||
}
|
||||
|
||||
static String getInsufficientXpMessage() {
|
||||
public static String getInsufficientXpMessage() {
|
||||
return conf.getString("options.messages.insufficient_xp",
|
||||
"&6You have not enough XP!&e &command& &6needs &e%s");
|
||||
}
|
||||
|
||||
static String getInvalidCommandSyntaxMessage() {
|
||||
public static String getInvalidCommandSyntaxMessage() {
|
||||
return conf
|
||||
.getString("options.messages.invalid_command_syntax",
|
||||
"&6You are not allowed to use command syntax /<pluginname>:<command>!");
|
||||
|
@ -598,7 +599,7 @@ public class BoosConfigManager {
|
|||
confusers.set("users." + uuid + "." + co + "." + hashedCommand, 0);
|
||||
}
|
||||
|
||||
static long getLimitResetDelayGlobal(String command) {
|
||||
public static long getLimitResetDelayGlobal(String command) {
|
||||
long delay = 0;
|
||||
String delayString = "";
|
||||
delayString = conf.getString(
|
|
@ -1,4 +1,4 @@
|
|||
package cz.boosik.boosCooldown;
|
||||
package cz.boosik.boosCooldown.Managers;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import util.boosChat;
|
||||
|
@ -78,8 +78,8 @@ public class BoosCoolDownManager {
|
|||
}
|
||||
}
|
||||
|
||||
static boolean coolDown(Player player, String regexCommand,
|
||||
String originalCommand, int time) {
|
||||
public static boolean coolDown(Player player, String regexCommand,
|
||||
String originalCommand, int time) {
|
||||
regexCommand = regexCommand.toLowerCase();
|
||||
return time > 0 && !player.hasPermission("booscooldowns.nocooldown") && !player.hasPermission("booscooldowns.nocooldown." + originalCommand) && cd(player, regexCommand, originalCommand, time);
|
||||
}
|
||||
|
@ -119,8 +119,8 @@ public class BoosCoolDownManager {
|
|||
return null;
|
||||
}
|
||||
|
||||
static boolean checkCoolDownOK(Player player, String regexCommand,
|
||||
String originalCommand, int time) {
|
||||
public static boolean checkCoolDownOK(Player player, String regexCommand,
|
||||
String originalCommand, int time) {
|
||||
regexCommand = regexCommand.toLowerCase();
|
||||
if (time > 0) {
|
||||
Date lastTime = getTime(player, regexCommand);
|
|
@ -1,4 +1,4 @@
|
|||
package cz.boosik.boosCooldown;
|
||||
package cz.boosik.boosCooldown.Managers;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.inventory.Inventory;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import util.boosChat;
|
||||
|
||||
class BoosItemCostManager {
|
||||
public class BoosItemCostManager {
|
||||
|
||||
private static boolean payItemForCommand(Player player,
|
||||
String originalCommand, String item, int count) {
|
||||
|
@ -36,9 +36,9 @@ class BoosItemCostManager {
|
|||
}
|
||||
}
|
||||
|
||||
static void payItemForCommand(PlayerCommandPreprocessEvent event,
|
||||
Player player, String regexCommand, String originalCommand,
|
||||
String item, int count) {
|
||||
public static void payItemForCommand(PlayerCommandPreprocessEvent event,
|
||||
Player player, String regexCommand, String originalCommand,
|
||||
String item, int count) {
|
||||
if (count > 0) {
|
||||
if (!player.hasPermission("booscooldowns.noitemcost")
|
||||
&& !player.hasPermission("booscooldowns.noitemcost."
|
|
@ -1,5 +1,6 @@
|
|||
package cz.boosik.boosCooldown;
|
||||
package cz.boosik.boosCooldown.Managers;
|
||||
|
||||
import cz.boosik.boosCooldown.BoosCoolDown;
|
||||
import org.bukkit.entity.Player;
|
||||
import util.boosChat;
|
||||
|
||||
|
@ -9,10 +10,10 @@ import java.util.Calendar;
|
|||
import java.util.Date;
|
||||
import java.util.Set;
|
||||
|
||||
class BoosLimitManager {
|
||||
public class BoosLimitManager {
|
||||
|
||||
static boolean blocked(Player player, String regexCommand,
|
||||
String originalCommand, int limit) {
|
||||
public static boolean blocked(Player player, String regexCommand,
|
||||
String originalCommand, int limit) {
|
||||
Date time = getTime(player, regexCommand);
|
||||
Date confTime = getTime(regexCommand);
|
||||
Calendar calcurrTime = Calendar.getInstance();
|
||||
|
@ -121,7 +122,7 @@ class BoosLimitManager {
|
|||
return uses;
|
||||
}
|
||||
|
||||
static void setUses(Player player, String regexCommand) {
|
||||
public static void setUses(Player player, String regexCommand) {
|
||||
if (BoosConfigManager.getLimitsEnabled()) {
|
||||
if (BoosConfigManager.getCommands(player).contains(regexCommand)) {
|
||||
int regexCommand2 = regexCommand.toLowerCase().hashCode();
|
||||
|
@ -143,7 +144,7 @@ class BoosLimitManager {
|
|||
}
|
||||
}
|
||||
|
||||
static void getLimitListMessages(Player send, String comm, int lim) {
|
||||
public static void getLimitListMessages(Player send, String comm, int lim) {
|
||||
if (lim != -1) {
|
||||
int uses = getUses(send, comm);
|
||||
String message = BoosConfigManager.getLimitListMessage();
|
||||
|
@ -232,7 +233,7 @@ class BoosLimitManager {
|
|||
return secondsBetween;
|
||||
}
|
||||
|
||||
static void clearAllLimits(int hashedCommand) {
|
||||
public static void clearAllLimits(int hashedCommand) {
|
||||
Set<String> players = BoosConfigManager.getAllPlayers();
|
||||
for (String player : players) {
|
||||
BoosConfigManager.clearSomething2("uses", player, hashedCommand);
|
||||
|
@ -241,7 +242,7 @@ class BoosLimitManager {
|
|||
BoosConfigManager.loadConfusers();
|
||||
}
|
||||
|
||||
static void setGlobalLimitResetDate() {
|
||||
public static void setGlobalLimitResetDate() {
|
||||
for (String command : BoosConfigManager.getLimitResetCommandsGlobal()) {
|
||||
if (BoosConfigManager.getLimitResetDelayGlobal(command) == -65535) {
|
||||
BoosConfigManager.getConfusers().set("global." + command, null);
|
||||
|
@ -253,7 +254,7 @@ class BoosLimitManager {
|
|||
BoosConfigManager.loadConfusers();
|
||||
}
|
||||
|
||||
static void setGlobalLimitResetDate(String command) {
|
||||
public static void setGlobalLimitResetDate(String command) {
|
||||
setTime(command);
|
||||
BoosConfigManager.saveConfusers();
|
||||
BoosConfigManager.loadConfusers();
|
|
@ -1,12 +1,13 @@
|
|||
package cz.boosik.boosCooldown;
|
||||
package cz.boosik.boosCooldown.Managers;
|
||||
|
||||
import cz.boosik.boosCooldown.BoosCoolDown;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
import net.milkbowl.vault.economy.EconomyResponse;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import util.boosChat;
|
||||
|
||||
class BoosPriceManager {
|
||||
public class BoosPriceManager {
|
||||
private static final Economy economy = BoosCoolDown.getEconomy();
|
||||
|
||||
private static boolean payForCommand(Player player,
|
||||
|
@ -30,9 +31,9 @@ class BoosPriceManager {
|
|||
}
|
||||
}
|
||||
|
||||
static void payForCommand(PlayerCommandPreprocessEvent event,
|
||||
Player player, String regexCommand, String originalCommand,
|
||||
double price) {
|
||||
public static void payForCommand(PlayerCommandPreprocessEvent event,
|
||||
Player player, String regexCommand, String originalCommand,
|
||||
double price) {
|
||||
if (price > 0) {
|
||||
if (!player.hasPermission("booscooldowns.noprice")
|
||||
&& !player.hasPermission("booscooldowns.noprice."
|
|
@ -1,6 +1,7 @@
|
|||
package cz.boosik.boosCooldown;
|
||||
package cz.boosik.boosCooldown.Managers;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import cz.boosik.boosCooldown.BoosCoolDown;
|
||||
import cz.boosik.boosCooldown.Runnables.BoosWarmUpTimer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import util.boosChat;
|
||||
|
@ -13,8 +14,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
public class BoosWarmUpManager {
|
||||
|
||||
private static final ConcurrentHashMap<String, BoosWarmUpTimer> playercommands = new ConcurrentHashMap<>();
|
||||
private static final ConcurrentHashMap<Player, Location> playerloc = new ConcurrentHashMap<>();
|
||||
private static final ConcurrentHashMap<Player, String> playerworld = new ConcurrentHashMap<>();
|
||||
|
||||
private static void applyPotionEffect(Player player, String regexCommand,
|
||||
int warmUpSeconds) {
|
||||
|
@ -44,11 +43,6 @@ public class BoosWarmUpManager {
|
|||
}
|
||||
}
|
||||
|
||||
public static void clearLocWorld(Player player) {
|
||||
BoosWarmUpManager.playerloc.remove(player);
|
||||
BoosWarmUpManager.playerworld.remove(player);
|
||||
}
|
||||
|
||||
public static boolean hasWarmUps(Player player) {
|
||||
Map<String, BoosWarmUpTimer> playercommands2 = playercommands;
|
||||
for (String key : playercommands2.keySet()) {
|
||||
|
@ -59,7 +53,7 @@ public class BoosWarmUpManager {
|
|||
return false;
|
||||
}
|
||||
|
||||
static boolean checkWarmUpOK(Player player, String regexCommand) {
|
||||
public static boolean checkWarmUpOK(Player player, String regexCommand) {
|
||||
int pre2 = regexCommand.toLowerCase().hashCode();
|
||||
int ok = 0;
|
||||
ok = BoosConfigManager.getConfusers().getInt(
|
||||
|
@ -67,7 +61,7 @@ public class BoosWarmUpManager {
|
|||
return ok == 1;
|
||||
}
|
||||
|
||||
static boolean isWarmUpProcess(Player player, String regexCommand) {
|
||||
public static boolean isWarmUpProcess(Player player, String regexCommand) {
|
||||
regexCommand = regexCommand.toLowerCase();
|
||||
return playercommands.containsKey(player.getUniqueId() + "@"
|
||||
+ regexCommand);
|
||||
|
@ -82,30 +76,30 @@ public class BoosWarmUpManager {
|
|||
}
|
||||
}
|
||||
|
||||
static void removeWarmUp(Player player, String regexCommand) {
|
||||
public static void removeWarmUp(Player player, String regexCommand) {
|
||||
int pre2 = regexCommand.toLowerCase().hashCode();
|
||||
BoosConfigManager.getConfusers().set(
|
||||
"users." + player.getUniqueId() + ".warmup." + pre2, null);
|
||||
}
|
||||
|
||||
static void removeWarmUpOK(Player player, String regexCommand) {
|
||||
public static void removeWarmUpOK(Player player, String regexCommand) {
|
||||
int pre2 = regexCommand.toLowerCase().hashCode();
|
||||
BoosConfigManager.getConfusers().set(
|
||||
"users." + player.getUniqueId() + ".warmup." + pre2, null);
|
||||
}
|
||||
|
||||
static void removeWarmUpProcess(String tag) {
|
||||
public static void removeWarmUpProcess(String tag) {
|
||||
BoosWarmUpManager.playercommands.remove(tag);
|
||||
}
|
||||
|
||||
static void setWarmUpOK(Player player, String regexCommand) {
|
||||
public static void setWarmUpOK(Player player, String regexCommand) {
|
||||
int pre2 = regexCommand.toLowerCase().hashCode();
|
||||
BoosConfigManager.getConfusers().set(
|
||||
"users." + player.getUniqueId() + ".warmup." + pre2, 1);
|
||||
}
|
||||
|
||||
static void startWarmUp(BoosCoolDown bCoolDown, Player player,
|
||||
String regexCommand, String originalCommand, int warmUpSeconds) {
|
||||
public static void startWarmUp(BoosCoolDown bCoolDown, Player player,
|
||||
String regexCommand, String originalCommand, int warmUpSeconds) {
|
||||
regexCommand = regexCommand.toLowerCase();
|
||||
long warmUpMinutes = (long) Math.ceil(warmUpSeconds / 60.0);
|
||||
long warmUpHours = (long) Math.ceil(warmUpMinutes / 60.0);
|
||||
|
@ -140,12 +134,4 @@ public class BoosWarmUpManager {
|
|||
boosChat.sendMessageToPlayer(player, msg);
|
||||
}
|
||||
}
|
||||
|
||||
public static ConcurrentHashMap<Player, String> getPlayerworld() {
|
||||
return playerworld;
|
||||
}
|
||||
|
||||
public static ConcurrentHashMap<Player, Location> getPlayerloc() {
|
||||
return playerloc;
|
||||
}
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
package cz.boosik.boosCooldown;
|
||||
package cz.boosik.boosCooldown.Managers;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import util.boosChat;
|
||||
|
||||
class BoosXpCostManager {
|
||||
public class BoosXpCostManager {
|
||||
|
||||
private static boolean payXPForCommand(Player player,
|
||||
String originalCommand, int xpPrice) {
|
||||
|
@ -25,9 +25,9 @@ class BoosXpCostManager {
|
|||
}
|
||||
}
|
||||
|
||||
static void payXPForCommand(PlayerCommandPreprocessEvent event,
|
||||
Player player, String regexCommand, String originalCommand,
|
||||
int xpPrice) {
|
||||
public static void payXPForCommand(PlayerCommandPreprocessEvent event,
|
||||
Player player, String regexCommand, String originalCommand,
|
||||
int xpPrice) {
|
||||
if (xpPrice > 0) {
|
||||
if (!player.hasPermission("booscooldowns.noxpcost")
|
||||
&& !player.hasPermission("booscooldowns.noxpcost."
|
|
@ -1,8 +1,11 @@
|
|||
package cz.boosik.boosCooldown;
|
||||
package cz.boosik.boosCooldown.Runnables;
|
||||
|
||||
import cz.boosik.boosCooldown.BoosCoolDown;
|
||||
import cz.boosik.boosCooldown.Managers.BoosConfigManager;
|
||||
import cz.boosik.boosCooldown.Managers.BoosLimitManager;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
class BoosGlobalLimitResetRunnable implements Runnable {
|
||||
public class BoosGlobalLimitResetRunnable implements Runnable {
|
||||
|
||||
private final String command;
|
||||
|
|
@ -1,54 +1,53 @@
|
|||
package cz.boosik.boosCooldown;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.TimerTask;
|
||||
|
||||
class BoosWarmUpTimer extends TimerTask {
|
||||
|
||||
private final BoosCoolDown bCoolDown;
|
||||
private final Player player;
|
||||
private final String originalCommand;
|
||||
private final String regexCommand;
|
||||
|
||||
public BoosWarmUpTimer(BoosCoolDown bCoolDown, Player player,
|
||||
String regexCommand, String originalCommand) {
|
||||
this.bCoolDown = bCoolDown;
|
||||
this.player = player;
|
||||
this.regexCommand = regexCommand;
|
||||
this.originalCommand = originalCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
bCoolDown.getServer().getScheduler()
|
||||
.scheduleSyncDelayedTask(bCoolDown, new boosWarmUpRunnable());
|
||||
}
|
||||
|
||||
private class boosWarmUpRunnable implements Runnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (player.isOnline() && !player.isDead()
|
||||
&& BoosWarmUpManager.hasWarmUps(player)) {
|
||||
BoosWarmUpManager.setWarmUpOK(player, regexCommand);
|
||||
BoosWarmUpManager.removeWarmUpProcess(player.getUniqueId()
|
||||
+ "@" + regexCommand);
|
||||
BoosWarmUpManager.clearLocWorld(player);
|
||||
player.chat(originalCommand);
|
||||
} else if (player.isOnline() && player.isDead()
|
||||
&& BoosWarmUpManager.hasWarmUps(player)) {
|
||||
BoosWarmUpManager.removeWarmUp(player, regexCommand);
|
||||
BoosWarmUpManager.removeWarmUpProcess(player.getUniqueId()
|
||||
+ "@" + regexCommand);
|
||||
BoosWarmUpManager.clearLocWorld(player);
|
||||
} else if (!player.isOnline()
|
||||
&& BoosWarmUpManager.hasWarmUps(player)) {
|
||||
BoosWarmUpManager.removeWarmUp(player, regexCommand);
|
||||
BoosWarmUpManager.removeWarmUpProcess(player.getUniqueId()
|
||||
+ "@" + regexCommand);
|
||||
BoosWarmUpManager.clearLocWorld(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
package cz.boosik.boosCooldown.Runnables;
|
||||
|
||||
import cz.boosik.boosCooldown.BoosCoolDown;
|
||||
import cz.boosik.boosCooldown.Managers.BoosWarmUpManager;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.TimerTask;
|
||||
|
||||
public class BoosWarmUpTimer extends TimerTask {
|
||||
|
||||
private final BoosCoolDown bCoolDown;
|
||||
private final Player player;
|
||||
private final String originalCommand;
|
||||
private final String regexCommand;
|
||||
|
||||
public BoosWarmUpTimer(BoosCoolDown bCoolDown, Player player,
|
||||
String regexCommand, String originalCommand) {
|
||||
this.bCoolDown = bCoolDown;
|
||||
this.player = player;
|
||||
this.regexCommand = regexCommand;
|
||||
this.originalCommand = originalCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
bCoolDown.getServer().getScheduler()
|
||||
.scheduleSyncDelayedTask(bCoolDown, new boosWarmUpRunnable());
|
||||
}
|
||||
|
||||
private class boosWarmUpRunnable implements Runnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (player.isOnline() && !player.isDead()
|
||||
&& BoosWarmUpManager.hasWarmUps(player)) {
|
||||
BoosWarmUpManager.setWarmUpOK(player, regexCommand);
|
||||
BoosWarmUpManager.removeWarmUpProcess(player.getUniqueId()
|
||||
+ "@" + regexCommand);
|
||||
player.chat(originalCommand);
|
||||
} else if (player.isOnline() && player.isDead()
|
||||
&& BoosWarmUpManager.hasWarmUps(player)) {
|
||||
BoosWarmUpManager.removeWarmUp(player, regexCommand);
|
||||
BoosWarmUpManager.removeWarmUpProcess(player.getUniqueId()
|
||||
+ "@" + regexCommand);
|
||||
} else if (!player.isOnline()
|
||||
&& BoosWarmUpManager.hasWarmUps(player)) {
|
||||
BoosWarmUpManager.removeWarmUp(player, regexCommand);
|
||||
BoosWarmUpManager.removeWarmUpProcess(player.getUniqueId()
|
||||
+ "@" + regexCommand);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue