@Test public void testRectangular() { RectangularTabOverlay.Dimension size = new RectangularTabOverlay.Dimension(3, 9); RectangularTabOverlay tabOverlay = tabListHandler.enterContentOperationMode(ContentOperationMode.RECTANGULAR); assertEquals(0, clientTabList.players.size()); assertTrue(tabOverlay.getSupportedSizes().contains(size)); tabOverlay.setSize(size); assertEquals(3 * 9, clientTabList.players.size()); assertEquals(size, tabOverlay.getSize()); tabOverlay.setText(2, 1, "0123456789abcdefTEST"); assertEquals("0123456789abcdef", clientTabList.teams.get(clientTabList.playerToTeamMap.get(clientTabList.players.get(5))).getPrefix()); assertEquals("TEST", clientTabList.teams.get(clientTabList.playerToTeamMap.get(clientTabList.players.get(5))).getSuffix()); }
@Override public <R> R enterContentOperationMode(ContentOperationMode<R> operationMode) { AbstractContentOperationModeHandler<?> handler; if (operationMode == ContentOperationMode.PASS_TROUGH) { handler = new PassThroughHandlerContent(); } else if (operationMode == ContentOperationMode.SIMPLE) { handler = new SimpleContentOperationModeHandler(); } else if (operationMode == ContentOperationMode.RECTANGULAR) { handler = new RectangularSizeHandlerContent(); } else { throw new AssertionError("Missing operation mode handler for " + operationMode.getName()); } nextActiveHandlerQueue.add(handler); scheduleUpdate(); return Unchecked.cast(handler.getTabOverlay()); }
AbstractLegacyTabOverlayHandler implements PacketHandler, TabOverlayHandler { @Override public <R> R enterContentOperationMode(ContentOperationMode<R> operationMode) { AbstractContentOperationModeHandler<?> handler; if (operationMode == ContentOperationMode.PASS_TROUGH) { handler = new PassThroughHandlerContent(); } else if (operationMode == ContentOperationMode.SIMPLE) { handler = new SimpleContentOperationModeHandler(); } else if (operationMode == ContentOperationMode.RECTANGULAR) { handler = new RectangularSizeHandlerContent(); } else { throw new AssertionError("Missing operation mode handler for " + operationMode.getName()); } nextActiveHandlerQueue.add(handler); scheduleUpdate(); return Unchecked.cast(handler.getTabOverlay()); } }
AbstractLegacyTabOverlayHandler implements PacketHandler, TabOverlayHandler { @Override public <R> R enterContentOperationMode(ContentOperationMode<R> operationMode) { AbstractContentOperationModeHandler<?> handler; if (operationMode == ContentOperationMode.PASS_TROUGH) { handler = new PassThroughHandlerContent(); } else if (operationMode == ContentOperationMode.SIMPLE) { handler = new SimpleContentOperationModeHandler(); } else if (operationMode == ContentOperationMode.RECTANGULAR) { handler = new RectangularSizeHandlerContent(); } else { throw new AssertionError("Missing operation mode handler for " + operationMode.getName()); } nextActiveHandlerQueue.add(handler); scheduleUpdate(); return Unchecked.cast(handler.getTabOverlay()); } AbstractLegacyTabOverlayHandler(Logger logger, int playerListSize, Executor eventLoopExecutor, boolean is13OrLater); }
AbstractLegacyTabOverlayHandler implements PacketHandler, TabOverlayHandler { @Override public <R> R enterContentOperationMode(ContentOperationMode<R> operationMode) { AbstractContentOperationModeHandler<?> handler; if (operationMode == ContentOperationMode.PASS_TROUGH) { handler = new PassThroughHandlerContent(); } else if (operationMode == ContentOperationMode.SIMPLE) { handler = new SimpleContentOperationModeHandler(); } else if (operationMode == ContentOperationMode.RECTANGULAR) { handler = new RectangularSizeHandlerContent(); } else { throw new AssertionError("Missing operation mode handler for " + operationMode.getName()); } nextActiveHandlerQueue.add(handler); scheduleUpdate(); return Unchecked.cast(handler.getTabOverlay()); } AbstractLegacyTabOverlayHandler(Logger logger, int playerListSize, Executor eventLoopExecutor, boolean is13OrLater); @Override PacketListenerResult onPlayerListPacket(PlayerListItem packet); @Override PacketListenerResult onTeamPacket(Team packet); @Override PacketListenerResult onPlayerListHeaderFooterPacket(PlayerListHeaderFooter packet); @Override void onServerSwitch(boolean is13OrLater); @Override R enterContentOperationMode(ContentOperationMode<R> operationMode); @Override R enterHeaderAndFooterOperationMode(HeaderAndFooterOperationMode<R> operationMode); }
AbstractLegacyTabOverlayHandler implements PacketHandler, TabOverlayHandler { @Override public <R> R enterContentOperationMode(ContentOperationMode<R> operationMode) { AbstractContentOperationModeHandler<?> handler; if (operationMode == ContentOperationMode.PASS_TROUGH) { handler = new PassThroughHandlerContent(); } else if (operationMode == ContentOperationMode.SIMPLE) { handler = new SimpleContentOperationModeHandler(); } else if (operationMode == ContentOperationMode.RECTANGULAR) { handler = new RectangularSizeHandlerContent(); } else { throw new AssertionError("Missing operation mode handler for " + operationMode.getName()); } nextActiveHandlerQueue.add(handler); scheduleUpdate(); return Unchecked.cast(handler.getTabOverlay()); } AbstractLegacyTabOverlayHandler(Logger logger, int playerListSize, Executor eventLoopExecutor, boolean is13OrLater); @Override PacketListenerResult onPlayerListPacket(PlayerListItem packet); @Override PacketListenerResult onTeamPacket(Team packet); @Override PacketListenerResult onPlayerListHeaderFooterPacket(PlayerListHeaderFooter packet); @Override void onServerSwitch(boolean is13OrLater); @Override R enterContentOperationMode(ContentOperationMode<R> operationMode); @Override R enterHeaderAndFooterOperationMode(HeaderAndFooterOperationMode<R> operationMode);  }