nlipiarski / MCC

Marshal Command Code Syntax Highlighter
GNU General Public License v3.0
14 stars 2 forks source link

NBT tag types are handled incorrectly in some cases. #16

Closed Panossa closed 7 years ago

Panossa commented 7 years ago

See attached image. snap_2017 07 11_01h18m24s_003_

Panossa commented 7 years ago

Update: Slot:1b, Slot:2b and so on don't get highlighted. Only something that can only be 1 or 0 is highlighted with a 'b' following it.

Panossa commented 7 years ago

Update 2: Maxaxik suspects every int can be filled up with an "s" afterwards and still gets highlighted. Like in Duration.

Panossa commented 7 years ago

Update 3: Maxaxik found a lot more of those via ChunkFormat. See attached image: snap_2017 07 12_00h20m19s_003_

Code:

###
#Missing type definition in tags

#ENTITES
    testfor @s {Item:{tag:{AttributeModifiers:[{Amount:2.0d}]}}}
    testfor @s {Item:{tag:{AttributeModifiers:[{UUIDMost:2L}]}}}
    testfor @s {Item:{tag:{AttributeModifiers:[{UUIDLeast:2L}]}}}
    testfor @s {Item:{tag:{Id:2b}}}
    testfor @s {Item:{tag:{CustomPotionEffects:[{Amplifier:2b}]}}
    testfor @s {Color:2b}
    testfor @s {Peek:1b}
    testfor @s {AttachFace:1b}
    testfor @s {CollarColor:1b}
    testfor @s {shake:1b}
    testfor @s {inData:1b}
    testfor @s {pickup:1b}
    testfor @s {damage:1.0d}
    testfor @s {LootTableSeed:2L}
    testfor @s {PushX:1.0d}
    testfor @s {PushZ:1.0d}
    testfor @s {Data:2b}
    testfor @s {FallHurtAmount:2.0f}
    testfor @s {DurationOnUse:2.0f}
    testfor @s {Radius:2.0f}
    testfor @s {RadiusOnUse:2.0f}
    testfor @s {RadiusPerTick:2.0f}
    testfor @s {Facing:2b}
    testfor @s {ItemDropChance:2.0f}
    testfor @s {ItemRotation:1b}
    testfor @s {Target:{L:2L}}
    testfor @s {TXD:1.0d}
    testfor @s {TYD:1.0d}
    testfor @s {TZD:1.0d}
#   note: [I;2] -> the 'I;' part specifies that the tag is of type "int_array" and it's required for fireworks in 1.12, it's only present in these two tags
    testfor @s {Item:{tag:{Explosion:{Colors:[I;2]}}}}
    testfor @s {Item:{tag:{Explosion:{FadeColors:[I;2]}}}}

    testfor @s {Item:{tag:{Explosion:{Type:1b}}}}
    testfor @s {Item:{tag:{Explosion:{Fireworks:{Flight:2b}}}}}
    testfor @s {Item:{tag:{Decorations:[{type:1b}]}}}
    testfor @s {Item:{tag:{Decorations:[{x:1.0d}]}}}
    testfor @s {Item:{tag:{Decorations:[{z:1.0d}]}}}
    testfor @s {Item:{tag:{Decorations:[{rot:1.0d}]}}}
    testfor @s {Inventory:[{Slot:100b}]}
    testfor @s {FallDistance:1.0f}
    testfor @s {ExplosionRadius:1b}

#BLOCKS
    testforblock ~ ~ ~ noteblock * {note:1b}
    testforblock ~ ~ ~ piston * {progress:2.0f}
    testforblock ~ ~ ~ skull * {SkullType:1b}
    testforblock ~ ~ ~ skull * {Rot:1b}
    testforblock ~ ~ ~ brewing_stand * {Fuel:2b}
###
Panossa commented 7 years ago

Two more:

testfor @s {UUIDLeast:2L}
testfor @s {UUIDMost:2L}
nlipiarski commented 7 years ago

All b, s, and d issues have been fixed the [I;(num)] syntax is a work in progress.

nlipiarski commented 7 years ago

The integer array syntax has now been added. It will be available with the next release.