Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public override BlockActivationCommand[] GetBlockActivationCommands(WorldBase _world, BlockValue _blockValue, int _clrIdx, Vector3i _blockPos, EntityAlive _entityFocusing)
- {
- bool flag = false;
- ChunkCluster chunkCluster = _world.ChunkClusters[_clrIdx];
- if (chunkCluster != null)
- {
- IChunk chunkSync = chunkCluster.GetChunkSync(World.toChunkXZ(_blockPos.x), World.toChunkY(_blockPos.y), World.toChunkXZ(_blockPos.z));
- if (chunkSync != null)
- {
- BlockEntityData blockEntity = chunkSync.GetBlockEntity(_blockPos);
- if (blockEntity != null && blockEntity.bHasTransform)
- {
- Transform transform = blockEntity.transform.Find("MainLight");
- if (transform != null)
- {
- LightLOD component = transform.GetComponent<LightLOD>();
- if (component != null && component.GetLight() != null)
- {
- flag = true;
- }
- }
- }
- }
- }
- _world.IsMyLandProtectedBlock(_blockPos, _world.GetGameManager().GetPersistentLocalPlayer(), false);
- this.cmds[0].enabled = (_world.IsEditor() || this.bRuntimeSwitch);
- this.cmds[1].enabled = (_world.IsEditor() && flag);
- return this.cmds;
- }
Advertisement
Add Comment
Please, Sign In to add comment