Skimmed through it.
You need to look @ Entity Collection, your add method will not work with multiple players.
Code:
@Override
public boolean add(T t) {
for (int i = 0; i < capacity(); i++) {
entity[i] = t;
t.setIndex(i);
size++;
return true;
}
return false;
}
The login responses enum was pretty cute.
You reference the player/create the object through the Login Session class. Would be a better idea to either make a Game Session class or rename this class.
If you want a dummy player update packet, here
Code:
/* a dummy encoder for the packet */
PacketBuilder builder = new PacketBuilder(81, Type.VARIABLE_SHORT);
builder.startBitAccess();
builder.putBits(1, 1); /* this player has updated */
builder.putBits(2, 3); /* indicates we teleported */
builder.putBits(2, 0); /* height level */
builder.putBits(1, 1); /* should the walk queue be discarded? */
builder.putBits(1, 1); /* is there a block update? */
builder.putBits(7, 48); /* local Y coordinate */
builder.putBits(7, 48); /* local X coordinate */
builder.putBits(8, 0); /* number of other players */
builder.putBits(11, 2047); /* magic id to indicate blocks follow */
builder.finishBitAccess();
builder.put((byte)0); /* empty mask - no blocks for this player */
player.write(builder.toPacket());
This packet will allow you to render the landscape/terrain.
From:
https://github.com/MatthewBishop/Pos...blePlayer.java