Major command changes that don't work yet.

This commit is contained in:
MattBDev
2019-07-05 20:46:48 -04:00
parent ffc2092d93
commit 8108d0a936
399 changed files with 13558 additions and 7985 deletions

View File

@ -28,6 +28,7 @@ import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import javax.annotation.Nullable;
@ -71,10 +72,10 @@ public class EditSessionEvent extends Event implements Cancellable {
/**
* Create a new event.
*
* @param world the world
* @param actor the actor, or null if there is no actor specified
* @param world the world
* @param actor the actor, or null if there is no actor specified
* @param maxBlocks the maximum number of block changes
* @param stage the stage
* @param stage the stage
*/
public EditSessionEvent(@Nullable World world, Actor actor, int maxBlocks, Stage stage) {
this.world = world;
@ -96,9 +97,7 @@ public class EditSessionEvent extends Event implements Cancellable {
*
* @return the actor, which may be null if unavailable
*/
public
@Nullable
Actor getActor() {
public @Nullable Actor getActor() {
return actor;
}
@ -107,9 +106,7 @@ public class EditSessionEvent extends Event implements Cancellable {
*
* @return the world
*/
public
@Nullable
World getWorld() {
public @Nullable World getWorld() {
return world;
}
@ -173,5 +170,4 @@ public class EditSessionEvent extends Event implements Cancellable {
return clone;
}
}

View File

@ -21,7 +21,7 @@ package com.sk89q.worldedit.event.platform;
import com.sk89q.worldedit.event.AbstractCancellable;
import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.extension.platform.CommandManager;
import com.sk89q.worldedit.extension.platform.PlatformCommandManager;
import static com.google.common.base.Preconditions.checkNotNull;
@ -67,6 +67,6 @@ public class CommandEvent extends AbstractCancellable implements Runnable {
@Override
public void run() {
CommandManager.getInstance().handleCommandOnCurrentThread(this);
PlatformCommandManager.getInstance().handleCommandOnCurrentThread(this);
}
}

View File

@ -20,9 +20,9 @@
package com.sk89q.worldedit.event.platform;
import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.worldedit.event.Event;
import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.internal.util.Substring;
import java.util.Collections;
import java.util.List;
@ -34,7 +34,7 @@ public class CommandSuggestionEvent extends Event {
private final Actor actor;
private final String arguments;
private List<String> suggestions = Collections.emptyList();
private List<Substring> suggestions = Collections.emptyList();
/**
* Create a new instance.
@ -71,9 +71,14 @@ public class CommandSuggestionEvent extends Event {
/**
* Get the list of suggestions that are to be presented.
*
* <p>
* Each Substring holds the replacement as the substring,
* and the replacement range as the original substring range.
* </p>
*
* @return the list of suggestions
*/
public List<String> getSuggestions() {
public List<Substring> getSuggestions() {
return suggestions;
}
@ -82,7 +87,7 @@ public class CommandSuggestionEvent extends Event {
*
* @param suggestions the list of suggestions
*/
public void setSuggestions(List<String> suggestions) {
public void setSuggestions(List<Substring> suggestions) {
checkNotNull(suggestions);
this.suggestions = suggestions;
}