First Machine Age's Mods (Combined repo.)
Revision | 4cf6a65e323e65253acee704faa2562996d12ac0 (tree) |
---|---|
Zeit | 2020-12-01 16:20:09 |
Autor | melchior <melchior@user...> |
Commiter | melchior |
Updates for V1.14 *WIP*
@@ -40,9 +40,10 @@ namespace AnvilMetalRecovery | ||
40 | 40 | |
41 | 41 | public override void OnSplit(Vec3i voxelPos) |
42 | 42 | { |
43 | - if (!this.IsIronBloom && Voxels[voxelPos.X, voxelPos.Y, voxelPos.Z] == ( byte )EnumVoxelMaterial.Metal) { | |
43 | + | |
44 | + if (this.IsShavable && Voxels[voxelPos.X, voxelPos.Y, voxelPos.Z] == ( byte )EnumVoxelMaterial.Metal) { | |
44 | 45 | #if DEBUG |
45 | - Logger.VerboseDebug("Split some {0} @{1}, Total:{2}", this.BaseMaterial.Collectible.LastCodePart( ), voxelPos, SplitCount); | |
46 | + Logger.VerboseDebug("Split some {0} @{1}, Total:{2}", this.BaseMaterial.Collectible.LastCodePart( ), voxelPos, SplitCount); | |
46 | 47 | #endif |
47 | 48 | SplitCount++; |
48 | 49 | } |
@@ -55,7 +56,7 @@ namespace AnvilMetalRecovery | ||
55 | 56 | { |
56 | 57 | int splitTemp = SplitCount; |
57 | 58 | base.CheckIfFinished(byPlayer); |
58 | - // base.MatchesRecipe( ) -- Private; argh | |
59 | + // base.MatchesRecipe( ) -- Private; still in V1.14.... :\ | |
59 | 60 | /* |
60 | 61 | this.Voxels = new byte[16, 6, 16]; |
61 | 62 | this.workItemStack = null; |
@@ -85,5 +86,30 @@ namespace AnvilMetalRecovery | ||
85 | 86 | } |
86 | 87 | } |
87 | 88 | } |
89 | + | |
90 | + protected bool IsShavable { | |
91 | + get { | |
92 | + //this.SelectedRecipe <-- things that are recoverable? | |
93 | + return this.WorkItemStack?.Collectible?.FirstCodePart( ).Equals("ironbloom") == false; | |
94 | + } | |
95 | + } | |
96 | + | |
97 | + protected IAnvilWorkable AnvilWorkpiece { | |
98 | + get | |
99 | + { | |
100 | + if (this.WorkItemStack != null && this.WorkItemStack.Collectible is IAnvilWorkable) | |
101 | + { return this.WorkItemStack.Collectible as IAnvilWorkable; } | |
102 | + | |
103 | + return null; | |
104 | + } | |
105 | + } | |
106 | + | |
107 | + protected ItemStack BaseMaterial | |
108 | + { | |
109 | + get | |
110 | + { | |
111 | + return AnvilWorkpiece.GetBaseMaterial(this.WorkItemStack);//Right?? | |
112 | + } | |
113 | + } | |
88 | 114 | } |
89 | 115 | } |
\ No newline at end of file |
@@ -5,12 +5,12 @@ | ||
5 | 5 | attributes: { |
6 | 6 | handbook: { |
7 | 7 | excludeByType: { |
8 | - "*-chromium": true, | |
9 | - "*-platinum": true, | |
10 | - "*-titanium": true, | |
11 | - "*-rhodium": true, | |
12 | - "*-stainlessteel": true, | |
13 | - "*-uranium": true | |
8 | + "*-chromium": true, | |
9 | + "*-platinum": true, | |
10 | + "*-titanium": true, | |
11 | + "*-rhodium": true, | |
12 | + "*-stainlessteel": true, | |
13 | + "*-uranium": true | |
14 | 14 | } |
15 | 15 | } |
16 | 16 | }, |
@@ -31,6 +31,9 @@ | ||
31 | 31 | "*-bismuthbronze": 7900, |
32 | 32 | "*-blackbronze": 9000, |
33 | 33 | "*-iron": 7870, |
34 | + "*-meteoriciron": 7800, | |
35 | + "*-steel": 7820, | |
36 | + "*-blistersteel": 7720, | |
34 | 37 | "*-gold": 19300, |
35 | 38 | "*-lead": 11300, |
36 | 39 | "*-tin": 7260, |
@@ -79,6 +82,24 @@ | ||
79 | 82 | smeltedRatio: 20, |
80 | 83 | smeltedStack: { type: "item", code: "game:ingot-iron" } |
81 | 84 | }, |
85 | + "*-meteoriciron": { | |
86 | + meltingPoint: 1476, | |
87 | + meltingDuration: 30, | |
88 | + smeltedRatio: 20, | |
89 | + smeltedStack: { type: "item", code: "game:ingot-meteoriciron" } | |
90 | + }, | |
91 | + "*-steel": { | |
92 | + meltingPoint: 1502, | |
93 | + meltingDuration: 30, | |
94 | + smeltedRatio: 20, | |
95 | + smeltedStack: { type: "item", code: "game:ingot-steel" } | |
96 | + }, | |
97 | + "*-blistersteel": { | |
98 | + meltingPoint: 1602, | |
99 | + meltingDuration: 30, | |
100 | + smeltedRatio: 20, | |
101 | + smeltedStack: { type: "item", code: "game:ingot-blistersteel" } | |
102 | + }, | |
82 | 103 | "*-gold": { |
83 | 104 | meltingPoint: 1063, |
84 | 105 | meltingDuration: 30, |
@@ -4,9 +4,9 @@ | ||
4 | 4 | "description" : "Get back lost scrap and smithing discards.", |
5 | 5 | "authors": ["Melchior"], |
6 | 6 | "ModID":"metalrecovery", |
7 | - "version": "0.1.3", | |
7 | + "version": "0.1.4", | |
8 | 8 | "dependencies": { |
9 | - "game": "1.13.0", | |
9 | + "game": "1.14.0", | |
10 | 10 | "survival": "" |
11 | 11 | }, |
12 | 12 | "website": "http://nowebsite.nope" |
@@ -1,89 +0,0 @@ | ||
1 | -using System; | |
2 | -using System.Text; | |
3 | - | |
4 | -using Vintagestory.API.Common; | |
5 | -using Vintagestory.API.Config; | |
6 | -using Vintagestory.API.Datastructures; | |
7 | - | |
8 | -namespace FirstMachineAge | |
9 | -{ | |
10 | - public class CollapsingBlockEntity : BlockEntity | |
11 | - { | |
12 | - | |
13 | - public override void Initialize(ICoreAPI api) | |
14 | - { | |
15 | - base.Initialize(api); | |
16 | - //origlightHsv = Block.LightHsv; | |
17 | - //lightHsv = ( byte[ ] )Block.LightHsv.Clone( ); | |
18 | - } | |
19 | - | |
20 | - public void UponPlacement(string camo ) | |
21 | - { | |
22 | - this.Camo = camo; | |
23 | - | |
24 | - } | |
25 | - | |
26 | - public string Camo { get; protected set;} | |
27 | - | |
28 | - public override void GetBlockInfo(IPlayer forPlayer, StringBuilder sb) | |
29 | - { | |
30 | - //Mirror whatever tooltip for this material normally? | |
31 | - //sb.AppendLine(Lang.Get("{0} with {1} lining and {2} glass panels", material.UcFirst( ), lining.UcFirst( ), glass)); | |
32 | - } | |
33 | - | |
34 | - public override void FromTreeAtributes(ITreeAttribute tree, IWorldAccessor worldForResolving) | |
35 | - { | |
36 | - base.FromTreeAtributes(tree, worldForResolving); | |
37 | - | |
38 | - this.Camo = tree.GetString(CollapsingBlock.CamoKey, "dirt"); | |
39 | - | |
40 | - if (Api != null && Api.Side == EnumAppSide.Client) | |
41 | - { MarkDirty(true);} | |
42 | - | |
43 | - } | |
44 | - | |
45 | - | |
46 | - public override void ToTreeAttributes(ITreeAttribute tree) | |
47 | - { | |
48 | - base.ToTreeAttributes(tree); | |
49 | - | |
50 | - tree.SetString(CollapsingBlock.CamoKey, this.Camo); | |
51 | - } | |
52 | - | |
53 | - /* | |
54 | - private MeshData getMesh(ITesselatorAPI tesselator) | |
55 | - { | |
56 | - Dictionary<string, MeshData> lanternMeshes = ObjectCacheUtil.GetOrCreate(Api, "blockLanternBlockMeshes", ( ) => new Dictionary<string, MeshData>( )); | |
57 | - | |
58 | - MeshData mesh = null; | |
59 | - BlockLantern block = Api.World.BlockAccessor.GetBlock(Pos) as BlockLantern; | |
60 | - if (block == null) return null; | |
61 | - | |
62 | - string orient = block.LastCodePart( ); | |
63 | - | |
64 | - if (lanternMeshes.TryGetValue(material + "-" + lining + "-" + orient + "-" + glass, out mesh)) { | |
65 | - return mesh; | |
66 | - } | |
67 | - | |
68 | - return lanternMeshes[material + "-" + lining + "-" + orient + "-" + glass] = block.GenMesh(Api as ICoreClientAPI, material, lining, glass, null, tesselator); | |
69 | - } | |
70 | - | |
71 | - public override bool OnTesselation(ITerrainMeshPool mesher, ITesselatorAPI tesselator) | |
72 | - { | |
73 | - MeshData mesh = getMesh(tesselator); | |
74 | - | |
75 | - if (mesh == null) return false; | |
76 | - | |
77 | - string part = Block.LastCodePart( ); | |
78 | - if (part == "up" || part == "down") { | |
79 | - mesh = mesh.Clone( ).Rotate(new Vec3f(0.5f, 0.5f, 0.5f), 0, MeshAngle, 0); | |
80 | - } | |
81 | - | |
82 | - mesher.AddMeshData(mesh); | |
83 | - | |
84 | - return true; | |
85 | - } | |
86 | - */ | |
87 | - } | |
88 | -} | |
89 | - |