├── HMCL ├── icon.ico ├── old.jpg ├── 2016-02-25.png ├── HMCLauncher.exe └── src │ ├── main │ ├── icon.icns │ ├── resources │ │ └── org │ │ │ └── jackhuang │ │ │ └── hellominecraft │ │ │ └── launcher │ │ │ ├── close.png │ │ │ ├── icon.png │ │ │ ├── minimize.png │ │ │ ├── background.jpg │ │ │ └── ui │ │ │ └── Bundle.properties │ └── java │ │ └── org │ │ └── jackhuang │ │ └── hellominecraft │ │ └── launcher │ │ ├── ui │ │ ├── Selectable.java │ │ ├── Page.java │ │ ├── NewTabPane.java │ │ └── RepaintPage.java │ │ └── util │ │ ├── LauncherVisibility.java │ │ ├── FileNameFilter.java │ │ ├── HMCLGameProvider.java │ │ └── upgrade │ │ └── IUpgrader.java │ └── core │ └── java │ └── org │ └── jackhuang │ └── hellominecraft │ └── launcher │ ├── core │ ├── version │ │ ├── GameDirType.java │ │ ├── LibrariesDownloadInfo.java │ │ ├── Rules.java │ │ ├── Natives.java │ │ ├── Extract.java │ │ ├── AssetIndexDownloadInfo.java │ │ ├── DecompressLibraryJob.java │ │ ├── MinecraftOldLibrary.java │ │ ├── OSRestriction.java │ │ └── LibraryDownloadInfo.java │ ├── launch │ │ ├── LaunchingState.java │ │ ├── IAssetProvider.java │ │ └── LibraryDownloadTask.java │ ├── auth │ │ ├── yggdrasil │ │ │ ├── Property.java │ │ │ ├── User.java │ │ │ ├── Response.java │ │ │ └── UUIDTypeAdapter.java │ │ ├── LoginInfo.java │ │ └── AuthenticationException.java │ ├── service │ │ ├── IMinecraftBasicService.java │ │ ├── IMinecraftLoader.java │ │ ├── IMinecraftModService.java │ │ ├── IMinecraftInstallerService.java │ │ └── IMinecraftDownloadService.java │ ├── install │ │ ├── liteloader │ │ │ ├── LiteLoaderMCVersions.java │ │ │ ├── LiteLoaderVersionsRoot.java │ │ │ ├── LiteLoaderVersion.java │ │ │ └── LiteLoaderVersionsMeta.java │ │ ├── InstallerType.java │ │ ├── InstallProfile.java │ │ ├── InstallerVersionNewerComparator.java │ │ ├── forge │ │ │ └── MinecraftForgeVersionRoot.java │ │ └── optifine │ │ │ └── OptiFineVersion.java │ ├── download │ │ ├── MinecraftRemoteLatestVersion.java │ │ ├── CurseDownloadProvider.java │ │ └── MinecraftRemoteVersion.java │ ├── GameException.java │ └── asset │ │ └── AssetsIndex.java │ └── api │ └── PluginManager.java ├── HMCSM ├── HMCLauncher.exe └── src │ └── main │ ├── icon.icns │ ├── resources │ ├── icon.icns │ ├── icon.png │ ├── background.jpg │ └── log4j2.xml │ └── java │ └── org │ └── jackhuang │ └── hellominecraft │ └── svrmgr │ ├── plugin │ ├── Category.java │ ├── PluginInformation.java │ ├── PluginVersion.java │ ├── PluginInfo.java │ └── BukkitPlugin.java │ ├── install │ ├── bukkit │ │ └── BukkitVersion.java │ └── cauldron │ │ ├── InstallProfile.java │ │ ├── Install.java │ │ ├── MinecraftVersion.java │ │ ├── MinecraftLibrary.java │ │ └── ForgeVersion.java │ ├── server │ ├── ServerDownloadPackage.java │ ├── schedule │ │ ├── AutoSchedule.java │ │ ├── AutoSendCommandSchedule.java │ │ ├── AutoRestartSchedule.java │ │ ├── AutoBroadcastSchedule.java │ │ ├── AutoSaveSchedule.java │ │ ├── AutoBackupSchedule.java │ │ └── AutoExecuteSchedule.java │ └── ServerChecker.java │ ├── util │ ├── IMonitorService.java │ ├── version │ │ ├── MinecraftRemoteLatestVersion.java │ │ ├── MinecraftRemoteVersions.java │ │ └── MinecraftRemoteVersion.java │ ├── Utilities.java │ └── WaitForThread.java │ └── setting │ ├── Op.java │ ├── WhiteList.java │ ├── Schedule.java │ ├── BannedPlayers.java │ └── Settings.java ├── HMCUtils ├── src │ └── main │ │ ├── resources │ │ └── org │ │ │ └── jackhuang │ │ │ └── hellominecraft │ │ │ └── wizard.jpg │ │ └── java │ │ └── org │ │ └── jackhuang │ │ └── hellominecraft │ │ └── util │ │ ├── func │ │ ├── Consumer.java │ │ ├── Function.java │ │ ├── NonFunction.java │ │ ├── Predicate.java │ │ ├── BiFunction.java │ │ └── CallbackIO.java │ │ ├── Event.java │ │ ├── task │ │ ├── comm │ │ │ ├── PreviousResult.java │ │ │ └── PreviousResultRegistrar.java │ │ ├── ProgressProviderListener.java │ │ ├── TaskInfo.java │ │ ├── NoShownTaskException.java │ │ ├── TaskRunnable.java │ │ ├── DoingDoneListener.java │ │ ├── DeleteFileTask.java │ │ ├── ParallelTask.java │ │ └── DoubleTask.java │ │ ├── log │ │ ├── LoggingException.java │ │ ├── LogEvent.java │ │ ├── message │ │ │ ├── IMessage.java │ │ │ ├── ParameterizedMessageFactory.java │ │ │ ├── IMessageFactory.java │ │ │ └── AbstractMessageFactory.java │ │ ├── layout │ │ │ ├── ILayout.java │ │ │ ├── AbstractStringLayout.java │ │ │ └── DefaultLayout.java │ │ ├── appender │ │ │ ├── IAppender.java │ │ │ └── AbstractAppender.java │ │ ├── Configuration.java │ │ └── HMCLog.java │ │ ├── ui │ │ ├── wizard │ │ │ ├── api │ │ │ │ ├── displayer │ │ │ │ │ └── InstructionsPanel.java │ │ │ │ └── WizardResultReceiver.java │ │ │ └── spi │ │ │ │ ├── AbstractWizard.java │ │ │ │ └── WizardObserver.java │ │ ├── IRepaint.java │ │ ├── WideComboBox.java │ │ └── checktree │ │ │ └── CheckBoxTreeNodeSelectionListener.java │ │ ├── sys │ │ ├── ProcessManager.java │ │ └── Platform.java │ │ ├── CollectionUtils.java │ │ ├── MathUtils.java │ │ ├── IUpdateChecker.java │ │ └── net │ │ └── WebPage.java └── build.gradle ├── HMCLaF ├── src │ └── main │ │ ├── resources │ │ └── org │ │ │ └── jackhuang │ │ │ └── hellominecraft │ │ │ └── lookandfeel │ │ │ └── images │ │ │ ├── checkbox_on.png │ │ │ ├── combo_over.png │ │ │ ├── radio_btn.png │ │ │ ├── tree_closed.gif │ │ │ ├── tree_leaf.gif │ │ │ ├── tree_open.gif │ │ │ ├── checkbox_off.png │ │ │ ├── combo_normal.png │ │ │ ├── combo_pressed.png │ │ │ ├── tree_expanded.gif │ │ │ ├── checkbox_on_over.png │ │ │ ├── combo_disabled.png │ │ │ ├── option_pane_info.png │ │ │ ├── radio_btn_over.png │ │ │ ├── scroll_dec_over.png │ │ │ ├── scroll_disabled.png │ │ │ ├── scroll_enabled.png │ │ │ ├── scroll_inc_over.png │ │ │ ├── tree_collapsed.gif │ │ │ ├── checkbox_off_over.png │ │ │ ├── option_pane_error.png │ │ │ ├── radio_btn_pressed.png │ │ │ ├── radio_btn_selected.png │ │ │ ├── scroll_dec_normal.png │ │ │ ├── scroll_dec_pressed.png │ │ │ ├── scroll_inc_normal.png │ │ │ ├── scroll_inc_pressed.png │ │ │ ├── scroll_thumb_over.png │ │ │ ├── checkbox_off_disabled.png │ │ │ ├── checkbox_off_pressed.png │ │ │ ├── checkbox_on_disabled.png │ │ │ ├── checkbox_on_pressed.png │ │ │ ├── option_pane_question.png │ │ │ ├── option_pane_warning.png │ │ │ ├── scroll_thumb_normal.png │ │ │ ├── scroll_thumb_pressed.png │ │ │ ├── radio_btn_selected_over.png │ │ │ ├── radio_btn_disabled_normal.png │ │ │ ├── radio_btn_selected_pressed.png │ │ │ └── radio_btn_disabled_selected.png │ │ └── java │ │ └── org │ │ └── jackhuang │ │ └── hellominecraft │ │ └── lookandfeel │ │ ├── ConstomButton.java │ │ └── ui │ │ └── ListCellRender.java └── build.gradle ├── .gitignore ├── license-header.txt ├── .nb-gradle-properties ├── settings.gradle ├── .travis.yml └── README.md /HMCL/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCL/icon.ico -------------------------------------------------------------------------------- /HMCL/old.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCL/old.jpg -------------------------------------------------------------------------------- /HMCL/2016-02-25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCL/2016-02-25.png -------------------------------------------------------------------------------- /HMCL/HMCLauncher.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCL/HMCLauncher.exe -------------------------------------------------------------------------------- /HMCSM/HMCLauncher.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCSM/HMCLauncher.exe -------------------------------------------------------------------------------- /HMCL/src/main/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCL/src/main/icon.icns -------------------------------------------------------------------------------- /HMCSM/src/main/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCSM/src/main/icon.icns -------------------------------------------------------------------------------- /HMCSM/src/main/resources/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCSM/src/main/resources/icon.icns -------------------------------------------------------------------------------- /HMCSM/src/main/resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCSM/src/main/resources/icon.png -------------------------------------------------------------------------------- /HMCSM/src/main/resources/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCSM/src/main/resources/background.jpg -------------------------------------------------------------------------------- /HMCUtils/src/main/resources/org/jackhuang/hellominecraft/wizard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCUtils/src/main/resources/org/jackhuang/hellominecraft/wizard.jpg -------------------------------------------------------------------------------- /HMCL/src/main/resources/org/jackhuang/hellominecraft/launcher/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCL/src/main/resources/org/jackhuang/hellominecraft/launcher/close.png -------------------------------------------------------------------------------- /HMCL/src/main/resources/org/jackhuang/hellominecraft/launcher/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCL/src/main/resources/org/jackhuang/hellominecraft/launcher/icon.png -------------------------------------------------------------------------------- /HMCL/src/main/resources/org/jackhuang/hellominecraft/launcher/minimize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCL/src/main/resources/org/jackhuang/hellominecraft/launcher/minimize.png -------------------------------------------------------------------------------- /HMCL/src/main/resources/org/jackhuang/hellominecraft/launcher/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCL/src/main/resources/org/jackhuang/hellominecraft/launcher/background.jpg -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/checkbox_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/checkbox_on.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/combo_over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/combo_over.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/radio_btn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/radio_btn.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_closed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_closed.gif -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_leaf.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_leaf.gif -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_open.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_open.gif -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/checkbox_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/checkbox_off.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/combo_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/combo_normal.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/combo_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/combo_pressed.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_expanded.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_expanded.gif -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/checkbox_on_over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/checkbox_on_over.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/combo_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/combo_disabled.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/option_pane_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/option_pane_info.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/radio_btn_over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/radio_btn_over.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/scroll_dec_over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/scroll_dec_over.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/scroll_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/scroll_disabled.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/scroll_enabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/scroll_enabled.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/scroll_inc_over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/scroll_inc_over.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_collapsed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_collapsed.gif -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/checkbox_off_over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/checkbox_off_over.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/option_pane_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/option_pane_error.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/radio_btn_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/radio_btn_pressed.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/radio_btn_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/radio_btn_selected.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/scroll_dec_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/scroll_dec_normal.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/scroll_dec_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/scroll_dec_pressed.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/scroll_inc_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/scroll_inc_normal.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/scroll_inc_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/scroll_inc_pressed.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/scroll_thumb_over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/scroll_thumb_over.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/checkbox_off_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/checkbox_off_disabled.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/checkbox_off_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/checkbox_off_pressed.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/checkbox_on_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/checkbox_on_disabled.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/checkbox_on_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/checkbox_on_pressed.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/option_pane_question.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/option_pane_question.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/option_pane_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/option_pane_warning.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/scroll_thumb_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/scroll_thumb_normal.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/scroll_thumb_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/scroll_thumb_pressed.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/radio_btn_selected_over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/radio_btn_selected_over.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/radio_btn_disabled_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/radio_btn_disabled_normal.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/radio_btn_selected_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/radio_btn_selected_pressed.png -------------------------------------------------------------------------------- /HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/radio_btn_disabled_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfinityStudio/HMCL/HEAD/HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/radio_btn_disabled_selected.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | 11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 12 | hs_err_pid* 13 | 14 | .gradle 15 | .nb-gradle 16 | 17 | *.bat 18 | *.log 19 | .mine* 20 | *.json 21 | *.hmd 22 | 23 | HMCLAPI/build/ 24 | HMCL/build/ 25 | HMCLServer/ 26 | HMCSM/build/ 27 | MetroLookAndFeel/build/ 28 | /HMCUtils/build/ 29 | /HMCLaF/build/ -------------------------------------------------------------------------------- /license-header.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ -------------------------------------------------------------------------------- /HMCL/src/main/resources/org/jackhuang/hellominecraft/launcher/ui/Bundle.properties: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/func/Consumer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.func; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public interface Consumer { 25 | 26 | void accept(T t); 27 | } 28 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/func/Function.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.func; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public interface Function { 25 | 26 | R apply(T t); 27 | } 28 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/func/NonFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.func; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public interface NonFunction { 25 | 26 | T apply(); 27 | } 28 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/func/Predicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.func; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public interface Predicate { 25 | 26 | boolean apply(T t); 27 | } 28 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/func/BiFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.func; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public interface BiFunction { 25 | 26 | C apply(A a, B b); 27 | } 28 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/plugin/Category.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.plugin; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public class Category { 25 | 26 | public double count; 27 | public String name; 28 | } 29 | -------------------------------------------------------------------------------- /HMCSM/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/Event.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | * @param EventArgs 24 | */ 25 | public interface Event { 26 | 27 | boolean call(Object sender, T t); 28 | } 29 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/plugin/PluginInformation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.plugin; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public class PluginInformation { 25 | 26 | public String name, version, author, description; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/version/GameDirType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.version; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public enum GameDirType { 25 | 26 | ROOT_FOLDER, 27 | VERSION_FOLDER; 28 | } 29 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/task/comm/PreviousResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.task.comm; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | * @param Task result type 24 | */ 25 | public interface PreviousResult { 26 | 27 | T getResult(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/install/bukkit/BukkitVersion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.install.bukkit; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public class BukkitVersion { 25 | 26 | public String buildNumber, version, type, downloadLink, infoLink; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/server/ServerDownloadPackage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.server; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public class ServerDownloadPackage { 25 | 26 | public String mcversion, version, forgeversion, majorversion, file; 27 | } 28 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/install/cauldron/InstallProfile.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.install.cauldron; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public class InstallProfile { 25 | 26 | public Install install; 27 | public MinecraftVersion versionInfo; 28 | } 29 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/func/CallbackIO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.func; 19 | 20 | import java.io.IOException; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public interface CallbackIO { 27 | 28 | void call(T t) throws IOException; 29 | } 30 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/install/cauldron/Install.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.install.cauldron; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public class Install { 25 | 26 | public String profileName, target, path, version, filePath, welcome, minecraft, mirrorList, logo; 27 | } 28 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/log/LoggingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.log; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public class LoggingException extends RuntimeException { 25 | 26 | public LoggingException(Exception e) { 27 | super(e); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/launch/LaunchingState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.launch; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public enum LaunchingState { 25 | LoggingIn, 26 | GeneratingLaunchingCodes, 27 | DownloadingLibraries, 28 | DecompressingNatives 29 | } 30 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/auth/yggdrasil/Property.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.auth.yggdrasil; 19 | 20 | public class Property { 21 | 22 | public final String name, value; 23 | 24 | public Property(String name, String value) { 25 | this.name = name; 26 | this.value = value; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/ui/Selectable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.ui; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public interface Selectable { 25 | 26 | void onCreate(); 27 | 28 | boolean isCreated(); 29 | 30 | void onSelect(); 31 | 32 | boolean isSelected(); 33 | 34 | void onLeave(); 35 | } 36 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/plugin/PluginVersion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.plugin; 19 | 20 | import java.util.List; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public class PluginVersion { 27 | 28 | public long date; 29 | public String download, link, version; 30 | public List game_versions; 31 | public String filename, type; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/task/ProgressProviderListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.task; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public interface ProgressProviderListener { 25 | 26 | void setProgress(Task task, int prog, int max); 27 | 28 | void setStatus(Task task, String sta); 29 | 30 | void onProgressProviderDone(Task task); 31 | } 32 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/task/TaskInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.task; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public abstract class TaskInfo extends Task { 25 | 26 | public TaskInfo(String info) { 27 | this.tag = info; 28 | } 29 | 30 | @Override 31 | public String getInfo() { 32 | return tag; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/log/LogEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.log; 19 | 20 | import org.jackhuang.hellominecraft.util.log.message.IMessage; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public class LogEvent { 27 | 28 | public Level level; 29 | public String threadName; 30 | public Throwable thrown; 31 | public IMessage message; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/util/IMonitorService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.util; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public interface IMonitorService { 25 | 26 | /** 27 | * 获得当前的监控对象. 28 | * 29 | * @return 返回构造好的监控对象 30 | * 31 | * @throws Exception 32 | */ 33 | public MonitorInfoBean getMonitorInfoBean() throws Exception; 34 | } 35 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/task/NoShownTaskException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.task; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public class NoShownTaskException extends RuntimeException { 25 | private static final long serialVersionUID = 4893571368018439312L; 26 | 27 | public NoShownTaskException(String msg) { 28 | super(msg); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/auth/LoginInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.auth; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public final class LoginInfo { 25 | 26 | public String username, password; 27 | 28 | public LoginInfo(String username, String password) { 29 | this.username = username; 30 | this.password = password; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/plugin/PluginInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.plugin; 19 | 20 | import java.util.List; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public class PluginInfo { 27 | 28 | public String website, dbo_page, description, slug, plugin_name, 29 | link, stage, main; 30 | public List authors, categories; 31 | public List versions; 32 | } 33 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/log/message/IMessage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.log.message; 19 | 20 | import java.io.Serializable; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public interface IMessage extends Serializable { 27 | 28 | String getFormattedMessage(); 29 | 30 | String getFormat(); 31 | 32 | Object[] getParameters(); 33 | 34 | Throwable getThrowable(); 35 | } 36 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/service/IMinecraftBasicService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.service; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public abstract class IMinecraftBasicService { 25 | 26 | public IMinecraftService service; 27 | 28 | public IMinecraftBasicService(IMinecraftService service) { 29 | this.service = service; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/log/message/ParameterizedMessageFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.log.message; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public final class ParameterizedMessageFactory extends AbstractMessageFactory { 25 | 26 | @Override 27 | public IMessage newMessage(String message, Object[] params) { 28 | return new ParameterizedMessage(message, params); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /.nb-gradle-properties: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | j2se 5 | 1.8 6 | 1.8 7 | 8 | 9 | launch4j 10 | no 11 | 12 | launch4j 13 | 14 | 15 | 16 | 17 | 18 | createApp 19 | no 20 | 21 | createApp 22 | 23 | 24 | 25 | 26 | 27 | 28 | j2se 29 | 1.8 30 | 31 | 32 | GNU General Public License 33 | 34 | huangyuhui 35 | 36 | 37 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/log/layout/ILayout.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.log.layout; 19 | 20 | import java.io.Serializable; 21 | import org.jackhuang.hellominecraft.util.log.LogEvent; 22 | 23 | /** 24 | * 25 | * @author huangyuhui 26 | * @param 27 | */ 28 | public interface ILayout { 29 | 30 | byte[] toByteArray(LogEvent event); 31 | 32 | T toSerializable(LogEvent event); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/util/version/MinecraftRemoteLatestVersion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.util.version; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public class MinecraftRemoteLatestVersion { 27 | 28 | @SerializedName("snapshot") 29 | public String snapshot; 30 | @SerializedName("release") 31 | public String release; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/install/liteloader/LiteLoaderMCVersions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.install.liteloader; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | import java.util.Map; 22 | 23 | /** 24 | * 25 | * @author huangyuhui 26 | */ 27 | public class LiteLoaderMCVersions { 28 | 29 | @SerializedName("artefacts") 30 | public Map> artefacts; 31 | } 32 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/download/MinecraftRemoteLatestVersion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.download; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public class MinecraftRemoteLatestVersion { 27 | 28 | @SerializedName("snapshot") 29 | public String snapshot; 30 | 31 | @SerializedName("release") 32 | public String release; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/log/message/IMessageFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.log.message; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public abstract interface IMessageFactory { 25 | 26 | public abstract IMessage newMessage(Object paramObject); 27 | 28 | public abstract IMessage newMessage(String paramString); 29 | 30 | public abstract IMessage newMessage(String paramString, Object[] paramArrayOfObject); 31 | } 32 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/log/layout/AbstractStringLayout.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.log.layout; 19 | 20 | import org.jackhuang.hellominecraft.util.log.LogEvent; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public abstract class AbstractStringLayout implements ILayout { 27 | 28 | @Override 29 | public byte[] toByteArray(LogEvent event) { 30 | return toSerializable(event).getBytes(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/launch/IAssetProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.launch; 19 | 20 | import org.jackhuang.hellominecraft.launcher.core.GameException; 21 | import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion; 22 | 23 | /** 24 | * 25 | * @author huang 26 | */ 27 | public interface IAssetProvider { 28 | 29 | String provide(MinecraftVersion mv, Boolean allowChecking) throws GameException; 30 | } 31 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/install/cauldron/MinecraftVersion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.install.cauldron; 19 | 20 | import java.util.List; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public class MinecraftVersion { 27 | 28 | public String minecraftArguments, mainClass, time, id, type, processArguments, 29 | releaseTime, assets, jar, inheritsFrom; 30 | public int minimumLauncherVersion; 31 | 32 | public List libraries; 33 | } 34 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/download/CurseDownloadProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.download; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public class CurseDownloadProvider extends MojangDownloadProvider { 25 | 26 | @Override 27 | public String getParsedDownloadURL(String str) { 28 | return str == null ? null : str.replace("http://files.minecraftforge.net/maven", "http://ftb.cursecdn.com/FTB2/maven"); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/version/LibrariesDownloadInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.version; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | import java.util.Map; 22 | 23 | /** 24 | * 25 | * @author huangyuhui 26 | */ 27 | public class LibrariesDownloadInfo { 28 | 29 | @SerializedName("classifiers") 30 | Map classifiers; 31 | @SerializedName("artifact") 32 | LibraryDownloadInfo artifact; 33 | } 34 | -------------------------------------------------------------------------------- /HMCUtils/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | apply plugin: 'me.tatarka.retrolambda' 19 | 20 | if (!hasProperty('mainClass')) { 21 | ext.mainClass = '' 22 | } 23 | 24 | if (System.getenv("BUILD_NUMBER") != null) 25 | version = System.getenv("BUILD_NUMBER") 26 | 27 | buildscript { 28 | repositories { 29 | mavenCentral(); 30 | 31 | dependencies { 32 | classpath 'me.tatarka:gradle-retrolambda:3.1.0' 33 | } 34 | } 35 | } 36 | 37 | retrolambda { 38 | javaVersion = JavaVersion.VERSION_1_6 39 | } 40 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/install/InstallerType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.install; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public enum InstallerType { 25 | Forge("forge"), OptiFine("optifine"), LiteLoader("liteloader"); 26 | 27 | public final String id; 28 | 29 | private InstallerType(String id) { 30 | this.id = id; 31 | } 32 | 33 | public String getLocalizedName() { 34 | return this.name(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/service/IMinecraftLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.service; 19 | 20 | import java.util.List; 21 | import org.jackhuang.hellominecraft.launcher.core.GameException; 22 | import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion; 23 | 24 | /** 25 | * 26 | * @author huangyuhui 27 | */ 28 | public interface IMinecraftLoader { 29 | 30 | MinecraftVersion getMinecraftVersion(); 31 | 32 | List makeLaunchingCommand() throws GameException; 33 | } 34 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/util/version/MinecraftRemoteVersions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.util.version; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | import java.util.ArrayList; 22 | 23 | /** 24 | * 25 | * @author huangyuhui 26 | */ 27 | public class MinecraftRemoteVersions { 28 | 29 | @SerializedName("versions") 30 | public ArrayList versions; 31 | @SerializedName("latest") 32 | public MinecraftRemoteLatestVersion latest; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/install/liteloader/LiteLoaderVersionsRoot.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.install.liteloader; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | import java.util.Map; 22 | 23 | /** 24 | * 25 | * @author huangyuhui 26 | */ 27 | public class LiteLoaderVersionsRoot { 28 | 29 | @SerializedName("versions") 30 | public Map versions; 31 | @SerializedName("meta") 32 | public LiteLoaderVersionsMeta meta; 33 | } 34 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/log/message/AbstractMessageFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.log.message; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public abstract class AbstractMessageFactory 25 | implements IMessageFactory { 26 | 27 | @Override 28 | public IMessage newMessage(Object message) { 29 | return new ObjectMessage(message); 30 | } 31 | 32 | @Override 33 | public IMessage newMessage(String message) { 34 | return new SimpleMessage(message); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/task/comm/PreviousResultRegistrar.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.task.comm; 19 | 20 | import org.jackhuang.hellominecraft.util.task.Task; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | * @param Previous task result type 26 | */ 27 | public interface PreviousResultRegistrar { 28 | 29 | /** 30 | * 31 | * @param pr previous task handler 32 | * 33 | * @return task self instance(factory mode!) 34 | */ 35 | Task registerPreviousResult(PreviousResult pr); 36 | } 37 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/log/appender/IAppender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.log.appender; 19 | 20 | import java.io.Serializable; 21 | import org.jackhuang.hellominecraft.util.log.LogEvent; 22 | import org.jackhuang.hellominecraft.util.log.layout.ILayout; 23 | 24 | /** 25 | * 26 | * @author huangyuhui 27 | */ 28 | public interface IAppender { 29 | 30 | void append(LogEvent event); 31 | 32 | String getName(); 33 | 34 | boolean ignoreExceptions(); 35 | 36 | ILayout getLayout(); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/util/version/MinecraftRemoteVersion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.util.version; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public class MinecraftRemoteVersion { 27 | 28 | @SerializedName("id") 29 | public String id; 30 | @SerializedName("time") 31 | public String time; 32 | @SerializedName("releaseTime") 33 | public String releaseTime; 34 | @SerializedName("type") 35 | public String type; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/server/schedule/AutoSchedule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.server.schedule; 19 | 20 | import java.util.TimerTask; 21 | import org.jackhuang.hellominecraft.svrmgr.server.Server; 22 | import org.jackhuang.hellominecraft.svrmgr.setting.Schedule; 23 | 24 | /** 25 | * 26 | * @author huangyuhui 27 | */ 28 | public abstract class AutoSchedule extends TimerTask { 29 | 30 | Schedule main; 31 | Server server; 32 | 33 | public AutoSchedule(Schedule s, Server s2) { 34 | main = s; 35 | server = s2; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/version/Rules.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.version; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public class Rules { 27 | 28 | @SerializedName("action") 29 | private String action; 30 | @SerializedName("os") 31 | private OSRestriction os; 32 | 33 | public Rules() { 34 | } 35 | 36 | public String action() { 37 | return os == null || os.isCurrentOS() ? action : null; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /HMCLaF/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | apply plugin: 'me.tatarka.retrolambda' 19 | 20 | if (!hasProperty('mainClass')) { 21 | ext.mainClass = '' 22 | } 23 | 24 | if (System.getenv("BUILD_NUMBER") != null) 25 | version = System.getenv("BUILD_NUMBER") 26 | 27 | buildscript { 28 | repositories { 29 | mavenCentral(); 30 | 31 | dependencies { 32 | classpath 'me.tatarka:gradle-retrolambda:3.1.0' 33 | } 34 | } 35 | } 36 | 37 | dependencies { 38 | compile project(":HMCUtils") 39 | } 40 | 41 | retrolambda { 42 | javaVersion = JavaVersion.VERSION_1_6 43 | } 44 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/setting/Op.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.setting; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public class Op extends PlayerList { 25 | 26 | @Override 27 | protected Op.Operator newPlayer(String name) { 28 | return new Op.Operator(name); 29 | } 30 | 31 | public static class Operator extends PlayerList.BasePlayer { 32 | 33 | public int level; 34 | 35 | public Operator(String name) { 36 | super(name); 37 | level = 4; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/GameException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public class GameException extends Exception { 25 | 26 | public GameException() { 27 | } 28 | 29 | public GameException(String message) { 30 | super(message); 31 | } 32 | 33 | public GameException(String message, Throwable cause) { 34 | super(message, cause); 35 | } 36 | 37 | public GameException(Throwable cause) { 38 | super(cause); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/auth/AuthenticationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.auth; 19 | 20 | public class AuthenticationException extends Exception { 21 | 22 | public AuthenticationException() { 23 | } 24 | 25 | public AuthenticationException(String message) { 26 | super(message); 27 | } 28 | 29 | public AuthenticationException(String message, Throwable cause) { 30 | super(message, cause); 31 | } 32 | 33 | public AuthenticationException(Throwable cause) { 34 | super(cause); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/setting/WhiteList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.setting; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public class WhiteList extends PlayerList { 25 | 26 | @Override 27 | protected WhiteList.WhiteListPlayer newPlayer(String name) { 28 | return new WhiteList.WhiteListPlayer(name); 29 | } 30 | 31 | public static class WhiteListPlayer extends PlayerList.BasePlayer { 32 | 33 | public WhiteListPlayer(String name) { 34 | super(name); 35 | } 36 | 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/server/schedule/AutoSendCommandSchedule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.server.schedule; 19 | 20 | import org.jackhuang.hellominecraft.svrmgr.server.Server; 21 | import org.jackhuang.hellominecraft.svrmgr.setting.Schedule; 22 | 23 | /** 24 | * 25 | * @author huangyuhui 26 | */ 27 | public class AutoSendCommandSchedule extends AutoSchedule { 28 | 29 | public AutoSendCommandSchedule(Schedule s, Server s2) { 30 | super(s, s2); 31 | } 32 | 33 | @Override 34 | public void run() { 35 | server.sendCommand(main.content); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/task/TaskRunnable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.task; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public class TaskRunnable extends TaskInfo { 25 | 26 | private final Runnable r; 27 | 28 | public TaskRunnable(String info, Runnable r) { 29 | super(info); 30 | this.r = r; 31 | } 32 | 33 | public TaskRunnable(Runnable r) { 34 | this("TaskRunnable", r); 35 | } 36 | 37 | @Override 38 | public void executeTask(boolean areDependTasksSucceeded) { 39 | r.run(); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/install/InstallProfile.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.install; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion; 22 | import org.jackhuang.hellominecraft.launcher.core.install.forge.Install; 23 | 24 | /** 25 | * 26 | * @author huangyuhui 27 | */ 28 | public class InstallProfile { 29 | 30 | @SerializedName("install") 31 | public Install install; 32 | @SerializedName("versionInfo") 33 | public MinecraftVersion versionInfo; 34 | } 35 | -------------------------------------------------------------------------------- /HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/util/LauncherVisibility.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.util; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public enum LauncherVisibility { 25 | 26 | /** 27 | * Close the launcher anyway when the game process created even if failed to 28 | * launch game. 29 | */ 30 | CLOSE, 31 | /** 32 | * Hide the launcher when the game process created, if failed to launch 33 | * game, will show the log window. 34 | */ 35 | HIDE, 36 | /** 37 | * Keep the launcher visible even if the game launched successfully. 38 | */ 39 | KEEP; 40 | } 41 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/task/DoingDoneListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.task; 19 | 20 | import java.util.Collection; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public interface DoingDoneListener { 27 | 28 | /** 29 | * Task done. 30 | * 31 | * @param k 32 | */ 33 | void onDone(K k, Collection tasks); 34 | 35 | /** 36 | * Before task executing. 37 | * 38 | * @param k 39 | */ 40 | void onDoing(K k, Collection tasks); 41 | 42 | /** 43 | * Task failed. 44 | * 45 | * @param k 46 | */ 47 | void onFailed(K k); 48 | } 49 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/auth/yggdrasil/User.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.auth.yggdrasil; 19 | 20 | public class User { 21 | 22 | private String id; 23 | private PropertyMap properties; 24 | 25 | public User() { 26 | } 27 | 28 | public String getId() { 29 | return id; 30 | } 31 | 32 | public void setId(String id) { 33 | this.id = id; 34 | } 35 | 36 | public PropertyMap getProperties() { 37 | return properties; 38 | } 39 | 40 | public void setProperties(PropertyMap properties) { 41 | this.properties = properties; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/server/schedule/AutoRestartSchedule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.server.schedule; 19 | 20 | import java.util.TimerTask; 21 | import org.jackhuang.hellominecraft.svrmgr.server.Server; 22 | import org.jackhuang.hellominecraft.svrmgr.setting.Schedule; 23 | 24 | /** 25 | * 26 | * @author huangyuhui 27 | */ 28 | public class AutoRestartSchedule extends TimerTask { 29 | 30 | Schedule main; 31 | Server server; 32 | 33 | public AutoRestartSchedule(Schedule s, Server s2) { 34 | main = s; 35 | server = s2; 36 | } 37 | 38 | @Override 39 | public void run() { 40 | server.restart(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | rootProject.name = 'Hello Minecraft!' 19 | 20 | // Find the directories containing a "build.gradle" file in the root directory 21 | // of the project. That is, every directory containing a "build.gradle" will 22 | // be automatically the subproject of this project. 23 | def subDirs = rootDir.listFiles(new FileFilter() { 24 | public boolean accept(File file) { 25 | if (!file.isDirectory()) { 26 | return false 27 | } 28 | if (file.name == 'buildSrc') { 29 | return false 30 | } 31 | return new File(file, 'build.gradle').isFile() 32 | } 33 | }); 34 | 35 | subDirs.each { File dir -> 36 | include dir.name 37 | } 38 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/ui/wizard/api/displayer/InstructionsPanel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this template, choose Tools | Templates 3 | * and open the template in the editor. 4 | */ 5 | 6 | package org.jackhuang.hellominecraft.util.ui.wizard.api.displayer; 7 | 8 | import java.awt.Container; 9 | 10 | /** 11 | * Interface for providing the UI for instructions displayed in a wizard. 12 | * 13 | * @author Tim Boudreau 14 | */ 15 | public interface InstructionsPanel { 16 | /** 17 | * Get the component that will actually display the instructions. 18 | * Note that this component should have a layout manager that can position 19 | * a single component in a location that will not obscure the instructions, 20 | * for showing a progress bar. 21 | * 22 | * This method should always return the same component. 23 | * 24 | * @return A component that can listen to the wizard, display the steps 25 | * in that wizard, notice and update when they change, and optionally 26 | * highlight the current step. 27 | */ 28 | public Container getComponent(); 29 | /** 30 | * Set whether or not the panel is in the summary page at the end of a 31 | * wizard (in which case it should add a "summary" item to its 32 | * list of steps and highlight that). 33 | * 34 | * @param val Whether or not the wizard has navigated to a summary page. 35 | */ 36 | public void setInSummaryPage (boolean val); 37 | } 38 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/install/InstallerVersionNewerComparator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.install; 19 | 20 | import java.io.Serializable; 21 | import java.util.Comparator; 22 | import org.jackhuang.hellominecraft.launcher.core.install.InstallerVersionList.InstallerVersion; 23 | 24 | /** 25 | * 26 | * @author huangyuhui 27 | */ 28 | public class InstallerVersionNewerComparator implements Comparator, Serializable { 29 | 30 | private static final long serialVersionUID = 14758562453742645L; 31 | 32 | @Override 33 | public int compare(InstallerVersion o1, InstallerVersion o2) { 34 | return o2.compareTo(o1); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/server/schedule/AutoBroadcastSchedule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.server.schedule; 19 | 20 | import java.util.TimerTask; 21 | import org.jackhuang.hellominecraft.svrmgr.server.Server; 22 | import org.jackhuang.hellominecraft.svrmgr.setting.Schedule; 23 | 24 | /** 25 | * 26 | * @author huangyuhui 27 | */ 28 | public class AutoBroadcastSchedule extends TimerTask { 29 | 30 | Schedule main; 31 | Server server; 32 | 33 | public AutoBroadcastSchedule(Schedule s, Server s2) { 34 | main = s; 35 | server = s2; 36 | } 37 | 38 | @Override 39 | public void run() { 40 | server.sendCommand("say " + main.content); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /HMCLaF/src/main/java/org/jackhuang/hellominecraft/lookandfeel/ConstomButton.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 huangyuhui 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. 16 | */ 17 | package org.jackhuang.hellominecraft.lookandfeel; 18 | 19 | import java.awt.Color; 20 | import org.jackhuang.hellominecraft.util.ui.GraphicsUtils; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public class ConstomButton extends javax.swing.JButton { 27 | public Color normalFg = GraphicsUtils.getWebColorWithAlpha("DDDDDD6F"), normalBg = GraphicsUtils.getWebColorWithAlpha("DDDDDD6F"), 28 | prelightFg = GraphicsUtils.getWebColorWithAlpha("FFFFFF7F"), prelightBg = GraphicsUtils.getWebColorWithAlpha("FFFFFF7F"), 29 | activeFg = GraphicsUtils.getWebColorWithAlpha("EAEDF83F"), activeBg = GraphicsUtils.getWebColorWithAlpha("EAEDF83F"); 30 | public int drawPercent = 0; 31 | public int radix = 0; 32 | } 33 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/log/layout/DefaultLayout.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.log.layout; 19 | 20 | import java.text.SimpleDateFormat; 21 | import java.util.Date; 22 | import org.jackhuang.hellominecraft.util.log.LogEvent; 23 | 24 | /** 25 | * 26 | * @author huangyuhui 27 | */ 28 | public class DefaultLayout extends AbstractStringLayout { 29 | 30 | private static final SimpleDateFormat SDF = new SimpleDateFormat("HH:mm:ss"); 31 | 32 | @Override 33 | public String toSerializable(LogEvent event) { 34 | return "[" + SDF.format(new Date()) + "] [" + event.threadName + "/" + event.level.name() + "] " + event.message.getFormattedMessage() + "\n"; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/sys/ProcessManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.sys; 19 | 20 | import java.util.HashSet; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public class ProcessManager { 27 | 28 | private static final HashSet GAME_PROCESSES = new HashSet<>(); 29 | 30 | public void registerProcess(JavaProcess jp) { 31 | GAME_PROCESSES.add(jp); 32 | } 33 | 34 | public void stopAllProcesses() { 35 | for (JavaProcess jp : GAME_PROCESSES) 36 | jp.stop(); 37 | GAME_PROCESSES.clear(); 38 | } 39 | 40 | public void onProcessStopped(JavaProcess p) { 41 | GAME_PROCESSES.remove(p); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/task/DeleteFileTask.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.task; 19 | 20 | import java.io.File; 21 | import java.io.IOException; 22 | 23 | /** 24 | * 25 | * @author huangyuhui 26 | */ 27 | public class DeleteFileTask extends Task { 28 | 29 | File f; 30 | 31 | public DeleteFileTask(File f) { 32 | this.f = f; 33 | } 34 | 35 | @Override 36 | public void executeTask(boolean areDependTasksSucceeded) throws Throwable { 37 | if (!f.delete()) throw new IOException("Failed to delete" + f); 38 | } 39 | 40 | @Override 41 | public String getInfo() { 42 | return "Delete: " + f.getAbsolutePath(); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/version/Natives.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.version; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public class Natives implements Cloneable { 27 | 28 | @SerializedName("windows") 29 | public String windows; 30 | @SerializedName("osx") 31 | public String osx; 32 | @SerializedName("linux") 33 | public String linux; 34 | 35 | @Override 36 | protected Object clone() { 37 | try { 38 | return super.clone(); 39 | } catch (CloneNotSupportedException ex) { 40 | throw new InternalError(ex); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/server/schedule/AutoSaveSchedule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.server.schedule; 19 | 20 | import java.util.TimerTask; 21 | import org.jackhuang.hellominecraft.svrmgr.server.Server; 22 | import org.jackhuang.hellominecraft.svrmgr.setting.Schedule; 23 | 24 | /** 25 | * 26 | * @author huangyuhui 27 | */ 28 | public class AutoSaveSchedule extends TimerTask { 29 | 30 | Schedule main; 31 | Server server; 32 | 33 | public AutoSaveSchedule(Schedule s, Server s2) { 34 | main = s; 35 | server = s2; 36 | } 37 | 38 | @Override 39 | public void run() { 40 | System.out.println("auto save"); 41 | server.sendCommand("save-all"); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/api/PluginManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.api; 19 | 20 | import org.jackhuang.hellominecraft.util.log.HMCLog; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public class PluginManager { 27 | 28 | private static IPlugin NOW_PLUGIN; 29 | 30 | public static void getPlugin(Class cls) { 31 | try { 32 | IPlugin p = (IPlugin) cls.newInstance(); 33 | NOW_PLUGIN = p; 34 | } catch (IllegalAccessException | InstantiationException e) { 35 | HMCLog.err("Failed to new instance"); 36 | } 37 | } 38 | 39 | public static IPlugin plugin() { 40 | return NOW_PLUGIN; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/install/cauldron/MinecraftLibrary.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.install.cauldron; 19 | 20 | import java.io.File; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public class MinecraftLibrary { 27 | 28 | public String url, formatted = null, name; 29 | //public boolean serverreq=true, clientreq=true; 30 | public String[] checksums; 31 | 32 | public void init() { 33 | String str = name; 34 | String[] s = str.split(":"); 35 | str = s[0]; 36 | str = str.replace('.', File.separatorChar); 37 | str += File.separator + s[1] + File.separator + s[2] 38 | + File.separator + s[1] + '-' + s[2] + ".jar"; 39 | formatted = str; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/service/IMinecraftModService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.service; 19 | 20 | import java.io.File; 21 | import java.util.List; 22 | import org.jackhuang.hellominecraft.launcher.core.mod.ModInfo; 23 | 24 | /** 25 | * 26 | * @author huangyuhui 27 | */ 28 | public abstract class IMinecraftModService extends IMinecraftBasicService { 29 | 30 | public IMinecraftModService(IMinecraftService service) { 31 | super(service); 32 | } 33 | 34 | public abstract List getMods(String id); 35 | 36 | public abstract List recacheMods(String id); 37 | 38 | public abstract boolean addMod(String id, File f); 39 | 40 | public abstract boolean removeMod(String id, Object[] mods); 41 | } 42 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/launch/LibraryDownloadTask.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.launch; 19 | 20 | import org.jackhuang.hellominecraft.util.C; 21 | import org.jackhuang.hellominecraft.launcher.core.download.DownloadLibraryJob; 22 | import org.jackhuang.hellominecraft.util.net.FileDownloadTask; 23 | 24 | /** 25 | * 26 | * @author huangyuhui 27 | */ 28 | public class LibraryDownloadTask extends FileDownloadTask { 29 | 30 | DownloadLibraryJob job; 31 | 32 | public LibraryDownloadTask(DownloadLibraryJob job) { 33 | super(job.parse().url, job.path); 34 | this.job = job; 35 | } 36 | 37 | @Override 38 | public String getInfo() { 39 | return C.i18n("download") + ": " + job.lib.name; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/log/Configuration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.log; 19 | 20 | import java.util.ArrayList; 21 | import org.jackhuang.hellominecraft.util.log.appender.ConsoleAppender; 22 | import org.jackhuang.hellominecraft.util.log.appender.IAppender; 23 | import org.jackhuang.hellominecraft.util.log.layout.DefaultLayout; 24 | 25 | /** 26 | * 27 | * @author huangyuhui 28 | */ 29 | public class Configuration { 30 | 31 | public ArrayList appenders = new ArrayList<>(); 32 | 33 | public static final Configuration DEFAULT; 34 | 35 | static { 36 | DEFAULT = new Configuration(); 37 | DEFAULT.appenders.add(new ConsoleAppender("Console", new DefaultLayout(), true, new ConsoleAppender.SystemOutStream(), true)); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: 3 | - oraclejdk8 4 | branches: 5 | only: 6 | - master 7 | before_deploy: 8 | - git config --global user.email ${GITHUB_EMAIL} 9 | - git config --global user.name ${GITHUB_NAME} 10 | - git tag ${TRAVIS_BUILD_NUMBER} 11 | - git push -q ${REPO} --tags 12 | deploy: 13 | provider: releases 14 | api_key: 15 | secure: lfFEwKtij/s9Ao/SKL7oVdsWcfASshZuwT27gllMrTx1ZQqLCG2I5mGJOp5ukx7lb3y4Tu316nFasLjy9NI3eLXSx9f0w4q+wMf0K5Yj9iOwu/TIn7JkLyHDMQ20qRwGxZplS2WUb669gIRg+l6jUHeTBW+dlTxr0mMa6WHIl8UDpHwfFrGC3i6dL4y6WlDwGl2rYktvOoA/iqvtglBcHuXaL2sDfhp5MXRcYULTIw+b9zmiQXP665DQN+Su5I3gwB4y5X8RH72GAacZn13fEIo5i8UUoHM7UQxM8y8DKSO3avyFCfpUle9+9sErQVW7b6JV1c+AoLWuAhNJLMlUTKarZE7UMqfjvoQHxX5hp2B2WHLEON/UJiGf25HJWx6VhJitE0/odujqnG/umesqki2jMTs6gPcxbc9iBjzUg+ZmFztdtC+Emnni7lpqVVl+Y5hsJRn3Z6rIiNgwmaE0r2OQgAm1vRYFc7jvOdRfyFG+uCRZF6nS56BzJ7dLc0WW8dTgSft6YFll4ZYL6hiI9qiIaBAK948y5HV+6VBWuO3xf/G2CUFbE1Y9qUCjToh3ahxNDzZvXB+rXqvlvNQOi5l8n594oQ61n45qIHSKlMBn9Bxhw29oWT5mo1aYIaNXbpzKam2w4mK0T3VrgTszu/3282wRbNr+VAwdGMfwW1s= 16 | file: 17 | - HMCL/build/libs/HMCL-${HMCL_VERSION_ROOT}.${TRAVIS_BUILD_NUMBER}.jar 18 | - HMCL/build/libs/HMCL-${HMCL_VERSION_ROOT}.${TRAVIS_BUILD_NUMBER}.exe 19 | - HMCL/build/libs/HMCL-${HMCL_VERSION_ROOT}.${TRAVIS_BUILD_NUMBER}-MacOSApp.zip 20 | on: 21 | repo: huanghongxun/HMCL 22 | tags: false 23 | skip_cleanup: true 24 | install: echo "skip 'gradle assemble' step" 25 | script: gradle build --continue 26 | before_cache: 27 | - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock 28 | #cache: 29 | # directories: 30 | # - "$HOME/.gradle/caches/" 31 | # - "$HOME/.gradle/wrapper/" 32 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/install/liteloader/LiteLoaderVersion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.install.liteloader; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | import org.jackhuang.hellominecraft.launcher.core.version.MinecraftLibrary; 22 | 23 | /** 24 | * 25 | * @author huangyuhui 26 | */ 27 | public class LiteLoaderVersion { 28 | 29 | @SerializedName("tweakClass") 30 | public String tweakClass; 31 | @SerializedName("file") 32 | public String file; 33 | @SerializedName("version") 34 | public String version; 35 | @SerializedName("md5") 36 | public String md5; 37 | @SerializedName("timestamp") 38 | public String timestamp; 39 | @SerializedName("libraries") 40 | public MinecraftLibrary[] libraries; 41 | } 42 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/task/ParallelTask.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.task; 19 | 20 | import java.util.Collection; 21 | import java.util.HashSet; 22 | 23 | /** 24 | * 25 | * @author huangyuhui 26 | */ 27 | public class ParallelTask extends Task { 28 | 29 | Collection tasks = new HashSet<>(); 30 | 31 | public ParallelTask() { 32 | hidden = true; 33 | } 34 | 35 | @Override 36 | public void executeTask(boolean areDependTasksSucceeded) { 37 | } 38 | 39 | @Override 40 | public String getInfo() { 41 | return "PARALLEL"; 42 | } 43 | 44 | @Override 45 | public Collection getDependTasks() { 46 | return tasks; 47 | } 48 | 49 | public void addTask(Task t) { 50 | tasks.add(t); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/server/ServerChecker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.server; 19 | 20 | import java.io.File; 21 | import java.io.IOException; 22 | import java.util.zip.ZipFile; 23 | import org.jackhuang.hellominecraft.util.log.HMCLog; 24 | 25 | /** 26 | * 27 | * @author huangyuhui 28 | */ 29 | public class ServerChecker { 30 | 31 | public static boolean isServerJar(File f) { 32 | ZipFile file; 33 | try { 34 | file = new ZipFile(f); 35 | } catch (IOException ex) { 36 | HMCLog.warn("", ex); 37 | return false; 38 | } 39 | if (file.getEntry("org/bukkit/craftbukkit/Main.class") != null) 40 | return true; 41 | return file.getEntry("net/minecraft/server/MinecraftServer.class") != null; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/util/Utilities.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.util; 19 | 20 | import java.io.File; 21 | import org.jackhuang.hellominecraft.svrmgr.setting.SettingsManager; 22 | import org.jackhuang.hellominecraft.util.sys.IOUtils; 23 | 24 | /** 25 | * 26 | * @author huangyuhui 27 | */ 28 | public class Utilities { 29 | 30 | public static String getGameDir() { 31 | return IOUtils.addSeparator(new File(SettingsManager.settings.mainjar).getParent()); 32 | } 33 | 34 | public static String getPath(String lastFolder) { 35 | File file = new File(try2GetPath(lastFolder)); 36 | return file.exists() ? file.getPath() : null; 37 | } 38 | 39 | public static String try2GetPath(String lastFolder) { 40 | return getGameDir() + lastFolder; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/sys/Platform.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.sys; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public enum Platform { 25 | 26 | UNKNOWN { 27 | 28 | @Override 29 | public String getBit() { 30 | return "unknown"; 31 | } 32 | 33 | }, 34 | BIT_32 { 35 | 36 | @Override 37 | public String getBit() { 38 | return "32"; 39 | } 40 | 41 | }, 42 | BIT_64 { 43 | 44 | @Override 45 | public String getBit() { 46 | return "64"; 47 | } 48 | 49 | }; 50 | 51 | public abstract String getBit(); 52 | 53 | public static Platform getPlatform() { 54 | return System.getProperty("os.arch").contains("64") ? BIT_64 : BIT_32; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/util/FileNameFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.util; 19 | 20 | import java.io.File; 21 | import javax.swing.filechooser.FileFilter; 22 | import org.jackhuang.hellominecraft.util.sys.FileUtils; 23 | 24 | /** 25 | * 26 | * @author huangyuhui 27 | */ 28 | public class FileNameFilter extends FileFilter { 29 | 30 | String acceptedName; 31 | 32 | public FileNameFilter(String acceptedName) { 33 | this.acceptedName = acceptedName; 34 | } 35 | 36 | @Override 37 | public boolean accept(File f) { 38 | return f.isDirectory() || f.getName().equals(acceptedName) && !FileUtils.getExtension(f.getName()).equals("lnk"); 39 | } 40 | 41 | @Override 42 | public String getDescription() { 43 | return acceptedName; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/auth/yggdrasil/Response.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.auth.yggdrasil; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | 22 | public class Response { 23 | 24 | @SerializedName("accessToken") 25 | public String accessToken; 26 | @SerializedName("clientToken") 27 | public String clientToken; 28 | @SerializedName("selectedProfile") 29 | public GameProfile selectedProfile; 30 | @SerializedName("availableProfiles") 31 | public GameProfile[] availableProfiles; 32 | @SerializedName("user") 33 | public User user; 34 | @SerializedName("error") 35 | public String error; 36 | @SerializedName("errorMessage") 37 | public String errorMessage; 38 | @SerializedName("cause") 39 | public String cause; 40 | } 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Hello Minecraft! Launcher [![Build Status](https://travis-ci.org/huanghongxun/HMCL.svg?branch=master)](https://travis-ci.org/huanghongxun/HMCL) 2 | 开源协议为GPL v3, 详情参见http://www.gnu.org/licenses/gpl.html 3 | 4 | ## Introduction 5 | 6 | HMCL is a Minecraft launcher which supports Mod management, game customizing, auto installing(Forge, LiteLoader and OptiFine), modpack creating, UI customizing and so on. 7 | 8 | ## Contribution 9 | If you want to submit a pull request, there're some requirements: 10 | * IDE: Netbeans 8.1 11 | * Compiler: Java 1.8 and libraries only supports Java 1.7(because of retrolambda). 12 | * Do NOT modify `gradle` files. 13 | 14 | ## Code 15 | * package `org.jackhuang.hellominecraft.util`: HMCL development utilities. 16 | * package `org.jackhuang.hellominecraft.launcher`: HMCL UI core. 17 | * package `org.jackhuang.hellominecraft.launcher.core`: HMCL game launcher core. 18 | * package `org.jackhuang.hellominecraft.launcher.api`: Nothing here! 19 | * package `org.jackhuang.hellominecraft.svrmgr`: All HMCSM codes. 20 | * Folder `HMCUtils/src/main/resources/org/jackhuang/hellominecraft/lang` contains language files. 21 | 22 | ## Pay Attention 23 | * When you do decide to modify this app, please and you MUST delete `org.jackhuang.hellominecraft.launcher.util.CrashReporter`, or errors your code cause will be sent to my server. 24 | * package `org.jackhuang.hellominecraft.util.logging`: repackaged Apache Log4j, Apache License 2.0. 25 | * package `com.google.gson`: Apache License 2.0 26 | * package `org.jackhuang.hellominecraft.lookandfeel.ui`: contains some NimbusLAF's code belonging to Sun Microsystems under LGPL. -------------------------------------------------------------------------------- /HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/ui/Page.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.ui; 19 | 20 | import javax.swing.JPanel; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public class Page extends JPanel implements Selectable { 27 | 28 | boolean selected = false; 29 | 30 | @Override 31 | public boolean isSelected() { 32 | return selected; 33 | } 34 | 35 | @Override 36 | public void onSelect() { 37 | selected = true; 38 | } 39 | 40 | @Override 41 | public void onLeave() { 42 | selected = false; 43 | } 44 | 45 | boolean created = false; 46 | 47 | @Override 48 | public void onCreate() { 49 | created = true; 50 | } 51 | 52 | @Override 53 | public boolean isCreated() { 54 | return created; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/util/WaitForThread.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.util; 19 | 20 | import org.jackhuang.hellominecraft.util.EventHandler; 21 | import org.jackhuang.hellominecraft.util.log.HMCLog; 22 | 23 | /** 24 | * 25 | * @author jack 26 | */ 27 | public class WaitForThread extends Thread { 28 | 29 | public final EventHandler event = new EventHandler<>(this); 30 | Process p; 31 | 32 | public WaitForThread(Process p) { 33 | this.p = p; 34 | } 35 | 36 | @Override 37 | public void run() { 38 | try { 39 | int exitCode = p.waitFor(); 40 | event.execute(exitCode); 41 | } catch (InterruptedException ex) { 42 | HMCLog.err("Game has been interrupted.", ex); 43 | event.execute(-1); 44 | } 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/ui/IRepaint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.ui; 19 | 20 | import java.awt.Rectangle; 21 | import java.awt.Window; 22 | import java.util.Collection; 23 | import javax.swing.JComponent; 24 | 25 | /** 26 | * 27 | * @author huang 28 | */ 29 | public interface IRepaint { 30 | 31 | /** 32 | * addDirtyRegion to? 33 | * @return the component which needs repainting. 34 | */ 35 | JComponent getRepaintComponent(); 36 | 37 | /** 38 | * addDirtyRegion to? 39 | * @return the window which needs repainting. 40 | */ 41 | Window getRepaintWindow(); 42 | 43 | /** 44 | * Repaint the component/window you want. 45 | * @return the region where you want to repaint. 46 | */ 47 | Collection getRepaintRects(); 48 | } 49 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/install/cauldron/ForgeVersion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.install.cauldron; 19 | 20 | import java.util.Arrays; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public class ForgeVersion { 27 | 28 | public String vername, ver, mcver, releasetime, changelog; 29 | public String[] installer, javadoc, src, universal, userdev; 30 | public int typeint; 31 | 32 | @Override 33 | public String toString() { 34 | return "ForgeVersion{" + "vername=" + vername + ", ver=" + ver + ", mcver=" + mcver + ", releasetime=" + releasetime + ", changelog=" + changelog + ", installer=" + Arrays.toString(installer) + ", javadoc=" + Arrays.toString(javadoc) + ", src=" + Arrays.toString(src) + ", universal=" + universal + ", userdev=" + userdev + ", typeint=" + typeint + '}'; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/log/HMCLog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.log; 19 | 20 | import org.jackhuang.hellominecraft.util.log.logger.Logger; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public class HMCLog { 27 | 28 | private static final Logger LOGGER = new Logger("Hello Minecraft!"); 29 | 30 | public static void log(String message) { 31 | LOGGER.info(message); 32 | } 33 | 34 | public static void warn(String message) { 35 | LOGGER.warn(message); 36 | } 37 | 38 | public static void warn(String msg, Throwable t) { 39 | LOGGER.warn(msg, t); 40 | } 41 | 42 | public static void err(String msg) { 43 | LOGGER.error(msg); 44 | } 45 | 46 | public static void err(String msg, Throwable t) { 47 | LOGGER.error(msg, t); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/server/schedule/AutoBackupSchedule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.server.schedule; 19 | 20 | import java.util.TimerTask; 21 | import org.jackhuang.hellominecraft.svrmgr.server.Server; 22 | import org.jackhuang.hellominecraft.svrmgr.server.BackupManager; 23 | import org.jackhuang.hellominecraft.svrmgr.setting.Schedule; 24 | 25 | /** 26 | * 27 | * @author huangyuhui 28 | */ 29 | public class AutoBackupSchedule extends TimerTask { 30 | 31 | Schedule main; 32 | Server server; 33 | 34 | public AutoBackupSchedule(Schedule s, Server s2) { 35 | main = s; 36 | server = s2; 37 | } 38 | 39 | @Override 40 | public void run() { 41 | System.out.println("Backup"); 42 | Server.getInstance().sendCommand("say 自动备份完毕"); 43 | BackupManager.backupAllWorlds(); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/download/MinecraftRemoteVersion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.download; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public class MinecraftRemoteVersion { 27 | 28 | @SerializedName("id") 29 | public String id; 30 | @SerializedName("time") 31 | public String time; 32 | @SerializedName("releaseTime") 33 | public String releaseTime; 34 | @SerializedName("type") 35 | public String type; 36 | @SerializedName("url") 37 | private String url; 38 | 39 | public String getUrl(DownloadType type) { 40 | if (url == null) 41 | return type.getProvider().getVersionsDownloadURL() + id + "/" + id + ".json"; 42 | return type.getProvider().getParsedDownloadURL(url); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/version/Extract.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.version; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | import java.util.ArrayList; 22 | import java.util.List; 23 | import org.jackhuang.hellominecraft.util.StrUtils; 24 | 25 | /** 26 | * 27 | * @author huangyuhui 28 | */ 29 | public class Extract implements Cloneable { 30 | 31 | @SerializedName("exclude") 32 | public List exclude = new ArrayList<>(); 33 | 34 | public boolean allow(String path) { 35 | return !StrUtils.startsWithOne(exclude, path); 36 | } 37 | 38 | @Override 39 | public Object clone() { 40 | try { 41 | return super.clone(); 42 | } catch (CloneNotSupportedException ex) { 43 | throw new InternalError(ex); 44 | } 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/plugin/BukkitPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.plugin; 19 | 20 | import java.util.List; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public class BukkitPlugin { 27 | 28 | public String description, plugin_name, slug; 29 | public List versions; 30 | 31 | public String getLatestVersion() { 32 | if (versions != null) { 33 | PluginVersion v = versions.get(0); 34 | return v.version; 35 | } 36 | return null; 37 | } 38 | 39 | public String getLatestBukkit() { 40 | if (versions != null) { 41 | PluginVersion v = versions.get(0); 42 | List al = v.game_versions; 43 | if (al != null && !al.isEmpty()) 44 | return al.get(0); 45 | } 46 | return ""; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/version/AssetIndexDownloadInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.version; 19 | 20 | import org.jackhuang.hellominecraft.launcher.core.download.DownloadType; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public class AssetIndexDownloadInfo extends GameDownloadInfo { 27 | 28 | int totalSize; 29 | 30 | public AssetIndexDownloadInfo() { 31 | } 32 | 33 | public AssetIndexDownloadInfo(String id) { 34 | this.id = id; 35 | url = null; 36 | } 37 | 38 | @Override 39 | public String getCustomizedURL(DownloadType dt) { 40 | return dt.getProvider().getIndexesDownloadURL() + id + ".json"; 41 | } 42 | 43 | public String getId() { 44 | return id; 45 | } 46 | 47 | public int getTotalSize() { 48 | return totalSize; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/version/DecompressLibraryJob.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.version; 19 | 20 | import java.io.File; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public class DecompressLibraryJob { 27 | 28 | public File[] decompressFiles; 29 | public Extract[] extractRules; 30 | private File decompressTo; 31 | 32 | public DecompressLibraryJob(File[] decompressFiles, Extract[] extractRules, File decompressTo) { 33 | this.decompressFiles = decompressFiles.clone(); 34 | this.extractRules = extractRules.clone(); 35 | this.decompressTo = decompressTo; 36 | } 37 | 38 | public File getDecompressTo() { 39 | return decompressTo; 40 | } 41 | 42 | public void setDecompressTo(File decompressTo) { 43 | this.decompressTo = decompressTo; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/setting/Schedule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.setting; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public class Schedule { 25 | 26 | public static final int TYPE_AUTO_SAVE = 0, 27 | TYPE_AUTO_RESTART = 1, 28 | TYPE_AUTO_BACKUP = 2, 29 | TYPE_AUTO_BROADCAST = 3, 30 | TYPE_AUTO_SEND_COMMAND = 4, 31 | TYPE_AUTO_EXECUTE = 5; 32 | public static final int TYPE2_AUTO_BACKUP_PLUGINS = 1, 33 | TYPE2_AUTH_BACKUP_CONFIG = 2, 34 | TYPE3_AUTH_BACKUP_WORLD = 3; 35 | public static final int TIME_TYPE_PER = 0, 36 | TIME_TYPE_PAST_HOUR = 1, 37 | TIME_TYPE_SERVER_STARTED = 2, 38 | TIME_TYPE_SERVER_STOPPED = 3, 39 | TIME_TYPE_SERVER_CRASHED = 4; 40 | 41 | public int type, type2, timeType; 42 | public String content; 43 | public double per; 44 | } 45 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/ui/wizard/spi/AbstractWizard.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.ui.wizard.spi; 19 | 20 | import java.util.Collections; 21 | import java.util.LinkedList; 22 | import java.util.List; 23 | import org.jackhuang.hellominecraft.util.func.Consumer; 24 | 25 | /** 26 | * 27 | * @author huang 28 | */ 29 | public abstract class AbstractWizard implements WizardImplementation { 30 | 31 | protected final List listenerList = Collections.synchronizedList(new LinkedList<>()); 32 | 33 | protected void fireChanged(Consumer r) { 34 | WizardObserver[] listeners = listenerList.toArray(new WizardObserver[listenerList.size()]); 35 | 36 | for (int i = listeners.length - 1; i >= 0; i--) { 37 | WizardObserver l = (WizardObserver) listeners[i]; 38 | r.accept(l); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/setting/BannedPlayers.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.setting; 19 | 20 | import java.text.SimpleDateFormat; 21 | import java.util.Date; 22 | 23 | /** 24 | * 25 | * @author huangyuhui 26 | */ 27 | public class BannedPlayers extends PlayerList { 28 | 29 | @Override 30 | protected BannedPlayer newPlayer(String name) { 31 | return new BannedPlayer(name); 32 | } 33 | 34 | public static class BannedPlayer extends PlayerList.BasePlayer { 35 | 36 | public String source, expires, reason, created; 37 | 38 | public BannedPlayer(String name) { 39 | super(name); 40 | 41 | created = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss +0800").format(new Date()); 42 | source = "Server"; 43 | expires = "forever"; 44 | reason = "你已经被服务器封禁"; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/setting/Settings.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.setting; 19 | 20 | import java.util.ArrayList; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public class Settings { 27 | 28 | public boolean checkUpdate; 29 | public String maxMemory; 30 | public String mainjar, bgPath, javaDir, javaArgs; 31 | public ArrayList inactiveExtMods, inactiveCoreMods, inactivePlugins, 32 | inactiveWorlds; 33 | public ArrayList schedules; 34 | 35 | public Settings() { 36 | maxMemory = "1024"; 37 | checkUpdate = true; 38 | schedules = new ArrayList<>(); 39 | mainjar = bgPath = javaDir = javaArgs = ""; 40 | inactiveExtMods = new ArrayList<>(); 41 | inactiveCoreMods = new ArrayList<>(); 42 | inactivePlugins = new ArrayList<>(); 43 | inactiveWorlds = new ArrayList<>(); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /HMCSM/src/main/java/org/jackhuang/hellominecraft/svrmgr/server/schedule/AutoExecuteSchedule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Server Manager. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.svrmgr.server.schedule; 19 | 20 | import java.io.IOException; 21 | import java.util.TimerTask; 22 | import org.jackhuang.hellominecraft.util.log.HMCLog; 23 | import org.jackhuang.hellominecraft.svrmgr.server.Server; 24 | import org.jackhuang.hellominecraft.svrmgr.setting.Schedule; 25 | 26 | /** 27 | * 28 | * @author huangyuhui 29 | */ 30 | public class AutoExecuteSchedule extends TimerTask { 31 | 32 | Schedule main; 33 | Server server; 34 | 35 | public AutoExecuteSchedule(Schedule s, Server s2) { 36 | main = s; 37 | server = s2; 38 | } 39 | 40 | @Override 41 | public void run() { 42 | try { 43 | Runtime.getRuntime().exec(main.content); 44 | } catch (IOException ex) { 45 | HMCLog.err("Failed to exec command: " + main.content, ex); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/ui/WideComboBox.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.ui; 19 | 20 | import java.awt.Dimension; 21 | import javax.swing.JComboBox; 22 | 23 | /** 24 | * Make the popup menu of combo boxes wider. 25 | * @author huangyuhui 26 | */ 27 | public class WideComboBox extends JComboBox { 28 | 29 | public WideComboBox() { 30 | } 31 | 32 | private boolean layingOut = false; 33 | public int customzedMinimumWidth = 300; 34 | 35 | @Override 36 | public void doLayout() { 37 | try { 38 | layingOut = true; 39 | super.doLayout(); 40 | } finally { 41 | layingOut = false; 42 | } 43 | } 44 | 45 | @Override 46 | public Dimension getSize() { 47 | Dimension dim = super.getSize(); 48 | if (!layingOut) 49 | dim.width = Math.max(dim.width, customzedMinimumWidth); 50 | return dim; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/version/MinecraftOldLibrary.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.version; 19 | 20 | import java.io.File; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public class MinecraftOldLibrary extends MinecraftLibrary { 27 | 28 | public MinecraftOldLibrary(String name) { 29 | super(name); 30 | } 31 | 32 | @Override 33 | public boolean isRequiredToUnzip() { 34 | return false; 35 | } 36 | 37 | @Override 38 | public boolean allow() { 39 | return true; 40 | } 41 | 42 | @Override 43 | public File getFilePath(File gameDir) { 44 | return new File(gameDir, "bin/" + name + ".jar"); 45 | } 46 | 47 | @Override 48 | public Object clone() { 49 | return super.clone(); 50 | } 51 | 52 | @Override 53 | public LibraryDownloadInfo getDownloadInfo() { 54 | return new LibraryDownloadInfo(); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/ui/NewTabPane.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.ui; 19 | 20 | import javax.swing.JTabbedPane; 21 | import javax.swing.event.ChangeEvent; 22 | import javax.swing.event.ChangeListener; 23 | 24 | /** 25 | * 26 | * @author huangyuhui 27 | */ 28 | public class NewTabPane extends JTabbedPane implements ChangeListener { 29 | 30 | public NewTabPane() { 31 | super(); 32 | addChangeListener(this); 33 | } 34 | 35 | public boolean initializing; 36 | 37 | @Override 38 | public void stateChanged(ChangeEvent e) { 39 | if (initializing) 40 | return; 41 | for (int i = 0; i < getComponentCount(); ++i) 42 | if (getSelectedIndex() != i && getComponent(i) instanceof Selectable) 43 | ((Selectable) getComponent(i)).onLeave(); 44 | if (getSelectedComponent() instanceof Selectable) 45 | ((Selectable) getSelectedComponent()).onSelect(); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/install/forge/MinecraftForgeVersionRoot.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.install.forge; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | import java.util.Map; 22 | 23 | /** 24 | * 25 | * @author huangyuhui 26 | */ 27 | public class MinecraftForgeVersionRoot { 28 | 29 | @SerializedName("artifact") 30 | public String artifact; 31 | @SerializedName("webpath") 32 | public String webpath; 33 | @SerializedName("adfly") 34 | public String adfly; 35 | @SerializedName("homepage") 36 | public String homepage; 37 | @SerializedName("name") 38 | public String name; 39 | @SerializedName("branches") 40 | public Map branches; 41 | @SerializedName("mcversion") 42 | public Map mcversion; 43 | @SerializedName("promos") 44 | public Map promos; 45 | @SerializedName("number") 46 | public Map number; 47 | } 48 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/auth/yggdrasil/UUIDTypeAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.auth.yggdrasil; 19 | 20 | import com.google.gson.TypeAdapter; 21 | import com.google.gson.stream.JsonReader; 22 | import com.google.gson.stream.JsonWriter; 23 | import java.io.IOException; 24 | import java.util.UUID; 25 | 26 | public class UUIDTypeAdapter extends TypeAdapter { 27 | 28 | @Override 29 | public void write(JsonWriter out, UUID value) throws IOException { 30 | out.value(fromUUID(value)); 31 | } 32 | 33 | @Override 34 | public UUID read(JsonReader in) throws IOException { 35 | return fromString(in.nextString()); 36 | } 37 | 38 | public static String fromUUID(UUID value) { 39 | return value.toString().replace("-", ""); 40 | } 41 | 42 | public static UUID fromString(String input) { 43 | return UUID.fromString(input.replaceFirst("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})", "$1-$2-$3-$4-$5")); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/asset/AssetsIndex.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.asset; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | import java.util.HashSet; 22 | import java.util.LinkedHashMap; 23 | import java.util.Map; 24 | import java.util.Set; 25 | 26 | /** 27 | * 28 | * @author huangyuhui 29 | */ 30 | public class AssetsIndex { 31 | 32 | public static final String DEFAULT_ASSET_NAME = "legacy"; 33 | 34 | @SerializedName("objects") 35 | public Map objects; 36 | 37 | @SerializedName("virtual") 38 | public boolean virtual; 39 | 40 | public AssetsIndex() { 41 | this.objects = new LinkedHashMap<>(); 42 | } 43 | 44 | public Map getFileMap() { 45 | return this.objects; 46 | } 47 | 48 | public Set getUniqueObjects() { 49 | return new HashSet<>(this.objects.values()); 50 | } 51 | 52 | public boolean isVirtual() { 53 | return this.virtual; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/version/OSRestriction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.version; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | import org.jackhuang.hellominecraft.util.StrUtils; 22 | import org.jackhuang.hellominecraft.util.sys.OS; 23 | 24 | /** 25 | * 26 | * @author huangyuhui 27 | */ 28 | public class OSRestriction { 29 | 30 | @SerializedName("version") 31 | private String version; 32 | @SerializedName("name") 33 | public String name; 34 | 35 | public String getVersion() { 36 | return version; 37 | } 38 | 39 | public void setVersion(String version) { 40 | this.version = version; 41 | } 42 | 43 | public String getName() { 44 | return name; 45 | } 46 | 47 | public void setName(String name) { 48 | this.name = name; 49 | } 50 | 51 | public boolean isCurrentOS() { 52 | return StrUtils.isBlank(getName()) || OS.os().name().equalsIgnoreCase(getName()); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/ui/RepaintPage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.ui; 19 | 20 | import org.jackhuang.hellominecraft.util.ui.IRepaint; 21 | import java.awt.Rectangle; 22 | import java.awt.Window; 23 | import java.util.Arrays; 24 | import java.util.Collection; 25 | import javax.swing.JComponent; 26 | 27 | /** 28 | * 29 | * @author huang 30 | */ 31 | public class RepaintPage extends Page implements IRepaint { 32 | 33 | public RepaintPage() { 34 | super(); 35 | } 36 | 37 | JComponent repainter; 38 | 39 | @Override 40 | public JComponent getRepaintComponent() { 41 | return repainter; 42 | } 43 | 44 | public void setRepainter(JComponent repainter) { 45 | this.repainter = repainter; 46 | } 47 | 48 | @Override 49 | public Collection getRepaintRects() { 50 | return Arrays.asList(this.getBounds()); 51 | } 52 | 53 | @Override 54 | public Window getRepaintWindow() { 55 | return null; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /HMCLaF/src/main/java/org/jackhuang/hellominecraft/lookandfeel/ui/ListCellRender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: NimbusGraphicsUtils.java,v 1.9 2005/12/05 15:00:55 kizune Exp $ 3 | * 4 | * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle, 5 | * Santa Clara, California 95054, U.S.A. All rights reserved. 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | package org.jackhuang.hellominecraft.lookandfeel.ui; 22 | 23 | import javax.swing.DefaultListCellRenderer; 24 | import javax.swing.JList; 25 | import java.awt.Color; 26 | import java.awt.Component; 27 | 28 | /** 29 | * NimbusListCellRender 30 | * 31 | * @author Created by Jasper Potts (Jan 19, 2007) 32 | * @version 1.0 33 | */ 34 | public class ListCellRender extends DefaultListCellRenderer { 35 | 36 | @Override 37 | public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, 38 | boolean cellHasFocus) { 39 | setOpaque(true); 40 | setBackground(Color.magenta); 41 | return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/ui/wizard/spi/WizardObserver.java: -------------------------------------------------------------------------------- 1 | /* The contents of this file are subject to the terms of the Common Development 2 | and Distribution License (the License). You may not use this file except in 3 | compliance with the License. 4 | You can obtain a copy of the License at http://www.netbeans.org/cddl.html 5 | or http://www.netbeans.org/cddl.txt. 6 | When distributing Covered Code, include this CDDL Header Notice in each file 7 | and include the License file at http://www.netbeans.org/cddl.txt. 8 | If applicable, add the following below the CDDL Header, with the fields 9 | enclosed by brackets [] replaced by your own identifying information: 10 | "Portions Copyrighted [year] [name of copyright owner]" */ 11 | package org.jackhuang.hellominecraft.util.ui.wizard.spi; 12 | 13 | /** 14 | * Observer which can detect changes in the state of a wizard as the 15 | * user proceeds. Only likely to be used by implementations of 16 | * WizardDisplayer. 17 | */ 18 | public interface WizardObserver { 19 | /** 20 | * Called when the number or names of the steps of the 21 | * wizard changes (for example, the user made a choice in one pane which 22 | * affects the flow of subsequent steps). 23 | * @param wizard The wizard whose steps have changed 24 | */ 25 | public void stepsChanged(Wizard wizard); 26 | 27 | /** 28 | * Called when the enablement of the next/previous/finish buttons 29 | * change, or the problem text changes. 30 | * @param wizard The wizard whose navigability has changed 31 | */ 32 | public void navigabilityChanged(Wizard wizard); 33 | 34 | /** 35 | * Called whenever the current step changes. 36 | * 37 | * @param wizard The wizard whose current step has changed 38 | */ 39 | public void selectionChanged(Wizard wizard); 40 | } -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/task/DoubleTask.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.task; 19 | 20 | import java.util.Arrays; 21 | import java.util.Collection; 22 | 23 | /** 24 | * 25 | * @author huangyuhui 26 | */ 27 | public class DoubleTask extends TaskInfo { 28 | 29 | Task a, b; 30 | 31 | public DoubleTask(Task a, Task b) { 32 | this(a, b, "Double Task"); 33 | } 34 | 35 | public DoubleTask(Task a, Task b, String info) { 36 | super(info); 37 | this.a = a; 38 | this.b = b; 39 | hidden = true; 40 | } 41 | 42 | @Override 43 | public Collection getDependTasks() { 44 | return Arrays.asList(a); 45 | } 46 | 47 | @Override 48 | public Collection getAfterTasks() { 49 | return Arrays.asList(b); 50 | } 51 | 52 | @Override 53 | public void executeTask(boolean areDependTasksSucceeded) throws Throwable { 54 | if (!areDependTasksSucceeded) 55 | throw new IllegalStateException("Depend tasks failed."); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/CollectionUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util; 19 | 20 | import org.jackhuang.hellominecraft.util.func.Predicate; 21 | import java.util.ArrayList; 22 | import java.util.Collection; 23 | import java.util.Iterator; 24 | 25 | /** 26 | * 27 | * @author huangyuhui 28 | */ 29 | public final class CollectionUtils { 30 | 31 | private CollectionUtils() { 32 | } 33 | 34 | public static ArrayList filter(Collection coll, Predicate p) { 35 | ArrayList newColl = new ArrayList<>(); 36 | for (T t : coll) 37 | if (p.apply(t)) 38 | newColl.add(t); 39 | return newColl; 40 | } 41 | 42 | public static boolean removeIf(Collection coll, Predicate p) { 43 | boolean removed = false; 44 | final Iterator each = coll.iterator(); 45 | while (each.hasNext()) 46 | if (p.apply(each.next())) { 47 | each.remove(); 48 | removed = true; 49 | } 50 | return removed; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/service/IMinecraftInstallerService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.service; 19 | 20 | import org.jackhuang.hellominecraft.launcher.core.install.InstallerType; 21 | import org.jackhuang.hellominecraft.launcher.core.install.InstallerVersionList; 22 | import org.jackhuang.hellominecraft.util.task.Task; 23 | 24 | /** 25 | * 26 | * @author huangyuhui 27 | */ 28 | public abstract class IMinecraftInstallerService extends IMinecraftBasicService { 29 | 30 | public IMinecraftInstallerService(IMinecraftService service) { 31 | super(service); 32 | } 33 | 34 | public abstract Task download(String installId, InstallerVersionList.InstallerVersion v, InstallerType type); 35 | 36 | public abstract Task downloadForge(String installId, InstallerVersionList.InstallerVersion v); 37 | 38 | public abstract Task downloadOptiFine(String installId, InstallerVersionList.InstallerVersion v); 39 | 40 | public abstract Task downloadLiteLoader(String installId, InstallerVersionList.InstallerVersion v); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/util/HMCLGameProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.util; 19 | 20 | import java.io.File; 21 | import org.jackhuang.hellominecraft.launcher.core.version.GameDirType; 22 | import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersionManager; 23 | import org.jackhuang.hellominecraft.launcher.setting.VersionSetting; 24 | 25 | /** 26 | * 27 | * @author huangyuhui 28 | */ 29 | public class HMCLGameProvider extends MinecraftVersionManager { 30 | 31 | public HMCLGameProvider(HMCLMinecraftService p) { 32 | super(p); 33 | } 34 | 35 | @Override 36 | public File getRunDirectory(String id) { 37 | VersionSetting vs = ((HMCLMinecraftService) service).getVersionSetting(id); 38 | if (vs == null) 39 | return super.getRunDirectory(id); 40 | else 41 | return ((HMCLMinecraftService) service).getVersionSetting(id).getGameDirType() == GameDirType.VERSION_FOLDER 42 | ? service.version().versionRoot(id) 43 | : super.getRunDirectory(id); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/ui/checktree/CheckBoxTreeNodeSelectionListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.ui.checktree; 19 | 20 | import java.awt.event.MouseAdapter; 21 | import java.awt.event.MouseEvent; 22 | 23 | import javax.swing.JTree; 24 | import javax.swing.tree.TreePath; 25 | import javax.swing.tree.DefaultTreeModel; 26 | 27 | public class CheckBoxTreeNodeSelectionListener extends MouseAdapter { 28 | 29 | @Override 30 | public void mouseClicked(MouseEvent event) { 31 | JTree tree = (JTree) event.getSource(); 32 | int x = event.getX(); 33 | int y = event.getY(); 34 | int row = tree.getRowForLocation(x, y); 35 | TreePath path = tree.getPathForRow(row); 36 | if (path != null) { 37 | CheckBoxTreeNode node = (CheckBoxTreeNode) path.getLastPathComponent(); 38 | if (node != null) { 39 | boolean isSelected = !node.isSelected(); 40 | node.setSelected(isSelected); 41 | ((DefaultTreeModel) tree.getModel()).nodeStructureChanged(node); 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/install/liteloader/LiteLoaderVersionsMeta.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.install.liteloader; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public class LiteLoaderVersionsMeta { 27 | 28 | @SerializedName("versions") 29 | private String description; 30 | @SerializedName("authors") 31 | private String authors; 32 | @SerializedName("url") 33 | private String url; 34 | 35 | public LiteLoaderVersionsMeta() { 36 | } 37 | 38 | public String getDescription() { 39 | return description; 40 | } 41 | 42 | public void setDescription(String description) { 43 | this.description = description; 44 | } 45 | 46 | public String getAuthors() { 47 | return authors; 48 | } 49 | 50 | public void setAuthors(String authors) { 51 | this.authors = authors; 52 | } 53 | 54 | public String getUrl() { 55 | return url; 56 | } 57 | 58 | public void setUrl(String url) { 59 | this.url = url; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/MathUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util; 19 | 20 | /** 21 | * 22 | * @author huang 23 | */ 24 | public final class MathUtils { 25 | 26 | private MathUtils() { 27 | } 28 | 29 | public static int parseInt(String s, int def) { 30 | try { 31 | return Integer.parseInt(s); 32 | } catch (Exception e) { 33 | return def; 34 | } 35 | } 36 | 37 | public static boolean canParseInt(String s) { 38 | try { 39 | Integer.parseInt(s); 40 | return true; 41 | } catch (Exception e) { 42 | return false; 43 | } 44 | } 45 | 46 | public static int parseMemory(String s, int def) { 47 | try { 48 | return Integer.parseInt(s); 49 | } catch (Exception e) { 50 | int a = parseInt(s.substring(0, s.length() - 1), def); 51 | if (s.endsWith("g")) 52 | return a * 1024; 53 | else if (s.endsWith("k")) 54 | return a / 1024; 55 | else 56 | return a; 57 | } 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/version/LibraryDownloadInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.version; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | import org.jackhuang.hellominecraft.launcher.core.download.DownloadType; 22 | import org.jackhuang.hellominecraft.util.StrUtils; 23 | import org.jackhuang.hellominecraft.util.sys.IOUtils; 24 | 25 | /** 26 | * 27 | * @author huangyuhui 28 | */ 29 | public class LibraryDownloadInfo extends GameDownloadInfo { 30 | 31 | @SerializedName("path") 32 | public String path; 33 | @SerializedName("forgeURL") 34 | public String forgeURL; 35 | 36 | @Override 37 | public String getUrl(DownloadType dt, boolean allowSelf) { 38 | String myURL = (forgeURL == null ? dt.getProvider().getLibraryDownloadURL() : forgeURL); 39 | if (StrUtils.isNotBlank(url) && allowSelf) 40 | myURL = url; 41 | if (!myURL.endsWith(".jar")) 42 | if (path == null) 43 | return null; 44 | else 45 | myURL = IOUtils.addURLSeparator(myURL) + path.replace('\\', '/'); 46 | return myURL; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/IUpdateChecker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util; 19 | 20 | import java.util.Map; 21 | 22 | /** 23 | * 24 | * @author huangyuhui 25 | */ 26 | public interface IUpdateChecker { 27 | 28 | /** 29 | * 30 | */ 31 | void checkOutdate(); 32 | 33 | /** 34 | * Get the cached newest version number, use "process" method to 35 | * download! 36 | * 37 | * @return the newest version number 38 | * 39 | * @see process 40 | */ 41 | VersionNumber getNewVersion(); 42 | 43 | /** 44 | * Download the version number synchronously. When you execute this method 45 | * first, should leave "showMessage" false. 46 | * 47 | * @param showMessage If it is requested to warn the user that there is a 48 | * new version. 49 | * 50 | * @return the process observable. 51 | */ 52 | AbstractSwingWorker process(boolean showMessage); 53 | 54 | /** 55 | * Get the download links. 56 | * 57 | * @return a JSON, which contains the server response. 58 | */ 59 | AbstractSwingWorker> requestDownloadLink(); 60 | 61 | } 62 | -------------------------------------------------------------------------------- /HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/util/upgrade/IUpgrader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.util.upgrade; 19 | 20 | import org.jackhuang.hellominecraft.util.Event; 21 | import org.jackhuang.hellominecraft.util.VersionNumber; 22 | 23 | /** 24 | * 25 | * @author huangyuhui 26 | */ 27 | public abstract class IUpgrader implements Event { 28 | 29 | public static final IUpgrader NOW_UPGRADER = new AppDataUpgrader(); 30 | 31 | /** 32 | * Paring arguments to decide on whether the upgrade is needed. 33 | * 34 | * @param nowVersion now launcher version 35 | * @param args Application CommandLine Arguments 36 | * 37 | * @return true if it is needed to break the main thread to shutdown this 38 | * application. 39 | */ 40 | public abstract boolean parseArguments(VersionNumber nowVersion, String[] args); 41 | 42 | /** 43 | * Just download the new app. 44 | * 45 | * @param sender Should be VersionChecker 46 | * @param number the newest version 47 | * 48 | * @return should return true 49 | */ 50 | @Override 51 | public abstract boolean call(Object sender, VersionNumber number); 52 | } 53 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/log/appender/AbstractAppender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft!. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.log.appender; 19 | 20 | import java.io.Serializable; 21 | import org.jackhuang.hellominecraft.util.log.layout.ILayout; 22 | 23 | /** 24 | * 25 | * @author huangyuhui 26 | */ 27 | public abstract class AbstractAppender implements IAppender { 28 | 29 | String name; 30 | private final ILayout layout; 31 | private final boolean ignoreExceptions; 32 | 33 | public AbstractAppender(String name, ILayout layout) { 34 | this(name, layout, true); 35 | } 36 | 37 | public AbstractAppender(String name, ILayout layout, boolean ignoreExceptions) { 38 | this.name = name; 39 | this.layout = layout; 40 | this.ignoreExceptions = ignoreExceptions; 41 | } 42 | 43 | @Override 44 | public String getName() { 45 | return name; 46 | } 47 | 48 | @Override 49 | public boolean ignoreExceptions() { 50 | return ignoreExceptions; 51 | } 52 | 53 | @Override 54 | public ILayout getLayout() { 55 | return this.layout; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/ui/wizard/api/WizardResultReceiver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the terms of the Common Development 3 | * and Distribution License (the License). You may not use this file except in 4 | * compliance with the License. 5 | * 6 | * You can obtain a copy of the License at http://www.netbeans.org/cddl.html 7 | * or http://www.netbeans.org/cddl.txt. 8 | * 9 | * When distributing Covered Code, include this CDDL Header Notice in each file 10 | * and include the License file at http://www.netbeans.org/cddl.txt. 11 | * If applicable, add the following below the CDDL Header, with the fields 12 | * enclosed by brackets [] replaced by your own identifying information: 13 | * "Portions Copyrighted [year] [name of copyright owner]" 14 | * 15 | * The Original Software is NetBeans. The Initial Developer of the Original 16 | * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun 17 | * Microsystems, Inc. All Rights Reserved. 18 | */ 19 | package org.jackhuang.hellominecraft.util.ui.wizard.api; 20 | 21 | import java.util.Map; 22 | 23 | /** 24 | * Object which is called when the wizard is completed or cancelled. Only 25 | * useful if you want to call WizardDisplayer.installInContainer() to install 26 | * a wizard in a custom container (such as a JInternalDialog) - this class 27 | * is a callback to notify the caller that the Finish or Cancel button has 28 | * been pressed. 29 | * 30 | * @author Tim Boudreau 31 | */ 32 | public interface WizardResultReceiver { 33 | /** 34 | * Called when the wizard has been completed, providing whatever object 35 | * the wizard created as its result. 36 | * @param wizardResult The object created by Wizard.finish() 37 | */ 38 | void finished (Object wizardResult); 39 | /** 40 | * Called when the wizard has been cancelled. 41 | * @param settings The settings that were gathered thus far in the 42 | * wizard 43 | */ 44 | void cancelled (Map settings); 45 | } 46 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/service/IMinecraftDownloadService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.service; 19 | 20 | import java.io.File; 21 | import java.util.List; 22 | import org.jackhuang.hellominecraft.launcher.core.GameException; 23 | import org.jackhuang.hellominecraft.launcher.core.download.DownloadLibraryJob; 24 | import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion; 25 | import org.jackhuang.hellominecraft.util.task.Task; 26 | 27 | /** 28 | * 29 | * @author huangyuhui 30 | */ 31 | public abstract class IMinecraftDownloadService extends IMinecraftBasicService { 32 | 33 | public IMinecraftDownloadService(IMinecraftService service) { 34 | super(service); 35 | } 36 | 37 | public abstract Task downloadMinecraft(String id); 38 | 39 | public abstract Task downloadMinecraftJar(MinecraftVersion mv, File f); 40 | 41 | public abstract Task downloadMinecraftVersionJson(String id); 42 | 43 | /** 44 | * Get the libraries that need to download. 45 | * 46 | * @return the library collection 47 | */ 48 | public abstract List getDownloadLibraries(MinecraftVersion mv) throws GameException; 49 | 50 | } 51 | -------------------------------------------------------------------------------- /HMCL/src/core/java/org/jackhuang/hellominecraft/launcher/core/install/optifine/OptiFineVersion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.launcher.core.install.optifine; 19 | 20 | /** 21 | * 22 | * @author huangyuhui 23 | */ 24 | public class OptiFineVersion { 25 | 26 | private String dl, ver, date, mirror, mcversion; 27 | public String patch, type; // For BMCLAPI2. 28 | 29 | public String getDownloadLink() { 30 | return dl; 31 | } 32 | 33 | public void setDownloadLink(String dl) { 34 | this.dl = dl; 35 | } 36 | 37 | public String getVersion() { 38 | return ver; 39 | } 40 | 41 | public void setVersion(String ver) { 42 | this.ver = ver; 43 | } 44 | 45 | public String getDate() { 46 | return date; 47 | } 48 | 49 | public void setDate(String date) { 50 | this.date = date; 51 | } 52 | 53 | public String getMirror() { 54 | return mirror; 55 | } 56 | 57 | public void setMirror(String mirror) { 58 | this.mirror = mirror; 59 | } 60 | 61 | public String getMCVersion() { 62 | return mcversion; 63 | } 64 | 65 | public void setMCVersion(String mcver) { 66 | this.mcversion = mcver; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/net/WebPage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Hello Minecraft! Launcher. 3 | * Copyright (C) 2013 huangyuhui 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see {http://www.gnu.org/licenses/}. 17 | */ 18 | package org.jackhuang.hellominecraft.util.net; 19 | 20 | import javax.swing.JScrollPane; 21 | import javax.swing.event.HyperlinkEvent; 22 | import org.jackhuang.hellominecraft.util.log.HMCLog; 23 | import org.jackhuang.hellominecraft.util.ui.SwingUtils; 24 | 25 | /** 26 | * 27 | * @author huangyuhui 28 | */ 29 | public class WebPage extends JScrollPane { 30 | 31 | private final javax.swing.JTextPane browser; 32 | 33 | /** 34 | * Creates new form WebPagePanel 35 | */ 36 | public WebPage(String content) { 37 | browser = new javax.swing.JTextPane(); 38 | browser.setEditable(false); 39 | browser.setMargin(null); 40 | browser.setContentType("text/html"); 41 | browser.addHyperlinkListener(he -> { 42 | if (he.getEventType() == HyperlinkEvent.EventType.ACTIVATED) 43 | try { 44 | SwingUtils.openLink(he.getURL().toString()); 45 | } catch (Exception e) { 46 | HMCLog.err("Unexpected exception opening link " + he.getURL(), e); 47 | } 48 | }); 49 | browser.setText(content); 50 | 51 | setViewportView(browser); 52 | } 53 | } 54 | --------------------------------------------------------------------------------