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

Fixed Android Fuel Interfaces

This commit is contained in:
TheBusyBiscuit 2020-03-20 11:37:37 +01:00
parent 84dbea4473
commit 777b54e696
2 changed files with 10 additions and 7 deletions

View File

@ -78,6 +78,8 @@
* Fixed #1719
* Fixed death waypoints not having the correct texture
* Fixed Androids having no texture when moving
* Fixed Androids not taking fuel from interfaces
* Fixed #1721
## Release Candidate 9 (07 Mar 2020)

View File

@ -233,7 +233,7 @@ public abstract class ProgrammableAndroid extends Android implements InventoryBl
return;
}
if (BlockStorage.getLocationInfo(b.getLocation(), "paused").equals("false")) {
if ("false".equals(BlockStorage.getLocationInfo(b.getLocation(), "paused"))) {
BlockMenu menu = BlockStorage.getInventory(b);
float fuel = Float.parseFloat(BlockStorage.getLocationInfo(b.getLocation(), "fuel"));
@ -408,18 +408,19 @@ public abstract class ProgrammableAndroid extends Android implements InventoryBl
private boolean insertFuel(BlockMenu menu, Inventory dispenser, int slot, ItemStack currentFuel, ItemStack newFuel) {
if (currentFuel == null) {
menu.replaceExistingItem(43, item);
menu.replaceExistingItem(43, newFuel);
dispenser.setItem(slot, null);
return true;
}
else if (SlimefunManager.isItemSimilar(item, currentFuel, true)) {
int rest = item.getType().getMaxStackSize() - currentFuel.getAmount();
else if (SlimefunManager.isItemSimilar(newFuel, currentFuel, true)) {
int rest = newFuel.getType().getMaxStackSize() - currentFuel.getAmount();
if (rest > 0) {
int amount = item.getAmount() > rest ? rest : item.getAmount();
menu.replaceExistingItem(43, new CustomItem(item, currentFuel.getAmount() + amount));
ItemUtils.consumeItem(item, amount, false);
int amount = newFuel.getAmount() > rest ? rest : newFuel.getAmount();
menu.replaceExistingItem(43, new CustomItem(newFuel, currentFuel.getAmount() + amount));
ItemUtils.consumeItem(newFuel, amount, false);
}
return true;
}