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))) if(!(EnchantChecks.helmet(player, this)))
return; return;
int xp = event.getDroppedExp(); int xp = event.getXp();
Collection<ItemStack> drops = event.getDrops(); Collection<ItemStack> drops = event.getDrops();
new DropQueue(player) new DropQueue(player)

View File

@ -30,14 +30,14 @@ import java.util.Collection;
import java.util.List; import java.util.List;
public class Telekinesis extends EcoEnchant { public class Telekinesis extends EcoEnchant {
private static boolean always = false;
public Telekinesis() { public Telekinesis() {
super( super(
"telekinesis", EnchantmentType.NORMAL "telekinesis", EnchantmentType.NORMAL
); );
} }
private static boolean always = false;
// START OF LISTENERS // START OF LISTENERS
@Override @Override
@ -128,7 +128,7 @@ public class Telekinesis extends EcoEnchant {
if (!EnchantChecks.item(item, this)) return; if (!EnchantChecks.item(item, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return; if(this.getDisabledWorlds().contains(player.getWorld())) return;
int xp = event.getDroppedExp(); int xp = event.getXp();
Collection<ItemStack> drops = event.getDrops(); Collection<ItemStack> drops = event.getDrops();
if(entity instanceof Player && Soulbound.getSoulboundItems((Player) entity) != null) { 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. * The {@link Entity} that killed.
*/ */
@Getter @Getter
private final Entity damager; private final Entity killer;
/** /**
* The associated {@link EntityDeathEvent}. * The associated {@link EntityDeathEvent}.
@ -54,18 +54,18 @@ public class EntityDeathByEntityEvent extends Event {
* Create event based off parameters. * Create event based off parameters.
* *
* @param victim The killed entity * @param victim The killed entity
* @param damager The killer * @param killer The killer
* @param drops The item drops * @param drops The item drops
* @param xp The amount of xp to drop * @param xp The amount of xp to drop
* @param deathEvent The associated {@link EntityDeathEvent} * @param deathEvent The associated {@link EntityDeathEvent}
*/ */
public EntityDeathByEntityEvent(@NotNull final LivingEntity victim, public EntityDeathByEntityEvent(@NotNull final LivingEntity victim,
@NotNull final Entity damager, @NotNull final Entity killer,
@NotNull final List<ItemStack> drops, @NotNull final List<ItemStack> drops,
final int xp, final int xp,
@NotNull final EntityDeathEvent deathEvent) { @NotNull final EntityDeathEvent deathEvent) {
this.victim = victim; this.victim = victim;
this.damager = damager; this.killer = killer;
this.drops = drops; this.drops = drops;
this.xp = xp; this.xp = xp;
this.deathEvent = deathEvent; this.deathEvent = deathEvent;

View File

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