Fixed FastCollatedDropQueue

This commit is contained in:
Auxilor 2020-12-19 17:35:09 +00:00
parent 293027fc23
commit 0ffbde71b9
2 changed files with 4 additions and 2 deletions

View File

@ -3,6 +3,7 @@ package com.willfp.ecoenchants.util.internal.drops;
import com.willfp.ecoenchants.EcoEnchantsPlugin;
import com.willfp.ecoenchants.config.ConfigManager;
import com.willfp.ecoenchants.util.internal.DropQueue;
import com.willfp.ecoenchants.util.internal.Logger;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;

View File

@ -129,11 +129,12 @@ public class InternalDropQueue implements AbstractDropQueue {
World world = loc.getWorld();
assert world != null;
loc = loc.add(0.5, 0.5, 0.5);
if(hasTelekinesis) {
HashMap<Integer, ItemStack> leftover = player.getInventory().addItem(items.toArray(new ItemStack[0]));
for(ItemStack drop : leftover.values()) {
world.dropItemNaturally(loc.add(0.5, 0, 0.5), drop).setVelocity(new Vector());
world.dropItem(loc, drop).setVelocity(new Vector());
}
if (xp > 0) {
PlayerExpChangeEvent event = new PlayerExpChangeEvent(player, xp);
@ -149,7 +150,7 @@ public class InternalDropQueue implements AbstractDropQueue {
}
} else {
for (ItemStack drop : items) {
world.dropItemNaturally(loc.add(0.5, 0, 0.5), drop).setVelocity(new Vector());
world.dropItem(loc, drop).setVelocity(new Vector());
}
if (xp > 0) {
ExperienceOrb orb = (ExperienceOrb) world.spawnEntity(loc, EntityType.EXPERIENCE_ORB);