Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ public void onPlayerJoin(final PlayerJoinEvent event) {
// plugins
return;
}
// Set the addon in the User object - required to have the right context for prefixes in translations
plugin.getIWM().getAddon(event.getPlayer().getWorld()).ifPresent(gm -> user.setAddon(gm));

// Get the UUID
UUID playerUUID = event.getPlayer().getUniqueId();

// Check if player hasn't joined before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.RanksManagerBeforeClassTest;
import world.bentobox.bentobox.Settings;
import world.bentobox.bentobox.api.addons.AddonDescription;
import world.bentobox.bentobox.api.addons.GameModeAddon;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.bentobox.database.objects.Island;
Expand Down Expand Up @@ -91,6 +92,8 @@ public class JoinLeaveListenerTest extends RanksManagerBeforeClassTest {
@Mock
private AddonsManager am;

private AddonDescription desc;

/**
*/
@Before
Expand All @@ -107,6 +110,8 @@ public void setUp() throws Exception {
when(iwm.isOnLeaveResetInventory(any())).thenReturn(true);
when(iwm.getOverWorlds()).thenReturn(Collections.singletonList(world));
when(iwm.getResetEpoch(any())).thenReturn(20L);
desc = new AddonDescription.Builder("main", "BSkyBlock", "1.0.0").build();
when(gameMode.getDescription()).thenReturn(desc);
Optional<GameModeAddon> opGm = Optional.of(gameMode);
when(iwm.getAddon(any())).thenReturn(opGm);
when(gameMode.getPermissionPrefix()).thenReturn("acidisland.");
Expand Down