Browse Source

Fix TextBlock.Text=null, most new blocks and others

tags/v2.2.0
NorbiPeti 4 years ago
parent
commit
1e9d1c8f81
3 changed files with 55 additions and 1 deletions
  1. +6
    -1
      GamecraftModdingAPI/Block.cs
  2. +48
    -0
      GamecraftModdingAPI/Blocks/BlockIDs.cs
  3. +1
    -0
      GamecraftModdingAPI/Blocks/TextBlock.cs

+ 6
- 1
GamecraftModdingAPI/Block.cs View File

@@ -439,7 +439,12 @@ namespace GamecraftModdingAPI
//Lets improve that using delegates
var block = New<T>(Id.entityID, Id.groupID);
block.InitData = this.InitData;
if (this.InitData.Group != null)
{
block.InitData = this.InitData;
Placed += block.OnPlacedInit; //Reset InitData of new object
}

return block;
}



+ 48
- 0
GamecraftModdingAPI/Blocks/BlockIDs.cs View File

@@ -248,6 +248,54 @@ namespace GamecraftModdingAPI.Blocks
PlasmaCannonBlock,
QuantumRiflePickup = 300,
QuantumRifleAmmoPickup,
AluminiumSlicedFraction,
AluminiumSlicedSlope,
AluminiumHalfPyramidLeft = 305,
AluminiumHalfPyramidRight,
AluminiumPyramidSliced,
AluminiumTubeCross,
AluminiumTubeT,
AluminiumPlateSquare,
AluminiumPlateCircle,
AluminiumPlateTriangle, //312
OiledSlicedFraction = 314,
OiledSlicedSlope,
OiledHalfPyramidLeft,
OiledHalfPyramidRight,
OiledPyramidSliced,
GlassSlicedFraction,
GlassSlicedSlope,
GlassHalfPyramidLeft,
GlassHalfPyramidRight,
GlassPyramidSliced,
RubberSlicedFraction,
RubberSlicedSlope,
RubberHalfPyramidLeft,
RubberHalfPyramidRight,
RubberPyramidSliced,
WoodSlicedFraction,
WoodSlicedSlope, //330
WoodHalfPyramidLeft,
WoodHalfPyramidRight,
WoodPyramidSliced,
OiledTubeCross = 339,
OiledTubeT,
GlassTubeT,
RubberTubeCross = 343,
RubberTubeT,
WoodTubeCross,
WoodTubeT,
OiledTubeCorner = 353,
GlassTubeCorner,
RubberTubeCorner,
WoodTubeCorner,
IronSlicedFraction = 366,
IronSlicedSlope,
IronHalfPyramidLeft,
IronHalfPyramidRight,
IronPyramidSliced,
IronTubeCross,
IronTubeT,
MagmaRockCube=777,
MagmaRockCubeSliced,
MagmaRockSlope,


+ 1
- 0
GamecraftModdingAPI/Blocks/TextBlock.cs View File

@@ -33,6 +33,7 @@ namespace GamecraftModdingAPI.Blocks
{
BlockEngine.SetBlockInfo(this, (ref TextBlockDataStruct tbds, string val) =>
{
if (val == null) val = "";
tbds.textCurrent.Set(val);
tbds.textStored.Set(val);
}, value);


Loading…
Cancel
Save