@Override
  public void handlePacketData(ByteBuf dataStream) {
    if (!worldObj.isRemote) {
      int type = dataStream.readInt();

      switch (type) {
        case 0:
          if (getReactor() != null) getReactor().setInjectionRate(dataStream.readInt());
          break;
      }

      return;
    }

    super.handlePacketData(dataStream);

    if (worldObj.isRemote) {
      boolean formed = dataStream.readBoolean();

      if (formed) {
        if (getReactor() == null || !((FusionReactor) getReactor()).formed) {
          Mekanism.proxy.doGenericSparkle(
              this,
              new INodeChecker() {
                @Override
                public boolean isNode(TileEntity tile) {
                  return tile instanceof TileEntityReactorBlock;
                }
              });
        }

        if (getReactor() == null) {
          setReactor(new FusionReactor(this));
          MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
        }

        ((FusionReactor) getReactor()).formed = true;
        getReactor().setPlasmaTemp(dataStream.readDouble());
        getReactor().setCaseTemp(dataStream.readDouble());
        getReactor().setInjectionRate(dataStream.readInt());
        getReactor().setBurning(dataStream.readBoolean());
        fuelTank.setGas(new GasStack(GasRegistry.getGas("fusionFuelDT"), dataStream.readInt()));
        deuteriumTank.setGas(new GasStack(GasRegistry.getGas("deuterium"), dataStream.readInt()));
        tritiumTank.setGas(new GasStack(GasRegistry.getGas("tritium"), dataStream.readInt()));
        waterTank.setCapacity(dataStream.readInt());
        waterTank.setFluid(new FluidStack(FluidRegistry.getFluid("water"), dataStream.readInt()));
        steamTank.setCapacity(dataStream.readInt());
        steamTank.setFluid(new FluidStack(FluidRegistry.getFluid("steam"), dataStream.readInt()));
      } else if (getReactor() != null) {
        setReactor(null);
        MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
      }
    }
  }
  @Override
  public void handlePacketData(ByteBuf data) {
    if (FMLCommonHandler.instance().getEffectiveSide().isClient()) {
      int gasID = data.readInt();

      if (gasID < 0) {
        collectedGas.setGas(null);
      } else {
        collectedGas.setGas(new GasStack(gasID, data.readInt()));
      }
    }
  }
  @Override
  public void handlePacketData(ByteBuf dataStream) {
    super.handlePacketData(dataStream);

    isActive = dataStream.readBoolean();
    controlType = RedstoneControl.values()[dataStream.readInt()];
    operatingTicks = dataStream.readInt();

    if (dataStream.readBoolean()) {
      injectTank.setGas(
          new GasStack(GasRegistry.getGas(dataStream.readInt()), dataStream.readInt()));
    } else {
      injectTank.setGas(null);
    }

    if (dataStream.readBoolean()) {
      outputTank.setGas(
          new GasStack(GasRegistry.getGas(dataStream.readInt()), dataStream.readInt()));
    } else {
      outputTank.setGas(null);
    }

    MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
  }