@Test public void testTabListSimple() { SimpleTabOverlay tabOverlay = tabListHandler.enterContentOperationMode(ContentOperationMode.SIMPLE.SIMPLE); tabOverlay.setSize(60); for (int i = 0; i < 60; i++) { tabOverlay.setText(i, String.format("Slot %02d", i)); tabOverlay.setPing(i, i); } assertEquals(60, clientTabList.players.size()); for (int i = 0; i < 60; i++) { assertEquals(String.format("Slot %02d", i), clientTabList.teams.get(clientTabList.playerToTeamMap.get(clientTabList.players.get(i))).getPrefix()); assertEquals((Object) i, clientTabList.ping.get(clientTabList.players.get(i))); } tabOverlay.setSize(30); assertEquals(30, clientTabList.players.size()); for (int i = 0; i < 30; i++) { assertEquals(String.format("Slot %02d", i), clientTabList.teams.get(clientTabList.playerToTeamMap.get(clientTabList.players.get(i))).getPrefix()); assertEquals((Object) i, clientTabList.ping.get(clientTabList.players.get(i))); } tabListHandler.enterContentOperationMode(ContentOperationMode.PASS_TROUGH); assertEquals(0, clientTabList.players.size()); }
@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);  }