Skip to content

Commit 4f29132

Browse files
committed
fixup dupe bug causing functionality
1 parent dda703e commit 4f29132

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/main/java/xyz/oribuin/eternaltags/gui/PluginMenu.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ public final void searchTags(Player player, BaseGui gui) {
342342
event -> {
343343
event.setCancelled(true);
344344
String message = event.getMessage().toLowerCase();
345-
this.sync(() -> MenuProvider.get(TagsGUI.class).open(player, tag -> tag.getId().contains(message) || tag.getName().contains(message)
345+
this.sync(() -> MenuProvider.get(TagsGUI.class).open(event.getPlayer(), tag -> tag.getId().contains(message) || tag.getName().contains(message)
346346
));
347347
},
348348
60,

src/main/java/xyz/oribuin/eternaltags/gui/menu/FavouritesGUI.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,14 @@ private void addTags(@NotNull BaseGui gui, @NotNull Player player) {
169169
// Make sure the player has permission to use the tag
170170
if (!this.manager.canUseTag(player, tag)) {
171171
this.locale.sendMessage(player, "no-permission");
172-
gui.close(player);
172+
this.close(gui, player);
173173
return;
174174
}
175175

176176
// Run the tag actions
177177
if (!tagActions.isEmpty()) {
178178
this.runActions(tagActions, event, this.getTagPlaceholders(tag, player));
179-
gui.close(player);
179+
this.close(gui, player);
180180
return;
181181
}
182182

@@ -189,7 +189,7 @@ private void addTags(@NotNull BaseGui gui, @NotNull Player player) {
189189

190190
// Set the tag
191191
this.setTag(player, tag);
192-
gui.close(player);
192+
this.close(gui, player);
193193
};
194194

195195
// If the tag is already in the cache, use that instead of creating a new one.

src/main/java/xyz/oribuin/eternaltags/gui/menu/TagsGUI.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,15 @@ private void addTags(@NotNull BaseGui gui, @NotNull Player player, @Nullable Pre
188188
paginatedGui.clearPageItems();
189189

190190
Map<ClickType, List<Action>> tagActions = this.getTagActions();
191-
Sound tagSound = TagsUtils.getEnum(Sound.class, this.config.getString("tag-item.sound", ""));
191+
// Sound tagSound = TagsUtils.getEnum(Sound.class, this.config.getString("tag-item.sound", ""));
192192

193193
this.getTags(player, filter).forEach(tag -> {
194194
GuiAction<InventoryClickEvent> action = event -> {
195195

196196
// Check if the player has permission to use the tag
197197
if (!this.manager.canUseTag(player, tag)) {
198198
this.locale.sendMessage(player, "no-permission");
199-
gui.close(player);
199+
this.close(gui, player);
200200
return;
201201
}
202202

@@ -207,9 +207,9 @@ private void addTags(@NotNull BaseGui gui, @NotNull Player player, @Nullable Pre
207207
}
208208

209209
// Play the sound if it's not null
210-
if (tagSound != null) {
211-
player.playSound(player.getLocation(), tagSound, 75, 1);
212-
}
210+
// if (tagSound != null) {
211+
// player.playSound(player.getLocation(), tagSound, 75, 1);
212+
// }
213213

214214
// If the player is shift clicking, toggle the favourite status of the tag
215215
if (event.isShiftClick()) {
@@ -220,7 +220,7 @@ private void addTags(@NotNull BaseGui gui, @NotNull Player player, @Nullable Pre
220220

221221
// Set the tag if the player is not shift clicking
222222
this.setTag(player, tag);
223-
gui.close(player);
223+
this.close(gui, player);
224224
};
225225

226226
// If the tag is already in the cache, use that instead of creating a new one.

0 commit comments

Comments
 (0)