CraftTweaker

CraftTweaker

151M Downloads

IDataOps.convertTo for String values leaves extra Quotation marks

Dragon-Seeker opened this issue ยท 1 comments

commented

Issue description

For the STRING branch of the switch the call for input.asString should be input.getAsString to prevent quotation marks from being in the returned string. Found due to owolib's use of a custom format to handle Codec<->Endec interop

Steps to reproduce

No response

Script used

https://pastebin.com/9EXAAWjh

The crafttweaker.log file

https://pastebin.com/4WvwSk64

Minecraft version

1.20.4

Modloader

Fabric

Modloader version

0.15.3

CraftTweaker version

17.0.12

Other relevant information

No response

The latest.log file

https://pastebin.com/AybcDJd8

commented

For reference - This is the issue that dragon-seeker mentioned:
wisp-forest/alloy-forgery#129


The referenced CodeLine is part of IDataOps#convertTo

    @Override
    public <U> U convertTo(final DynamicOps<U> outOps, final IData input) {
        //... snip ...//
        
        return switch(input.getType()) {
            //... snip ...//
            case STRING -> outOps.createString(input.asString());
            case EMPTY -> outOps.empty();
        };
    }