generated from Astra-Interactive/AstraTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac7a8a0
commit 0fc7559
Showing
4 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ makeevrserg.java.ktarget=17 | |
# Project | ||
makeevrserg.project.name=AspeKt | ||
makeevrserg.project.group=ru.astrainteractive.aspekt | ||
makeevrserg.project.version.string=2.6.4 | ||
makeevrserg.project.version.string=2.6.5 | ||
makeevrserg.project.description=Essentials plugin for EmpireProjekt | ||
makeevrserg.project.developers=makeevrserg|Makeev Roman|[email protected] | ||
makeevrserg.project.url=https://empireprojekt.ru | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
plugin/src/main/kotlin/ru/astrainteractive/aspekt/command/Rtp.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,27 @@ | ||
package ru.astrainteractive.aspekt.command | ||
|
||
import com.earth2me.essentials.Essentials | ||
import com.earth2me.essentials.RandomTeleport | ||
import org.bukkit.Bukkit | ||
import ru.astrainteractive.astralibs.commands.registerCommand | ||
import ru.astrainteractive.astralibs.commands.types.PrimitiveArgumentType | ||
import ru.astrainteractive.astralibs.utils.hex | ||
|
||
fun CommandManager.rtp() = plugin.registerCommand("rtp") { | ||
sender.sendMessage("#db2c18Возможно, вы хотели ввести /tpr".hex()) | ||
} | ||
|
||
fun CommandManager.rtpBypassed() = plugin.registerCommand("rtpbypass") { | ||
val playerName = argument(0, PrimitiveArgumentType.String).resultOrNull() ?: return@registerCommand | ||
val player = Bukkit.getPlayer(playerName) ?: return@registerCommand | ||
val essentials = Bukkit.getPluginManager().getPlugin("Essentials") as Essentials | ||
val randomTeleport = RandomTeleport(essentials) | ||
val completable = randomTeleport.getRandomLocation( | ||
randomTeleport.center, | ||
randomTeleport.minRange, | ||
randomTeleport.maxRange | ||
) | ||
completable.whenComplete { location, _ -> | ||
player.teleport(location) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters