mirror of
https://github.com/songoda/EpicHoppers.git
synced 2024-11-29 13:45:24 +01:00
Added support for overflowed items on suction.
This commit is contained in:
parent
c9e2ca80aa
commit
4578ce1f0c
@ -21,6 +21,8 @@ import java.util.List;
|
|||||||
public class ModuleSuction implements Module {
|
public class ModuleSuction implements Module {
|
||||||
|
|
||||||
private final int amount;
|
private final int amount;
|
||||||
|
|
||||||
|
private boolean wildStacker = Bukkit.getPluginManager().isPluginEnabled("WildStacker");
|
||||||
|
|
||||||
public ModuleSuction(int amount) {
|
public ModuleSuction(int amount) {
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
@ -55,7 +57,7 @@ public class ModuleSuction implements Module {
|
|||||||
if (entity.hasMetadata("grabbed") || !entity.isOnGround())
|
if (entity.hasMetadata("grabbed") || !entity.isOnGround())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (Bukkit.getPluginManager().isPluginEnabled("WildStacker"))
|
if (wildStacker)
|
||||||
hopItem.setAmount(WildStackerAPI.getItemAmount((Item)entity));
|
hopItem.setAmount(WildStackerAPI.getItemAmount((Item)entity));
|
||||||
|
|
||||||
ItemStack item = ((Item) entity).getItemStack();
|
ItemStack item = ((Item) entity).getItemStack();
|
||||||
@ -68,8 +70,11 @@ public class ModuleSuction implements Module {
|
|||||||
float yy = (float) (0 + (Math.random() * .3));
|
float yy = (float) (0 + (Math.random() * .3));
|
||||||
float zz = (float) (0 + (Math.random() * .3));
|
float zz = (float) (0 + (Math.random() * .3));
|
||||||
Arconix.pl().getApi().packetLibrary.getParticleManager().broadcastParticle(entity.getLocation(), xx, yy, zz, 0, "FLAME", 5);
|
Arconix.pl().getApi().packetLibrary.getParticleManager().broadcastParticle(entity.getLocation(), xx, yy, zz, 0, "FLAME", 5);
|
||||||
|
|
||||||
|
for (ItemStack itemStack : hopperBlock.getInventory().addItem(hopItem).values()) {
|
||||||
|
entity.getWorld().dropItemNaturally(entity.getLocation(), itemStack);
|
||||||
|
}
|
||||||
entity.remove();
|
entity.remove();
|
||||||
hopperBlock.getInventory().addItem(hopItem);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user