Well.. I'll post pictures of my problem:
This is where I spawn an object:
It shows up where I spawned it, but then It pops up multiple times around the world. :
Heres the createobject code:
Code:
public void CreateObj(int x, int y, int id, int face, int type)
{
outStream.createFrame(85);
outStream.writeByteC(y - (mapRegionY * 8));
outStream.writeByteC(x - (mapRegionX * 8));
outStream.createFrame(151);
outStream.writeByteA(0);
outStream.writeWordBigEndian(id);
outStream.writeByteS((type << 2) + (face & 3));
}
And heres an example of a server that has an unglitched CreateObject method:
Code:
public void createObject(int x, int y, int typeID, int orientation, int tileObjectType){ //Makes Global objects
for (Player p : GameEngine.playerHandler.players) {
if (p != null) {
clientHandler person = (clientHandler)p;
if ((person.playerName != null || person.playerName != "null")) {
if (person.distanceToPoint(x, y) <= 60) {
person.createNewTileObject(x, y, typeID, orientation, tileObjectType);
}
}
}
}
}
Any help on getting this to work on my server would be great.. I'm just inexperienced and don't know where to start.