/** Sets whether the computer is on. */ public void setOn(boolean on) { super.setOn(on); if (on) { IComputer computer; if (NetworkUtilities.isServerWorld(getWorldObj())) { int nextID = getComputerID(); if (nextID == -1) { nextID = ComputerManager.getNextAvailableID(); } computer = new ServerTerminalComputer(nextID, this); this.update(); } else { computer = new ClientTerminalComputer(this); } this.setComputerID(computer.getID()); computer.start(); } }
/** * Gets the computer corresponding to this TileEntity, on the Server side. * * @return The matching computer. */ public IServerComputer getServerComputer() { return ComputerManager.getServerComputer(computerID); }
/** * Gets the computer corresponding to this TileEntity, on the Client side. * * @return The matching computer. */ public IClientComputer getClientComputer() { return ComputerManager.getClientComputer(computerID); }