From cc7dc0d593b03fa7670a2549e69666210ecc70a8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 16 Dec 2025 21:15:08 +0000 Subject: [PATCH 1/2] Initial plan From c38c376a8daacdf72dfcab3a12c1fc25c0d78187 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 16 Dec 2025 21:18:38 +0000 Subject: [PATCH 2/2] Add test cases for nether world border behavior Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com> --- .../listeners/ShowVirtualWorldBorderTest.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/test/java/world/bentobox/border/listeners/ShowVirtualWorldBorderTest.java b/src/test/java/world/bentobox/border/listeners/ShowVirtualWorldBorderTest.java index c8872e7..131b32e 100644 --- a/src/test/java/world/bentobox/border/listeners/ShowVirtualWorldBorderTest.java +++ b/src/test/java/world/bentobox/border/listeners/ShowVirtualWorldBorderTest.java @@ -2,10 +2,12 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import org.bukkit.Bukkit; +import org.bukkit.World.Environment; import org.bukkit.WorldBorder; import org.bukkit.entity.Player; import org.bukkit.util.Vector; @@ -123,4 +125,39 @@ public void testHideBorder() { verify(mockPlayer).setWorldBorder(null); } + /** + * Test method for {@link world.bentobox.border.listeners.ShowVirtualWorldBorder#showBorder(org.bukkit.entity.Player, world.bentobox.bentobox.database.objects.Island)}. + * Tests that border is shown when player is in an island nether world. + */ + @Test + public void testShowBorderInIslandNetherWorld() { + // Setup: Player is in a nether environment that IS an island nether world + when(world.getEnvironment()).thenReturn(Environment.NETHER); + when(iwm.isIslandNether(world)).thenReturn(true); + when(addon.getPlugin()).thenReturn(plugin); + + svwb.showBorder(mockPlayer, island); + + // Verify that the border was set (border should show in island nether worlds) + verify(mockPlayer).setWorldBorder(wb); + verify(wb).setSize(200.0D); + } + + /** + * Test method for {@link world.bentobox.border.listeners.ShowVirtualWorldBorder#showBorder(org.bukkit.entity.Player, world.bentobox.bentobox.database.objects.Island)}. + * Tests that border is NOT shown when player is in a non-island nether world. + */ + @Test + public void testShowBorderInNonIslandNetherWorld() { + // Setup: Player is in a nether environment that is NOT an island nether world + when(world.getEnvironment()).thenReturn(Environment.NETHER); + when(iwm.isIslandNether(world)).thenReturn(false); + when(addon.getPlugin()).thenReturn(plugin); + + svwb.showBorder(mockPlayer, island); + + // Verify that the border was NOT set (border should not show in non-island nether worlds) + verify(mockPlayer, never()).setWorldBorder(any()); + } + }