Merge pull request #19 from IronApollo/master

Fix for '//mask ?' resulting in pattern error
Fixes CommandSuggestionEvent 
Update FaweLocalBlockQueue to support Plotsquared restrictions
This commit is contained in:
NotMyFault
2018-11-14 07:41:42 +01:00
committed by GitHub
4 changed files with 28 additions and 18 deletions

View File

@ -6,6 +6,7 @@ import com.sk89q.worldedit.event.platform.CommandSuggestionEvent;
import com.sk89q.worldedit.extension.platform.CommandManager;
import com.sk89q.worldedit.util.command.CommandMapping;
import com.sk89q.worldedit.util.command.Dispatcher;
import org.bukkit.command.CommandSender;
import org.bukkit.event.Listener;
@ -23,11 +24,12 @@ public class ATabCompleteListener implements Listener {
MutableCharSequence mBuffer = MutableCharSequence.getTemporal();
mBuffer.setString(buffer);
mBuffer.setSubstring(0, firstSpace);
String label = buffer.substring(mBuffer.indexOf(':') + 1, firstSpace);
int index;
String label = buffer.substring(index = (mBuffer.indexOf(':') == -1 ? 1 : mBuffer.indexOf(':') + 1), firstSpace);
Dispatcher dispatcher = CommandManager.getInstance().getDispatcher();
CommandMapping weCommand = dispatcher.get(label);
if (weCommand != null) {
CommandSuggestionEvent event = new CommandSuggestionEvent(worldEdit.wrapCommandSender(sender), buffer);
CommandSuggestionEvent event = new CommandSuggestionEvent(worldEdit.wrapCommandSender(sender), buffer.substring(index, buffer.length()));
worldEdit.getWorldEdit().getEventBus().post(event);
List<String> suggestions = event.getSuggestions();
if (suggestions != null) {

View File

@ -278,7 +278,12 @@ public abstract class BukkitQueue_0<CHUNK, CHUNKSECTIONS, SECTION> extends NMSMa
public void sendChunk(int x, int z, int bitMask) {}
@Override
public void refreshChunk(FaweChunk fs) {}
public void refreshChunk(FaweChunk fs) {
World world = getWorld();
if(world != null) {
world.refreshChunk(fs.getX(), fs.getZ());
}
}
@Override
public boolean regenerateChunk(World world, int x, int z, BaseBiome biome, Long seed) {