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:
parent
84dbea4473
commit
777b54e696
@ -78,6 +78,8 @@
|
|||||||
* Fixed #1719
|
* Fixed #1719
|
||||||
* Fixed death waypoints not having the correct texture
|
* Fixed death waypoints not having the correct texture
|
||||||
* Fixed Androids having no texture when moving
|
* Fixed Androids having no texture when moving
|
||||||
|
* Fixed Androids not taking fuel from interfaces
|
||||||
|
* Fixed #1721
|
||||||
|
|
||||||
## Release Candidate 9 (07 Mar 2020)
|
## Release Candidate 9 (07 Mar 2020)
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@ public abstract class ProgrammableAndroid extends Android implements InventoryBl
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BlockStorage.getLocationInfo(b.getLocation(), "paused").equals("false")) {
|
if ("false".equals(BlockStorage.getLocationInfo(b.getLocation(), "paused"))) {
|
||||||
BlockMenu menu = BlockStorage.getInventory(b);
|
BlockMenu menu = BlockStorage.getInventory(b);
|
||||||
float fuel = Float.parseFloat(BlockStorage.getLocationInfo(b.getLocation(), "fuel"));
|
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) {
|
private boolean insertFuel(BlockMenu menu, Inventory dispenser, int slot, ItemStack currentFuel, ItemStack newFuel) {
|
||||||
if (currentFuel == null) {
|
if (currentFuel == null) {
|
||||||
menu.replaceExistingItem(43, item);
|
menu.replaceExistingItem(43, newFuel);
|
||||||
dispenser.setItem(slot, null);
|
dispenser.setItem(slot, null);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (SlimefunManager.isItemSimilar(item, currentFuel, true)) {
|
else if (SlimefunManager.isItemSimilar(newFuel, currentFuel, true)) {
|
||||||
int rest = item.getType().getMaxStackSize() - currentFuel.getAmount();
|
int rest = newFuel.getType().getMaxStackSize() - currentFuel.getAmount();
|
||||||
|
|
||||||
if (rest > 0) {
|
if (rest > 0) {
|
||||||
int amount = item.getAmount() > rest ? rest : item.getAmount();
|
int amount = newFuel.getAmount() > rest ? rest : newFuel.getAmount();
|
||||||
menu.replaceExistingItem(43, new CustomItem(item, currentFuel.getAmount() + amount));
|
menu.replaceExistingItem(43, new CustomItem(newFuel, currentFuel.getAmount() + amount));
|
||||||
ItemUtils.consumeItem(item, amount, false);
|
ItemUtils.consumeItem(newFuel, amount, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user