
Originally Posted by
Bars
}
public static Server clientHandler = null;
public static java.net.ServerSocket clientListener = null;
public static boolean shutdownServer = false;
public static boolean shutdownClientHandler;
public static int ServerlistenerPort = 43594;
public static itemHandler = new ItemHandler();
public static playerHandler = new PlayerHandler();
public static npcHandler = new NPCHandler();
public static shopHandler = new ShopHandler();
public static worldObject = new WorldObject();
public static objectHandler = new ObjectHandler();
public void run() {
These following are fine.
Code:
public static Server clientHandler = null;
public static java.net.ServerSocket clientListener = null;
public static boolean shutdownServer = false;
public static boolean shutdownClientHandler;
public static int ServerlistenerPort = 43594;
But you are tring to create a new instance of a handler, and you are going about it the wrong way.
Code:
public static itemHandler = new ItemHandler();
public static playerHandler = new PlayerHandler();
public static npcHandler = new NPCHandler();
public static shopHandler = new ShopHandler();
public static worldObject = new WorldObject();
public static objectHandler = new ObjectHandler();
In the way you are tring to do it here, that should look like this
Code:
public static ItemHandler itemHandler = new ItemHandler();
public static PlayerHandler playerHandler = new PlayerHandler();
public static NPCHandler npcHandler = new NPCHandler();
public static ShopHandler shopHandler = new ShopHandler();
public static WorldObject worldObject = new WorldObject();
public static ObjectHandler objectHandler = new ObjectHandler();
Or you can do this:
Declare outside of your methods
Code:
public static ItemHandler itemHandler = null;
public static PlayerHandler playerHandler = null;
public static NPCHandler npcHandler = null;
public static ShopHandler shopHandler = null;
public static WorldObject worldObject = null;
public static ObjectHandler objectHandler = null;
And inside of your main method
Code:
itemHandler = new ItemHandler();
playerHandler = new PlayerHandler();
npcHandler = new NPCHandler();
shopHandler = new ShopHandler();
worldObject = new WorldObject();
objectHandler = new ObjectHandler();