Skip to content

Commit 9d70fdb

Browse files
authored
Add MiniMessage support for thunder enabled / disabled (#6454)
<!-- EssentialsX bug fix submission guide ==================================== NOTE: Failure to fill out this template properly may result in your PR being delayed or ignored without warning. NOTE: Don't type between any arrows in the template, as this text will be hidden. This includes this header block and any other explanation text blocks. Want to discuss your PR before submitting it? Join the EssentialsX Development server: https://discord.gg/CUN7qVb EssentialsX is GPL ------------------ By contributing to EssentialsX, you agree to license your code under the GNU General Public License version 3, which can be found at the link below: https://github.com/EssentialsX/Essentials/blob/2.x/LICENSE Instructions ------------ If you are submitting a bug fix, please follow the following steps: 1. Fill out the template in full. This includes providing screenshots and a link to the original bug report. If there isn't an existing bug report, we recommend opening a new detailed bug report BEFORE opening your PR to fix it, else your PR may be delayed or rejected without warning. You can open a new bug report by following this link: https://github.com/EssentialsX/Essentials/issues/new/choose 2. When linking logs or config files, do not attach them to the post! Copy and paste any logs into https://gist.github.com/, then paste a link to them in the relevant parts of the template. Do not use Hastebin or Pastebin, as this can cause issues with future reviews. DO NOT drag logs directly into this text box, as we cannot read these! 3. If you are fixing a performance issue, please include a link to a Timings and/or profiler report, both before and after your PR. 4. If you are fixing a visual bug, such as in commands, please include screenshots so that we can more easily review the proposed fix. (You can drag screenshots into the bottom of the editor.) --> ### Information <!-- Replace #nnnn with the number of the original issue. If this PR fixes multiple issues, you should repeat the phrase "fixes #nnnn" for each issue. --> This PR fixes missing MiniMessage support for the enabled / disabled thunder message ### Details **Proposed fix:** <!-- Type a description of your proposed fix below this line. --> Added parsing **Environments tested:** <!-- Type the OS you have used below. --> OS: Linux <!-- Type the JDK version (from java -version) you have used below. --> Java version: 21 <!-- Put an "x" inside the boxes for the server software you have tested this bug fix on. If this feature does not apply to a server, strike through the server software using ~~strikethrough~~. If you have tested on other environments, add a new line with relevant details. --> - [x] 1.21.8 Paper version - [ ] CraftBukkit/Spigot/Paper 1.12.2 - [ ] CraftBukkit 1.8.8 **Demonstration:** <!-- Below this block, include screenshots/log snippets from before and after as necessary. If you have created or used a test case plugin, please link to a download of the plugin, source code and exact version used where possible. -->
1 parent 297d0e4 commit 9d70fdb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Essentials/src/main/java/com/earth2me/essentials/commands/Commandthunder.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.earth2me.essentials.commands;
22

33
import com.earth2me.essentials.User;
4+
import com.earth2me.essentials.utils.CommonPlaceholders;
45
import com.google.common.collect.Lists;
56
import org.bukkit.Server;
67
import org.bukkit.World;
@@ -21,15 +22,16 @@ public void run(final Server server, final User user, final String commandLabel,
2122

2223
final World world = user.getWorld();
2324
final boolean setThunder = args[0].equalsIgnoreCase("true");
25+
2426
if (args.length == 1) {
2527
world.setThundering(setThunder);
26-
user.sendTl("thunder", setThunder ? user.playerTl("enabled") : user.playerTl("disabled"));
28+
user.sendTl("thunder", CommonPlaceholders.enableDisable(user.getSource(), setThunder));
2729
return;
2830
}
2931

3032
world.setThundering(setThunder);
3133
world.setThunderDuration(Integer.parseInt(args[1]) * 20);
32-
user.sendTl("thunderDuration", setThunder ? user.playerTl("enabled") : user.playerTl("disabled"), Integer.parseInt(args[1]));
34+
user.sendTl("thunderDuration", CommonPlaceholders.enableDisable(user.getSource(), setThunder), Integer.parseInt(args[1]));
3335
}
3436

3537
@Override

0 commit comments

Comments
 (0)