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

Allow reactors to take in fuel from access port

- Also allow reactors to take in fuel in bulk
This commit is contained in:
AlexLander123 2019-10-28 04:02:06 +08:00
parent 9f3c3a413b
commit 8601986c09

View File

@ -336,7 +336,7 @@ public abstract class AReactor extends SlimefunItem implements RecipeDisplayItem
MachineFuel fuel = findRecipe(menu, found);
if (port != null) {
restockCoolant(menu, port);
restockFuel(menu, port);
}
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 (MachineFuel recipe: recipes) {
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;
}
}