public override void FromTreeAttributes(ITreeAttribute tree, IWorldAccessor worldForResolving) { base.FromTreeAttributes(tree, worldForResolving); squeezed = tree.GetBool("squeezezd"); state = (EnumCurdsBundleState)tree.GetInt("state"); }
public MeshData GetMesh(EnumCurdsBundleState state) { if (meshes[(int)state] == null) { Shape shape = GetShape(state); ICoreClientAPI capi = api as ICoreClientAPI; MeshData mesh; capi.Tesselator.TesselateShape(this, shape, out mesh); meshes[(int)state] = mesh; } return(meshes[(int)state]); }
public Shape GetShape(EnumCurdsBundleState state) { string path = "shapes/block/food/curdbundle-plain.json"; if (state == EnumCurdsBundleState.BundledStick) { path = "shapes/block/food/curdbundle-stick.json"; } if (state == EnumCurdsBundleState.Opened) { path = "shapes/item/food/dairy/cheese/linen-raw.json"; } if (state == EnumCurdsBundleState.OpenedSalted) { path = "shapes/item/food/dairy/cheese/linen-salted.json"; } return(api.Assets.Get(new AssetLocation(path)).ToObject <Shape>()); }