Skip to content

Commit 9e55f33

Browse files
committed
improvement
1 parent 267677b commit 9e55f33

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

src/main/java/me/wanttobee/commandTree/ICommandObject.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ import me.wanttobee.commandTree.commandTree.ICommandNode
44

55
//an interface to build your command tree from
66
interface ICommandObject {
7-
7+
// the text that you will see when you enter the 'help' command in minecraft
88
val helpText : String
9-
109
val baseTree : ICommandNode
1110
}
1211

src/main/java/me/wanttobee/commandTree/WTBMCommands.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ object WTBMCommands {
99
var title : String? = null
1010
private set
1111

12-
fun setPlugin(plugin: JavaPlugin, title: String?){
12+
fun initialize(plugin: JavaPlugin, title: String?){
1313
minecraftPlugin = plugin
1414
WTBMCommands.title = title
1515
}

src/main/java/me/wanttobee/commandTree/commandTree/CommandBranch.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@ import org.bukkit.entity.Player
66
// We are using a composite design
77
// that means we have branches and leaves
88
// branches may have new nodes hanging on it
9-
// however, leaves are normally the end
10-
// in our case however, we modified this design a bit, and we can better explain it as
9+
// leaves are normally the end
10+
// in our case however, there can be leaves to contain other leaves lol
1111
// branched: a way of sorting the leaves in groups
1212
// leaves: the parameters which are eventually going to be used for the thing you are trying to do
13-
// leaves can have nodes under them, but it becomes messy if you do (just like basically all the big minecraft commands XD)
14-
1513
class CommandBranch(argName: String, private val branches : Array<ICommandNode> ) : ICommandNode(argName) {
1614

1715
override val commandParam: String = "..."

src/main/java/me/wanttobee/commandTree/commandTree/ICommandLeaf.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ import org.bukkit.entity.Player
77
// We are using a composite design
88
// that means we have branches and leaves
99
// branches may have new nodes hanging on it
10-
// however, leaves are normally the end
11-
// in our case however, we modified this design a bit, and we can better explain it as
10+
// leaves are normally the end
11+
// in our case however, there can be leaves to contain other leaves lol
1212
// branched: a way of sorting the leaves in groups
1313
// leaves: the parameters which are eventually going to be used for the thing you are trying to do
14-
// leaves can have nodes under them, but it becomes messy if you do (just like basically all the big minecraft commands XD)
1514
abstract class ICommandLeaf<T>(argName : String, protected val effect : (Player, T) -> Unit, protected val emptyEffect : ((Player) -> Unit)? = null) : ICommandNode(argName) {
1615

1716
// some leaves have more arguments, in order to find when this leaf is finished, we need to say how many

0 commit comments

Comments
 (0)