KubeJS (Old)

KubeJS (Old)

3M Downloads

string wrapper changes

rlnt opened this issue ยท 0 comments

commented

Describe the feature

After a bit of discussion, the following idea was brought up in the Discord that would be very beneficial for the quality of life of Kube.

Ingredients and Items already support string wrappers like 5x minecraft:stick or 3x #forge:ingots.
A feature barely known is that fluids also support this but the syntax is minecraft:water 500 which is equal to 500 millibuckets of water. This is very inconsistent and confusing.

Like Dan mentioned in the indigo channel, the * character could be used as an alias for the x character. That's maybe a bit more recognizable for experienced developers or people coming from CraftTweaker.

The main change would be to have the string wrappers more consistent. Here is a simple overview how that could look like:

let number = 5
`${number}x minecraft:stick` // Item.of('minecraft:stick', number)
`${number}* minecraft:stick` // Item.of('minecraft:stick', number)
`${number}x #minecraft:stone` // Ingredient.of('#minecraft:stone', number)
`${number}* #minecraft:stone` // Ingredient.of('#minecraft:stone', number)
`${number}mb minecraft:water` // Fluid.of('minecraft:water', number)
`${number}b minecraft:water` // Fluid.of('minecraft:water', number * 1000)

The fluid wrapper could also get the unit constant for a bucket Fluid.BUCKET = 1000 so Fluid.of('water', 10 * Fluid.BUCKET) is possible.

Additional info

No response