Search in sources :

Example 1 with ServerPlayer

use of com.irtimaled.bbor.common.models.ServerPlayer in project BoundingBoxOutlineReloaded by irtimaled.

the class CommonProxy method playerLoggedIn.

private void playerLoggedIn(PlayerLoggedIn event) {
    if (seed == null || spawnX == null || spawnZ == null) {
        return;
    }
    ServerPlayer player = event.getPlayer();
    player.sendPacket(InitializeClient.getPayload(seed, spawnX, spawnZ));
}
Also used : ServerPlayer(com.irtimaled.bbor.common.models.ServerPlayer)

Example 2 with ServerPlayer

use of com.irtimaled.bbor.common.models.ServerPlayer in project BoundingBoxOutlineReloaded by irtimaled.

the class CommonProxy method serverTick.

private void serverTick() {
    for (Map.Entry<Integer, ServerPlayer> playerEntry : players.entrySet()) {
        int playerId = playerEntry.getKey();
        ServerPlayer player = playerEntry.getValue();
        sendToPlayer(playerId, player);
    }
}
Also used : ServerPlayer(com.irtimaled.bbor.common.models.ServerPlayer) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) Map(java.util.Map)

Example 3 with ServerPlayer

use of com.irtimaled.bbor.common.models.ServerPlayer in project BoundingBoxOutlineReloaded by irtimaled.

the class CommonProxy method onPlayerSubscribed.

private void onPlayerSubscribed(PlayerSubscribed event) {
    int playerId = event.getPlayerId();
    ServerPlayer player = event.getPlayer();
    players.put(playerId, player);
    sendToPlayer(playerId, player);
}
Also used : ServerPlayer(com.irtimaled.bbor.common.models.ServerPlayer)

Example 4 with ServerPlayer

use of com.irtimaled.bbor.common.models.ServerPlayer in project BoundingBoxOutlineReloaded by irtimaled.

the class CommonInterop method playerLoggedIn.

public static void playerLoggedIn(ServerPlayerEntity player) {
    ServerPlayNetHandler connection = player.connection;
    if (connection == null)
        return;
    NetworkManager networkManager = connection.netManager;
    if (networkManager.isLocalChannel())
        return;
    EventBus.publish(new PlayerLoggedIn(new ServerPlayer(player)));
}
Also used : ServerPlayNetHandler(net.minecraft.network.play.ServerPlayNetHandler) ServerPlayer(com.irtimaled.bbor.common.models.ServerPlayer) NetworkManager(net.minecraft.network.NetworkManager)

Aggregations

ServerPlayer (com.irtimaled.bbor.common.models.ServerPlayer)4 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 NetworkManager (net.minecraft.network.NetworkManager)1 ServerPlayNetHandler (net.minecraft.network.play.ServerPlayNetHandler)1