use of buildcraft.api.core.InvalidInputDataException in project BuildCraft by BuildCraft.
the class SchematicBlockPipe method computeRequiredItems.
@Nonnull
@Override
public List<ItemStack> computeRequiredItems() {
try {
ImmutableList.Builder<ItemStack> builder = ImmutableList.builder();
PipeDefinition definition = PipeRegistry.INSTANCE.loadDefinition(tileNbt.getCompoundTag("pipe").getString("def"));
EnumDyeColor color = NBTUtilBC.readEnum(tileNbt.getCompoundTag("pipe").getTag("col"), EnumDyeColor.class);
Item item = (Item) PipeApi.pipeRegistry.getItemForPipe(definition);
if (item != null) {
builder.add(new ItemStack(item, 1, color == null ? 0 : color.getMetadata() + 1));
}
return builder.build();
} catch (InvalidInputDataException e) {
throw new RuntimeException(e);
}
}
use of buildcraft.api.core.InvalidInputDataException in project BuildCraft by BuildCraft.
the class StatementTypeParam method readFromBuffer.
@Override
public IStatementParameter readFromBuffer(PacketBufferBC buffer) throws IOException {
if (buffer.readBoolean()) {
String tag = buffer.readString();
IParamReaderBuf reader = StatementManager.paramsBuf.get(tag);
if (reader == null) {
throw new InvalidInputDataException("Unknown paramater type " + tag);
}
return reader.readFromBuf(buffer);
} else {
return null;
}
}
Aggregations