using System.Xml.Linq; public class MinEventActionSpawnBlockRebirth : MinEventActionRemoveBuff { private string blockName = ""; private string duration = ""; public override void Execute(MinEventParams _params) { if (!SingletonMonoBehaviour.Instance.IsServer) { return; } Vector3 transformPos = MinEventParams.CachedEventParam.Position; Vector3i blockPos = World.worldToBlockPos(transformPos); Chunk chunk = (Chunk)GameManager.Instance.World.GetChunkFromWorldPos(blockPos); BlockValue blockValue; byte rotationNew = 0; byte blockRotation = 1; if (blockName == "smalltower") { int initialBlockY = 1; int posX = blockPos.x; int posY = blockPos.y; int posZ = blockPos.z; //blockValue = Block.GetBlockValue("FuriousRamsayExplodingBlock:cube", true); blockValue = Block.GetBlockValue("FuriousRamsayExplodingBlock", true); blockValue.Block.blockMaterial = MaterialBlock.fromString("Mbrick"); blockValue.Block.MaxDamage = 1200; blockValue.Block.SetSideTextureId(7); blockValue.Block.Properties.Values["Duration"] = duration; blockValue.rotation = 0; posX = blockPos.x; posY = blockPos.y; posZ = blockPos.z; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("brickShapes:cube", true); blockValue.rotation = 0; posX = blockPos.x; posY = blockPos.y + initialBlockY; posZ = blockPos.z; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("brickShapes:cube", true); blockValue.rotation = 0; posX = blockPos.x; posY = blockPos.y + initialBlockY + 1; posZ = blockPos.z; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("brickShapes:cube", true); blockValue.rotation = 0; posX = blockPos.x; posY = blockPos.y + initialBlockY + 2; posZ = blockPos.z; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("brickShapes:3mTubeCorner", true); blockValue.rotation = 7; posX = blockPos.x; posY = blockPos.y + initialBlockY + 2; posZ = blockPos.z - 1; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("brickShapes:3mTubeCorner", true); blockValue.rotation = 5; posX = blockPos.x; posY = blockPos.y + initialBlockY + 2; posZ = blockPos.z + 1; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("woodShapes:ladderSquare", true); blockValue.rotation = 3; posX = blockPos.x - 1; posY = blockPos.y + initialBlockY + 1; posZ = blockPos.z; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("woodShapes:ladderSquare", true); blockValue.rotation = 1; posX = blockPos.x + 1; posY = blockPos.y + initialBlockY + 1; posZ = blockPos.z; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("woodShapes:ladderSquare", true); blockValue.rotation = 3; posX = blockPos.x - 1; posY = blockPos.y + initialBlockY + 2; posZ = blockPos.z; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("woodShapes:ladderSquare", true); blockValue.rotation = 1; posX = blockPos.x + 1; posY = blockPos.y + initialBlockY + 2; posZ = blockPos.z; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("woodShapes:catwalkV1", true); blockValue.rotation = 0; posX = blockPos.x; posY = blockPos.y + initialBlockY + 3; posZ = blockPos.z; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("woodShapes:catwalkV1RailSingle", true); blockValue.rotation = 2; posX = blockPos.x; posY = blockPos.y + initialBlockY + 3; posZ = blockPos.z - 1; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("woodShapes:catwalkV1RailSingle", true); blockValue.rotation = 0; posX = blockPos.x; posY = blockPos.y + initialBlockY + 3; posZ = blockPos.z + 1; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("woodShapes:catwalkV1Corner", true); blockValue.rotation = 0; posX = blockPos.x + 1; posY = blockPos.y + initialBlockY + 3; posZ = blockPos.z + 1; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("woodShapes:catwalkV1Corner", true); blockValue.rotation = 1; posX = blockPos.x + 1; posY = blockPos.y + initialBlockY + 3; posZ = blockPos.z - 1; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("woodShapes:catwalkV1Corner", true); blockValue.rotation = 2; posX = blockPos.x - 1; posY = blockPos.y + initialBlockY + 3; posZ = blockPos.z - 1; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("woodShapes:catwalkV1Corner", true); blockValue.rotation = 3; posX = blockPos.x - 1; posY = blockPos.y + initialBlockY + 3; posZ = blockPos.z + 1; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); DynamicMeshManager.ChunkChanged(blockPos, -1, blockValue.type); } else if (blockName == "smalltowerconcrete") { int initialBlockY = 1; int posX = blockPos.x; int posY = blockPos.y; int posZ = blockPos.z; blockValue = Block.GetBlockValue("FuriousRamsayExplodingBlock", true); blockValue.Block.Properties.Values["Duration"] = duration; blockValue.rotation = 0; blockValue.Block.blockMaterial = MaterialBlock.fromString("Mconcrete_shapes"); blockValue.Block.MaxDamage = 5000; blockValue.Block.SetSideTextureId(8); posX = blockPos.x; posY = blockPos.y; posZ = blockPos.z; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("concreteShapes:cube", true); blockValue.rotation = 0; posX = blockPos.x; posY = blockPos.y + initialBlockY; posZ = blockPos.z; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("concreteShapes:cube", true); blockValue.rotation = 0; posX = blockPos.x; posY = blockPos.y + initialBlockY + 1; posZ = blockPos.z; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("concreteShapes:cube", true); blockValue.rotation = 0; posX = blockPos.x; posY = blockPos.y + initialBlockY + 2; posZ = blockPos.z; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("concreteShapes:3mTubeCorner", true); blockValue.rotation = 7; posX = blockPos.x; posY = blockPos.y + initialBlockY + 2; posZ = blockPos.z - 1; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("concreteShapes:3mTubeCorner", true); blockValue.rotation = 5; posX = blockPos.x; posY = blockPos.y + initialBlockY + 2; posZ = blockPos.z + 1; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("woodShapes:ladderSquare", true); blockValue.rotation = 3; posX = blockPos.x - 1; posY = blockPos.y + initialBlockY + 1; posZ = blockPos.z; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("woodShapes:ladderSquare", true); blockValue.rotation = 1; posX = blockPos.x + 1; posY = blockPos.y + initialBlockY + 1; posZ = blockPos.z; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("woodShapes:ladderSquare", true); blockValue.rotation = 3; posX = blockPos.x - 1; posY = blockPos.y + initialBlockY + 2; posZ = blockPos.z; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("woodShapes:ladderSquare", true); blockValue.rotation = 1; posX = blockPos.x + 1; posY = blockPos.y + initialBlockY + 2; posZ = blockPos.z; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("woodShapes:catwalkV1", true); blockValue.rotation = 0; posX = blockPos.x; posY = blockPos.y + initialBlockY + 3; posZ = blockPos.z; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("woodShapes:catwalkV1RailSingle", true); blockValue.rotation = 2; posX = blockPos.x; posY = blockPos.y + initialBlockY + 3; posZ = blockPos.z - 1; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("woodShapes:catwalkV1RailSingle", true); blockValue.rotation = 0; posX = blockPos.x; posY = blockPos.y + initialBlockY + 3; posZ = blockPos.z + 1; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("woodShapes:catwalkV1Corner", true); blockValue.rotation = 0; posX = blockPos.x + 1; posY = blockPos.y + initialBlockY + 3; posZ = blockPos.z + 1; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("woodShapes:catwalkV1Corner", true); blockValue.rotation = 1; posX = blockPos.x + 1; posY = blockPos.y + initialBlockY + 3; posZ = blockPos.z - 1; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("woodShapes:catwalkV1Corner", true); blockValue.rotation = 2; posX = blockPos.x - 1; posY = blockPos.y + initialBlockY + 3; posZ = blockPos.z - 1; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); blockValue = Block.GetBlockValue("woodShapes:catwalkV1Corner", true); blockValue.rotation = 3; posX = blockPos.x - 1; posY = blockPos.y + initialBlockY + 3; posZ = blockPos.z + 1; rotationNew = blockValue.rotation; RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew); blockValue.rotation = rotationNew; blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags.none, false); GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue); DynamicMeshManager.ChunkChanged(blockPos, -1, blockValue.type); } } public override bool ParseXmlAttribute(XAttribute _attribute) { var flag = base.ParseXmlAttribute(_attribute); if (flag) return true; var name = _attribute.Name; if (name == null) { return flag; } else if (name == "blockname") { blockName = _attribute.Value; return true; } else if (name == "duration") { duration = _attribute.Value; return true; } else { return false; } } }