+ fixed tellrawJson

This commit is contained in:
坏黑 2019-05-30 21:12:21 +08:00
parent a6b4246bd3
commit 4b1cbd6349
2 changed files with 7 additions and 3 deletions

View File

@ -17,6 +17,7 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* @Author sky * @Author sky
@ -166,8 +167,9 @@ public class TellrawJson {
} }
public BaseComponent[] getComponentsAll() { public BaseComponent[] getComponentsAll() {
List<BaseComponent> components = this.components.stream().filter(component -> !(component instanceof TextComponent) || !((TextComponent) component).getText().isEmpty()).collect(Collectors.toList());
this.componentsLatest.stream().filter(component -> !(component instanceof TextComponent) || !((TextComponent) component).getText().isEmpty()).forEach(components::add); this.componentsLatest.stream().filter(component -> !(component instanceof TextComponent) || !((TextComponent) component).getText().isEmpty()).forEach(components::add);
return this.components.stream().filter(component -> !(component instanceof TextComponent) || !((TextComponent) component).getText().isEmpty()).toArray(BaseComponent[]::new); return components.toArray(new BaseComponent[0]);
} }
@Deprecated @Deprecated

View File

@ -55,8 +55,10 @@ public class ListenerPlayerCommand implements Listener {
if (TabooLib.getVerint() > 10700) { if (TabooLib.getVerint() > 10700) {
e.setCancelled(true); e.setCancelled(true);
} }
Bukkit.getScheduler().runTask(Main.getInst(), DataUtils::saveAllCaches); Bukkit.getScheduler().runTask(Main.getInst(), () -> {
Bukkit.getScheduler().runTask(Main.getInst(), () -> PlayerDataManager.saveAllCaches(true, false)); DataUtils.saveAllCaches();
PlayerDataManager.saveAllCaches(true, false);
});
TLogger.getGlobalLogger().info("Successfully."); TLogger.getGlobalLogger().info("Successfully.");
} else if (e.getCommand().equalsIgnoreCase("tDebug")) { } else if (e.getCommand().equalsIgnoreCase("tDebug")) {
if (TabooLib.getVerint() > 10700) { if (TabooLib.getVerint() > 10700) {