Renamed method in EntityDeathByEntityEvent

This commit is contained in:
Auxilor 2020-12-23 22:46:50 +00:00
parent e3975a4c4b
commit 311251686d
4 changed files with 13 additions and 10 deletions

View File

@ -47,7 +47,7 @@ public class Fetching extends EcoEnchant {
if(!(EnchantChecks.helmet(player, this)))
return;
int xp = event.getDroppedExp();
int xp = event.getXp();
Collection<ItemStack> drops = event.getDrops();
new DropQueue(player)

View File

@ -30,14 +30,14 @@ import java.util.Collection;
import java.util.List;
public class Telekinesis extends EcoEnchant {
private static boolean always = false;
public Telekinesis() {
super(
"telekinesis", EnchantmentType.NORMAL
);
}
private static boolean always = false;
// START OF LISTENERS
@Override
@ -128,7 +128,7 @@ public class Telekinesis extends EcoEnchant {
if (!EnchantChecks.item(item, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
int xp = event.getDroppedExp();
int xp = event.getXp();
Collection<ItemStack> drops = event.getDrops();
if(entity instanceof Player && Soulbound.getSoulboundItems((Player) entity) != null) {

View File

@ -30,7 +30,7 @@ public class EntityDeathByEntityEvent extends Event {
* The {@link Entity} that killed.
*/
@Getter
private final Entity damager;
private final Entity killer;
/**
* The associated {@link EntityDeathEvent}.
@ -54,18 +54,18 @@ public class EntityDeathByEntityEvent extends Event {
* Create event based off parameters.
*
* @param victim The killed entity
* @param damager The killer
* @param killer The killer
* @param drops The item drops
* @param xp The amount of xp to drop
* @param deathEvent The associated {@link EntityDeathEvent}
*/
public EntityDeathByEntityEvent(@NotNull final LivingEntity victim,
@NotNull final Entity damager,
@NotNull final Entity killer,
@NotNull final List<ItemStack> drops,
final int xp,
@NotNull final EntityDeathEvent deathEvent) {
this.victim = victim;
this.damager = damager;
this.killer = killer;
this.drops = drops;
this.xp = xp;
this.deathEvent = deathEvent;

View File

@ -28,9 +28,12 @@ public class NaturalExpGainListeners implements Listener {
NaturalExpGainBuilder toRemove = null;
for (NaturalExpGainBuilder searchBuilder : events) {
if (!searchBuilder.getLocation().getWorld().equals(event.getPlayer().getLocation().getWorld())) continue;
if (searchBuilder.getReason().equals(NaturalExpGainBuilder.BuildReason.BOTTLE) && searchBuilder.getLocation().distanceSquared(event.getPlayer().getLocation()) > 52)
if (!searchBuilder.getLocation().getWorld().equals(event.getPlayer().getLocation().getWorld())) {
continue;
}
if (searchBuilder.getReason().equals(NaturalExpGainBuilder.BuildReason.BOTTLE) && searchBuilder.getLocation().distanceSquared(event.getPlayer().getLocation()) > 52) {
toRemove = searchBuilder;
}
}
if (toRemove != null) {