Skip to content

Commit

Permalink
Save player profile when equipping tags in the menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Refrac committed Dec 31, 2023
1 parent ecebdd1 commit e3b6ec8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.refracdevelopment</groupId>
<artifactId>SimpleTags</artifactId>
<version>1.2</version>
<version>1.3</version>
<packaging>jar</packaging>

<name>SimpleTags</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import me.refracdevelopment.simpletags.SimpleTags;
import me.refracdevelopment.simpletags.player.data.ProfileData;
import me.refracdevelopment.simpletags.player.data.Tag;
import me.refracdevelopment.simpletags.utilities.Tasks;
import me.refracdevelopment.simpletags.utilities.Utilities;
import me.refracdevelopment.simpletags.utilities.chat.Color;
import me.refracdevelopment.simpletags.utilities.chat.Placeholders;
Expand Down Expand Up @@ -77,13 +78,15 @@ public void handleMenu(InventoryClickEvent e) {
if (!profile.getTag().equalsIgnoreCase(tag.getConfigName()) || profile.getTag().isEmpty()) {
profile.setTag(tag.getConfigName());
profile.setTagPrefix(tag.getTagPrefix());
Tasks.runAsync(profile::save);
Color.sendMessage(player, "tag-updated", Placeholders.setPlaceholders(player));
player.closeInventory();
return;
}

profile.setTag("");
profile.setTagPrefix("");
Tasks.runAsync(profile::save);
Color.sendMessage(player, "tag-reset", Placeholders.setPlaceholders(player));
player.closeInventory();
}
Expand Down

0 comments on commit e3b6ec8

Please sign in to comment.