Overhauled command handling and suggestion support.

This commit is contained in:
sk89q
2014-06-28 16:30:02 -07:00
parent 2258513104
commit 33e1e0b1f1
24 changed files with 536 additions and 224 deletions

View File

@ -19,6 +19,7 @@
package com.sk89q.worldedit.forge;
import com.google.common.base.Joiner;
import com.google.common.io.ByteStreams;
import com.google.common.io.Closer;
import com.sk89q.worldedit.LocalSession;
@ -123,8 +124,10 @@ public class ForgeWorldEdit {
if (((EntityPlayerMP) event.sender).worldObj.isRemote) return;
String[] split = new String[event.parameters.length + 1];
System.arraycopy(event.parameters, 0, split, 1, event.parameters.length);
split[0] = ("/" + event.command.getCommandName());
WorldEdit.getInstance().handleCommand(wrap((EntityPlayerMP) event.sender), split);
split[0] = event.command.getCommandName();
com.sk89q.worldedit.event.platform.CommandEvent weEvent =
new com.sk89q.worldedit.event.platform.CommandEvent(wrap((EntityPlayerMP) event.sender), Joiner.on(" ").join(split));
WorldEdit.getInstance().getEventBus().post(weEvent);
}
}