Skip to content

Releases: UndefinedCreations/UndefinedAPI

0.5.00

02 Jun 10:57
Compare
Choose a tag to compare

In this big update to the api we have added the ability to create a use fake players. For more info see the wiki

0.4.00

22 Feb 20:24
9714135
Compare
Choose a tag to compare
0.4.00 Pre-release
Pre-release

Scoreboard

We have made it easy to create scoreboards when using this API. Instead of have to create teams and score in the spigot api. You can just create a UndefinedScoreboard class. After that you can create line with addEmptyLine(), addLine(String) and addValueLine(Int, String, String). (See below)

Kotlin

player.scoreboard = Bukkit.getScoreboardManager().newScoreboard

UndefinedScoreboard("Test", player.scoreboard)
    .addLine("IDK")
    .addEmptyLine()
    .addEmptyLine()
    .addValueLine(0, "Prefix ", " Suffix")

Java

ScoreboardManager manager = Bukkit.getScoreboardManager();
player.setScoreboard(manager.getNewScoreboard());

UndefinedScoreboard board = new UndefinedScoreboard("Test", player.getScoreboard());
board.addLine("IDK");
board.addEmptyLine();
board.addEmptyLine();
board.addValueLine(0, "Prefix ", " Suffix");

Changing value line

To be able to change a value line you can use the setValueLine(Int, String, String). The Int is the id of the line. (See below)

Kotlin

board.setValueLine(0, "Prefix2 ", " Suffix2")

board.setValueLine(0, prefix = "Prefix2 ")

board.setValueLine(0, suffix = " Suffix")

Java

board.setValueLine(0, "Prefix2 ", " Suffix2");

board.setValueLine(0, "Prefix2 ", null);

board.setValueLine(0, null, " Suffix");

0.3.5v

20 Feb 19:55
Compare
Choose a tag to compare
0.3.5v Pre-release
Pre-release

Menu page update. String to small text

0.3.4v

20 Feb 16:13
Compare
Choose a tag to compare
0.3.4v Pre-release
Pre-release

Mutli Button

0.3.3v

20 Feb 13:49
Compare
Choose a tag to compare
0.3.3v Pre-release
Pre-release

Maven Repo Update

Page Menu

18 Feb 11:08
Compare
Choose a tag to compare
Page Menu Pre-release
Pre-release

Paged Menu

Caution

KOTLIN ONLY

To be able to create a custom paged Menu you will need to extend the UndefinedPageMenu. Its never the same as a normal Menu but you will need to pase a List of itemStacks witch will be sorted into pages. When the same as the normal Menu you will to extend the generateInventory method with createPageInventory method.
After that put in your back button and next button using the setBackButton and setNextButton. You are able to shape the inventory to your liking. (See below)

Note

You need to have the setBackButton and setNextButton for the gui to work.

class FunGui(list: List<ItemStack>): UndefinedPageMenu("Fun", MenuSize.LARGE, list) {
    override fun generateInventory(): Inventory = createPageInventory {

        setBackButton(PageButton(45, ItemStack(Material.RED_STAINED_GLASS_PANE), ItemStack(Material.GRAY_STAINED_GLASS_PANE)))
        setNextButton(PageButton(53, ItemStack(Material.LIME_STAINED_GLASS_PANE), ItemStack(Material.GRAY_STAINED_GLASS_PANE)))

        setColumn(6, ItemBuilder(Material.LIGHT_GRAY_STAINED_GLASS_PANE).setName(" ").build())
    }
}

When lastly extend the clickData: ClickData.() witch will run then the gui is pressed. (See below)

override var clickData: ClickData.() -> Unit = {
    println("DIAMONDS")
}

0.03v

17 Feb 11:47
Compare
Choose a tag to compare
0.03v Pre-release
Pre-release

Scheduler

Caution

KOTLIN ONLY

Note

TimeUntil class was taken from TwilightAPI

This API makes it easier to create tasks by make methods that be accessed any were. We are going to start by running code sync and async by using this. (See below)

sync { 
    //Run sync code
}
        
async { 
    //Run async code
}

Delay

Next is delaying a task. This is not much different. (See below)

delay(20) {
    //This task will be run in 20 ticks
}

delay(20, true) {
    //This task will be run in 20 ticks async
}
        
delay(1, TimeUnit.SECONDS, false){
    //This task will be run is 20 ticks sync
}

Repeating

Last one is creating repeating tasks. With this you will be able to give in how many times the task will run as wel. (See below)

repeatingTask(1) {
    //This will run every tick
}

repeatingTask(20, 5){
    //This will run every 20 ticks 5 times
}

repeatingTask(1, true){
    //This will run every tick async
}

repeatingTask(20, true, 5){
    //This will run every 20 ticks 5 times async
}

repeatingTask(1, TimeUnit.SECONDS){
    //This will run every second
}

repeatingTask(1, TimeUnit.SECONDS, 5){
    //This will run every second 5 times
}

repeatingTask(1, TimeUnit.SECONDS, true){
    //This will run every second async
}

repeatingTask(1, TimeUnit.SECONDS, 5, true){
    //This will run every second 5 times async
}

Event Rework

17 Feb 13:53
b94f47d
Compare
Choose a tag to compare
Event Rework Pre-release
Pre-release

Events

Caution

KOTLIN ONLY

When using this API you won't need to do and registering of event or even extending the Listener class. Even creating custom events is easier.

Listening

Listening to an event is straight forward and easy. You need to create a method called event<EventType>. (See below)

event<PlayerJoinEvent> { 
    //Player Join
}

To be able to unregister the listener you can very easily put .unregister at the end. (See below)

event<PlayerJoinEvent> {
    //Player Join
}.unregister()

0.02v

16 Feb 16:58
Compare
Choose a tag to compare
0.02v Pre-release
Pre-release

Events

When using this api for events you won't need to register any events or even extend the Listener Class. The only thing you will need to do to make events work is create a method with the @EventHandler and the event type as the first parameter. (See below)

Kotlin

@EventHandler
fun onJoin(e: PlayerJoinEvent){
    //Code
}

Java

@EventHandler
public void onJoin(PlayerJoinEvent e){
    //Code
}

0.1V

14 Feb 16:07
3dab58f
Compare
Choose a tag to compare
0.1V Pre-release
Pre-release

First version.

Features:

  • Command Manager
  • GUI/Menu Manager
  • ItemBuilder
  • File Utils
  • Inventory Utils
  • JSON Utils
  • Location Utils
  • Random Utils