mirror of
https://github.com/songoda/EpicHoppers.git
synced 2025-01-10 09:57:45 +01:00
Hoppers modules will now correctly account for stack amounts.
Module descriptions will now be displayed correctly.
This commit is contained in:
parent
009f5569f8
commit
81e167dd46
@ -260,7 +260,7 @@ public class HopHandler {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public boolean canHop(Inventory i, ItemStack item, int hop) {
|
||||
private boolean canHop(Inventory i, ItemStack item, int hop) {
|
||||
try {
|
||||
if (i.firstEmpty() != -1) {
|
||||
return true;
|
||||
|
@ -85,7 +85,7 @@ public class ModuleAutoCrafting implements Module {
|
||||
if (inventory.firstEmpty() != -1) return true;
|
||||
|
||||
for (ItemStack stack : inventory.getContents()) {
|
||||
if (stack.isSimilar(item) && stack.getAmount() < stack.getMaxStackSize()) {
|
||||
if (stack.isSimilar(item) && (stack.getAmount() + item.getAmount()) < stack.getMaxStackSize()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -61,6 +61,6 @@ public class ModuleBlockBreak implements Module {
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return EpicHoppersPlugin.getInstance().getLocale().getMessage("interface.hopper.blockbreak", true);
|
||||
return EpicHoppersPlugin.getInstance().getLocale().getMessage("interface.hopper.blockbreak", amount);
|
||||
}
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ public class ModuleSuction implements Module {
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return EpicHoppersPlugin.getInstance().getLocale().getMessage("interface.hopper.suction", true);
|
||||
return EpicHoppersPlugin.getInstance().getLocale().getMessage("interface.hopper.suction", amount);
|
||||
}
|
||||
|
||||
private boolean canMove(Inventory inventory, ItemStack item) {
|
||||
@ -89,7 +89,7 @@ public class ModuleSuction implements Module {
|
||||
if (inventory.firstEmpty() != -1) return true;
|
||||
|
||||
for (ItemStack stack : inventory.getContents()) {
|
||||
if (stack.isSimilar(item) && stack.getAmount() < stack.getMaxStackSize()) {
|
||||
if (stack.isSimilar(item) && (stack.getAmount() + item.getAmount()) < stack.getMaxStackSize()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user