mirror of
https://github.com/songoda/UltimateStacker.git
synced 2024-09-27 14:12:59 +02:00
Items now work with the remove all command.
This commit is contained in:
parent
fae3383ab1
commit
53c8cee1e9
@ -10,6 +10,7 @@ import org.bukkit.World;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.Item;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@ -43,13 +44,13 @@ public class CommandRemoveAll extends AbstractCommand {
|
|||||||
EntityStackManager stackManager = plugin.getEntityStackManager();
|
EntityStackManager stackManager = plugin.getEntityStackManager();
|
||||||
for (World world : Bukkit.getWorlds()) {
|
for (World world : Bukkit.getWorlds()) {
|
||||||
for (Entity entityO : world.getEntities()) {
|
for (Entity entityO : world.getEntities()) {
|
||||||
if (entityO instanceof Player || !(entityO instanceof LivingEntity)) continue;
|
if (entityO instanceof Player) continue;
|
||||||
|
|
||||||
if (entityO.getType() != EntityType.DROPPED_ITEM && (stackManager.isStackedAndLoaded((LivingEntity)entityO) || all) && type.equalsIgnoreCase("entities")) {
|
if (entityO instanceof LivingEntity && (stackManager.isStackedAndLoaded((LivingEntity)entityO) || all) && type.equalsIgnoreCase("entities")) {
|
||||||
entityO.remove();
|
entityO.remove();
|
||||||
amountRemoved++;
|
amountRemoved++;
|
||||||
} else if (entityO.getType() == EntityType.DROPPED_ITEM && type.equalsIgnoreCase("items")) {
|
} else if (entityO.getType() == EntityType.DROPPED_ITEM && type.equalsIgnoreCase("items")) {
|
||||||
if (entityO.isCustomNameVisible() && !entityO.getCustomName().contains(TextUtils.convertToInvisibleString("IS")) || all)
|
if (!UltimateStacker.hasCustomAmount((Item)entityO) && !all)
|
||||||
continue;
|
continue;
|
||||||
entityO.remove();
|
entityO.remove();
|
||||||
amountRemoved++;
|
amountRemoved++;
|
||||||
|
Loading…
Reference in New Issue
Block a user