Final fix for dupe

This commit is contained in:
Brianna 2019-05-27 01:32:00 -04:00
parent 0622f28861
commit 0c7341a1b4
2 changed files with 6 additions and 5 deletions

View File

@ -75,19 +75,15 @@ public class ModuleSuction implements Module {
StringUtils.substring(itemStack.getItemMeta().getDisplayName(), 0, 3).equals("***")) {
return; //Compatibility with Shop instance: https://www.spigotmc.org/resources/shop-a-simple-intuitive-shop-instance.9628/
}
if (entity.hasMetadata("grabbed") || !entity.isOnGround())
return;
if (wildStacker)
itemStack.setAmount(WildStackerAPI.getItemAmount((Item) entity));
if (!canMove(hopperInventory, itemStack))
if (!canMove(hopperInventory, itemStack) || blacklist.contains(item.getUniqueId()))
return;
blacklist.add(item.getUniqueId());
((Item) entity).setPickupDelay(10);
entity.setMetadata("grabbed", new FixedMetadataValue(EpicHoppers.getInstance(), ""));
float xx = (float) (0 + (Math.random() * .1));
float yy = (float) (0 + (Math.random() * .1));
float zz = (float) (0 + (Math.random() * .1));
@ -107,6 +103,10 @@ public class ModuleSuction implements Module {
return blacklist.contains(uuid);
}
public static boolean addToBlacklist(UUID uuid) {
return blacklist.add(uuid);
}
public ItemStack getGUIButton(Hopper hopper) {
return null;
}

View File

@ -60,5 +60,6 @@ public class EntityListeners implements Listener {
public void onPlayerPickup(PlayerPickupItemEvent event) {
if (ModuleSuction.isBlacklisted(event.getItem().getUniqueId()))
event.setCancelled(true);
ModuleSuction.addToBlacklist(event.getItem().getUniqueId());
}
}