mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-27 23:33:08 +00:00
Energy Cubes and Gas Tanks now have configurable item inputs and gas/energy outputs, fixed Portable Tank item output
This commit is contained in:
1 parent
0a135a6936
commit
a22b33a629
24 files changed
+287
-118
No files matched your search
@@ -11,7 +11,7 @@ import java.util.Map;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.transmitters.TransmissionType;
|
||||
import mekanism.common.SideData;
|
||||
import mekanism.common.SideData.EnergyState;
|
||||
import mekanism.common.SideData.IOState;
|
||||
import mekanism.common.base.ITileComponent;
|
||||
import mekanism.common.tile.TileEntityContainerBlock;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
@@ -93,22 +93,22 @@ public class TileComponentConfig implements ITileComponent
|
||||
setConfig(type, new byte[] {sideData, sideData, sideData, sideData, sideData, sideData});
|
||||
}
|
||||
|
||||
public void setIOEnergyConfig()
|
||||
public void setIOConfig(TransmissionType type)
|
||||
{
|
||||
addOutput(TransmissionType.ENERGY, new SideData("None", EnumColor.GREY, EnergyState.OFF));
|
||||
addOutput(TransmissionType.ENERGY, new SideData("Input", EnumColor.DARK_GREEN, EnergyState.INPUT));
|
||||
addOutput(TransmissionType.ENERGY, new SideData("Output", EnumColor.DARK_RED, EnergyState.OUTPUT));
|
||||
addOutput(type, new SideData("None", EnumColor.GREY, IOState.OFF));
|
||||
addOutput(type, new SideData("Input", EnumColor.DARK_GREEN, IOState.INPUT));
|
||||
addOutput(type, new SideData("Output", EnumColor.DARK_RED, IOState.OUTPUT));
|
||||
|
||||
setConfig(TransmissionType.ENERGY, new byte[] {1, 1, 2, 1, 1, 1});
|
||||
setConfig(type, new byte[] {1, 1, 2, 1, 1, 1});
|
||||
}
|
||||
|
||||
public void setInputEnergyConfig()
|
||||
public void setInputConfig(TransmissionType type)
|
||||
{
|
||||
addOutput(TransmissionType.ENERGY, new SideData("None", EnumColor.GREY, EnergyState.OFF));
|
||||
addOutput(TransmissionType.ENERGY, new SideData("Input", EnumColor.DARK_GREEN, EnergyState.INPUT));
|
||||
addOutput(type, new SideData("None", EnumColor.GREY, IOState.OFF));
|
||||
addOutput(type, new SideData("Input", EnumColor.DARK_GREEN, IOState.INPUT));
|
||||
|
||||
setConfig(TransmissionType.ENERGY, new byte[] {1, 1, 1, 1, 1, 1});
|
||||
setCanEject(TransmissionType.ENERGY, false);
|
||||
fillConfig(type, 1);
|
||||
setCanEject(type, false);
|
||||
}
|
||||
|
||||
public void setConfig(TransmissionType type, byte[] config)
|
||||
@@ -156,29 +156,10 @@ public class TileComponentConfig implements ITileComponent
|
||||
{
|
||||
for(TransmissionType type : transmissions)
|
||||
{
|
||||
try {//TODO remove soon
|
||||
if(nbtTags.getByteArray("config" + type.ordinal()).length > 0)
|
||||
{
|
||||
sideConfigs.put(type.ordinal(), nbtTags.getByteArray("config" + type.ordinal()));
|
||||
ejecting.put(type.ordinal(), nbtTags.getBoolean("ejecting" + type.ordinal()));
|
||||
}
|
||||
} catch(Exception e) {
|
||||
try {
|
||||
byte[] bytes = new byte[6];
|
||||
|
||||
for(int i = 0; i < 6; i++)
|
||||
{
|
||||
bytes[i] = nbtTags.getByte("config"+i);
|
||||
|
||||
if(bytes[i] > 0)
|
||||
{
|
||||
bytes[i]--;
|
||||
}
|
||||
}
|
||||
|
||||
sideConfigs.put(TransmissionType.ITEM.ordinal(), bytes);
|
||||
ejecting.put(TransmissionType.ITEM.ordinal(), nbtTags.getBoolean("ejecting"));
|
||||
} catch(Exception e1) {}
|
||||
if(nbtTags.getByteArray("config" + type.ordinal()).length > 0)
|
||||
{
|
||||
sideConfigs.put(type.ordinal(), nbtTags.getByteArray("config" + type.ordinal()));
|
||||
ejecting.put(type.ordinal(), nbtTags.getBoolean("ejecting" + type.ordinal()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user