diff --git a/common/src/main/kotlin/com/undefined/stellar/argument/ArgumentHandler.kt b/common/src/main/kotlin/com/undefined/stellar/argument/ArgumentHandler.kt index 1dbb2e1..8d9e21e 100644 --- a/common/src/main/kotlin/com/undefined/stellar/argument/ArgumentHandler.kt +++ b/common/src/main/kotlin/com/undefined/stellar/argument/ArgumentHandler.kt @@ -36,7 +36,6 @@ import java.util.* /** * An open class that adds all the methods for adding arguments * - * @code * @since 1.0 */ open class ArgumentHandler { diff --git a/common/src/main/kotlin/com/undefined/stellar/argument/types/item/ItemTypeArgument.kt b/common/src/main/kotlin/com/undefined/stellar/argument/types/registry/ItemTypeArgument.kt similarity index 81% rename from common/src/main/kotlin/com/undefined/stellar/argument/types/item/ItemTypeArgument.kt rename to common/src/main/kotlin/com/undefined/stellar/argument/types/registry/ItemTypeArgument.kt index b2f5d98..f140b3b 100644 --- a/common/src/main/kotlin/com/undefined/stellar/argument/types/item/ItemTypeArgument.kt +++ b/common/src/main/kotlin/com/undefined/stellar/argument/types/registry/ItemTypeArgument.kt @@ -1,4 +1,4 @@ -package com.undefined.stellar.argument.types.item +package com.undefined.stellar.argument.types.registry import com.undefined.stellar.AbstractStellarCommand import com.undefined.stellar.argument.AbstractStellarArgument diff --git a/common/src/main/kotlin/com/undefined/stellar/argument/types/item/PatternTypeArgument.kt b/common/src/main/kotlin/com/undefined/stellar/argument/types/registry/PatternTypeArgument.kt similarity index 82% rename from common/src/main/kotlin/com/undefined/stellar/argument/types/item/PatternTypeArgument.kt rename to common/src/main/kotlin/com/undefined/stellar/argument/types/registry/PatternTypeArgument.kt index fc03de3..f6ef0b5 100644 --- a/common/src/main/kotlin/com/undefined/stellar/argument/types/item/PatternTypeArgument.kt +++ b/common/src/main/kotlin/com/undefined/stellar/argument/types/registry/PatternTypeArgument.kt @@ -1,4 +1,4 @@ -package com.undefined.stellar.argument.types.item +package com.undefined.stellar.argument.types.registry import com.undefined.stellar.AbstractStellarCommand import com.undefined.stellar.argument.AbstractStellarArgument diff --git a/common/src/main/kotlin/com/undefined/stellar/argument/types/item/PotionArgument.kt b/common/src/main/kotlin/com/undefined/stellar/argument/types/registry/PotionArgument.kt similarity index 81% rename from common/src/main/kotlin/com/undefined/stellar/argument/types/item/PotionArgument.kt rename to common/src/main/kotlin/com/undefined/stellar/argument/types/registry/PotionArgument.kt index 25d080b..f835916 100644 --- a/common/src/main/kotlin/com/undefined/stellar/argument/types/item/PotionArgument.kt +++ b/common/src/main/kotlin/com/undefined/stellar/argument/types/registry/PotionArgument.kt @@ -1,4 +1,4 @@ -package com.undefined.stellar.argument.types.item +package com.undefined.stellar.argument.types.registry import com.undefined.stellar.AbstractStellarCommand import com.undefined.stellar.argument.AbstractStellarArgument diff --git a/common/src/main/kotlin/com/undefined/stellar/argument/types/item/TrimMaterialArgument.kt b/common/src/main/kotlin/com/undefined/stellar/argument/types/registry/TrimMaterialArgument.kt similarity index 82% rename from common/src/main/kotlin/com/undefined/stellar/argument/types/item/TrimMaterialArgument.kt rename to common/src/main/kotlin/com/undefined/stellar/argument/types/registry/TrimMaterialArgument.kt index 449c298..194115b 100644 --- a/common/src/main/kotlin/com/undefined/stellar/argument/types/item/TrimMaterialArgument.kt +++ b/common/src/main/kotlin/com/undefined/stellar/argument/types/registry/TrimMaterialArgument.kt @@ -1,4 +1,4 @@ -package com.undefined.stellar.argument.types.item +package com.undefined.stellar.argument.types.registry import com.undefined.stellar.AbstractStellarCommand import com.undefined.stellar.argument.AbstractStellarArgument diff --git a/common/src/main/kotlin/com/undefined/stellar/argument/types/item/TrimPatternArgument.kt b/common/src/main/kotlin/com/undefined/stellar/argument/types/registry/TrimPatternArgument.kt similarity index 82% rename from common/src/main/kotlin/com/undefined/stellar/argument/types/item/TrimPatternArgument.kt rename to common/src/main/kotlin/com/undefined/stellar/argument/types/registry/TrimPatternArgument.kt index 7c1f66f..88e3295 100644 --- a/common/src/main/kotlin/com/undefined/stellar/argument/types/item/TrimPatternArgument.kt +++ b/common/src/main/kotlin/com/undefined/stellar/argument/types/registry/TrimPatternArgument.kt @@ -1,4 +1,4 @@ -package com.undefined.stellar.argument.types.item +package com.undefined.stellar.argument.types.registry import com.undefined.stellar.AbstractStellarCommand import com.undefined.stellar.argument.AbstractStellarArgument diff --git a/common/src/main/kotlin/com/undefined/stellar/argument/types/item/ParticleArgument.kt b/common/src/main/kotlin/com/undefined/stellar/argument/types/world/ParticleArgument.kt similarity index 82% rename from common/src/main/kotlin/com/undefined/stellar/argument/types/item/ParticleArgument.kt rename to common/src/main/kotlin/com/undefined/stellar/argument/types/world/ParticleArgument.kt index fbdbdeb..5a9920a 100644 --- a/common/src/main/kotlin/com/undefined/stellar/argument/types/item/ParticleArgument.kt +++ b/common/src/main/kotlin/com/undefined/stellar/argument/types/world/ParticleArgument.kt @@ -1,4 +1,4 @@ -package com.undefined.stellar.argument.types.item +package com.undefined.stellar.argument.types.world import com.undefined.stellar.AbstractStellarCommand import com.undefined.stellar.argument.AbstractStellarArgument diff --git a/server/src/main/kotlin/com/undefined/stellar/Main.kt b/server/src/main/kotlin/com/undefined/stellar/Main.kt index c5f4006..71f033a 100644 --- a/server/src/main/kotlin/com/undefined/stellar/Main.kt +++ b/server/src/main/kotlin/com/undefined/stellar/Main.kt @@ -1,19 +1,21 @@ package com.undefined.stellar -import org.bukkit.Location +import org.bukkit.Material import org.bukkit.entity.Player +import org.bukkit.inventory.ItemStack import org.bukkit.plugin.java.JavaPlugin +import java.util.function.Predicate class Main : JavaPlugin() { override fun onEnable() { - val command = StellarCommand("test") - command.addArgument("t") - .addLocationArgument("block") + StellarCommand("isItem") + .addItemArgument(name = "item") .addExecution { - sender.sendMessage(getArgument("block").toVector().toString()) + val predicate = getArgument>("item") + sender.inventory.setItem() } - command.register(this) + .register(this) } } \ No newline at end of file diff --git a/v1_19_2/src/main/kotlin/com/undefined/stellar/v1_19_2/ArgumentHelper.kt b/v1_19_2/src/main/kotlin/com/undefined/stellar/v1_19_2/ArgumentHelper.kt index 7cada00..18830b6 100644 --- a/v1_19_2/src/main/kotlin/com/undefined/stellar/v1_19_2/ArgumentHelper.kt +++ b/v1_19_2/src/main/kotlin/com/undefined/stellar/v1_19_2/ArgumentHelper.kt @@ -58,7 +58,6 @@ import net.minecraft.network.chat.Component import net.minecraft.resources.ResourceKey import net.minecraft.server.MinecraftServer import net.minecraft.server.level.ColumnPos -import net.minecraft.world.entity.ai.attributes.Attribute import net.minecraft.world.inventory.MenuType import net.minecraft.world.level.Level import net.minecraft.world.level.block.state.pattern.BlockInWorld @@ -79,7 +78,6 @@ import org.bukkit.scoreboard.DisplaySlot import java.time.Duration import java.util.* import java.util.function.Predicate -import java.util.function.Supplier @Suppress("UNCHECKED_CAST") object ArgumentHelper { @@ -135,7 +133,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> ObjectiveArgument.objective() is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.criteria() is com.undefined.stellar.argument.types.math.OperationArgument -> OperationArgument.operation() - is com.undefined.stellar.argument.types.item.ParticleArgument -> ParticleArgument.particle() + is com.undefined.stellar.argument.types.world.ParticleArgument -> ParticleArgument.particle() is com.undefined.stellar.argument.types.math.AngleArgument -> AngleArgument.angle() is com.undefined.stellar.argument.types.math.RotationArgument -> RotationArgument.rotation() is DisplaySlotArgument -> ScoreboardSlotArgument.displaySlot() @@ -219,7 +217,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> Bukkit.getScoreboardManager().mainScoreboard.getObjective(ObjectiveArgument.getObjective(context, argument.name).name) is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.getCriteria(context, argument.name).name is com.undefined.stellar.argument.types.math.OperationArgument -> Operation.getOperation(getArgumentInput(context, argument.name) ?: return null) - is com.undefined.stellar.argument.types.item.ParticleArgument -> { + is com.undefined.stellar.argument.types.world.ParticleArgument -> { val particleOptions = ParticleArgument.getParticle(context, argument.name) getParticleData(context, CraftParticle.toBukkit(particleOptions.type), particleOptions) } diff --git a/v1_19_3/src/main/kotlin/com/undefined/stellar/v1_19_3/ArgumentHelper.kt b/v1_19_3/src/main/kotlin/com/undefined/stellar/v1_19_3/ArgumentHelper.kt index a11c95e..13784bf 100644 --- a/v1_19_3/src/main/kotlin/com/undefined/stellar/v1_19_3/ArgumentHelper.kt +++ b/v1_19_3/src/main/kotlin/com/undefined/stellar/v1_19_3/ArgumentHelper.kt @@ -133,7 +133,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> ObjectiveArgument.objective() is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.criteria() is com.undefined.stellar.argument.types.math.OperationArgument -> OperationArgument.operation() - is com.undefined.stellar.argument.types.item.ParticleArgument -> ParticleArgument.particle( + is com.undefined.stellar.argument.types.world.ParticleArgument -> ParticleArgument.particle( COMMAND_BUILD_CONTEXT ) is com.undefined.stellar.argument.types.math.AngleArgument -> AngleArgument.angle() @@ -219,7 +219,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> Bukkit.getScoreboardManager().mainScoreboard.getObjective(ObjectiveArgument.getObjective(context, argument.name).name) is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.getCriteria(context, argument.name).name is com.undefined.stellar.argument.types.math.OperationArgument -> Operation.getOperation(getArgumentInput(context, argument.name) ?: return null) - is com.undefined.stellar.argument.types.item.ParticleArgument -> { + is com.undefined.stellar.argument.types.world.ParticleArgument -> { val particleOptions = ParticleArgument.getParticle(context, argument.name) getParticleData(context, CraftParticle.toBukkit(particleOptions.type), particleOptions) } diff --git a/v1_19_4/src/main/kotlin/com/undefined/stellar/v1_19_4/ArgumentHelper.kt b/v1_19_4/src/main/kotlin/com/undefined/stellar/v1_19_4/ArgumentHelper.kt index 16b759c..408f645 100644 --- a/v1_19_4/src/main/kotlin/com/undefined/stellar/v1_19_4/ArgumentHelper.kt +++ b/v1_19_4/src/main/kotlin/com/undefined/stellar/v1_19_4/ArgumentHelper.kt @@ -140,7 +140,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> ObjectiveArgument.objective() is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.criteria() is com.undefined.stellar.argument.types.math.OperationArgument -> OperationArgument.operation() - is com.undefined.stellar.argument.types.item.ParticleArgument -> ParticleArgument.particle( + is com.undefined.stellar.argument.types.world.ParticleArgument -> ParticleArgument.particle( COMMAND_BUILD_CONTEXT ) is com.undefined.stellar.argument.types.math.AngleArgument -> AngleArgument.angle() @@ -226,7 +226,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> Bukkit.getScoreboardManager().mainScoreboard.getObjective(ObjectiveArgument.getObjective(context, argument.name).name) is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.getCriteria(context, argument.name).name is com.undefined.stellar.argument.types.math.OperationArgument -> Operation.getOperation(getArgumentInput(context, argument.name) ?: return null) - is com.undefined.stellar.argument.types.item.ParticleArgument -> { + is com.undefined.stellar.argument.types.world.ParticleArgument -> { val particleOptions = ParticleArgument.getParticle(context, argument.name) getParticleData(context, CraftParticle.toBukkit(particleOptions.type), particleOptions) } diff --git a/v1_20/src/main/kotlin/com/undefined/stellar/v1_20/ArgumentHelper.kt b/v1_20/src/main/kotlin/com/undefined/stellar/v1_20/ArgumentHelper.kt index 87778d1..f14107b 100644 --- a/v1_20/src/main/kotlin/com/undefined/stellar/v1_20/ArgumentHelper.kt +++ b/v1_20/src/main/kotlin/com/undefined/stellar/v1_20/ArgumentHelper.kt @@ -136,7 +136,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> ObjectiveArgument.objective() is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.criteria() is com.undefined.stellar.argument.types.math.OperationArgument -> OperationArgument.operation() - is com.undefined.stellar.argument.types.item.ParticleArgument -> ParticleArgument.particle(COMMAND_BUILD_CONTEXT) + is com.undefined.stellar.argument.types.world.ParticleArgument -> ParticleArgument.particle(COMMAND_BUILD_CONTEXT) is com.undefined.stellar.argument.types.math.AngleArgument -> AngleArgument.angle() is com.undefined.stellar.argument.types.math.RotationArgument -> RotationArgument.rotation() is DisplaySlotArgument -> ScoreboardSlotArgument.displaySlot() @@ -220,7 +220,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> Bukkit.getScoreboardManager().mainScoreboard.getObjective(ObjectiveArgument.getObjective(context, argument.name).name) is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.getCriteria(context, argument.name).name is com.undefined.stellar.argument.types.math.OperationArgument -> Operation.getOperation(getArgumentInput(context, argument.name) ?: return null) - is com.undefined.stellar.argument.types.item.ParticleArgument -> { + is com.undefined.stellar.argument.types.world.ParticleArgument -> { val particleOptions = ParticleArgument.getParticle(context, argument.name) getParticleData(context, CraftParticle.toBukkit(particleOptions.type), particleOptions) } diff --git a/v1_20_1/src/main/kotlin/com/undefined/stellar/v1_20_1/ArgumentHelper.kt b/v1_20_1/src/main/kotlin/com/undefined/stellar/v1_20_1/ArgumentHelper.kt index ff373d3..d370a8d 100644 --- a/v1_20_1/src/main/kotlin/com/undefined/stellar/v1_20_1/ArgumentHelper.kt +++ b/v1_20_1/src/main/kotlin/com/undefined/stellar/v1_20_1/ArgumentHelper.kt @@ -136,7 +136,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> ObjectiveArgument.objective() is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.criteria() is com.undefined.stellar.argument.types.math.OperationArgument -> OperationArgument.operation() - is com.undefined.stellar.argument.types.item.ParticleArgument -> ParticleArgument.particle(COMMAND_BUILD_CONTEXT) + is com.undefined.stellar.argument.types.world.ParticleArgument -> ParticleArgument.particle(COMMAND_BUILD_CONTEXT) is com.undefined.stellar.argument.types.math.AngleArgument -> AngleArgument.angle() is com.undefined.stellar.argument.types.math.RotationArgument -> RotationArgument.rotation() is DisplaySlotArgument -> ScoreboardSlotArgument.displaySlot() @@ -220,7 +220,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> Bukkit.getScoreboardManager().mainScoreboard.getObjective(ObjectiveArgument.getObjective(context, argument.name).name) is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.getCriteria(context, argument.name).name is com.undefined.stellar.argument.types.math.OperationArgument -> Operation.getOperation(getArgumentInput(context, argument.name) ?: return null) - is com.undefined.stellar.argument.types.item.ParticleArgument -> { + is com.undefined.stellar.argument.types.world.ParticleArgument -> { val particleOptions = ParticleArgument.getParticle(context, argument.name) getParticleData(context, CraftParticle.toBukkit(particleOptions.type), particleOptions) } diff --git a/v1_20_2/src/main/kotlin/com/undefined/stellar/v1_20_2/ArgumentHelper.kt b/v1_20_2/src/main/kotlin/com/undefined/stellar/v1_20_2/ArgumentHelper.kt index 782294e..0cfb5b2 100644 --- a/v1_20_2/src/main/kotlin/com/undefined/stellar/v1_20_2/ArgumentHelper.kt +++ b/v1_20_2/src/main/kotlin/com/undefined/stellar/v1_20_2/ArgumentHelper.kt @@ -110,7 +110,6 @@ object ArgumentHelper { fun > getArgumentType(argument: T): ArgumentType<*> = when (argument) { is ListArgument<*> -> getArgumentType(argument.type) - is EnumArgument<*> -> StringArgumentType.word() is CustomArgument<*> -> getArgumentType(argument.type) is StringArgument -> brigadier(argument.type) is PhraseArgument -> brigadier(StringType.PHRASE) @@ -138,7 +137,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> ObjectiveArgument.objective() is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.criteria() is com.undefined.stellar.argument.types.math.OperationArgument -> OperationArgument.operation() - is com.undefined.stellar.argument.types.item.ParticleArgument -> ParticleArgument.particle(COMMAND_BUILD_CONTEXT) + is com.undefined.stellar.argument.types.world.ParticleArgument -> ParticleArgument.particle(COMMAND_BUILD_CONTEXT) is com.undefined.stellar.argument.types.math.AngleArgument -> AngleArgument.angle() is com.undefined.stellar.argument.types.math.RotationArgument -> RotationArgument.rotation() is DisplaySlotArgument -> ScoreboardSlotArgument.displaySlot() @@ -222,7 +221,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> Bukkit.getScoreboardManager().mainScoreboard.getObjective(ObjectiveArgument.getObjective(context, argument.name).name) is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.getCriteria(context, argument.name).name is com.undefined.stellar.argument.types.math.OperationArgument -> Operation.getOperation(getArgumentInput(context, argument.name) ?: return null) - is com.undefined.stellar.argument.types.item.ParticleArgument -> { + is com.undefined.stellar.argument.types.world.ParticleArgument -> { val particleOptions = ParticleArgument.getParticle(context, argument.name) getParticleData(context, CraftParticle.minecraftToBukkit(particleOptions.type), particleOptions) } diff --git a/v1_20_4/src/main/kotlin/com/undefined/stellar/v1_20_4/ArgumentHelper.kt b/v1_20_4/src/main/kotlin/com/undefined/stellar/v1_20_4/ArgumentHelper.kt index de2ce25..a6a3030 100644 --- a/v1_20_4/src/main/kotlin/com/undefined/stellar/v1_20_4/ArgumentHelper.kt +++ b/v1_20_4/src/main/kotlin/com/undefined/stellar/v1_20_4/ArgumentHelper.kt @@ -110,7 +110,6 @@ object ArgumentHelper { fun > getArgumentType(argument: T): ArgumentType<*> = when (argument) { is ListArgument<*> -> getArgumentType(argument.type) - is EnumArgument<*> -> StringArgumentType.word() is CustomArgument<*> -> getArgumentType(argument.type) is StringArgument -> brigadier(argument.type) is PhraseArgument -> brigadier(StringType.PHRASE) @@ -138,7 +137,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> ObjectiveArgument.objective() is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.criteria() is com.undefined.stellar.argument.types.math.OperationArgument -> OperationArgument.operation() - is com.undefined.stellar.argument.types.item.ParticleArgument -> ParticleArgument.particle(COMMAND_BUILD_CONTEXT) + is com.undefined.stellar.argument.types.world.ParticleArgument -> ParticleArgument.particle(COMMAND_BUILD_CONTEXT) is com.undefined.stellar.argument.types.math.AngleArgument -> AngleArgument.angle() is com.undefined.stellar.argument.types.math.RotationArgument -> RotationArgument.rotation() is DisplaySlotArgument -> ScoreboardSlotArgument.displaySlot() @@ -222,7 +221,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> Bukkit.getScoreboardManager().mainScoreboard.getObjective(ObjectiveArgument.getObjective(context, argument.name).name) is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.getCriteria(context, argument.name).name is com.undefined.stellar.argument.types.math.OperationArgument -> Operation.getOperation(getArgumentInput(context, argument.name) ?: return null) - is com.undefined.stellar.argument.types.item.ParticleArgument -> { + is com.undefined.stellar.argument.types.world.ParticleArgument -> { val particleOptions = ParticleArgument.getParticle(context, argument.name) getParticleData(context, CraftParticle.minecraftToBukkit(particleOptions.type), particleOptions) } diff --git a/v1_20_6/src/main/kotlin/com/undefined/stellar/v1_20_6/ArgumentHelper.kt b/v1_20_6/src/main/kotlin/com/undefined/stellar/v1_20_6/ArgumentHelper.kt index 382ef1f..c6886fc 100644 --- a/v1_20_6/src/main/kotlin/com/undefined/stellar/v1_20_6/ArgumentHelper.kt +++ b/v1_20_6/src/main/kotlin/com/undefined/stellar/v1_20_6/ArgumentHelper.kt @@ -135,7 +135,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> ObjectiveArgument.objective() is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.criteria() is com.undefined.stellar.argument.types.math.OperationArgument -> OperationArgument.operation() - is com.undefined.stellar.argument.types.item.ParticleArgument -> ParticleArgument.particle(COMMAND_BUILD_CONTEXT) + is com.undefined.stellar.argument.types.world.ParticleArgument -> ParticleArgument.particle(COMMAND_BUILD_CONTEXT) is com.undefined.stellar.argument.types.math.AngleArgument -> AngleArgument.angle() is com.undefined.stellar.argument.types.math.RotationArgument -> RotationArgument.rotation() is DisplaySlotArgument -> ScoreboardSlotArgument.displaySlot() @@ -218,7 +218,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> Bukkit.getScoreboardManager().mainScoreboard.getObjective(ObjectiveArgument.getObjective(context, argument.name).name) is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.getCriteria(context, argument.name).name is com.undefined.stellar.argument.types.math.OperationArgument -> Operation.getOperation(getArgumentInput(context, argument.name) ?: return null) - is com.undefined.stellar.argument.types.item.ParticleArgument -> { + is com.undefined.stellar.argument.types.world.ParticleArgument -> { val particleOptions = ParticleArgument.getParticle(context, argument.name) getParticleData(context, CraftParticle.minecraftToBukkit(particleOptions.type), particleOptions) } diff --git a/v1_21/src/main/kotlin/com/undefined/stellar/v1_21/ArgumentHelper.kt b/v1_21/src/main/kotlin/com/undefined/stellar/v1_21/ArgumentHelper.kt index 3b71db6..55151a3 100644 --- a/v1_21/src/main/kotlin/com/undefined/stellar/v1_21/ArgumentHelper.kt +++ b/v1_21/src/main/kotlin/com/undefined/stellar/v1_21/ArgumentHelper.kt @@ -109,7 +109,6 @@ object ArgumentHelper { fun > getArgumentType(argument: T): ArgumentType<*> = when (argument) { is ListArgument<*> -> getArgumentType(argument.type) - is EnumArgument<*> -> StringArgumentType.word() is CustomArgument<*> -> getArgumentType(argument.type) is StringArgument -> brigadier(argument.type) is PhraseArgument -> brigadier(StringType.PHRASE) @@ -137,7 +136,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> ObjectiveArgument.objective() is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.criteria() is com.undefined.stellar.argument.types.math.OperationArgument -> OperationArgument.operation() - is com.undefined.stellar.argument.types.item.ParticleArgument -> ParticleArgument.particle(COMMAND_BUILD_CONTEXT) + is com.undefined.stellar.argument.types.world.ParticleArgument -> ParticleArgument.particle(COMMAND_BUILD_CONTEXT) is com.undefined.stellar.argument.types.math.AngleArgument -> AngleArgument.angle() is com.undefined.stellar.argument.types.math.RotationArgument -> RotationArgument.rotation() is DisplaySlotArgument -> ScoreboardSlotArgument.displaySlot() @@ -221,7 +220,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> Bukkit.getScoreboardManager().mainScoreboard.getObjective(ObjectiveArgument.getObjective(context, argument.name).name) is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.getCriteria(context, argument.name).name is com.undefined.stellar.argument.types.math.OperationArgument -> Operation.getOperation(getArgumentInput(context, argument.name) ?: return null) - is com.undefined.stellar.argument.types.item.ParticleArgument -> { + is com.undefined.stellar.argument.types.world.ParticleArgument -> { val particleOptions = ParticleArgument.getParticle(context, argument.name) getParticleData(context, CraftParticle.minecraftToBukkit(particleOptions.type), particleOptions) } diff --git a/v1_21_1/src/main/kotlin/com/undefined/stellar/v1_21_1/ArgumentHelper.kt b/v1_21_1/src/main/kotlin/com/undefined/stellar/v1_21_1/ArgumentHelper.kt index d52a2ba..9bd4927 100644 --- a/v1_21_1/src/main/kotlin/com/undefined/stellar/v1_21_1/ArgumentHelper.kt +++ b/v1_21_1/src/main/kotlin/com/undefined/stellar/v1_21_1/ArgumentHelper.kt @@ -109,7 +109,6 @@ object ArgumentHelper { fun > getArgumentType(argument: T): ArgumentType<*> = when (argument) { is ListArgument<*> -> getArgumentType(argument.type) - is EnumArgument<*> -> StringArgumentType.word() is CustomArgument<*> -> getArgumentType(argument.type) is StringArgument -> brigadier(argument.type) is PhraseArgument -> brigadier(StringType.PHRASE) @@ -137,7 +136,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> ObjectiveArgument.objective() is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.criteria() is com.undefined.stellar.argument.types.math.OperationArgument -> OperationArgument.operation() - is com.undefined.stellar.argument.types.item.ParticleArgument -> ParticleArgument.particle(COMMAND_BUILD_CONTEXT) + is com.undefined.stellar.argument.types.world.ParticleArgument -> ParticleArgument.particle(COMMAND_BUILD_CONTEXT) is com.undefined.stellar.argument.types.math.AngleArgument -> AngleArgument.angle() is com.undefined.stellar.argument.types.math.RotationArgument -> RotationArgument.rotation() is DisplaySlotArgument -> ScoreboardSlotArgument.displaySlot() @@ -221,7 +220,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> Bukkit.getScoreboardManager().mainScoreboard.getObjective(ObjectiveArgument.getObjective(context, argument.name).name) is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.getCriteria(context, argument.name).name is com.undefined.stellar.argument.types.math.OperationArgument -> Operation.getOperation(getArgumentInput(context, argument.name) ?: return null) - is com.undefined.stellar.argument.types.item.ParticleArgument -> { + is com.undefined.stellar.argument.types.world.ParticleArgument -> { val particleOptions = ParticleArgument.getParticle(context, argument.name) getParticleData(context, CraftParticle.minecraftToBukkit(particleOptions.type), particleOptions) } diff --git a/v1_21_3/src/main/kotlin/com/undefined/stellar/v1_21_3/ArgumentHelper.kt b/v1_21_3/src/main/kotlin/com/undefined/stellar/v1_21_3/ArgumentHelper.kt index fb8e56c..51c49d7 100644 --- a/v1_21_3/src/main/kotlin/com/undefined/stellar/v1_21_3/ArgumentHelper.kt +++ b/v1_21_3/src/main/kotlin/com/undefined/stellar/v1_21_3/ArgumentHelper.kt @@ -109,7 +109,6 @@ object ArgumentHelper { fun > getArgumentType(argument: T): ArgumentType<*> = when (argument) { is ListArgument<*> -> getArgumentType(argument.type) - is EnumArgument<*> -> StringArgumentType.word() is CustomArgument<*> -> getArgumentType(argument.type) is StringArgument -> brigadier(argument.type) is PhraseArgument -> brigadier(StringType.PHRASE) @@ -137,7 +136,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> ObjectiveArgument.objective() is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.criteria() is com.undefined.stellar.argument.types.math.OperationArgument -> OperationArgument.operation() - is com.undefined.stellar.argument.types.item.ParticleArgument -> ParticleArgument.particle(COMMAND_BUILD_CONTEXT) + is com.undefined.stellar.argument.types.world.ParticleArgument -> ParticleArgument.particle(COMMAND_BUILD_CONTEXT) is com.undefined.stellar.argument.types.math.AngleArgument -> AngleArgument.angle() is com.undefined.stellar.argument.types.math.RotationArgument -> RotationArgument.rotation() is DisplaySlotArgument -> ScoreboardSlotArgument.displaySlot() @@ -221,7 +220,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> Bukkit.getScoreboardManager().mainScoreboard.getObjective(ObjectiveArgument.getObjective(context, argument.name).name) is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.getCriteria(context, argument.name).name is com.undefined.stellar.argument.types.math.OperationArgument -> Operation.getOperation(getArgumentInput(context, argument.name) ?: return null) - is com.undefined.stellar.argument.types.item.ParticleArgument -> { + is com.undefined.stellar.argument.types.world.ParticleArgument -> { val particleOptions = ParticleArgument.getParticle(context, argument.name) getParticleData(context, CraftParticle.minecraftToBukkit(particleOptions.type), particleOptions) } diff --git a/v1_21_4/src/main/kotlin/com/undefined/stellar/v1_21_4/ArgumentHelper.kt b/v1_21_4/src/main/kotlin/com/undefined/stellar/v1_21_4/ArgumentHelper.kt index 2c193ef..6fe48ff 100644 --- a/v1_21_4/src/main/kotlin/com/undefined/stellar/v1_21_4/ArgumentHelper.kt +++ b/v1_21_4/src/main/kotlin/com/undefined/stellar/v1_21_4/ArgumentHelper.kt @@ -109,7 +109,6 @@ object ArgumentHelper { fun > getArgumentType(argument: T): ArgumentType<*> = when (argument) { is ListArgument<*> -> getArgumentType(argument.type) - is EnumArgument<*> -> StringArgumentType.word() is CustomArgument<*> -> getArgumentType(argument.type) is StringArgument -> brigadier(argument.type) is PhraseArgument -> brigadier(StringType.PHRASE) @@ -137,7 +136,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> ObjectiveArgument.objective() is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.criteria() is com.undefined.stellar.argument.types.math.OperationArgument -> OperationArgument.operation() - is com.undefined.stellar.argument.types.item.ParticleArgument -> ParticleArgument.particle(COMMAND_BUILD_CONTEXT) + is com.undefined.stellar.argument.types.world.ParticleArgument -> ParticleArgument.particle(COMMAND_BUILD_CONTEXT) is com.undefined.stellar.argument.types.math.AngleArgument -> AngleArgument.angle() is com.undefined.stellar.argument.types.math.RotationArgument -> RotationArgument.rotation() is DisplaySlotArgument -> ScoreboardSlotArgument.displaySlot() @@ -221,7 +220,7 @@ object ArgumentHelper { is com.undefined.stellar.argument.types.scoreboard.ObjectiveArgument -> Bukkit.getScoreboardManager().mainScoreboard.getObjective(ObjectiveArgument.getObjective(context, argument.name).name) is com.undefined.stellar.argument.types.scoreboard.ObjectiveCriteriaArgument -> ObjectiveCriteriaArgument.getCriteria(context, argument.name).name is com.undefined.stellar.argument.types.math.OperationArgument -> Operation.getOperation(getArgumentInput(context, argument.name) ?: return null) - is com.undefined.stellar.argument.types.item.ParticleArgument -> { + is com.undefined.stellar.argument.types.world.ParticleArgument -> { val particleOptions = ParticleArgument.getParticle(context, argument.name) getParticleData(context, CraftParticle.minecraftToBukkit(particleOptions.type), particleOptions) }