public override BoundingBox[] GetCustomCollisionBoxes(SubsystemTerrain terrain, int value) { int data = Terrain.ExtractData(value); int face = BottomSuckerBlock.GetFace(data); int subvariant = BottomSuckerBlock.GetSubvariant(data); return(m_collisionBoxes[4 * face + subvariant]); }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { int data = Terrain.ExtractData(value); int face = BottomSuckerBlock.GetFace(data); int subvariant = BottomSuckerBlock.GetSubvariant(data); Color color = m_colors[subvariant]; generator.GenerateMeshVertices(this, x, y, z, m_blockMeshes[4 * face + subvariant], color, null, geometry.SubsetOpaque); base.GenerateTerrainVertices(generator, geometry, value, x, y, z); }
public override void OnNeighborBlockChanged(int x, int y, int z, int neighborX, int neighborY, int neighborZ) { base.OnNeighborBlockChanged(x, y, z, neighborX, neighborY, neighborZ); int face = BottomSuckerBlock.GetFace(Terrain.ExtractData(base.SubsystemTerrain.Terrain.GetCellValue(x, y, z))); Point3 point = CellFace.FaceToPoint3(CellFace.OppositeFace(face)); int cellValue = base.SubsystemTerrain.Terrain.GetCellValue(x + point.X, y + point.Y, z + point.Z); if (!IsSupport(cellValue, face)) { base.SubsystemTerrain.DestroyCell(0, x, y, z, 0, noDrop: false, noParticleSystem: false); } }