Tools for building games mainly focused on changing block properties.
And noclip.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- using System.Linq;
- using GamecraftModdingAPI;
- using GamecraftModdingAPI.Blocks;
- using GamecraftModdingAPI.Utility;
-
- namespace BlockMod
- {
- public class BlockSelections
- {
- internal Block[] blocks = new Block[0];
- internal Block refBlock;
-
- public bool CheckNoBlocks(Block[] blocks)
- {
- if (blocks.Length == 0)
- {
- Logging.CommandLogWarning("No blocks selected. Use selectBlocks first.");
- return true;
- }
-
- return false;
- }
-
- public Block[] SelectBlocks(byte id)
- {
- var blocks = ObjectIdentifier.GetBySimID(id).SelectMany(block => block.GetConnectedCubes()).ToArray();
- return blocks;
- }
-
- public Block[] SelectBlocks(char id)
- {
- var blocks = ObjectIdentifier.GetByID(id).SelectMany(oid => oid.GetConnectedCubes())
- .ToArray();
- return blocks;
- }
- }
- }
|