jdash

A Java library for the Geometry Dash API

License

License

GroupId

GroupId

com.github.alex1304
ArtifactId

ArtifactId

jdash
Last Version

Last Version

3.3.10
Release Date

Release Date

Type

Type

jar
Description

Description

jdash
A Java library for the Geometry Dash API
Project URL

Project URL

http://maven.apache.org
Source Code Management

Source Code Management

http://github.com/Alex1304/jdash/tree/master

Download jdash

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.alex1304/jdash/ -->
<dependency>
    <groupId>com.github.alex1304</groupId>
    <artifactId>jdash</artifactId>
    <version>3.3.10</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.alex1304/jdash/
implementation 'com.github.alex1304:jdash:3.3.10'
// https://jarcasting.com/artifacts/com.github.alex1304/jdash/
implementation ("com.github.alex1304:jdash:3.3.10")
'com.github.alex1304:jdash:jar:3.3.10'
<dependency org="com.github.alex1304" name="jdash" rev="3.3.10">
  <artifact name="jdash" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.alex1304', module='jdash', version='3.3.10')
)
libraryDependencies += "com.github.alex1304" % "jdash" % "3.3.10"
[com.github.alex1304/jdash "3.3.10"]

Dependencies

compile (5)

Group / Artifact Type Version
io.projectreactor.netty : reactor-netty jar 0.9.7.RELEASE
org.apache.commons : commons-configuration2 jar 2.7
commons-beanutils : commons-beanutils jar 1.9.4
io.projectreactor.addons : reactor-extra jar 3.3.3.RELEASE
com.github.ben-manes.caffeine : caffeine jar 2.8.4

Project Modules

There are no modules declared in this project.

JDash

Maven Central Documentation Status

A Java library for Geometry Dash.

Features

  • Provides a high-level HTTP client to fetch data from Geometry Dash servers
  • Supports authentication with Geometry Dash account username / password
  • Allows for both blocking and reactive/non-blocking programming styles
  • Supports request caching for better performances
  • Provides a convenient way to generate player icons.

Get started

In a Maven project, add the following dependency to your pom.xml:

<dependencies>

	<!-- ... your other dependencies -->
	
	<dependency>
		<groupId>com.github.alex1304</groupId>
		<artifactId>jdash</artifactId>
		<version><!-- Latest version number --></version>
	</dependency>
</dependencies>

Or download the latest version at the releases page, and add all required JAR files into the build path of your Java project.

How to use it ?

There are many ways to use the library. Here are a few examples:

Anonymous client, blocking style

import com.github.alex1304.jdash.client.AnonymousGDClient;
import com.github.alex1304.jdash.client.GDClientBuilder;
import com.github.alex1304.jdash.entity.GDLevel;
import com.github.alex1304.jdash.entity.GDUser;

public class TestMain {

	public static void main(String[] args) {
		// Build an anonymous client
		AnonymousGDClient client = GDClientBuilder.create().buildAnonymous();
		// Fetch level of ID 10565740
		GDLevel level = client.getLevelById(10565740).block();
		// Fetch user of name "RobTop"
		GDUser user = client.searchUser("RobTop").block();
		// Do stuff with them, for example print them
		System.out.println(level);
		System.out.println(user);
	}

}

Anonymous client, non-blocking style

import com.github.alex1304.jdash.client.AnonymousGDClient;
import com.github.alex1304.jdash.client.GDClientBuilder;

public class TestMain {

	public static void main(String[] args) throws Exception {
		// Build an anonymous client
		AnonymousGDClient client = GDClientBuilder.create().buildAnonymous();
		// Fetch level of ID 10565740 then print it
		client.getLevelById(10565740).doOnSuccess(level -> System.out.println(level)).subscribe();
		// Fetch user of name "RobTop" then print it
		client.searchUser("RobTop").doOnSuccess(user -> System.out.println(user)).subscribe();
		// The above calls are non-blocking, meaning that you can do something else in parallel while the client is doing its job!
		// Let's put that in evidence:
		System.out.println("Start another long-running task here...");
		Thread.sleep(5000);
		System.out.println("Bye!");
	}

}

Authenticated client

import com.github.alex1304.jdash.client.AuthenticatedGDClient;
import com.github.alex1304.jdash.client.GDClientBuilder;
import com.github.alex1304.jdash.entity.GDMessage;
import com.github.alex1304.jdash.exception.GDLoginFailedException;
import com.github.alex1304.jdash.util.GDPaginator;

public class TestMain {

	public static void main(String[] args) throws Exception {
		// Build an anonymous client
		try {
			AuthenticatedGDClient client = GDClientBuilder.create().buildAuthenticated(new Credentials("MyUsername", "MyP@ssw0rd")).block();
			// With an authenticated client, you can do cool stuff like this:
			client.getPrivateMessages(0).doOnSuccess(messages -> {
				for (GDMessage message : messages) {
					System.out.println(message);
				}
			}).subscribe();
			// Pretty self-explanatory, right? It's fetching your in-game private messages!
			// Here's a blocking version:
			GDPaginator<GDMessage> messages = client.getPrivateMessages(0).block();
			for (GDMessage message : messages) {
				System.out.println(message);
			}
			// GDPaginator is basically a List but with extra metadata info related to pagination
			// (number of pages, number of items per page, etc). RTFM for more details.
		} catch (GDLoginFailedException e) {
			System.err.println("Oops! Login failed.");
		}
	}

}

The full documentation is available here.

License

MIT

Contribute

Issues and Pull requests are more than welcome ! There is no guide that tells how to structure them, but if you explain clearly what you did in your pull request, we will be able to dicuss about it and getting it eventually merged. This is the same for issues, feel free to submit them as long as they are clear.

Contact

E-mail: [email protected]

Discord: Alex1304#9704

Twitter: @gd_alex1304

Versions

Version
3.3.10
3.3.9
3.3.8
3.3.7
3.3.6
3.3.5
3.3.4
3.3.3
3.3.2
3.3.1
3.3.0
3.2.4
3.2.3
3.2.2
3.2.1
3.2.0
3.1.6
3.1.5
3.1.4
3.1.3
3.1.2
3.1.1
3.1.0
3.0.0
2.2.4
2.2.3
2.2.2
2.2.1
2.2.0
2.1.2
2.1.1
2.1.0
2.0.8
2.0.7
2.0.6
2.0.5
2.0.4
2.0.3
2.0.2
2.0.1
2.0.0