1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 11:45:51 +00:00

Merge pull request #1210 from AlexLander123/fixes

Allow reactors to take in fuel from access port
This commit is contained in:
TheBusyBiscuit 2019-10-27 21:16:43 +01:00 committed by GitHub
commit 461555d76f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -336,7 +336,7 @@ public abstract class AReactor extends SlimefunItem implements RecipeDisplayItem
MachineFuel fuel = findRecipe(menu, found); MachineFuel fuel = findRecipe(menu, found);
if (port != null) { if (port != null) {
restockCoolant(menu, port); restockFuel(menu, port);
} }
if (fuel != null) { if (fuel != null) {
@ -368,11 +368,11 @@ public abstract class AReactor extends SlimefunItem implements RecipeDisplayItem
}); });
} }
private void restockCoolant(BlockMenu menu, BlockMenu port) { private void restockFuel(BlockMenu menu, BlockMenu port) {
for (int slot: getFuelSlots()) { for (int slot: getFuelSlots()) {
for (MachineFuel recipe: recipes) { for (MachineFuel recipe: recipes) {
if (SlimefunManager.isItemSimiliar(port.getItemInSlot(slot), recipe.getInput(), true) && menu.fits(new CustomItem(port.getItemInSlot(slot), 1), getFuelSlots())) { if (SlimefunManager.isItemSimiliar(port.getItemInSlot(slot), recipe.getInput(), true) && menu.fits(new CustomItem(port.getItemInSlot(slot), 1), getFuelSlots())) {
port.replaceExistingItem(slot, InvUtils.decreaseItem(port.getItemInSlot(slot), 1)); port.replaceExistingItem(slot, menu.pushItem(port.getItemInSlot(slot), getFuelSlots()));
return; return;
} }
} }