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 //Lets improve that using delegates
var block = New<T>(Id.entityID, Id.groupID); var block = New<T>(Id.entityID, Id.groupID);
if (this.InitData.Group != null)
{
block.InitData = this.InitData; block.InitData = this.InitData;
Placed += block.OnPlacedInit; //Reset InitData of new object
}
return block; return block;
} }

View file

@ -248,6 +248,54 @@ namespace GamecraftModdingAPI.Blocks
PlasmaCannonBlock, PlasmaCannonBlock,
QuantumRiflePickup = 300, QuantumRiflePickup = 300,
QuantumRifleAmmoPickup, 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, MagmaRockCube=777,
MagmaRockCubeSliced, MagmaRockCubeSliced,
MagmaRockSlope, MagmaRockSlope,

View file

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