public void RemoveParentBlock(WorldBase _world, int _clrIdx, Vector3i _blockPos, BlockValue _blockValue) { ChunkCluster chunkCluster = _world.ChunkClusters[_clrIdx]; if (chunkCluster == null) { return; } Vector3i parentPos = this.multiBlockPos.GetParentPos(_blockPos, _blockValue); BlockValue block = chunkCluster.GetBlock(parentPos); if (!block.ischild && block.type == _blockValue.type) { chunkCluster.SetBlock(parentPos, Block.GetBlockValue("water"), true, true); } }
/*public override void OnBlockPlaceBefore(WorldBase _world, ref BlockPlacement.Result _bpResult, EntityAlive _ea, Random _rnd) * { * base.OnBlockPlaceBefore(_world, ref _bpResult, _ea, _rnd); * }*/ public void RemoveChilds(WorldBase _world, int _clrIdx, Vector3i _blockPos, BlockValue _blockValue) { ChunkCluster chunkCluster = _world.ChunkClusters[_clrIdx]; if (chunkCluster == null) { return; } byte rotation = _blockValue.rotation; for (int i = this.multiBlockPos.Length - 1; i >= 0; i--) { Vector3i other = this.multiBlockPos.Get(i, _blockValue.type, (int)rotation); if ((other.x != 0 || other.y != 0 || other.z != 0) && chunkCluster.GetBlock(_blockPos + other).type == _blockValue.type) { //chunkCluster.SetBlock(_blockPos + other, true, Block.GetBlockValue("water"), true, MarchingCubes.DensityAir, false, false, false); chunkCluster.SetBlock(_blockPos + other, Block.GetBlockValue("water"), false, false); } } }
public void RemoveChilds(WorldBase _world, int _clrIdx, Vector3i _blockPos, BlockValue _blockValue) { DebugMsg("BlockDummyBoat RemoveChilds"); ChunkCluster chunkCluster = _world.ChunkClusters[_clrIdx]; if (chunkCluster == null) { DebugMsg("BlockDummyBoat RemoveChilds: Chunk is NULL"); return; } byte rotation = _blockValue.rotation; for (int i = this.multiBlockPos.Length - 1; i >= 0; i--) { Vector3i other = this.multiBlockPos.Get(i, _blockValue.type, (int)rotation); if ((other.x != 0 || other.y != 0 || other.z != 0) && chunkCluster.GetBlock(_blockPos + other).type == _blockValue.type) { chunkCluster.SetBlock(_blockPos + other, Block.GetBlockValue("water"), false, false); } } }