mirror of
https://github.com/taoneill/war.git
synced 2025-01-03 06:17:33 +01:00
Merge pull request #848 from Ultra03/develop
Add an option in config to disable the 1.9 attack cooldown
This commit is contained in:
commit
7b982c2687
@ -8,6 +8,7 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.BlockState;
|
||||
@ -371,6 +372,12 @@ public class Team {
|
||||
player.setScoreboard(this.warzone.getScoreboard());
|
||||
}
|
||||
warzone.updateScoreboard();
|
||||
boolean cooldownEnabled = War.war.getWarConfig().getBoolean(WarConfig.DISABLECOOLDOWN);
|
||||
if(cooldownEnabled) {
|
||||
player.getAttribute(Attribute.GENERIC_ATTACK_SPEED).setBaseValue(1024.0);
|
||||
} else {
|
||||
player.getAttribute(Attribute.GENERIC_ATTACK_SPEED).setBaseValue(4.0);
|
||||
}
|
||||
}
|
||||
|
||||
public List<Player> getPlayers() {
|
||||
@ -431,6 +438,7 @@ public class Team {
|
||||
}
|
||||
this.warzone.getLoadoutSelections().remove(thePlayer);
|
||||
warzone.updateScoreboard();
|
||||
thePlayer.getAttribute(Attribute.GENERIC_ATTACK_SPEED).setBaseValue(4.0);
|
||||
}
|
||||
|
||||
public int getRemainingLives() {
|
||||
|
@ -147,6 +147,7 @@ public class War extends JavaPlugin {
|
||||
warConfig.put(WarConfig.LANGUAGE, Locale.getDefault().toString());
|
||||
warConfig.put(WarConfig.AUTOJOIN, "");
|
||||
warConfig.put(WarConfig.TPWARMUP, 0);
|
||||
warConfig.put(WarConfig.DISABLECOOLDOWN, false);
|
||||
|
||||
warzoneDefaultConfig.put(WarzoneConfig.AUTOASSIGN, false);
|
||||
warzoneDefaultConfig.put(WarzoneConfig.BLOCKHEADS, true);
|
||||
|
@ -13,7 +13,8 @@ public enum WarConfig {
|
||||
MAXSIZE (Integer.class, "Max size", "Maximum volume of a warzone"),
|
||||
LANGUAGE (String.class, "Language", "Preferred server language"),
|
||||
AUTOJOIN (String.class, "Auto-join", "Name of warzone to send players to upon join"),
|
||||
TPWARMUP(Integer.class, "TP warmup", "Amount of seconds a player must wait after requesting a teleport");
|
||||
TPWARMUP(Integer.class, "TP warmup", "Amount of seconds a player must wait after requesting a teleport"),
|
||||
DISABLECOOLDOWN (Boolean.class, "Disable the 1.9 combat cooldown", "Disables the attack cooldown when swinging a weapon");
|
||||
|
||||
private final Class<?> configType;
|
||||
private final String title;
|
||||
|
@ -46,7 +46,7 @@ import java.util.logging.Level;
|
||||
*/
|
||||
public class WarPlayerListener implements Listener {
|
||||
private java.util.Random random = new java.util.Random();
|
||||
private HashMap<String, Location> latestLocations = new HashMap<String, Location>();
|
||||
private HashMap<String, Location> latestLocations = new HashMap<String, Location>();
|
||||
|
||||
/**
|
||||
* Correctly removes quitting players from warzones
|
||||
|
Loading…
Reference in New Issue
Block a user