Skip to content

Commit 917e369

Browse files
committed
Added playerName extension in CommandContext.
1 parent e5ba975 commit 917e369

File tree

6 files changed

+19
-7
lines changed

6 files changed

+19
-7
lines changed

documentation/in-using.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ CommandContext<CommandSource>.isPlayerSender
6464
- return: true if command sender is player. (boolean value)
6565
```
6666

67+
```
68+
CommandContext<CommandSource>.playerName
69+
70+
- return: player nickname from CommandContext. (string value)
71+
```
72+
6773
```
6874
CommandEvent.commandName
6975

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ mappingsChannelVersion=20190719-1.14.3
1414
kotlinJdkVersionTarget=jdk8
1515
kotlinxSerializationVersion=0.12.0
1616
kotlinVersion=1.3.50
17-
projectEssentialsVersion=1.14.4-1.0.0.2
17+
projectEssentialsVersion=1.14.4-1.0.1.0
1818
projectEssentialsName=Project Essentials Core
1919
projectEssentialsId=project_essentials_core
2020
projectEssentialsVendor=MairwunNx (Pavel Erokhin)

src/main/kotlin/com/mairwunnx/projectessentialscore/EntryPoint.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import net.minecraftforge.fml.common.Mod
77
internal class EntryPoint : EssBase() {
88
init {
99
modInstance = this
10-
modVersion = "1.14.4-1.0.0.2"
10+
modVersion = "1.14.4-1.0.1.0"
1111
logBaseInfo()
1212
validateForgeVersion()
1313
}

src/main/kotlin/com/mairwunnx/projectessentialscore/extensions/CommandContextExtensions.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,9 @@ import net.minecraft.entity.player.ServerPlayerEntity
1212
*/
1313
fun CommandContext<CommandSource>.isPlayerSender(): Boolean =
1414
this.source.entity is ServerPlayerEntity
15+
16+
/**
17+
* @return player nickname from CommandContext.
18+
* @since 1.14.4-1.0.1.0
19+
*/
20+
fun CommandContext<CommandSource>.playerName(): String = this.source.asPlayer().name.string

src/main/resources/META-INF/mods.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ issueTrackerURL="https://github.com/ProjectEssentials/ProjectEssentials-Core/iss
44

55
[[mods]]
66
modId="project_essentials_core"
7-
version="1.14.4-1.0.0.2"
7+
version="1.14.4-1.0.1.0"
88
displayName="Project Essentials Core"
99
updateJSONURL="https://raw.githubusercontent.com/ProjectEssentials/ProjectEssentials-Core/MC-1.14.X/update.json"
1010
displayURL="https://github.com/ProjectEssentials/ProjectEssentials-Core"

update.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"homepage": "https://github.com/ProjectEssentials/ProjectEssentials-Core/releases/tag/v1.14.4-1.0.0.2",
2+
"homepage": "https://github.com/ProjectEssentials/ProjectEssentials-Core/releases/tag/v1.14.4-1.0.1.0",
33
"1.14.4": {
4-
"1.14.4-1.0.0.2": " - Some fixes."
4+
"1.14.4-1.0.1.0": " - Added playerName extension in CommandContext."
55
},
66
"promos": {
7-
"1.14.4-latest": "1.14.4-1.0.0.2",
8-
"1.14.4-recommended": "1.14.4-1.0.0.2"
7+
"1.14.4-latest": "1.14.4-1.0.1.0",
8+
"1.14.4-recommended": "1.14.4-1.0.1.0"
99
}
1010
}

0 commit comments

Comments
 (0)