Add /br raise and /br lower as shortcuts for /br deform.

This commit is contained in:
Albert Pham
2015-10-28 13:50:07 -07:00
parent 98b61d0fbd
commit cba32732a3
4 changed files with 95 additions and 8 deletions

View File

@ -35,7 +35,7 @@ public class LegacyCommandAdapter implements CommandCallable {
private final CommandExecutor<?> executor;
public LegacyCommandAdapter(CommandExecutor<?> executor) {
private LegacyCommandAdapter(CommandExecutor<?> executor) {
this.executor = executor;
}
@ -79,4 +79,9 @@ public class LegacyCommandAdapter implements CommandCallable {
return Lists.newArrayList();
}
}
public static LegacyCommandAdapter adapt(CommandExecutor<?> executor) {
return new LegacyCommandAdapter(executor);
}
}

View File

@ -0,0 +1,69 @@
/*
* WorldEdit, a Minecraft world manipulation toolkit
* Copyright (C) sk89q <http://www.sk89q.com>
* Copyright (C) WorldEdit team and contributors
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.sk89q.worldedit.util.command.composition;
import com.sk89q.minecraft.util.commands.CommandException;
import com.sk89q.minecraft.util.commands.CommandLocals;
import com.sk89q.worldedit.util.command.argument.CommandArgs;
import com.sk89q.worldedit.util.command.argument.MissingArgumentException;
import java.util.Collections;
import java.util.List;
public class ProvidedValue<T> implements CommandExecutor<T> {
private final T value;
private final String description;
private ProvidedValue(T value, String description) {
this.value = value;
this.description = description;
}
@Override
public T call(CommandArgs args, CommandLocals locals) throws CommandException {
return value;
}
@Override
public List<String> getSuggestions(CommandArgs args, CommandLocals locals) throws MissingArgumentException {
return Collections.emptyList();
}
@Override
public String getUsage() {
return "";
}
@Override
public String getDescription() {
return description;
}
@Override
public boolean testPermission(CommandLocals locals) {
return true;
}
public static <T> ProvidedValue<T> create(T value, String description) {
return new ProvidedValue<T>(value, description);
}
}