You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: Use Cloud annotations for commands
* refactor: Convert ArmorColorCommand to cloud
* refactor: Convert CalcXPCommand to cloud
* refactor: Convert GlintCustomizeCommand to cloud
* remove: FragBotCommand
* refactor: Convert OrderedWaypointCommand to cloud
* refactor: Convert ProtectItemCommand to cloud
* refactor: Convert RepartyCommand to cloud
Override Reparty no longer does anything
* refactor: Convert TrackCooldownCommand to cloud
* refactor: Convert ItemCycleCommand to cloud
* refactor: Convert HollowWaypointCommand to cloud
* refactor: Convert ScamCheckCommand to cloud
* refactor: Convert TrophyFishCommand to cloud
* refactor: Convert CataCommand to cloud
* refactor: Convert SlayerCommand to cloud
* refactor: Convert SkytilsCommand to cloud
* remove: BaseCommand and StatCommand
* fix: Catch errors when constructing commands
* fix!: HollowWaypointCommand Syntax
Some things of note:
Cloud doesn't seem to support greedy string, so you can't use names with spaces anymore
Difference in argument order (cloud/brigadier limitation) may affect other mods (NEU)
* fix: Make some commands greedy
* fix: Make HollowWaypointCommand Quoted instead of Greedy
* feat: Improve error presentation
* fix: Use launch instead of withContext for commands
The current command executor will run on the calling thread. We can try async later if we verify there are no concurrency issues.
* refactor: Make it easier for future multiversioning
* fix: Re-throw any caught exceptions while executing commands
* feat: Backwards compatibility hack for `sthw add` when using NEU
* fix: Remove duplicate exception messages by wrapping the exception
if (!Utils.inSkyblock) throwWrongUsageException("You must be in Skyblock to use this command!")
50
-
val item = player.heldItem
51
-
?:throwWrongUsageException("You must hold a leather armor piece to use this command")
52
-
if ((item.item as?ItemArmor)?.armorMaterial !=ItemArmor.ArmorMaterial.LEATHER) throwWrongUsageException("You must hold a leather armor piece to use this command")
53
-
val extraAttributes =ItemUtil.getExtraAttributes(item)
54
-
if (extraAttributes ==null||!extraAttributes.hasKey("uuid")) throwWrongUsageException("This item does not have a UUID!")
55
-
val uuid = extraAttributes.getString("uuid")
56
-
if (subcommand =="set") {
57
-
if (args.size !=2) throwWrongUsageException("You must specify a valid hex color!")
58
-
val color:CustomColor=try {
59
-
Utils.customColorFromString(args[1])
60
-
} catch (e:IllegalArgumentException) {
61
-
throwSyntaxErrorException("$failPrefix §cUnable to get a color from inputted string.")
62
-
}
63
-
ArmorColor.armorColors[uuid] = color
64
-
PersistentSave.markDirty<ArmorColor>()
65
-
UChat.chat("$successPrefix §aSet the color of your ${item.displayName}§a to ${args[1]}!")
66
-
} else {
67
-
if (ArmorColor.armorColors.containsKey(uuid)) {
68
-
ArmorColor.armorColors.remove(uuid)
69
-
PersistentSave.markDirty<ArmorColor>()
70
-
UChat.chat("$successPrefix §aCleared the custom color for your ${item.displayName}§a!")
71
-
} elseUChat.chat("§cThat item doesn't have a custom color!")
72
-
}
73
-
} elseUChat.chat(getCommandUsage(player))
54
+
UChat.chat("$successPrefix §aCleared the custom color for your ${item.displayName}§a!")
55
+
} elseUChat.chat("§cThat item doesn't have a custom color!")
56
+
}
57
+
58
+
@Command("armorcolor set <color>")
59
+
funsetCurrent(
60
+
@Greedy
61
+
@Argument("color", description ="The color to set the armor to")
62
+
color:String
63
+
) {
64
+
val (item, uuid) = getCurrentArmor()
65
+
val customColor:CustomColor=try {
66
+
Utils.customColorFromString(color)
67
+
} catch (e:IllegalArgumentException) {
68
+
throwSyntaxErrorException("$failPrefix §cUnable to get a color from inputted string.")
69
+
}
70
+
ArmorColor.armorColors[uuid] = customColor
71
+
PersistentSave.markDirty<ArmorColor>()
72
+
UChat.chat("$successPrefix §aSet the color of your ${item.displayName}§a to $color!")
if (!Utils.inSkyblock) throwWrongUsageException("You must be in Skyblock to use this command!")
77
+
val item = mc.thePlayer?.heldItem ?:throwWrongUsageException("You must hold a leather armor piece to use this command")
78
+
if ((item.item as?ItemArmor)?.armorMaterial !=ItemArmor.ArmorMaterial.LEATHER) throwWrongUsageException("You must hold a leather armor piece to use this command")
79
+
val extraAttributes =ItemUtil.getExtraAttributes(item)
80
+
if (extraAttributes ==null||!extraAttributes.hasKey("uuid")) throwWrongUsageException("This item does not have a UUID!")
0 commit comments