Skip to content

Commit 6bec8b0

Browse files
committed
Added ProjectEssentials-Cooldown to dependencies.
1 parent 7474d22 commit 6bec8b0

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ dependencies {
9797
name: "ProjectEssentials-Core",
9898
version: "v1.14.4-1.0.2.0"
9999
)
100+
compile(
101+
group: "com.github.projectessentials",
102+
name: "ProjectEssentials-Cooldown",
103+
version: "v1.14.4-1.0.0.0"
104+
)
100105
}
101106

102107
task installMods(type: Copy) {

src/main/kotlin/com/mairwunnx/projectessentialspermissions/commands/PermissionsCommand.kt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.mairwunnx.projectessentialspermissions.commands
22

3+
import com.mairwunnx.projectessentialscooldown.essentials.CommandsAliases
34
import com.mairwunnx.projectessentialscore.extensions.isPlayerSender
45
import com.mairwunnx.projectessentialscore.extensions.playerName
56
import com.mairwunnx.projectessentialscore.extensions.sendMsg
@@ -16,12 +17,13 @@ import net.minecraft.command.CommandSource
1617
import net.minecraft.command.Commands
1718
import org.apache.logging.log4j.LogManager
1819

19-
@Suppress("DuplicatedCode") // todo: DuplicatedCode warning.
20+
@Suppress("DuplicatedCode")
2021
internal object PermissionsCommand {
21-
private val aliases = arrayOf("essentials", "ess")
22+
private val aliases = listOf("essentials", "ess")
2223
private val logger = LogManager.getLogger()
2324

2425
internal fun register(dispatcher: CommandDispatcher<CommandSource>) {
26+
assignAliases()
2527
aliases.forEach { command ->
2628
dispatcher.register(
2729
literal<CommandSource>(command).then(
@@ -35,6 +37,17 @@ internal object PermissionsCommand {
3537
}
3638
}
3739

40+
private fun assignAliases() {
41+
try {
42+
Class.forName(
43+
"com.mairwunnx.projectessentialscooldown.essentials.CommandsAliases"
44+
)
45+
CommandsAliases.aliases["essentials"] = mutableListOf("ess")
46+
} catch (_: ClassNotFoundException) {
47+
// ignored
48+
}
49+
}
50+
3851
private fun buildAboutCommand(): LiteralArgumentBuilder<CommandSource> {
3952
return Commands.literal("permissions").executes {
4053
return@executes aboutCommandExecute(it)
@@ -101,6 +114,7 @@ internal object PermissionsCommand {
101114
}
102115
else -> {
103116
PermissionBase.loadData()
117+
assignAliases()
104118
when {
105119
c.isPlayerSender() -> sendMsg(
106120
"permissions", c.source, "perm.reload.success"

update.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"homepage": "https://github.com/ProjectEssentials/ProjectEssentials-Permissions/releases/tag/v1.14.4-0.2.0.0",
33
"1.14.4": {
4+
"1.14.4-0.3.0.0": " - Fixed incorrect permission removing from user.",
45
"1.14.4-0.2.0.0": " - Improved configuration logging after loading.",
56
"1.14.4-0.1.1.0": " - Code cleanup. Added core module as dependency.",
67
"1.14.4-0.1.0.2": " - Fixed some wrong meta information for mod.",

0 commit comments

Comments
 (0)