mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
Fix valid fuel check for Gas Generator. Fixes #5448
This commit is contained in:
1 file changed
+6
-16
+6
-16
@@ -1,7 +1,8 @@
|
||||
package mekanism.generators.common.inventory.container;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.IGasItem;
|
||||
import mekanism.common.MekanismFluids;
|
||||
import mekanism.common.FuelHandler;
|
||||
import mekanism.common.inventory.slot.SlotEnergy.SlotCharge;
|
||||
import mekanism.generators.common.tile.TileEntityGasGenerator;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
@@ -22,21 +23,10 @@ public class ContainerGasGenerator extends ContainerFuelGenerator<TileEntityGasG
|
||||
|
||||
@Override
|
||||
protected boolean tryFuel(ItemStack slotStack) {
|
||||
return slotStack.getItem() instanceof IGasItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ItemStack handleFuel(ItemStack slotStack, int slotID) {
|
||||
if (slotID != 0 && slotID != 1) {
|
||||
if (((IGasItem) slotStack.getItem()).getGas(slotStack) != null
|
||||
&& ((IGasItem) slotStack.getItem()).getGas(slotStack).getGas() == MekanismFluids.Hydrogen) {
|
||||
if (!mergeItemStack(slotStack, 0, 1, false)) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
}
|
||||
} else if (!mergeItemStack(slotStack, 2, inventorySlots.size(), true)) {
|
||||
return ItemStack.EMPTY;
|
||||
if (slotStack.getItem() instanceof IGasItem) {
|
||||
GasStack gasStack = ((IGasItem) slotStack.getItem()).getGas(slotStack);
|
||||
return gasStack != null && FuelHandler.getFuel(gasStack.getGas()) != null;
|
||||
}
|
||||
return slotStack;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user