Skip to content

Commit 91b7f16

Browse files
authored
Merge pull request #24 from maytees/master
Edit to README.md
2 parents 4a1689d + 4d88b33 commit 91b7f16

2 files changed

Lines changed: 57 additions & 2 deletions

File tree

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
# SimpAPI v4.3.2
2+
3+
## Table Of Contents:
4+
****
5+
- [Introduction](#introduction)
6+
- [Installation](#installation)
7+
- [Maven](#maven)
8+
- [Gradle](#gradle)
9+
- [Usage](#usage)
10+
- [ColorTranslator - Hexadecimal Color Usage](#colortranslator---hexadecimal-color-usage)
11+
- [Skull Creator](#skull-creator)
12+
- [Menu Manager](#menu-manager)
13+
- [Command Manager](#command-manager)
14+
15+
## Introduction
216
****
317
SimpAPI, finally a good API that can make coding MC Plugins much easier and less painful.
418
This API includes all of my primary utilities like *Menu Manager*, *Command Manager*, *ColorTranslator*, and more.
@@ -70,6 +84,38 @@ As you can see, all you need to do is provide the color code after an & as you w
7084

7185
There is also a method for TextComponents called translateColorCodesToTextComponent() which works the same.
7286

87+
### Skull Creator
88+
****
89+
90+
What the skull creator does should be pretty self-explanatory, here are a few tutorials on how to use it.
91+
92+
#### Creating a skull
93+
94+
_**Example**_: 1
95+
```java
96+
ItemStack playerSkull = SkullCreator.itemFromUuid(player.getUniqueId());
97+
```
98+
99+
In the example above, we are using the itemFromUuid, this will take in the player's uuid, which will return an ItemStack
100+
101+
_**Example**_: 2
102+
```java
103+
ItemStack playerSkull = SkullCreator.itemFromUuid(player.getName());
104+
```
105+
106+
Although the example above works, it is not recommended because names are not as accurate as id's.
107+
108+
Keep in mind that when you create a skull, the default name of said skull will be `{Player name}'s Head`. If you would like to change this to be just the players name, without `'s head`, all you have to do is get the item's meta, and change the display name to the player's display name, simple!:
109+
110+
```java
111+
ItemStack playerSkull = SkullCreator.itemFromUuid(player.getUniqueId());
112+
playerSkull.getItemMeta().setDisplayName(
113+
player.getDisplayName()
114+
);
115+
```
116+
##### Note:
117+
118+
The skull creator was not created by Kody Simpson, the creator of the [library](https://github.com/deanveloper/SkullCreator/blob/master/src/main/java/dev/dbassett/skullcreator/SkullCreator.java) is [Dean B](https://github.com/deanveloper)
73119

74120
### Menu Manager
75121
****

src/main/java/me/kodysimpson/simpapi/command/CoreCommand.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package me.kodysimpson.simpapi.command;
22

3+
import org.bukkit.Bukkit;
34
import org.bukkit.command.Command;
45
import org.bukkit.command.CommandSender;
56
import org.bukkit.entity.Player;
@@ -57,18 +58,26 @@ public boolean execute(@NotNull CommandSender sender, @NotNull String commandLab
5758
if (args.length == 1){ //prank <subcommand> <args>
5859
ArrayList<String> subcommandsArguments = new ArrayList<>();
5960

61+
//Does the subcommand autocomplete
6062
for (int i = 0; i < getSubCommands().size(); i++){
6163
subcommandsArguments.add(getSubCommands().get(i).getName());
6264
}
63-
6465
return subcommandsArguments;
6566
}else if(args.length >= 2){
6667
for (int i = 0; i < getSubCommands().size(); i++){
6768
if (args[0].equalsIgnoreCase(getSubCommands().get(i).getName())){
68-
return getSubCommands().get(i).getSubcommandArguments((Player) sender, args);
69+
List<String> subCommandArgs = getSubCommands().get(i).getSubcommandArguments(
70+
(Player) sender, args
71+
);
72+
73+
if(!(subCommandArgs == null))
74+
return subCommandArgs;
75+
76+
return Collections.emptyList();
6977
}
7078
}
7179
}
80+
7281
return Collections.emptyList();
7382
}
7483

0 commit comments

Comments
 (0)