feat: rename /option -> /builder

This commit is contained in:
ForestOfLight
2026-05-24 21:36:32 -07:00
Unverified
parent 1919ba7f16
commit 374022a527
3 changed files with 17 additions and 17 deletions
@@ -0,0 +1,38 @@
import { CommandPermissionLevel, CustomCommandParamType, CustomCommandStatus, system } from '@minecraft/server';
import { Command } from '../classes/Commands/Command';
import { PlayerCommandOrigin } from '../classes/Commands/PlayerCommandOrigin';
import { BuilderOptions } from '../classes/Builder/BuilderOptions';
export class BuilderCommand extends Command {
constructor() {
super({
name: 'builder',
description: 'construct.commands.builder',
allowedSources: [PlayerCommandOrigin],
mandatoryParameters: [
{ name: 'builderOption', type: CustomCommandParamType.Enum },
{ name: 'state', type: CustomCommandParamType.Boolean }
],
enums: [
{ name: 'builderOption', values: ['easyPlace', 'fastEasyPlace', 'materialGrabber'] }
],
permissionLevel: CommandPermissionLevel.Any,
callback: (source, builderOption, state) => this.run(source, builderOption, state)
});
}
run(source, builderOption, state) {
if (!BuilderOptions.get(builderOption)) {
source.sendMessage({ translate: 'construct.commands.builder.unknownOption', with: [builderOption] });
return void 0;
}
system.run(() => {
const player = source.getSource();
BuilderOptions.setValue(builderOption, player.id, state);
source.sendMessage({ translate: 'construct.commands.builder.success', with: [builderOption, String(state)] });
});
return { status: CustomCommandStatus.Success };
}
}
export const builderCommand = new BuilderCommand();