WorldEdit icon indicating copy to clipboard operation
WorldEdit copied to clipboard

Allow signs to maintain text AND position/direction with //replace or //replacenear

Open QuietWindUponTheMoor opened this issue 8 months ago • 2 comments

The Problem

I would like to replace a bunch of signs of one type, with another type. In this case, I would like to replace spruce signs with bamboo signs.

Using a state-applying-pattern (^) did not seem to work: //replacenear 200 minecraft:spruce_wall_sign ^minecraft:bamboo_wall_sign (For replacenear), or, for strict replace: //replace minecraft:spruce_wall_sign ^minecraft:bamboo_wall_sign

This is because sign text is NBT metadata and not covered by state-applying-pattern.

A Solution

Add functionality to com.sk89q.worldedit.function.pattern.TypeApplyingPattern to also keep NBT data, or add another pattern that allows for this to be an option when replacing blocks.

Currently, BaseBlock I was told does not have any NBT data so I'd assume this would require some modifications to how the TypeApplyingPattern class operates.

Alternatives

The only other way I can personally think of that make the process I'm trying to accomplish here to be somewhat quicker than just manually re-doing all of the signs, is going through this process, using EssentialsX:

  1. Use /editsign copy
  2. Break the old sign, place the new sign off the desired type [in this case, a bamboo sign]
  3. Use /editsign paste to paste the text back onto the new sign

This is extremely tedious and almost as slow as just doing all of the signs over by hand again.

Anything Else?

No response

QuietWindUponTheMoor avatar Jun 07 '24 00:06 QuietWindUponTheMoor