Getting the error "CS1644: Feature `type pattern matching' cannot be used because it is not part of the C# 6.0 language specification" when I load my plugin onto the server. I've narrowed it down to this section of code that causes it. I'm not getting any errors in visual studios, if anyone knows how to fix this error it would be greatly appreciated
[ChatCommand("fill")]
private void fillwater(ConsoleSystem.Arg arg, BasePlayer basePlayer)
{
int num = arg.GetString(0, "").ToLower() == "salt" ? 1 : 0;
ItemDefinition itemDefinition = ItemManager.FindItemDefinition(num != 0 ? "water.salt" : "water");
for (int slot = 0; slot < PlayerBelt.MaxBeltSlots; ++slot)
{
Item itemInSlot = basePlayer.Belt.GetItemInSlot(slot);
if (itemInSlot != null && itemInSlot.GetHeldEntity() is BaseLiquidVessel heldEntity && heldEntity.hasLid)
{
int amount = 999;
ItemModContainer component;
if (heldEntity.GetItem().info.TryGetComponent<ItemModContainer>(out component))
amount = component.maxStackSize;
heldEntity.AddLiquid(itemDefinition, amount);
}
}
}