use of com.github.euonmyoji.newhonor.configuration.PlayerData in project NewHonor-SpongePlugin by euOnmyoji.
the class NewHonor method onPlayerDie.
@Listener
public void onPlayerDie(RespawnPlayerEvent event) {
Player p = event.getTargetEntity();
PlayerData pd = new PlayerData(p);
Task.builder().execute(() -> doSomething(pd)).async().name("newhonor - (die) init Player" + p.getName()).submit(this);
MessageChannel newChannel = MessageChannel.combined(p.getMessageChannel(), mMessage);
p.setMessageChannel(newChannel);
}
use of com.github.euonmyoji.newhonor.configuration.PlayerData in project NewHonor-SpongePlugin by euOnmyoji.
the class NewHonor method onClientConnectionJoin.
@Listener
public void onClientConnectionJoin(ClientConnectionEvent.Join event) {
Player p = event.getTargetEntity();
PlayerData pd = new PlayerData(p);
Task.builder().execute(() -> {
if (!pd.init()) {
logger.error("初始化玩家" + p.getName() + "," + p.getUniqueId() + ",头衔数据失败!");
}
doSomething(pd);
}).async().delayTicks(20).name("newhonor - init Player" + p.getName()).submit(this);
MessageChannel originalChannel = event.getOriginalChannel();
MessageChannel newChannel = MessageChannel.combined(p.getMessageChannel(), originalChannel, mMessage);
p.setMessageChannel(newChannel);
}
Aggregations