This repository was archived by the owner on Sep 2, 2024. It is now read-only.
Open
Conversation
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview:
Adds a command (
/copyval) which will convert the held Code Value into a string and copy it, if possible.Configuration exists for the command to change the format of the string copied using Java's format syntax.
Intended Use:
This command is intended to be used by players using external DF programming languages. It provides a relatively convenient method to convert common code values into a custom string format to be pasted into a script.
Available Settings:
Note:
It is definitely possible to add some more advanced configuration, like some type of regex replacement rules or something, though that feels very overkill for this.
Files Changed:
Solo Testing:
Invalid Cases:
/copyvalwhile holding air, correctly errors (Can't be air)/copyvalwhile holding a random item, correctly errors (Not a value)/copyvalwhile holding sound, correctly errors (Unsupported)/copyvalwhile holding particle, correctly errors (Unsupported)/copyvalwhile holding potion, correctly errors (Unsupported)/copyvalwhile holding variable, correctly errors (Unsupported)/copyvalwhile holding game value, correctly errors (Unsupported)/copyvalwhile holding parameter, correctly errors (Unsupported)Number:
/copyvalwhile holding a simple number item, correctly copies/copyvalwhile holding a number item with %math, correctly copies/copyvalwhile holding an unset number item, correctly treats it as 0/copyvalwith1correctly treated as simple/copyvalwith1.0correctly treated as simple/copyvalwith0.5correctly treated as simple/copyvalwith.5correctly treated as simple/copyvalwith1.0002correctly treated as non-simple/copyvalwith%math(2)correctly treated as non-simpleLocation:
/copyvalwhile holding a location item, correctly copies/copyvalwhile holding an unset location item, correctly treats it as 0, 0, 0, 0, 0Vector:
/copyvalwhile holding a vector item, correctly copies/copyvalwhile holding an unset vector item, correctly treats it as 0, 0, 0String
/copyvalwhile holding a string item, correctly copies (With delim + esc)/copyvalwhile holding a string item, blank delimiter setting, correctly ignores escape and uses raw value/copyvalwhile holding a string item, blank escape setting, correctly ignores delimiter and uses raw value/copyvalwhile holding a string item, blank escape and delimiter setting, correctly uses raw value/copyvalwhile holding an unset string item, correctly treats it as "string"Text:
/copyvalwhile holding a text item, correctly copies (With delim + esc)/copyvalwhile holding a text item, blank delimiter setting, correctly ignores escape and uses raw value/copyvalwhile holding a text item, blank escape setting, correctly ignores delimiter and uses raw value/copyvalwhile holding a text item, blank escape and delimiter setting, correctly uses raw value/copyvalwhile holding an unset text item, correctly treats it as "text"