File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
main/java/world/bentobox/bentobox/listeners
test/java/world/bentobox/bentobox/listeners Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,10 @@ public void onPlayerJoin(final PlayerJoinEvent event) {
5353 // plugins
5454 return;
5555 }
56+ // Set the addon in the User object - required to have the right context for prefixes in translations
57+ plugin.getIWM().getAddon(event.getPlayer().getWorld()).ifPresent(gm -> user.setAddon(gm));
58+
59+ // Get the UUID
5660 UUID playerUUID = event.getPlayer().getUniqueId();
5761
5862 // Check if player hasn't joined before
Original file line number Diff line number Diff line change 4343import world.bentobox.bentobox.BentoBox;
4444import world.bentobox.bentobox.RanksManagerBeforeClassTest;
4545import world.bentobox.bentobox.Settings;
46+ import world.bentobox.bentobox.api.addons.AddonDescription;
4647import world.bentobox.bentobox.api.addons.GameModeAddon;
4748import world.bentobox.bentobox.api.user.User;
4849import world.bentobox.bentobox.database.objects.Island;
@@ -91,6 +92,8 @@ public class JoinLeaveListenerTest extends RanksManagerBeforeClassTest {
9192 @Mock
9293 private AddonsManager am;
9394
95+ private AddonDescription desc;
96+
9497 /**
9598 */
9699 @Before
@@ -107,6 +110,8 @@ public void setUp() throws Exception {
107110 when(iwm.isOnLeaveResetInventory(any())).thenReturn(true);
108111 when(iwm.getOverWorlds()).thenReturn(Collections.singletonList(world));
109112 when(iwm.getResetEpoch(any())).thenReturn(20L);
113+ desc = new AddonDescription.Builder("main", "BSkyBlock", "1.0.0").build();
114+ when(gameMode.getDescription()).thenReturn(desc);
110115 Optional<GameModeAddon> opGm = Optional.of(gameMode);
111116 when(iwm.getAddon(any())).thenReturn(opGm);
112117 when(gameMode.getPermissionPrefix()).thenReturn("acidisland.");
You can’t perform that action at this time.
0 commit comments