Skip to content

Commit fabd129

Browse files
committed
[🐛] Fixed some duplicate and missing sounds
1 parent 0c32dc0 commit fabd129

5 files changed

Lines changed: 31 additions & 30 deletions

File tree

src/main/java/fr/snipertvmc/essentialsxgui/inventories/homes/HomeEditingInventory.java

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import fr.snipertvmc.essentialsxgui.utilities.MessagesUtils;
1313
import fr.snipertvmc.essentialsxgui.utilities.data.DataEntryUtils;
1414
import fr.snipertvmc.essentialsxgui.utilities.other.SoundsUtils;
15+
import org.bukkit.Sound;
1516
import org.bukkit.entity.Player;
1617

1718
import java.util.List;
@@ -63,22 +64,34 @@ public HomeEditingInventory(Player player, EXGHome home) {
6364
.updateVariables(
6465
Map.of("homeName", home.getName(),
6566
"homeDisplayName", home.getDisplayName()))
66-
.build(), e -> changeHomeDisplayName(player, home));
67+
.build(), e -> {
68+
69+
SoundsUtils.playSound(player, EXGSound.GUI_CLICK);
70+
changeHomeDisplayName(player, home);
71+
});
6772
}
6873

6974
if (config.getChangeIconItem().isEnabled()) {
7075
setItem(config.getChangeIconItem().getSlot(), config.getChangeIconItem()
7176
.updateVariables(
7277
Map.of("homeName", home.getName()))
73-
.build(), e -> changeHomeIcon(player, home));
78+
.build(), e -> {
79+
80+
SoundsUtils.playSound(player, EXGSound.GUI_CLICK);
81+
changeHomeIcon(player, home);
82+
});
7483
}
7584

7685
if (config.getDeleteHomeItem().isEnabled()) {
7786
setItem(config.getDeleteHomeItem().getSlot(), config.getDeleteHomeItem()
7887
.updateVariables(
7988
Map.of("homeName", home.getName(),
8089
"homeDisplayName", home.getDisplayName()))
81-
.build(), e -> deleteHome(player, home));
90+
.build(), e -> {
91+
92+
SoundsUtils.playSound(player, EXGSound.GUI_CLICK);
93+
deleteHome(player, home);
94+
});
8295
}
8396

8497

@@ -101,8 +114,6 @@ public void changeHomeDisplayName(Player player, EXGHome home) {
101114
return;
102115
}
103116

104-
SoundsUtils.playSound(player, EXGSound.GUI_CLICK);
105-
106117
EXGEntryType entryType = Main.getInstance().getFilesManager().getConfiguration().getEntryType("homes", "changeHomeDisplayNameEntryType");
107118
if (entryType == EXGEntryType.CHAT) {
108119
player.closeInventory();
@@ -137,8 +148,6 @@ public void changeHomeIcon(Player player, EXGHome home) {
137148
return;
138149
}
139150

140-
SoundsUtils.playSound(player, EXGSound.GUI_CLICK);
141-
142151
EXGEntryType entryType = Main.getInstance().getFilesManager().getConfiguration().getEntryType("homes", "changeHomeIconEntryType");
143152
if (entryType == EXGEntryType.CHAT) {
144153
player.closeInventory();
@@ -174,8 +183,6 @@ public void deleteHome(Player player, EXGHome home) {
174183
return;
175184
}
176185

177-
SoundsUtils.playSound(player, EXGSound.GUI_CLICK);
178-
179186
EXGEntryType entryType = Main.getInstance().getFilesManager().getConfiguration().getEntryType("homes", "deleteHomeEntryType");
180187
if (entryType == EXGEntryType.CHAT) {
181188
player.closeInventory();

src/main/java/fr/snipertvmc/essentialsxgui/inventories/homes/HomesInventory.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,6 @@ private void createNewHome(Player player) {
216216
return;
217217
}
218218

219-
SoundsUtils.playSound(player, EXGSound.GUI_CLICK);
220-
221219
EXGEntryType entryType = Main.getInstance().getFilesManager().getConfiguration().getEntryType("homes", "createNewHomeEntryType");
222220
if (entryType == EXGEntryType.CHAT) {
223221
player.closeInventory();
@@ -266,8 +264,6 @@ private void searchHome(Player player) {
266264
return;
267265
}
268266

269-
SoundsUtils.playSound(player, EXGSound.GUI_CLICK);
270-
271267
EXGEntryType entryType = Main.getInstance().getFilesManager().getConfiguration().getEntryType("homes", "searchHomeEntryType");
272268
if (entryType == EXGEntryType.CHAT) {
273269
player.closeInventory();

src/main/java/fr/snipertvmc/essentialsxgui/inventories/kits/KitEditingInventory.java

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,23 +63,35 @@ public KitEditingInventory(Player player, EXGKit kit) {
6363
.updateVariables(
6464
Map.of("kitName", kit.getName(),
6565
"kitDisplayName", kit.getDisplayName()))
66-
.build(), e -> changeKitDisplayName(player, kit));
66+
.build(), e -> {
67+
68+
SoundsUtils.playSound(player, EXGSound.GUI_CLICK);
69+
changeKitDisplayName(player, kit);
70+
});
6771
}
6872

6973

7074
if (config.getChangeIconItem().isEnabled()) {
7175
setItem(config.getChangeIconItem().getSlot(), config.getChangeIconItem()
7276
.updateVariables(
7377
Map.of("kitName", kit.getName()))
74-
.build(), e -> changeKitIcon(player, kit));
78+
.build(), e -> {
79+
80+
SoundsUtils.playSound(player, EXGSound.GUI_CLICK);
81+
changeKitIcon(player, kit);
82+
});
7583
}
7684

7785
if (config.getDeleteKitItem().isEnabled()) {
7886
setItem(config.getDeleteKitItem().getSlot(), config.getDeleteKitItem()
7987
.updateVariables(
8088
Map.of("kitName", kit.getName(),
8189
"kitDisplayName", kit.getDisplayName()))
82-
.build(), e -> deleteKit(player, kit));
90+
.build(), e -> {
91+
92+
SoundsUtils.playSound(player, EXGSound.GUI_CLICK);
93+
deleteKit(player, kit);
94+
});
8395
}
8496

8597

@@ -112,8 +124,6 @@ public void changeKitDisplayName(Player player, EXGKit kit) {
112124
return;
113125
}
114126

115-
SoundsUtils.playSound(player, EXGSound.GUI_CLICK);
116-
117127
EXGEntryType entryType = Main.getInstance().getFilesManager().getConfiguration().getEntryType("kits", "changeKitDisplayNameEntryType");
118128
if (entryType == EXGEntryType.CHAT) {
119129
player.closeInventory();
@@ -148,8 +158,6 @@ public void changeKitIcon(Player player, EXGKit kit) {
148158
return;
149159
}
150160

151-
SoundsUtils.playSound(player, EXGSound.GUI_CLICK);
152-
153161
EXGEntryType entryType = Main.getInstance().getFilesManager().getConfiguration().getEntryType("kits", "changeKitIconEntryType");
154162
if (entryType == EXGEntryType.CHAT) {
155163
player.closeInventory();
@@ -185,8 +193,6 @@ public void deleteKit(Player player, EXGKit kit) {
185193
return;
186194
}
187195

188-
SoundsUtils.playSound(player, EXGSound.GUI_CLICK);
189-
190196
EXGEntryType entryType = Main.getInstance().getFilesManager().getConfiguration().getEntryType("kits", "deleteKitEntryType");
191197
if (entryType == EXGEntryType.CHAT) {
192198
player.closeInventory();

src/main/java/fr/snipertvmc/essentialsxgui/inventories/kits/KitsAdminViewInventory.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,6 @@ private void createNewKitName(Player player) {
202202
return;
203203
}
204204

205-
SoundsUtils.playSound(player, EXGSound.GUI_CLICK);
206-
207205
EXGEntryType entryType = Main.getInstance().getFilesManager().getConfiguration().getEntryType("kits", "createNewKitNameEntryType");
208206
if (entryType == EXGEntryType.CHAT) {
209207
player.closeInventory();
@@ -242,8 +240,6 @@ private void createNewKitDelay(Player player, String kitName) {
242240
return;
243241
}
244242

245-
SoundsUtils.playSound(player, EXGSound.GUI_CLICK);
246-
247243
EXGEntryType entryType = Main.getInstance().getFilesManager().getConfiguration().getEntryType("kits", "createNewKitDelayEntryType");
248244
if (entryType == EXGEntryType.CHAT) {
249245
player.closeInventory();
@@ -277,8 +273,6 @@ private void searchKit(Player player) {
277273
return;
278274
}
279275

280-
SoundsUtils.playSound(player, EXGSound.GUI_CLICK);
281-
282276
EXGEntryType entryType = Main.getInstance().getFilesManager().getConfiguration().getEntryType("kits", "searchKitEntryType");
283277
if (entryType == EXGEntryType.CHAT) {
284278
player.closeInventory();

src/main/java/fr/snipertvmc/essentialsxgui/inventories/kits/KitsPlayerViewInventory.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,6 @@ private void searchKit(Player player) {
183183
return;
184184
}
185185

186-
SoundsUtils.playSound(player, EXGSound.GUI_CLICK);
187-
188186
EXGEntryType entryType = Main.getInstance().getFilesManager().getConfiguration().getEntryType("kits", "searchKitEntryType");
189187
if (entryType == EXGEntryType.CHAT) {
190188
player.closeInventory();

0 commit comments

Comments
 (0)