Fixed a few bugs with the new system
This commit is contained in:
parent
d4d7e88c4e
commit
4085cb297d
4 changed files with 26 additions and 14 deletions
|
@ -262,10 +262,10 @@ public class ItemConfigurator extends ItemEnergized implements IMekWrench, ITool
|
|||
|
||||
public static enum ConfiguratorMode
|
||||
{
|
||||
CONFIGURATE_ITEMS("configurate", "(" + TransmissionType.ITEM.getName() + ")", EnumColor.BRIGHT_GREEN, true),
|
||||
CONFIGURATE_FLUIDS("configurate", "(" + TransmissionType.FLUID.getName() + ")", EnumColor.BRIGHT_GREEN, true),
|
||||
CONFIGURATE_GASES("configurate", "(" + TransmissionType.GAS.getName() + ")", EnumColor.BRIGHT_GREEN, true),
|
||||
CONFIGURATE_ENERGY("configurate", "(" + TransmissionType.ENERGY.getName() + ")", EnumColor.BRIGHT_GREEN, true),
|
||||
CONFIGURATE_ITEMS("configurate", "(" + TransmissionType.ITEM.localize() + ")", EnumColor.BRIGHT_GREEN, true),
|
||||
CONFIGURATE_FLUIDS("configurate", "(" + TransmissionType.FLUID.localize() + ")", EnumColor.BRIGHT_GREEN, true),
|
||||
CONFIGURATE_GASES("configurate", "(" + TransmissionType.GAS.localize() + ")", EnumColor.BRIGHT_GREEN, true),
|
||||
CONFIGURATE_ENERGY("configurate", "(" + TransmissionType.ENERGY.localize() + ")", EnumColor.BRIGHT_GREEN, true),
|
||||
EMPTY("empty", "", EnumColor.DARK_RED, false),
|
||||
ROTATE("rotate", "", EnumColor.YELLOW, false),
|
||||
WRENCH("wrench", "", EnumColor.PINK, false);
|
||||
|
@ -285,7 +285,7 @@ public class ItemConfigurator extends ItemEnergized implements IMekWrench, ITool
|
|||
|
||||
public String getName()
|
||||
{
|
||||
return MekanismUtils.localize("tooltip.configurator." + name) + info;
|
||||
return MekanismUtils.localize("tooltip.configurator." + name) + " " + info;
|
||||
}
|
||||
|
||||
public EnumColor getColor()
|
||||
|
|
|
@ -162,6 +162,7 @@ public class PacketConfigurationUpdate implements IMessageHandler<ConfigurationU
|
|||
if(packetType == ConfigurationPacket.SIDE_DATA)
|
||||
{
|
||||
dataStream.writeInt(configIndex);
|
||||
dataStream.writeInt(transmission.ordinal());
|
||||
}
|
||||
|
||||
if(packetType == ConfigurationPacket.INPUT_COLOR)
|
||||
|
@ -181,6 +182,7 @@ public class PacketConfigurationUpdate implements IMessageHandler<ConfigurationU
|
|||
{
|
||||
clickType = dataStream.readInt();
|
||||
configIndex = dataStream.readInt();
|
||||
transmission = TransmissionType.values()[dataStream.readInt()];
|
||||
}
|
||||
else if(packetType == ConfigurationPacket.EJECT_COLOR)
|
||||
{
|
||||
|
|
|
@ -4,7 +4,9 @@ import io.netty.buffer.ByteBuf;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import mekanism.api.transmitters.TransmissionType;
|
||||
import mekanism.common.SideData;
|
||||
|
@ -17,8 +19,8 @@ public class TileComponentConfig implements ITileComponent
|
|||
{
|
||||
public TileEntityContainerBlock tileEntity;
|
||||
|
||||
public List<byte[]> sideConfigs = new ArrayList<byte[]>();
|
||||
public List<ArrayList<SideData>> sideOutputs = new ArrayList<ArrayList<SideData>>();
|
||||
public Map<Integer, byte[]> sideConfigs = new HashMap<Integer, byte[]>();
|
||||
public Map<Integer, ArrayList<SideData>> sideOutputs = new HashMap<Integer, ArrayList<SideData>>();
|
||||
|
||||
public List<TransmissionType> transmissions = new ArrayList<TransmissionType>();
|
||||
|
||||
|
@ -27,21 +29,22 @@ public class TileComponentConfig implements ITileComponent
|
|||
tileEntity = tile;
|
||||
transmissions = Arrays.asList(types);
|
||||
|
||||
//Populate SideData list with empty arrays
|
||||
for(TransmissionType transmission : types)
|
||||
{
|
||||
sideOutputs.put(transmission.ordinal(), new ArrayList<SideData>());
|
||||
}
|
||||
|
||||
tile.components.add(this);
|
||||
}
|
||||
|
||||
public void setConfig(TransmissionType type, byte[] config)
|
||||
{
|
||||
sideConfigs.set(type.ordinal(), config);
|
||||
sideConfigs.put(type.ordinal(), config);
|
||||
}
|
||||
|
||||
public void addOutput(TransmissionType type, SideData data)
|
||||
{
|
||||
if(sideOutputs.get(type.ordinal()) == null)
|
||||
{
|
||||
sideOutputs.set(type.ordinal(), new ArrayList<SideData>());
|
||||
}
|
||||
|
||||
sideOutputs.get(type.ordinal()).add(data);
|
||||
}
|
||||
|
||||
|
@ -80,7 +83,7 @@ public class TileComponentConfig implements ITileComponent
|
|||
{
|
||||
for(TransmissionType type : transmissions)
|
||||
{
|
||||
sideConfigs.set(type.ordinal(), nbtTags.getByteArray("config" + type.ordinal()));
|
||||
sideConfigs.put(type.ordinal(), nbtTags.getByteArray("config" + type.ordinal()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -319,6 +319,13 @@ oregas.silver=Silver Ore
|
|||
oregas.obsidian=Obsidian Ore
|
||||
oregas.lead=Lead Ore
|
||||
|
||||
//Transmission types
|
||||
transmission.Energy=Energy
|
||||
transmission.Fluids=Fluids
|
||||
transmission.Gases=Gases
|
||||
transmission.Items=Items
|
||||
transmission.Heat=Heat
|
||||
|
||||
//Update handler text
|
||||
update.consider=Consider updating to version
|
||||
update.newFeatures=New features
|
||||
|
|
Loading…
Add table
Reference in a new issue