1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00

Fixed Enttiy Assemblers

This commit is contained in:
TheBusyBiscuit 2020-07-25 14:45:57 +02:00
parent f15efd6cc2
commit c3ab3a6ecc
2 changed files with 6 additions and 7 deletions

View File

@ -53,6 +53,7 @@
* Fixed #2086
* Fixed #1894
* Fixed #2097
* Fixed Wither Assembler requiring more items than it actually consumes
## Release Candidate 14 (12 Jul 2020)

View File

@ -180,7 +180,7 @@ public abstract class AbstractEntityAssembler<T extends Entity> extends SimpleSl
@Override
public void tick(Block b, SlimefunItem sf, Config data) {
if (String.valueOf(false).equals(BlockStorage.getLocationInfo(b.getLocation(), "enabled"))) {
if ("false".equals(BlockStorage.getLocationInfo(b.getLocation(), "enabled"))) {
return;
}
@ -217,15 +217,13 @@ public abstract class AbstractEntityAssembler<T extends Entity> extends SimpleSl
}
private boolean findResource(BlockMenu menu, ItemStack item, int[] slots) {
Material resource = item.getType();
int required = item.getAmount();
int found = 0;
for (int slot : slots) {
if (SlimefunUtils.isItemSimilar(menu.getItemInSlot(slot), new ItemStack(resource), true, false)) {
if (SlimefunUtils.isItemSimilar(menu.getItemInSlot(slot), item, true, false)) {
found += menu.getItemInSlot(slot).getAmount();
if (found > required) {
if (found >= item.getAmount()) {
return true;
}
}
@ -239,7 +237,7 @@ public abstract class AbstractEntityAssembler<T extends Entity> extends SimpleSl
int headCount = getHead().getAmount();
for (int slot : bodySlots) {
if (SlimefunUtils.isItemSimilar(inv.getItemInSlot(slot), new ItemStack(getBody().getType()), true, false)) {
if (SlimefunUtils.isItemSimilar(inv.getItemInSlot(slot), getBody(), true, false)) {
int amount = inv.getItemInSlot(slot).getAmount();
if (amount >= bodyCount) {
@ -254,7 +252,7 @@ public abstract class AbstractEntityAssembler<T extends Entity> extends SimpleSl
}
for (int slot : headSlots) {
if (SlimefunUtils.isItemSimilar(inv.getItemInSlot(slot), new ItemStack(getHead().getType()), true, false)) {
if (SlimefunUtils.isItemSimilar(inv.getItemInSlot(slot), getHead(), true, false)) {
int amount = inv.getItemInSlot(slot).getAmount();
if (amount >= headCount) {