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

Allow relational placeholders #8

Open
markhughes opened this issue Sep 11, 2017 · 0 comments
Open

Allow relational placeholders #8

markhughes opened this issue Sep 11, 2017 · 0 comments

Comments

@markhughes
Copy link

markhughes commented Sep 11, 2017

Hello! Thanks for the awesome work with LegendChat

Currently LegacyFactions adds our placeholders through this method:

@EventHandler
public void onChatEvent(ChatMessageEvent event) {
	for (FactionsPlaceholder placeholder : FactionsPlaceholders.get().getPlaceholders()) {
		if (!event.getTags().contains("factions_" + placeholder.placeholder())) continue;
			
		event.setTagValue("factions_" + placeholder.placeholder(), placeholder.get(event.getSender()));
	}
}

Which works great for regular messages! However, we would like to add relational placeholders.

From the looks of it you take over chat (cancel and send it yourself) - which is great! Because this means you can set the format per-player.

Basically the relational placeholders are placeholders based on the relationship between two players. So an event that executes with the sender, and the receiver could help out here.

E.g. with LegacyFactions this would allow us to determine if they are an enemy/ally/truce/neutral. So rel_factions_relation_colour would return a colour to reflect this. So RED for enemies.

If we could maybe add a ChatMessageSendingEvent that allows us to change the format for a single player so we can add in our relationship based placeholders that would be awesome! I would create a PR, I just don't have time to go through the codebase and learn the project! :(

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

No branches or pull requests

1 participant