|
|
@@ -36,16 +36,11 @@ namespace GamecraftModdingAPI |
|
|
|
/// Place a new block at the given position. If scaled, position means the center of the block. The default block size is 0.2 in terms of position. |
|
|
|
/// Place blocks next to each other to connect them. |
|
|
|
/// The placed block will be a complete block with a placement grid and collision which will be saved along with the game. |
|
|
|
/// <para></para> |
|
|
|
/// <para>When placing multiple blocks, do not access properties immediately after creation as this |
|
|
|
/// triggers a sync each time which can affect performance and may cause issues with the game. |
|
|
|
/// You may either use AsyncUtils.WaitForSubmission() after placing all of the blocks |
|
|
|
/// or simply access the block properties which will trigger the synchronization the first time a property is used.</para> |
|
|
|
/// </summary> |
|
|
|
/// <param name="block">The block's type</param> |
|
|
|
/// <param name="color">The block's color</param> |
|
|
|
/// <param name="darkness">The block color's darkness (0-9) - 0 is default color</param> |
|
|
|
/// <param name="position">The block's position in the grid - default block size is 0.2</param> |
|
|
|
/// <param name="position">The block's position - default block size is 0.2</param> |
|
|
|
/// <param name="rotation">The block's rotation in degrees</param> |
|
|
|
/// <param name="uscale">The block's uniform scale - default scale is 1 (with 0.2 width)</param> |
|
|
|
/// <param name="scale">The block's non-uniform scale - 0 means <paramref name="uscale"/> is used</param> |
|
|
@@ -66,7 +61,7 @@ namespace GamecraftModdingAPI |
|
|
|
/// <param name="block">The block's type</param> |
|
|
|
/// <param name="color">The block's color</param> |
|
|
|
/// <param name="darkness">The block color's darkness (0-9) - 0 is default color</param> |
|
|
|
/// <param name="position">The block's position in the grid - default block size is 0.2</param> |
|
|
|
/// <param name="position">The block's position - default block size is 0.2</param> |
|
|
|
/// <param name="rotation">The block's rotation in degrees</param> |
|
|
|
/// <param name="uscale">The block's uniform scale - default scale is 1 (with 0.2 width)</param> |
|
|
|
/// <param name="scale">The block's non-uniform scale - 0 means <paramref name="uscale"/> is used</param> |
|
|
@@ -192,7 +187,7 @@ namespace GamecraftModdingAPI |
|
|
|
type); |
|
|
|
ILGenerator il = dynamic.GetILGenerator(); |
|
|
|
|
|
|
|
il.DeclareLocal(type); |
|
|
|
//il.DeclareLocal(type); |
|
|
|
il.Emit(OpCodes.Ldarg_0); //Load EGID and pass to constructor |
|
|
|
il.Emit(OpCodes.Newobj, ctor); //Call constructor |
|
|
|
//il.Emit(OpCodes.Stloc_0); - doesn't seem like we need these |
|
|
@@ -317,7 +312,7 @@ namespace GamecraftModdingAPI |
|
|
|
color.indexInPalette = (byte) (val.Color + val.Darkness * 10); |
|
|
|
color.overridePaletteColour = false; |
|
|
|
color.needsUpdate = true; |
|
|
|
BlockEngine.SetBlockColorFromPalette(ref color); |
|
|
|
color.paletteColour = BlockEngine.ConvertBlockColor(color.indexInPalette); |
|
|
|
}, value); |
|
|
|
} |
|
|
|
} |
|
|
|