fix: Code gens items. Fixes code genning of ore (#684)

### THIS IS A BREAKING CHANGE IF YOU ARE ALREADY USING CODEGEN. IF YOUR WORLD HAS ERRORS LOADING PLEASE CONTACT ME ON DISCORD. ORE MIGHT FAIL TO LOAD.
 
### Changes
* Fixes Components from addons not marking dirty
* Code gens BaseAddonContainer
* Code gens Ingots
* Fixes code gen deserialization for Ore
* Code gens dyetubs
* Code gens reagents
* Code gens tailor commodities
* Code gens fish
This commit is contained in:
Kamron Batman 2021-08-14 22:16:42 -07:00 committed by GitHub
parent 2de4717390
commit 25fa9b397b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
163 changed files with 1128 additions and 2494 deletions

View file

@ -4,7 +4,7 @@ using Server.Targeting;
namespace Server.Items
{
[Serializable(1, false)]
[Serializable(2, false)]
public abstract partial class BaseOre : Item
{
public BaseOre(CraftResource resource, int amount = 1) : base(RandomSize())
@ -38,21 +38,33 @@ namespace Server.Items
private void Deserialize(IGenericReader reader, int version)
{
var info = reader.ReadInt() switch
switch (version)
{
0 => OreInfo.Iron,
1 => OreInfo.DullCopper,
2 => OreInfo.ShadowIron,
3 => OreInfo.Copper,
4 => OreInfo.Bronze,
5 => OreInfo.Gold,
6 => OreInfo.Agapite,
7 => OreInfo.Verite,
8 => OreInfo.Valorite,
_ => null
};
case 1:
{
_resource = (CraftResource)reader.ReadInt();
break;
}
case 0:
{
var info = reader.ReadInt() switch
{
0 => OreInfo.Iron,
1 => OreInfo.DullCopper,
2 => OreInfo.ShadowIron,
3 => OreInfo.Copper,
4 => OreInfo.Bronze,
5 => OreInfo.Gold,
6 => OreInfo.Agapite,
7 => OreInfo.Verite,
8 => OreInfo.Valorite,
_ => null
};
Resource = CraftResources.GetFromOreInfo(info);
_resource = CraftResources.GetFromOreInfo(info);
break;
}
}
}
private static int RandomSize() =>