Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e0be3a629 | ||
|
|
17819de2ea |
@@ -2,7 +2,7 @@ package com.willfp.eco.internal.entities
|
|||||||
|
|
||||||
import com.willfp.eco.core.entities.args.EntityArgParseResult
|
import com.willfp.eco.core.entities.args.EntityArgParseResult
|
||||||
import com.willfp.eco.core.entities.args.EntityArgParser
|
import com.willfp.eco.core.entities.args.EntityArgParser
|
||||||
import org.bukkit.entity.Animals
|
import org.bukkit.entity.Ageable
|
||||||
|
|
||||||
class EntityArgParserAdult : EntityArgParser {
|
class EntityArgParserAdult : EntityArgParser {
|
||||||
override fun parseArguments(args: Array<out String>): EntityArgParseResult? {
|
override fun parseArguments(args: Array<out String>): EntityArgParseResult? {
|
||||||
@@ -20,14 +20,14 @@ class EntityArgParserAdult : EntityArgParser {
|
|||||||
|
|
||||||
return EntityArgParseResult(
|
return EntityArgParseResult(
|
||||||
{
|
{
|
||||||
if (it !is Animals) {
|
if (it !is Ageable) {
|
||||||
return@EntityArgParseResult false
|
return@EntityArgParseResult false
|
||||||
}
|
}
|
||||||
|
|
||||||
it.isAdult
|
it.isAdult
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
(it as? Animals)?.setAdult()
|
(it as? Ageable)?.setAdult()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package com.willfp.eco.internal.entities
|
|||||||
|
|
||||||
import com.willfp.eco.core.entities.args.EntityArgParseResult
|
import com.willfp.eco.core.entities.args.EntityArgParseResult
|
||||||
import com.willfp.eco.core.entities.args.EntityArgParser
|
import com.willfp.eco.core.entities.args.EntityArgParser
|
||||||
import org.bukkit.entity.Animals
|
import org.bukkit.entity.Ageable
|
||||||
|
|
||||||
class EntityArgParserBaby : EntityArgParser {
|
class EntityArgParserBaby : EntityArgParser {
|
||||||
override fun parseArguments(args: Array<out String>): EntityArgParseResult? {
|
override fun parseArguments(args: Array<out String>): EntityArgParseResult? {
|
||||||
@@ -20,14 +20,14 @@ class EntityArgParserBaby : EntityArgParser {
|
|||||||
|
|
||||||
return EntityArgParseResult(
|
return EntityArgParseResult(
|
||||||
{
|
{
|
||||||
if (it !is Animals) {
|
if (it !is Ageable) {
|
||||||
return@EntityArgParseResult false
|
return@EntityArgParseResult false
|
||||||
}
|
}
|
||||||
|
|
||||||
!it.isAdult
|
!it.isAdult
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
(it as? Animals)?.setBaby()
|
(it as? Ageable)?.setBaby()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version = 6.24.1
|
version = 6.24.2
|
||||||
plugin-name = eco
|
plugin-name = eco
|
||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
Reference in New Issue
Block a user