Skip to content

xap3y/SkullCreator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SkullCreator

Fork of SkullCreator with extra stuff

The only difference is that it is written in Kotlin, and allows you to get
head from name or UUID online (using MojangAPI)

Installation

Maven Central Version

Maven

Add skullcreator as a dependency:

<dependency>
    <groupId>eu.xap3y</groupId>
    <artifactId>skullcreator</artifactId>
    <version>1.0</version>
</dependency>

And shade it:

<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.6.0</version>
        <executions>
            <execution>
                <phase>package</phase>
                <goals>
                    <goal>shade</goal>
                </goals>
                <configuration>
                    <relocations>
                        <relocation>
                            <pattern>eu.xap3y.skullcreator</pattern>
                            <!-- Replace your.package with your real package -->
                            <shadedPattern>your.package.skullcreator</shadedPattern>
                        </relocation>
                    </relocations>
                </configuration>
            </execution>
        </executions>
    </plugin>
</plugins>
Gradle (Groovy)

Add skullcreator as a dependency:

repositories {
    mavenCentral()
}

dependencies {
    implementation 'eu.xap3y:skullcreator:1.0'
}

Don't forget to shadow it:

plugins {
    id 'com.github.johnrengelman.shadow' version '8.1.1'
}

tasks {
    shadowJar {
        // Dont forget to replace 'your.package' with your package
        relocate 'eu.xap3y.skullcreator', "your.package.skullcreator"
    }
}
Gradle (Kotlin DSL)

Add skullcreator as a dependency:

repositories {
    mavenCentral()
}
dependencies {
    implementation("eu.xap3y:skullcreator:1.0")
}
plugins {
    id("com.github.johnrengelman.shadow") version ("8.1.1")
}

tasks {
    shadowJar {
        relocate("eu.xap3y.skullcreator", "your.package.skullcreator")
    }
}

Usage

Note

Same as the original SkullCreator only except the new stuff below

You can look at some examples here
Docs are available at skullcreator.xap3y.eu

By Name (Online)

SkullCreator.itemFromNameOnline("XAP3Y") returning CompletableFuture<ItemStack>

Example (Kotlin)

SkullCreator.itemFromNameOnline("XAP3Y").whenComplete { item, _ ->
    player.inventory.addItem(item)
}

By UUID (Online)

The argument has to be UUID in string. It doesn't matter if you put the UUID with dashed or not
SkullCreator.itemFromUuidOnline("f1c3931e93d341258fdc9b1dc39bc4d6")
which also returns CompletableFuture<ItemStack>

Example (Kotlin)

SkullCreator.itemFromUuidOnline("f1c3931e93d341258fdc9b1dc39bc4d6").whenComplete { item, _ ->
    player.inventory.addItem(item)
}