Skip to content

Commit

Permalink
clear custom slots on server switch, should have the same effect as r…
Browse files Browse the repository at this point in the history
…eloading the plugin; see #731
  • Loading branch information
CodeCrafter47 committed Nov 5, 2023
1 parent 5a02b47 commit adc6fea
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,9 @@ private String getCustomSlotUsername(int index) {

@Override
void onServerSwitch() {
// do nothing
if (player.getPendingConnection().getVersion() >= 764) {
clearCustomSlots();
}
}

@Override
Expand Down Expand Up @@ -688,6 +690,10 @@ private void createTeamsIfNecessary() {

@Override
void onDeactivated() {
clearCustomSlots();
}

private void clearCustomSlots() {
int customSlots = 0;
for (int index = 0; index < 80; index++) {
if (slotState[index] != SlotState.UNUSED) {
Expand Down

0 comments on commit adc6fea

Please sign in to comment.