File tree 8 files changed +6
-19
lines changed
src/main/kotlin/me/arasple/mc/trmenu
8 files changed +6
-19
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
distributionBase =GRADLE_USER_HOME
2
2
distributionPath =wrapper/dists
3
- distributionUrl =https\://services.gradle.org/distributions/gradle-6.8.1 -bin.zip
3
+ distributionUrl =https\://services.gradle.org/distributions/gradle-6.8.2 -bin.zip
4
4
zipStoreBase =GRADLE_USER_HOME
5
5
zipStorePath =wrapper/dists
Original file line number Diff line number Diff line change @@ -106,13 +106,13 @@ object Actions {
106
106
fun readAction (any : Any ): List <AbstractAction > {
107
107
val actions = mutableListOf<AbstractAction >()
108
108
val findParser: (String ) -> ((Any , ActionOption ) -> AbstractAction ) = { name ->
109
- registries.find { it.first.matches(name) }?.second ? : registries[0 ].second
109
+ registries.find { it.first.matches(name.toLowerCase() ) }?.second ? : registries[0 ].second
110
110
}
111
111
112
112
when (any) {
113
113
is Map <* , * > -> {
114
114
val entry = any.entries.firstOrNull() ? : return actions
115
- val key = entry.key.toString().toLowerCase()
115
+ val key = entry.key.toString()
116
116
val value = entry.value ? : return actions
117
117
findParser(key).invoke(value, ActionOption ()).let { actions.add(it) }
118
118
}
Original file line number Diff line number Diff line change 1
1
package me.arasple.mc.trmenu.module.conf
2
2
3
- import io.izzel.taboolib.kotlin.kether.action.bukkit.PlayerOperator
4
- import io.izzel.taboolib.kotlin.kether.action.bukkit.PlayerOperators
5
3
import io.izzel.taboolib.module.nms.nbt.NBTBase
6
4
import io.izzel.taboolib.module.nms.nbt.NBTCompound
7
5
import me.arasple.mc.trmenu.api.action.pack.Reactions
@@ -36,6 +34,7 @@ import kotlin.math.max
36
34
/* *
37
35
* @author Arasple
38
36
* @date 2021/1/25 10:18
37
+ * 有好心人帮忙重写下这个模块吗 写的太烂了
39
38
*/
40
39
@Deprecated(" TO BE IMPROVE" )
41
40
object MenuSerializer : ISerializer {
Original file line number Diff line number Diff line change @@ -76,7 +76,6 @@ class Menu(
76
76
fun page (viewer : Player , page : Int ) {
77
77
Performance .MIRROR .check(" Menu:Event:ChangePage" ) {
78
78
val session = MenuSession .getSession(viewer)
79
-
80
79
val previous = session.layout()!!
81
80
val layout = layout[page]
82
81
val receptacle: Receptacle
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import me.arasple.mc.trmenu.util.Regexs
9
9
import org.bukkit.inventory.ItemFlag
10
10
import org.bukkit.inventory.ItemStack
11
11
import org.bukkit.inventory.meta.ItemMeta
12
- import kotlin.math.roundToInt
13
12
14
13
/* *
15
14
* @author Arasple
@@ -29,7 +28,7 @@ class Meta(
29
28
val isDynamic = isAmountDynamic || isNBTDynamic || isShinyDynamic
30
29
31
30
fun amount (session : MenuSession ): Int {
32
- return (if (isAmountDynamic) session.parse(amount) else amount).toDoubleOrNull()?.roundToInt () ? : 1
31
+ return (if (isAmountDynamic) session.parse(amount) else amount).toDoubleOrNull()?.toInt () ? : 1
33
32
}
34
33
35
34
fun shiny (session : MenuSession , builder : ItemBuilder ) {
Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ import org.bukkit.inventory.ItemStack
25
25
* @author Arasple
26
26
* @date 2020/7/22 12:08
27
27
*/
28
- @Deprecated(" TO BE IMPROVED" )
29
28
class CommandTemplate : BaseSubCommand () {
30
29
31
30
override fun getArguments (): Array <Argument > {
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ object FunctionParser {
48
48
else it.value
49
49
}
50
50
}.onFailure {
51
- it.print (" Error occured when parsing the string" )
51
+ it.print (" Error occured when parsing the string for player ${player.name} : $input " )
52
52
}.getOrElse { input }
53
53
}
54
54
You can’t perform that action at this time.
0 commit comments