use of org.spongepowered.common.interfaces.IMixinServerScoreboard in project SpongeCommon by SpongePowered.
the class MixinPlayerList method onPlayerLogOut.
@Inject(method = "playerLoggedOut(Lnet/minecraft/entity/player/EntityPlayerMP;)V", at = @At("HEAD"))
private void onPlayerLogOut(EntityPlayerMP player, CallbackInfo ci) {
// Synchronise with user object
NBTTagCompound nbt = new NBTTagCompound();
player.writeToNBT(nbt);
((SpongeUser) ((IMixinEntityPlayerMP) player).getUserObject()).readFromNbt(nbt);
// Remove player reference from scoreboard
((IMixinServerScoreboard) ((Player) player).getScoreboard()).removePlayer(player, false);
}
Aggregations