First Machine Age's Mods (Combined repo.)
修订版 | 80fb75351f90f15dcd53fa93741e05669556f420 (tree) |
---|---|
时间 | 2021-04-04 05:44:45 |
作者 | melchior <melchior@user...> |
Commiter | melchior |
W.I.P.: fixed wall model rotations and bounding...more
@@ -161,7 +161,6 @@ | ||
161 | 161 | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
162 | 162 | </None> |
163 | 163 | <None Include="assets\defensive\blocktypes\metal\brazier.json"> |
164 | - <CopyToOutputDirectory>Always</CopyToOutputDirectory> | |
165 | 164 | </None> |
166 | 165 | <None Include="assets\defensive\shapes\block\stone\brick_w_candle.json"> |
167 | 166 | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
@@ -170,7 +169,6 @@ | ||
170 | 169 | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
171 | 170 | </None> |
172 | 171 | <None Include="assets\defensive\blocktypes\stone\sconse_brick.json"> |
173 | - <CopyToOutputDirectory>Always</CopyToOutputDirectory> | |
174 | 172 | </None> |
175 | 173 | <None Include="assets\defensive\shapes\block\wood\false_floor.json"> |
176 | 174 | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
@@ -62,7 +62,7 @@ namespace FirstMachineAge | ||
62 | 62 | } |
63 | 63 | else |
64 | 64 | { |
65 | - failureCode = @"requirehorizontalattachable"; | |
65 | + failureCode = @"requirehorizontalside"; | |
66 | 66 | } |
67 | 67 | |
68 | 68 | return true; |
@@ -48,9 +48,7 @@ namespace FirstMachineAge | ||
48 | 48 | } |
49 | 49 | |
50 | 50 | if (enough) { |
51 | - localAcc.BlockAccessor.BreakBlock(here.Copy(), null); | |
52 | - //TODO: Sound & Dust | |
53 | - | |
51 | + localAcc.BlockAccessor.BreakBlock(here.Copy(), null); | |
54 | 52 | } |
55 | 53 | |
56 | 54 | } |
@@ -98,7 +96,7 @@ namespace FirstMachineAge | ||
98 | 96 | #endif |
99 | 97 | |
100 | 98 | //Tick Callback; in 200ms... |
101 | - ServerAPI.World.RegisterCallbackUnique(MabeyCollapse, pos.Copy() ,50); | |
99 | + ServerAPI.World.RegisterCallback(MabeyCollapse, pos.Copy() ,50); | |
102 | 100 | } |
103 | 101 | |
104 | 102 | public override void OnEntityInside(IWorldAccessor world, Entity entity, BlockPos pos) |
@@ -111,7 +109,7 @@ namespace FirstMachineAge | ||
111 | 109 | #endif |
112 | 110 | |
113 | 111 | //Tick Callback; in 200ms... |
114 | - ServerAPI.World.RegisterCallbackUnique(MabeyCollapse, pos.Copy( ), 50); | |
112 | + ServerAPI.World.RegisterCallback(MabeyCollapse, pos.Copy( ), 50); | |
115 | 113 | } |
116 | 114 | |
117 | 115 | public override string GetPlacedBlockName(IWorldAccessor world, BlockPos pos) |
@@ -140,29 +138,31 @@ namespace FirstMachineAge | ||
140 | 138 | return false; |
141 | 139 | } |
142 | 140 | |
143 | - public override void OnBlockBroken(IWorldAccessor world, BlockPos pos, IPlayer byPlayer, float dropQuantityMultiplier = 1) | |
141 | + public override void OnBlockRemoved(IWorldAccessor world, BlockPos pos) | |
144 | 142 | { |
145 | 143 | if (api.Side.IsClient( )) { |
144 | + var capi = api as ICoreClientAPI; | |
146 | 145 | //Bits of broken block |
147 | 146 | |
148 | - var particleProps = new SimpleParticleProperties(1, 3, this.GetRandomColor(api as ICoreClientAPI, pos.Copy( ), BlockFacing.UP), new Vec3d( ), new Vec3d( ), new Vec3f(-0.25f, -0.25f, -0.25f), new Vec3f(0.25f, 0.25f, 0.25f), 1, 1, 0.1f, 0.3f, EnumParticleModel.Quad); | |
149 | - particleProps.AddPos.Set(1.4, 1.4, 1.4); | |
150 | - particleProps.AddQuantity = 20; | |
151 | - particleProps.MinVelocity.Set(-0.25f, 0, -0.25f); | |
152 | - particleProps.AddVelocity.Set(0.5f, 1, 0.5f); | |
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 | + | |
149 | + particleProps.MinQuantity = 9; | |
150 | + particleProps.MinVelocity.Set(-0.05f, 0, -0.05f); | |
151 | + particleProps.AddVelocity.Set(0.5f, 0, 0.5f); | |
153 | 152 | particleProps.WithTerrainCollision = true; |
154 | 153 | particleProps.ParticleModel = EnumParticleModel.Cube; |
155 | - particleProps.LifeLength = 1.5f; | |
156 | - particleProps.SizeEvolve = EvolvingNatFloat.create(EnumTransformFunction.QUADRATIC, -0.5f); | |
154 | + particleProps.LifeLength = 1.5f; | |
157 | 155 | particleProps.GravityEffect = 2.5f; |
158 | - particleProps.MinSize = 0.5f; | |
159 | - particleProps.MaxSize = 1.5f; | |
156 | + particleProps.MinSize = 0.75f; | |
157 | + particleProps.MaxSize = 1.0f; | |
158 | + particleProps.WithTerrainCollision = true; | |
159 | + | |
160 | + capi.World.SpawnParticles(particleProps); | |
161 | + //TODO: Sound | |
160 | 162 | |
161 | - byPlayer.Entity.World.SpawnParticles(particleProps, byPlayer); | |
162 | - | |
163 | 163 | } |
164 | 164 | |
165 | - base.OnBlockBroken(world, pos, byPlayer, dropQuantityMultiplier); | |
165 | + base.OnBlockRemoved(world, pos); | |
166 | 166 | } |
167 | 167 | |
168 | 168 | #endregion |
@@ -1,9 +1,9 @@ | ||
1 | 1 | { |
2 | 2 | code: "enclosed_candle", |
3 | 3 | storageFlags: 1, |
4 | - behaviors: [{name: "HorizontalOrientable"}], | |
4 | + behaviors: [{name: "HorizontalAttachable", properties: { dropBlockFace: "north" }}], | |
5 | 5 | variantgroups: [ |
6 | - { code:"wall", loadFromProperties: "abstract/horizontalorientation" } | |
6 | + { code:"side", loadFromProperties: "abstract/horizontalorientation" } | |
7 | 7 | ], |
8 | 8 | collisionbox: null, |
9 | 9 | renderpass: "OpaqueNoCull", |
@@ -26,24 +26,24 @@ | ||
26 | 26 | shapeinventory: { base: "block/stone/false_wall_inv" }, |
27 | 27 | shapebytype: { |
28 | 28 | "*-north-down-closed-*": { base: "block/stone/false_wall_lower", rotateY: 0 }, |
29 | - "*-north-up-closed-*": { base: "block/stone/false_wall_upper", rotateY: 0 }, | |
30 | - "*-north-down-opened-*": { base: "block/stone/false_wall_lower" , rotateY: -90, offsetX: -0.80 }, | |
31 | - "*-north-up-opened-*": { base: "block/stone/false_wall_upper", rotateY: -90, offsetX: -0.80 }, | |
29 | + "*-north-up-closed-*": { base: "block/stone/false_wall_upper", rotateY: 0 }, | |
30 | + "*-north-down-opened-*": { base: "block/stone/false_wall_lower" ,rotateY: -90, offsetX: -0.80 }, | |
31 | + "*-north-up-opened-*": { base: "block/stone/false_wall_upper", rotateY: -90, offsetX: -0.80 }, | |
32 | 32 | |
33 | - "*-east-down-closed-*": { base:"block/stone/false_wall_lower", rotateY: 90 }, | |
34 | - "*-east-up-closed-*": { base: "block/stone/false_wall_upper", rotateY: 90 }, | |
35 | - "*-east-down-opened-*": { base: "block/stone/false_wall_lower", rotateY: 180, offsetX: -0.20 }, | |
36 | - "*-east-up-opened-*": { base: "block/stone/false_wall_upper", rotateY: 180, offsetX: -0.20 }, | |
33 | + "*-east-down-closed-*": { base:"block/stone/false_wall_lower", rotateY: 90 }, | |
34 | + "*-east-up-closed-*": { base: "block/stone/false_wall_upper", rotateY: 90 }, | |
35 | + "*-east-down-opened-*": { base: "block/stone/false_wall_lower", rotateY: 0, offsetZ: 0.80 }, | |
36 | + "*-east-up-opened-*": { base: "block/stone/false_wall_upper", rotateY: 0, offsetZ: 0.80 }, | |
37 | 37 | |
38 | 38 | "*-south-down-closed-*": { base: "block/stone/false_wall_lower", rotateY: 180 }, |
39 | - "*-south-up-closed-*": { base: "block/stone/false_wall_upper", rotateY:180 }, | |
40 | - "*-south-down-opened-*": { base: "block/stone/false_wall_lower", rotateY: 270, offsetX: -0.80 }, | |
41 | - "*-south-up-opened-*": { base: "block/stone/false_wall_upper", rotateY: 270, offsetX: -0.80 }, | |
39 | + "*-south-up-closed-*": { base: "block/stone/false_wall_upper", rotateY:180 }, | |
40 | + "*-south-down-opened-*": { base: "block/stone/false_wall_lower", rotateY: 90, offsetX: 0.80 }, | |
41 | + "*-south-up-opened-*": { base: "block/stone/false_wall_upper", rotateY: 90, offsetX: 0.80 }, | |
42 | 42 | |
43 | - "*-west-down-closed-*": { base: "block/stone/false_wall_lower", rotateY: 270 }, | |
44 | - "*-west-up-closed-*": { base: "block/stone/false_wall_upper", rotateY: 270 }, | |
45 | - "*-west-down-opened-*": { base: "block/stone/false_wall_lower", rotateY: 0, offsetX: -0.20 }, | |
46 | - "*-west-up-opened-*": { base: "block/stone/false_wall_upper", rotateY: 0, offsetX: -0.20 }, | |
43 | + "*-west-down-closed-*": { base: "block/stone/false_wall_lower", rotateY: 270 }, | |
44 | + "*-west-up-closed-*": { base: "block/stone/false_wall_upper", rotateY: 270 }, | |
45 | + "*-west-down-opened-*": { base: "block/stone/false_wall_lower", rotateY: 180, offsetZ: -0.80 }, | |
46 | + "*-west-up-opened-*": { base: "block/stone/false_wall_upper", rotateY: 180, offsetZ: -0.80 }, | |
47 | 47 | }, |
48 | 48 | blockmaterial: "Stone", |
49 | 49 | replaceable: 500, |
@@ -107,14 +107,14 @@ | ||
107 | 107 | }, |
108 | 108 | collisionbox: { x1: 0, y1: 0, z1: 0, x2: 1, y2: 1, z2: 0.25, |
109 | 109 | rotateYByType: { |
110 | - "*-north-*-opened-*": 90, | |
111 | - "*-north-*-closed-*": 0, | |
112 | - "*-west-*-opened-*": -180, | |
113 | - "*-west-*-closed-*": -90, | |
114 | - "*-east-*-opened-*": 180, | |
115 | - "*-east-*-closed-*": 90, | |
116 | - "*-south-*-opened-*": -90, | |
117 | - "*-south-*-closed-*": 90, | |
110 | + "*-north-*-opened-*": 90, | |
111 | + "*-south-*-opened-*": 270, | |
112 | + "*-east-*-opened-*": 180, | |
113 | + "*-west-*-opened-*": 0, | |
114 | + "*-north-*-closed-*": 0, | |
115 | + "*-south-*-closed-*": 180, | |
116 | + "*-east-*-closed-*": 90, | |
117 | + "*-west-*-closed-*": -90, | |
118 | 118 | } |
119 | 119 | }, |
120 | 120 | sounds: { |
@@ -12,4 +12,5 @@ | ||
12 | 12 | "defensive:bolted_shut": "<font color='red'>Bolted Shut!</font>", |
13 | 13 | "defensive:bolted_open": "Its Open.", |
14 | 14 | "defensive:block-enclosed_candle-*":"Enclosed candle holder", |
15 | + "defensive:placefailure-requirehorizontalside": "Cannot place block here! It needs one solid sided block adjacent.", | |
15 | 16 | } |
\ No newline at end of file |
@@ -11,6 +11,6 @@ | ||
11 | 11 | "_#___#___#_", |
12 | 12 | "_#___#___#_", |
13 | 13 | ]], |
14 | - name: "Lattice Iron Grille", | |
14 | + name: "Lattice Iron Grille H", | |
15 | 15 | output: { type: "block", code: "defensive:grille_horizontal-north", stacksize: 3 } |
16 | 16 | } |
\ No newline at end of file |
@@ -11,6 +11,6 @@ | ||
11 | 11 | "_#_______#_", |
12 | 12 | "_#_______#_", |
13 | 13 | ]], |
14 | - name: "Lattice Iron Grille", | |
15 | - output: { type: "block", code: "defensive:grille_vertical-north", stacksize: 3 } | |
14 | + name: "Lattice Iron Grille V", | |
15 | + output: { type: "block", code: "defensive:grille_vertical-down", stacksize: 3 } | |
16 | 16 | } |
\ No newline at end of file |