Extension on /copy
Extension on /copy
So, it's a pretty straight forward command. Basically, you could have a /r command on your copyslot. It'd be like the standard /r command we have now, but it'd be for your copy slots, it replaces the blocks on your current copyslot. /copyr or something maybe? I see myself being able to use this command all the time. Just a suggestion.
AtraxXx_Beer: um pav where should i set my entrance?
Pavoneo: My mouth
Pavoneo: Oh, too awkward?
Pavoneo: Ok.
Pavoneo: My mouth
Pavoneo: Oh, too awkward?
Pavoneo: Ok.
Re: Extension on /copy
Not necessary for people with super powers.
Show
- boblol0909
- SupOP
- Offline
- Posts: 314
- Joined: June 24th, 2011, 10:27 pm
Re: Extension on /copy
If anyone wants to mod theirs, here's a basic one:
Code: Select all
CommandManager.RegisterCommand(CdReplaceSlot);
static readonly CommandDescriptor CdReplaceSlot = new CommandDescriptor {
Name = "ReplaceSlot",
Aliases = new[] { "rs" },
Category = CommandCategory.Building,
Permissions = new[] { Permission.CopyAndPaste },
Usage = "/ReplaceSlot Block1 Block2",
Help = "Replaces all of block1 with block2 in the current copyslot.",
Handler = ReplaceSlotHandler
};
static void ReplaceSlotHandler(Player player, Command cmd) {
Block block1, block2;
block1 = cmd.NextBlock(player);
block2 = cmd.NextBlock(player);
if (block1 == Block.Undefined || block2 == Block.Undefined) {
return;
}
CopyState temp = player.GetCopyInformation();
if (temp == null) {
player.Message("The current copyslot is empty.");
return;
}
for (int x = 0; x < temp.Dimensions.X; x++) {
for (int y = 0; y < temp.Dimensions.Y; y++) {
for (int z = 0; z < temp.Dimensions.Z; z++) {
if (temp.Buffer[x, y, z] == block1)
temp.Buffer[x, y, z] = block2;
}
}
}
player.SetCopyInformation(temp);
player.Message(String.Format("All of block {0} replaced with {1} in copyslot {2}.", block1, block2, player.CopySlot+1));
}
Re: Extension on /copy
Yeah, I know I could do that, but what if you're in a situation where you have current blocks down, and you want to /pastenot air over it/near it any when /r'ing it, there's a bunch of blocks you wouldn't like to be /r'd and it'd just become troublesome. I know you could also paste next to it and /replace the blocks and recopy it then paste it. But that could be time consuming and if it's a large copy, it may not fit on the entire map. This is somewhat of a luxury command.BobKare wrote:Not necessary for people with super powers.Show
AtraxXx_Beer: um pav where should i set my entrance?
Pavoneo: My mouth
Pavoneo: Oh, too awkward?
Pavoneo: Ok.
Pavoneo: My mouth
Pavoneo: Oh, too awkward?
Pavoneo: Ok.
Re: Extension on /copy
Wait... Just took a look at your username...
I know who you are! xD
I know who you are! xD