Skip to content

Commit bef16af

Browse files
committed
Commit
1 parent a23e0d7 commit bef16af

9 files changed

Lines changed: 12 additions & 26 deletions

File tree

src/main/java/me/nik/combatplus/CombatPlus.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ public void onDisable() {
9191
Lang.reload();
9292
Lang.save();
9393

94-
//Unload Instances
95-
getCommand("combatplus").setExecutor(null);
96-
9794
//Done
9895
consoleMessage(Messenger.message("console.disabled"));
9996
}
@@ -157,7 +154,7 @@ private void initialize() {
157154
consoleMessage(Messenger.message("console.initialize"));
158155

159156
if (isEnabled("combat.settings.old_pvp") || isEnabled("custom.player_health.enabled")) {
160-
registerEvent(new AttributesSet(this));
157+
registerEvent(new AttributesSet());
161158
}
162159
if (isEnabled("combat.settings.old_weapon_damage") || isEnabled("combat.settings.old_tool_damage") || isEnabled("combat.settings.disable_sweep_attacks.enabled")) {
163160
registerEvent(new DamageModifiers());

src/main/java/me/nik/combatplus/listeners/AttributesSet.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package me.nik.combatplus.listeners;
22

3-
import me.nik.combatplus.CombatPlus;
43
import me.nik.combatplus.files.Config;
54
import me.nik.combatplus.utils.ResetStats;
65
import me.nik.combatplus.utils.SetAttackSpeed;
@@ -15,12 +14,6 @@
1514

1615
public class AttributesSet implements Listener {
1716

18-
private final CombatPlus plugin;
19-
20-
public AttributesSet(CombatPlus plugin) {
21-
this.plugin = plugin;
22-
}
23-
2417
/*
2518
Changes the attribute of the player to the Old Attack Speed (On Join)
2619
*/
@@ -44,6 +37,7 @@ public void onJoin(PlayerJoinEvent e) {
4437
}
4538

4639
}
40+
4741
/*
4842
Resets the attribute of the player to the New Attack Speed (On Leave)
4943
*/

src/main/java/me/nik/combatplus/listeners/Enderpearl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ private boolean holdsEnderPearl(Player p) {
5151

5252
// This Listener Adds a cooldown between using Ender Pearls
5353

54-
@EventHandler(priority = EventPriority.NORMAL)
54+
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
5555
public void onInteract(PlayerInteractEvent e) {
5656
if (worldUtils.enderpearlDisabledWorlds(e.getPlayer())) return;
5757
if (e.getAction().equals(Action.RIGHT_CLICK_AIR) || e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {

src/main/java/me/nik/combatplus/listeners/Offhand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ public void onDrag(InventoryDragEvent e) {
6161
private boolean itemCheck(ItemStack item) {
6262
return item != null && item.getType() != Material.AIR;
6363
}
64-
}
64+
}

src/main/java/me/nik/combatplus/listeners/PlayerRegen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ private double clamp(double value, double min, double max) {
7878
}
7979
return value;
8080
}
81-
}
81+
}

src/main/java/me/nik/combatplus/listeners/UpdateReminder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ public void run() {
2727
}
2828
}.runTaskLaterAsynchronously(plugin, 40);
2929
}
30-
}
30+
}

src/main/java/me/nik/combatplus/listeners/fixes/Criticals.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class Criticals implements Listener {
1818
Patches the Criticals Cheat if a player crits while he's on the ground
1919
*/
2020

21-
@EventHandler(priority = EventPriority.LOW)
21+
@EventHandler(priority = EventPriority.NORMAL)
2222
public void onCritical(EntityDamageByEntityEvent e) {
2323
if (!(e.getDamager() instanceof Player) || e.getCause() != EntityDamageEvent.DamageCause.ENTITY_ATTACK) return;
2424
Player p = (Player) e.getDamager();

src/main/java/me/nik/combatplus/listeners/fixes/HealthSpoof.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ public HealthSpoof(CombatPlus plugin) {
1717
this.plugin = plugin;
1818
}
1919

20-
@EventHandler(priority = EventPriority.LOWEST)
20+
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
2121
public void onCloseToDeath(EntityDamageEvent e) {
2222
if (!(e.getEntity() instanceof Player)) return;
23-
if (e.isCancelled()) return;
2423
Player p = (Player) e.getEntity();
2524
if (holdsTotem(p)) return;
26-
if (shouldDie(e, p)) {
25+
double health = p.getHealth();
26+
double damage = e.getFinalDamage();
27+
if (damage >= health || health < 1) {
2728
new BukkitRunnable() {
2829

2930
@Override
@@ -37,12 +38,6 @@ public void run() {
3738
}
3839
}
3940

40-
private boolean shouldDie(EntityDamageEvent e, Player p) {
41-
double health = p.getHealth();
42-
double damage = e.getFinalDamage();
43-
return damage >= health || health < 1;
44-
}
45-
4641
private boolean holdsTotem(Player p) {
4742
return p.getInventory().getItemInMainHand().getType().name().contains("TOTEM") || p.getInventory().getItemInOffHand().getType().name().contains("TOTEM");
4843
}

src/main/resources/plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: CombatPlus
2-
version: 1.2.8
2+
version: 1.2.9
33
main: me.nik.combatplus.CombatPlus
44
api-version: 1.13
55
authors: [Nik]

0 commit comments

Comments
 (0)