feat(sentinel): detect unauthorized flight
CI / build (push) Successful in 1m18s
CI / build (pull_request) Successful in 1m17s

This commit is contained in:
dmg committed 2026-10-29 16:14:33 -04:00
1 parent 297da5d7f7
commit e15ff6549f
27 files changed
+849 -27

No files matched your search

@@ -90,8 +90,10 @@ class PluginLifecycleTest {
when(subject.isOnline()).thenReturn(true);
when(subject.getGameMode()).thenReturn(GameMode.SURVIVAL);
when(subject.getPose()).thenReturn(Pose.STANDING);
when(subject.getLocation()).thenReturn(new Location(world, 0, 64, 0));
when(operator.hasPermission("sentinel.alerts")).thenReturn(true);
when(operator.hasPermission("sentinel.inspect")).thenReturn(true);
when(operator.hasPermission("sentinel.config")).thenReturn(true);
when(server.getPlayer(subject.getUniqueId())).thenReturn(subject);
doReturn((Collection) List.of(subject, operator)).when(server).getOnlinePlayers();
@@ -114,6 +116,8 @@ class PluginLifecycleTest {
assertTrue(command.execute(operator, "sentinel", new String[]{"inspect", "Alex"}));
verify(operator).sendMessage(argThat((String message) -> message.startsWith("Alex: 6 breaches")));
assertEquals(List.of("inspect"), command.tabComplete(operator, "sentinel", new String[]{"in"}));
assertEquals(List.of("unsupported-flight-ticks"),
command.tabComplete(operator, "sentinel", new String[]{"config", "unsupported-f"}));
Field monitorField = PurpurSentinelPlugin.class.getDeclaredField("monitor");
monitorField.setAccessible(true);