mirror of
https://github.com/songoda/EpicHoppers.git
synced 2024-11-23 10:45:46 +01:00
Final fix for dupe
This commit is contained in:
parent
0622f28861
commit
0c7341a1b4
@ -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;
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user