Skip to content

Commit ddc1432

Browse files
committed
chore: upstream kotlin usage
1 parent 981b6d9 commit ddc1432

File tree

3 files changed

+4
-41
lines changed

3 files changed

+4
-41
lines changed

src/main/java/ir/syrent/velocityreport/spigot/command/library/CommandBase.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ interface CommandBase {
1212
*
1313
* @return The name.
1414
*/
15-
val name: String
15+
var name: String
1616

1717
/**
1818
* Get command permission.
1919
*
2020
* @return The permission.
2121
*/
22-
val permission: String
22+
var permission: String
2323

2424
/**
2525
* If only players can execute the command.
2626
*
2727
* @return If true.
2828
*/
29-
val isPlayersOnly: Boolean
29+
var isPlayersOnly: Boolean
3030

3131
/**
3232
* Add a subcommand to the command.

src/main/java/ir/syrent/velocityreport/spigot/command/library/HandledCommand.kt

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -17,40 +17,7 @@ import java.util.stream.Collectors
1717
* in order to execute the command-specific code. It's essentially an internal
1818
* layer, hence why it's a package-private class.
1919
*/
20-
abstract class HandledCommand(name: String, permission: String, playersOnly: Boolean) : CommandBase {
21-
/**
22-
* Get the command name.
23-
*
24-
* @return The name.
25-
*/
26-
/**
27-
* The name of the command.
28-
*/
29-
override val name: String
30-
/**
31-
* Get the permission required to execute the command.
32-
*
33-
* @return The permission.
34-
*/
35-
/**
36-
* The permission required to execute the command.
37-
*
38-
*
39-
* Written out as a string for flexibility with subclasses.
40-
*/
41-
override val permission: String
42-
/**
43-
* Get if the command can only be executed by players.
44-
*
45-
* @return If players only.
46-
*/
47-
/**
48-
* Should the command only be allowed to be executed by players?
49-
*
50-
*
51-
* In other worlds, only allowed to be executed by console.
52-
*/
53-
override val isPlayersOnly: Boolean
20+
abstract class HandledCommand(override var name: String, override var permission: String, override var isPlayersOnly: Boolean) : CommandBase {
5421

5522
/**
5623
* All subcommands for the command.
@@ -68,9 +35,6 @@ abstract class HandledCommand(name: String, permission: String, playersOnly: Boo
6835
* @param playersOnly If only players should be able to execute this command.
6936
*/
7037
init {
71-
this.name = name
72-
this.permission = permission
73-
this.isPlayersOnly = playersOnly
7438
subcommands = ArrayList<CommandBase>()
7539
}
7640

src/main/java/ir/syrent/velocityreport/spigot/listener/PlayerQuitListener.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class PlayerQuitListener(
1818
@EventHandler
1919
private fun onPlayerQuit(event: PlayerQuitEvent) {
2020
val player = event.player
21-
Utils.actionbarPlayers.remove(player.uniqueId)
2221
plugin.cooldowns.remove(player.uniqueId)
2322
}
2423
}

0 commit comments

Comments
 (0)