Project Expansion

Project Expansion

4M Downloads

Add: Config option to disable the notification when your EMC is changed by `/emc add|remove|set ...`

James103 opened this issue ยท 2 comments

commented

As of Project Expansion 1.0.10 (commit 1a9c502), changing a player's EMC using the /emc add|remove|set ... command sends a notification to the targeted player(s) that their EMC was changed. This notification may not be desirable, especially in the following examples:

  1. The message may be spammed by a repeating command block giving 1 EMC/tick to all players by executing execute as @a run emc add @s 1.
  2. The modpack developer may want to implement an EMC penalty for death, but they want a custom message for the EMC loss instead of the message that is hard-coded and (currently) always active when using the /emc command on a different player.

To fix this, a config option should be added that allows the notification messages to be disabled.

  • Name: EMC Command Notification
  • Description: If the /emc command should send a notification to players when their EMC is changed.
  • Effect: If false, the /emc command does not send notifications to any players targeted that have their EMC changed.

Current workaround: Delete or comment out the following lines, then compile and install the mod as usual.

player.sendMessage(new TranslationTextComponent("command.projectexpansion.emc.add.notification", formatEMC(value), getSourceName(ctx.getSource()), formatEMC(newEMC)), getSourceUUID(ctx.getSource()));

player.sendMessage(new TranslationTextComponent("command.projectexpansion.emc.remove.notification", formatEMC(value), getSourceName(ctx.getSource()), formatEMC(newEMC)), getSourceUUID(ctx.getSource()));

player.sendMessage(new TranslationTextComponent("command.projectexpansion.emc.set.notification", formatEMC(newEMC), getSourceName(ctx.getSource())), getSourceUUID(ctx.getSource()));

commented

Added a "Notify EMC Changes" configuration option in [1.16] 1.0.11

commented

Backported to 1.15 in [1.15] 1.0.11