Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextReplacementConfig being weird #638

Closed
SoSeDiK opened this issue Dec 13, 2021 · 0 comments · Fixed by #641
Closed

TextReplacementConfig being weird #638

SoSeDiK opened this issue Dec 13, 2021 · 0 comments · Fixed by #641

Comments

@SoSeDiK
Copy link

SoSeDiK commented Dec 13, 2021

The following code:

var replacement = TextReplacementConfig.builder().match("hover").replacement(
	Component.text()
		.content("yeeet")
		.hoverEvent(Component.text("hover!"))
		.build()
).build();
var component1 = Component.text("hover").replaceText(replacement); // text the same as match above
var component2 = Component.text("hover ").replaceText(replacement); // there's space at the end now
player.sendMessage(component1);
player.sendMessage(component2);

Produces this result:
image
image
For some reason, TextReplacementConfig gets called twice (?) in the first case which wrongly replaces text inside hover.

Using Paper 1.17.1 build 399 and adventure-text-api 4.10.0-SNAPSHOT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants