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

This commit is contained in:
Norbi Peti 2020-09-18 21:19:39 +02:00
parent aae2057972
commit f2ce037564
3 changed files with 55 additions and 1 deletions

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;
}

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,

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);