Skip to content

Commit

Permalink
[Core] Remove self hit prevention, don't combat log on self hit
Browse files Browse the repository at this point in the history
  • Loading branch information
Kakifrucht committed Oct 30, 2019
1 parent 325e8d6 commit 3312017
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 10 deletions.
1 change: 0 additions & 1 deletion HalfminerCore/README.md
Expand Up @@ -108,7 +108,6 @@ Runs as Spigot plugin powered by Bukkit, depends on [Essentials](https://github.
- Reduces damage immunity
- Strength potions damage nerfed (*configurable*)
- Bow spamming disabled
- Disable hitting self with bow
- Broadcasts killstreaks via actionbar
- Run custom actions with custom probabilities on kill
- See ``customactions.txt`` in plugin directory for example actions
Expand Down
2 changes: 1 addition & 1 deletion HalfminerCore/pom.xml
Expand Up @@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>

<artifactId>HalfminerCore</artifactId>
<version>4.5.2</version>
<version>4.5.3</version>

<dependencies>
<dependency>
Expand Down
Expand Up @@ -109,7 +109,7 @@ public void onPvPTagPlayer(EntityDamageByEntityEvent e) {
Player victim = (Player) e.getEntity();
Player attacker = Utils.getPlayerSourceFromEntity(e.getDamager());

if (isPvP(victim, attacker)) {
if (!victim.equals(attacker) && isPvP(victim, attacker)) {

lastOpponentCache.put(victim, attacker);
lastOpponentCache.put(attacker, victim);
Expand Down
Expand Up @@ -37,7 +37,6 @@
* - Reduces damage immunity
* - Strength potions damage nerfed, configurable
* - Bow spamming disabled
* - Disable hitting self with bow
* - Killstreak via actionbar
* - Run custom actions with custom probabilities on kill
* - See customactions.txt for example actions
Expand Down Expand Up @@ -100,12 +99,6 @@ public void onAttackReduceStrengthAndLowerImmunity(EntityDamageByEntityEvent e)
final Player damagee = (Player) e.getEntity();
Player damager = Utils.getPlayerSourceFromEntity(e.getDamager());

// disable hitting self with bow
if (damagee.equals(damager) && e.getDamager() instanceof Projectile) {
e.setCancelled(true);
return;
}

if ((damager != null && damager.hasPermission("hmc.bypass.pvp"))
|| damagee.hasPermission("hmc.bypass.pvp")) {
return;
Expand Down

0 comments on commit 3312017

Please sign in to comment.