Rupture fires a FakeEntityDamageByEntityEvent fixes #4122

This commit is contained in:
nossr50 2020-02-28 15:43:32 -08:00
parent 326ff1cd70
commit 12abd68add
2 changed files with 7 additions and 1 deletions

View File

@ -2,12 +2,12 @@ Version 2.1.118
Fixed another dupe bug
Blast Mining no longer reduces debris from explosions due to some issues with the Bukkit API
Modified locale string 'Mining.Blast.Effect' to remove debris reduction mention
Rupture now fires a FakeEntityDamageByEntityEvent before damaging its victims (cancelling it will be ignored)
Version 2.1.117
Fixed a rare http error when polling Mojang for UUIDs
Fixed a bug that allowed duping
Version 2.1.116
Fixed directional plants not maintaining their direction when replanted

View File

@ -2,6 +2,7 @@ package com.gmail.nossr50.runnables.skills;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.MobHealthbarUtils;
import com.gmail.nossr50.util.player.NotificationManager;
@ -12,6 +13,7 @@ import com.gmail.nossr50.util.sounds.SoundType;
import org.bukkit.Bukkit;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitRunnable;
@ -115,6 +117,10 @@ public class BleedTimerTask extends BukkitRunnable {
// debugMessage+="TargetHealthBeforeDMG=["+String.valueOf(target.getHealth())+"], ";
//Fire a fake event
FakeEntityDamageByEntityEvent fakeEntityDamageByEntityEvent = (FakeEntityDamageByEntityEvent) CombatUtils.sendEntityDamageEvent(containerEntry.getValue().damageSource, target, EntityDamageEvent.DamageCause.CUSTOM, damage);
Bukkit.getPluginManager().callEvent(fakeEntityDamageByEntityEvent);
CombatUtils.dealNoInvulnerabilityTickDamageRupture(target, damage, containerEntry.getValue().damageSource, toolTier);
double victimHealthAftermath = target.getHealth();