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

Integrate RoyalDeath as a component of RoyalCommands #33

Merged
merged 7 commits into from
Oct 8, 2024

Conversation

BlaneyXYZ
Copy link
Member

Added config options to config.yml, custom death messages can be disabled
Added new file deathmessages.yml to contain custom messages for each cause

Added support for new causes of death

  • Campfire
  • Sonic Boom
  • Flying into Wall
  • Hot Floor (Magma touch)

/kill now supports a cause of death

Config options in config.yml, death messages in deathmessage.yml
Config has been adjusted, and the /kill command now support death cause
Copy link
Member

@WizardCM WizardCM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for doing this. The code overall looks correct (though I haven't tested it). I've added comments mostly around how we want to name the configuration fields, and some notes about variables.


To elaborate about why this PR was created:

The RoyalDeath plugin is relatively small, and we felt it could be contained within the larger RoyalCommands codebase to ensure it's more likely to be updated for new versions, and to ensure continued compatibility. Plus, added bonus of less duplicate code & the ability to extend it with additional functionality (such as PlaceholderAPI down the line).

final String pullFrom;
switch (this.getLastDamageCause()) {
case BLOCK_EXPLOSION:
pullFrom = "blo";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this particular code path is basically identical from RoyalDeath's implementation, but do we want to stick with strings as identifiers here? Or is that something we can change later without any real damage?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did think over this when first doing it, and change each of the types to match the DamageCause.
Where I got stuck is cases like FIRE and FIRE_TICK where we use fir, or PROJECTILE where it can either be pvp or mob

Nothing stopping us from expanding the strings to be the full name (or description)

I am open to suggestions of better ways to tackle this

modules/RoyalCommands/src/main/resources/config.yml Outdated Show resolved Hide resolved
modules/RoyalCommands/src/main/resources/config.yml Outdated Show resolved Hide resolved
modules/RoyalCommands/src/main/resources/config.yml Outdated Show resolved Hide resolved
modules/RoyalCommands/src/main/resources/config.yml Outdated Show resolved Hide resolved
Comment on lines 3 to 9
# {player} <- name of player who died
# {dispplayer} <- display name of player who died (nicknames, etc)
# {killer} <- what killed it (attacker name - PvP only)
# {dispkiller} <- what killed it (attacker display name - PvP only)
# {world} <- the world in which the player died
# {mob} <- what killed it (if it's a monster)
# {hand} <- what was in the killer's hand (PvP only, will use item name if available)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the perfect time to align some of these with the existing variables with the larger RCmds. At a bare minimum, kicks.messages.ingame_format uses {dispname} rather than {dispplayer}. Though this might be difficult as most RCmds messages are single-player, whereas death has a player who died and a player who caused it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dispname makes sense for the killed player display name
Thoughts on using kdispname for the killer display name?

@BlaneyXYZ BlaneyXYZ requested a review from WizardCM July 2, 2024 07:48
@BlaneyXYZ BlaneyXYZ merged commit a814ab9 into master Oct 8, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants