First Machine Age's Mods (Combined repo.)
Révision | 02a4d1e659ec67f0c5308a65e2a24bc38a629e5a (tree) |
---|---|
l'heure | 2021-08-04 08:38:28 |
Auteur | melchior <melchior@user...> |
Commiter | melchior |
Defensive Stuff VS compat update
V.S. 1.15 update for 'Defensive Stuff'
@@ -7,7 +7,7 @@ | ||
7 | 7 | <OutputType>Library</OutputType> |
8 | 8 | <RootNamespace>FirstMachineAge</RootNamespace> |
9 | 9 | <AssemblyName>Assorted</AssemblyName> |
10 | - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> | |
10 | + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> | |
11 | 11 | </PropertyGroup> |
12 | 12 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
13 | 13 | <DebugSymbols>true</DebugSymbols> |
@@ -7,6 +7,7 @@ using System.Threading.Tasks; | ||
7 | 7 | using Vintagestory.API; |
8 | 8 | using Vintagestory.API.Common; |
9 | 9 | using Vintagestory.API.Config; |
10 | +using Vintagestory.API.Datastructures; | |
10 | 11 | using Vintagestory.API.MathTools; |
11 | 12 | using Vintagestory.API.Server; |
12 | 13 | using Vintagestory.GameContent; |
@@ -5,12 +5,14 @@ using System.Linq; | ||
5 | 5 | |
6 | 6 | using Vintagestory.API; |
7 | 7 | using Vintagestory.API.Common; |
8 | +using Vintagestory.API.Datastructures; | |
8 | 9 | using Vintagestory.API.MathTools; |
9 | 10 | |
10 | 11 | namespace FirstMachineAge |
11 | 12 | { |
12 | 13 | public class BlockBehaviorNeedSides : BlockBehavior |
13 | 14 | { |
15 | + private const string _applicableMatKey = @"applicableMaterials"; | |
14 | 16 | public EnumBlockMaterial[ ] ApplicableMaterials { get; private set; } |
15 | 17 | |
16 | 18 | public BlockBehaviorNeedSides(Block block) : base(block) |
@@ -47,7 +49,7 @@ namespace FirstMachineAge | ||
47 | 49 | { |
48 | 50 | base.Initialize(properties); |
49 | 51 | |
50 | - this.ApplicableMaterials = properties[@"applicableMaterials"].FromEnumStrings<EnumBlockMaterial>(); | |
52 | + this.ApplicableMaterials = properties[_applicableMatKey].FromEnumStrings<EnumBlockMaterial>(); | |
51 | 53 | |
52 | 54 | } |
53 | 55 |
@@ -142,23 +142,30 @@ namespace FirstMachineAge | ||
142 | 142 | { |
143 | 143 | if (api.Side.IsClient( )) { |
144 | 144 | var capi = api as ICoreClientAPI; |
145 | + | |
146 | + //int color = capi.BlockTextureAtlas.GetRandomColor(this.TextureSubIdForBlockColor); | |
147 | + | |
145 | 148 | //Bits of broken block |
149 | + var particleProps = new SimpleParticleProperties | |
150 | + (7, 12, | |
151 | + 0x808080, | |
152 | + pos.ToVec3d().Add(0.1, 0.75, 0.1), | |
153 | + pos.ToVec3d().Add(0.7, 0.0, 0.7), | |
154 | + Vec3f.Zero, | |
155 | + Vec3f.Zero, | |
156 | + 5, //life length | |
157 | + 0.8f, //gravity effect | |
158 | + 0.25f, 0.7f, //min size, max size | |
159 | + EnumParticleModel.Cube); // quad or cube | |
146 | 160 | |
147 | - var particleProps = new SimpleParticleProperties(9, 12, this.GetRandomColor(api as ICoreClientAPI, pos.Copy( ), BlockFacing.UP), pos.ToVec3d( ),pos.ToVec3d( ), Vec3f.Zero, Vec3f.Zero); | |
148 | 161 | |
149 | - particleProps.MinQuantity = 9; | |
150 | - particleProps.MinVelocity.Set(-0.05f, 0, -0.05f); | |
151 | - particleProps.AddVelocity.Set(0.5f, 0, 0.5f); | |
152 | - particleProps.WithTerrainCollision = true; | |
153 | - particleProps.ParticleModel = EnumParticleModel.Cube; | |
154 | - particleProps.LifeLength = 1.5f; | |
155 | - particleProps.GravityEffect = 2.5f; | |
156 | - particleProps.MinSize = 0.75f; | |
157 | - particleProps.MaxSize = 1.0f; | |
162 | + particleProps.ShouldSwimOnLiquid = true; | |
158 | 163 | particleProps.WithTerrainCollision = true; |
164 | + particleProps.WindAffected = false; | |
165 | + | |
159 | 166 | |
160 | 167 | capi.World.SpawnParticles(particleProps); |
161 | - //TODO: Sound | |
168 | + //TODO: Sound ? | |
162 | 169 | |
163 | 170 | } |
164 | 171 |
@@ -5,6 +5,7 @@ using EnumsNET; | ||
5 | 5 | using Newtonsoft.Json.Linq; |
6 | 6 | |
7 | 7 | using Vintagestory.API; |
8 | +using Vintagestory.API.Datastructures; | |
8 | 9 | using Vintagestory.API.MathTools; |
9 | 10 | |
10 | 11 |
@@ -3,10 +3,10 @@ | ||
3 | 3 | "name": "Defensive Structures", |
4 | 4 | "description" : "Defensive structures and emplacements, ideal for stone castles...", |
5 | 5 | "authors": ["Melchior"], |
6 | - "version": "0.1.4", | |
6 | + "version": "0.1.5", | |
7 | 7 | "ModID":"defensive", |
8 | 8 | "dependencies": { |
9 | - "game": "1.14.0", | |
9 | + "game": "1.15.3", | |
10 | 10 | "survival": "" |
11 | 11 | }, |
12 | 12 | "website": "http://noname.nope" |