ServerPlayerListener.java
1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* This file is part of LiteLoader.
* Copyright (C) 2012-16 Adam Mummery-Smith
* All Rights Reserved.
*/
package com.mumfrey.liteloader;
import com.mojang.authlib.GameProfile;
import net.minecraft.entity.player.EntityPlayerMP;
/**
* Interface for mods which want to handle players joining and leaving a LAN
* game (or single player game)
*
* @author Adam Mummery-Smith
*/
public interface ServerPlayerListener extends LiteMod
{
/**
* Called when a player connects to the server and the EntityPlayerMP
* instance is created, the player has not logged in at this point and may
* be disconnected if login fails.
*
* @param player Player attempting to connect
* @param profile Player's GameProfile from the authentication service
*/
public abstract void onPlayerConnect(EntityPlayerMP player, GameProfile profile);
/**
* Called once the player has successfully logged in and all player
* variables are initialised and replicated.
*
* @param player Player connected
*/
public abstract void onPlayerLoggedIn(EntityPlayerMP player);
/**
* Called when a player respawns. This event is raised when a player
* respawns after dying or conquers the end.
*
* @param player New player instance
* @param oldPlayer Old player instance being discarded
* @param newDimension Dimension the player is respawning in
* @param playerWonTheGame True if the player conquered the end (this
* respawn is NOT as the result of a death)
*/
public abstract void onPlayerRespawn(EntityPlayerMP player, EntityPlayerMP oldPlayer, int newDimension, boolean playerWonTheGame);
/**
* Called when a player disconnects from the game
*
* @param player Player disconnecting
*/
public abstract void onPlayerLogout(EntityPlayerMP player);
}