mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-23 21:39:40 +00:00
Don't hard code some machines to specific gas types
This commit is contained in:
1 parent
f8b162bc31
commit
d8b6dfbb78
21 files changed
+181
-282
No files matched your search
@@ -3,15 +3,13 @@ package mekanism.common.tile;
|
||||
import java.util.Map;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.common.MekanismFluids;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.config.MekanismConfig.usage;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.recipe.inputs.AdvancedMachineInput;
|
||||
import mekanism.common.recipe.machines.OsmiumCompressorRecipe;
|
||||
import mekanism.common.tile.prefab.TileEntityAdvancedElectricMachine;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
public class TileEntityOsmiumCompressor extends TileEntityAdvancedElectricMachine<OsmiumCompressorRecipe> {
|
||||
|
||||
@@ -26,26 +24,25 @@ public class TileEntityOsmiumCompressor extends TileEntityAdvancedElectricMachin
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack getItemGas(ItemStack itemstack) {
|
||||
int amount = 0;
|
||||
|
||||
for (ItemStack ore : OreDictionary.getOres("ingotOsmium")) {
|
||||
if (ore.isItemEqual(itemstack)) {
|
||||
return new GasStack(MekanismFluids.LiquidOsmium, 200);
|
||||
}
|
||||
}
|
||||
|
||||
for (ItemStack ore : OreDictionary.getOres("blockOsmium")) {
|
||||
if (ore.isItemEqual(itemstack)) {
|
||||
return new GasStack(MekanismFluids.LiquidOsmium, 1800);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
public boolean isValidGas(Gas gas) {
|
||||
return Recipe.OSMIUM_COMPRESSOR.containsRecipe(gas);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidGas(Gas gas) {
|
||||
return false;
|
||||
public int receiveGas(EnumFacing side, GasStack stack, boolean doTransfer) {
|
||||
if (canReceiveGas(side, stack.getGas())) {
|
||||
return gasTank.receive(stack, doTransfer);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceiveGas(EnumFacing side, Gas type) {
|
||||
return gasTank.canReceive(type) && isValidGas(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTubeConnect(EnumFacing side) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user