diff --git a/pom.xml b/pom.xml index f9794e7..082cfe6 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 me.despical one-in-the-chamber - 2.7.5 + 2.7.6 One In The Chamber 2019 diff --git a/src/main/java/me/despical/oitc/user/User.java b/src/main/java/me/despical/oitc/user/User.java index d6f1da4..64cc5e5 100644 --- a/src/main/java/me/despical/oitc/user/User.java +++ b/src/main/java/me/despical/oitc/user/User.java @@ -164,7 +164,7 @@ public void updateAttackCooldown() { Optional.ofNullable(player.getAttribute(Attribute.GENERIC_ATTACK_SPEED)).ifPresent(attribute -> { this.attackCooldown = attribute.getBaseValue(); - attribute.setBaseValue(plugin.getConfig().getDouble("Hit-Cooldown-Delay", 4)); + attribute.setBaseValue(plugin.getConfig().getDouble("Hit-Cooldown-Delay", 20)); }); } @@ -175,7 +175,13 @@ public void resetAttackCooldown() { if (player == null) return; - Optional.ofNullable(player.getAttribute(Attribute.GENERIC_ATTACK_SPEED)).ifPresent(attribute -> attribute.setBaseValue(this.attackCooldown)); + Optional.ofNullable(player.getAttribute(Attribute.GENERIC_ATTACK_SPEED)).ifPresent(attribute -> { + if (attackCooldown == 0) { + attackCooldown = attribute.getDefaultValue(); + } + + attribute.setBaseValue(attackCooldown); + }); } public void setPinnedPage(final Page pinnedPage) { diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index d324ec4..d7b73cb 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -75,7 +75,7 @@ Chat-Format-Enabled: true Disable-Separate-Chat: false # The delay between hitting players. ONLY EFFECTED in Minecraft 1.9+ -Hit-Cooldown-Delay: 16 +Hit-Cooldown-Delay: 20 # Basic permissions for game, permissions explained here: https://github.com/Despical/OITC/wiki/Commands-and-permissions#basic-permissions Basic-Permissions: