20 public SlabBlock(
int coloredTextureSlot,
int fullBlockIndex) {
29 for (
int i = 0; i < 2; i++) {
100 if (color.HasValue) {
142 value2 = paintableBlock.Paint(subsystemTerrain, value2, color);
147 result.Value = value2;
148 result.CellFace = cellFace;
151 bool isTop = raycastResult.CellFace.Face >= 4
152 ? raycastResult.CellFace.Face == 5
153 : raycastResult.
HitPoint().
Y - raycastResult.CellFace.Y > 0.5f;
156 result.CellFace = raycastResult.
CellFace;
169 List<BlockDropValue> dropValues,
170 out
bool showDebris) {
188 if (color.HasValue) {
215 if (color2.HasValue) {
237 return base.GetCategory(value);
259 public static bool GetIsTop(
int data) => (data & 1) != 0;
261 public static int SetIsTop(
int data,
bool isTop) => (data & -2) | (isTop ? 1 : 0);
264 if ((data & 2) != 0) {
265 return (data >> 2) & 0xF;
271 if (color.HasValue) {
272 return (data & -63) | 2 | ((color.Value & 0xF) << 2);
ModelMesh FindMesh(string name, bool throwIfNotFound=true)
ReadOnlyList< ModelMeshPart > MeshParts
virtual void GenerateShadedMeshVertices(Block block, int x, int y, int z, BlockMesh blockMesh, Color color, Matrix? matrix, int[] facesMap, TerrainGeometrySubset subset)
float DestructionDebrisScale
virtual int GetFaceTextureSlot(int face, int value)
static Matrix GetBoneAbsoluteTransform(ModelBone modelBone)
static void DrawMeshBlock(PrimitivesRenderer3D primitivesRenderer, BlockMesh blockMesh, float size, ref Matrix matrix, DrawBlockEnvironmentData environmentData)
static object Get(Type type, string name)
static int SetIsTop(int data, bool isTop)
override IEnumerable< int > GetCreativeValues()
override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z)
override BlockPlacementData GetPlacementValue(SubsystemTerrain subsystemTerrain, ComponentMiner componentMiner, int value, TerrainRaycastResult raycastResult)
方块放置方向
BoundingBox[][] m_collisionBoxes
override bool IsFaceTransparent(SubsystemTerrain subsystemTerrain, int face, int value)
static bool GetIsTop(int data)
override string GetCategory(int value)
BlockMesh m_standaloneUncoloredBlockMesh
override string GetDisplayName(SubsystemTerrain subsystemTerrain, int value)
override void GetDropValues(SubsystemTerrain subsystemTerrain, int oldValue, int newValue, int toolLevel, List< BlockDropValue > dropValues, out bool showDebris)
override void DrawBlock(PrimitivesRenderer3D primitivesRenderer, int value, Color color, float size, ref Matrix matrix, DrawBlockEnvironmentData environmentData)
override BoundingBox[] GetCustomCollisionBoxes(SubsystemTerrain terrain, int value)
BlockMesh[] m_uncoloredBlockMeshes
virtual ? int GetPaintColor(int value)
BlockMesh[] m_coloredBlockMeshes
BlockMesh m_standaloneColoredBlockMesh
static ? int GetColor(int data)
SlabBlock(int coloredTextureSlot, int fullBlockIndex)
override void Initialize()
static int SetColor(int data, int? color)
virtual int Paint(SubsystemTerrain terrain, int value, int? color)
override BlockDebrisParticleSystem CreateDebrisParticleSystem(SubsystemTerrain subsystemTerrain, Vector3 position, int value, float strength)
string GetName(int index)
Color GetColor(int index)
TerrainGeometrySubset SubsetOpaque
static int ExtractContents(int value)
static int MakeBlockValue(int contents)
static int ExtractData(int value)
static Matrix CreateTranslation(float x, float y, float z)
static Point3 FaceToPoint3(int face)
Vector3 HitPoint(float offsetFromSurface=0f)