All Projects → to2mbn → JMCCC

to2mbn / JMCCC

Licence: MIT license
[This project has been discontinued.] A powerful open-source library for launching and downloading Minecraft.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to JMCCC

PureLauncher
🚀🎉✨An awesome Minecraft Launcher.
Stars: ✭ 51 (-50.49%)
Mutual labels:  minecraft-launcher, minecraft-downloader
PolyMC
A custom launcher for Minecraft that allows you to easily manage multiple installations of Minecraft at once (Fork of MultiMC)
Stars: ✭ 1,961 (+1803.88%)
Mutual labels:  minecraft-launcher
multifold
The next-generation cross-platform Minecraft Launcher.
Stars: ✭ 30 (-70.87%)
Mutual labels:  minecraft-launcher
Minecraft-Box-Launcher
Open source Minecraft Java Edition launcher built with ElectronJS
Stars: ✭ 19 (-81.55%)
Mutual labels:  minecraft-launcher
minecraft-launcher-core-node
Provide packages to install Minecraft, launch Minecraft and more to build launcher with NodeJs/Electron!
Stars: ✭ 126 (+22.33%)
Mutual labels:  minecraft-launcher
picomc
A tiny CLI Minecraft launcher
Stars: ✭ 51 (-50.49%)
Mutual labels:  minecraft-launcher
Uzurion-Launcher
Custom launcher for modded minecraft written in electron.js and Node.js (premium and crack)
Stars: ✭ 120 (+16.5%)
Mutual labels:  minecraft-launcher
Epherome
Powerful Minecraft Launcher
Stars: ✭ 116 (+12.62%)
Mutual labels:  minecraft-launcher
Hmcl
A Minecraft Launcher which is multi-functional, cross-platform and popular
Stars: ✭ 3,362 (+3164.08%)
Mutual labels:  minecraft-launcher
GBCLV3
Goose Bomb's Minecraft Client Launcher
Stars: ✭ 50 (-51.46%)
Mutual labels:  minecraft-launcher
CmlLib.Core
.NET Minecraft Launcher Library. All Version, Auth, Forge, Java, Crossplatform
Stars: ✭ 87 (-15.53%)
Mutual labels:  minecraft-launcher
ProjBobcat
The next generation Minecraft launcher core written in C# providing the freest, fastest and the most complete experience.
Stars: ✭ 80 (-22.33%)
Mutual labels:  minecraft-launcher
minecrowdcontrol
Minecraft Crowd Control Plugin
Stars: ✭ 19 (-81.55%)
Mutual labels:  minecraft-launcher
mcpelauncher
Launch MCPE on macOS! (archived-- has been merged back upstream)
Stars: ✭ 12 (-88.35%)
Mutual labels:  minecraft-launcher
gomclauncher
A Minecraft Launcher
Stars: ✭ 58 (-43.69%)
Mutual labels:  minecraft-launcher
Alicorn
A high performance custom Minecraft launcher.
Stars: ✭ 26 (-74.76%)
Mutual labels:  minecraft-launcher
Launcher
Улучшеный Minecraft лаунчер на основе sashok's742 v3
Stars: ✭ 75 (-27.18%)
Mutual labels:  minecraft-launcher

JMCCC

Gitter Build Status
A powerful open-source library for launching and downloading Minecraft.

License

JMCCC is licensed under the MIT license.

Features

  • Launches all versions of Minecraft
  • Scalable authentication
    • Supports Yggdrasil/Offline, and can be extended
  • Downloads all versions of Minecraft
    • Supports Forge/Liteloader
      • Supports Liteloader snapshots
    • Customizable download source
    • Asynchronous task system
    • Supports BIO/NIO
    • Supports caching
      • Can work on top of Ehcache or javax.cache
      • Different strategies for different files
  • Mojang API supports
    • Game profiles lookup
    • Fetches/Uploads textures
    • Fetches account information
    • Fetches name history
    • Blocked servers checking

Quick Start

Dependencies

Dependency Description
org.to2mbn:jmccc Minecraft launching feature.
org.to2mbn:jmccc-yggdrasil-authenticator Yggdrasil authentication feature.
org.to2mbn:jmccc-mcdownloader Minecraft downloading feature.
org.to2mbn:jmccc-mojang-api Mojang API client.

The snapshot repository:

<repository>
	<id>ossrh</id>
	<url>https://oss.sonatype.org/content/groups/public/</url>
	<snapshots>
		<enabled>true</enabled>
	</snapshots>
</repository>

Launching Minecraft

MinecraftDirectory dir = new MinecraftDirectory("/home/user/.minecraft");
Launcher launcher = LauncherBuilder.buildDefault();
launcher.launch(new LaunchOption("1.10", YggdrasilAuthenticator.password("<email>", "<password>"), dir));

You can replace YggdrasilAuthenticator.password("<email>", "<password>") with new OfflineAuthenticator("<username>") if you want to use offline authentication.

Downloading Minecraft

MinecraftDirectory dir = new MinecraftDirectory("/home/user/.minecraft");
MinecraftDownloader downloader = MinecraftDownloaderBuilder.buildDefault();
downloader.downloadIncrementally(dir, "1.10", new CallbackAdapter<Version>() {
	
	@Override
	public void failed(Throwable e) {
		// when the task fails
	}
	
	@Override
	public void done(Version result) {
		// when the task finishes
	}
	
	@Override
	public void cancelled() {
		// when the task cancels
	}
	
	@Override
	public <R> DownloadCallback<R> taskStart(DownloadTask<R> task) {
		// when a new sub download task starts
		// return a DownloadCallback to listen the status of the task
		return new CallbackAdapter<R>() {

			@Override
			public void done(R result) {
				// when the sub download task finishes
			}

			@Override
			public void failed(Throwable e) {
				// when the sub download task fails
			}

			@Override
			public void cancelled() {
				// when the sub download task cancels
			}

			@Override
			public void updateProgress(long done, long total) {
				// when the progress of the sub download task has updated
			}

			@Override
			public void retry(Throwable e, int current, int max) {
				// when the sub download task fails, and the downloader decides to retry the task
				// in this case, failed() won't be called
			}
		};
	}
});

You can pass a null callback if you don't want to monitor the whole task. You can also return null in taskStart() if you don't want to monitor sub tasks.

Don't forget to shutdown the downloader when you are no longer going to use it.

downloader.shutdown();

Downloading Forge/Liteloader

MinecraftDirectory dir = new MinecraftDirectory("/home/user/.minecraft");
ForgeDownloadProvider forgeProvider = new ForgeDownloadProvider();
LiteloaderDownloadProvider liteloaderProvider = new LiteloaderDownloadProvider();
MinecraftDownloader downloader = MinecraftDownloaderBuilder.create()
	.providerChain(DownloadProviderChain.create()
		.addProvider(forgeProvider)
		.addProvider(liteloaderProvider))
	.build();

downloader.downloadIncrementally(dir, "1.8-forge1.8-11.14.3.1514", new CallbackAdapter<Version>() {...});
downloader.downloadIncrementally(dir, "1.7.10-LiteLoader1.7.10", new CallbackAdapter<Version>() {...});
downloader.download(forgeProvider.forgeVersionList(), new CallbackAdapter<ForgeVersionList>() {...});
downloader.download(liteloaderProvider.liteloaderVersionList(), new CallbackAdapter<LiteloaderVersionList>() {...});

FML options

JMCCC won't add fml options (such as -Dfml.ignoreInvalidMinecraftCertificates=true and -Dfml.ignorePatchDiscrepancies=true) to the command line automatically. If you have problems launching forge, you may need to add these arguments manually. These arguments are already defined in class ExtraArgumentsTemplates.

option.extraJvmArguments().add(ExtraArgumentsTemplates.FML_IGNORE_INVALID_MINECRAFT_CERTIFICATES);
option.extraJvmArguments().add(ExtraArgumentsTemplates.FML_IGNORE_PATCH_DISCREPANCISE);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].