Fix block type check on placement

This commit is contained in:
Norbi Peti 2021-05-10 01:38:15 +02:00
parent aea3ef3623
commit 78ee3b3bcd
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56

View file

@ -49,8 +49,7 @@ namespace TechbloxModdingAPI.Blocks
{ {
if (_blockEntityFactory == null) if (_blockEntityFactory == null)
throw new BlockException("The factory is null."); throw new BlockException("The factory is null.");
uint resourceId = (uint) PrefabsID.GenerateResourceID(0, block); if(!FullGameFields._dataDb.ContainsKey<CubeListData>(block))
if (!PrefabsID.PrefabIDByResourceIDMap.ContainsKey(resourceId))
throw new BlockException("Block with ID " + block + " not found!"); throw new BlockException("Block with ID " + block + " not found!");
//RobocraftX.CR.MachineEditing.PlaceSingleBlockEngine //RobocraftX.CR.MachineEditing.PlaceSingleBlockEngine
DBEntityStruct dbEntity = new DBEntityStruct {DBID = block}; DBEntityStruct dbEntity = new DBEntityStruct {DBID = block};