@Test public void testSimpleTabList() { SimpleTabOverlay tabOverlay = tabOverlayHandler.enterContentOperationMode(ContentOperationMode.SIMPLE); for (int size = 1; size <= 80; size++) { tabOverlay.setSize(size); assertEquals("Size check failed for size " + size, size, clientTabList.getSize()); tabOverlay.setSlot(size - 1, Icon.DEFAULT_STEVE, "Slot " + (size - 1), size - 1); for (int i = 0; i < size; i++) { assertArrayEquals("Skin check failed for size " + size + " slot " + i, codecrafter47.bungeetablistplus.api.bungee.Icon.DEFAULT.getProperties(), clientTabList.getProperties(i)); assertEquals("Text check failed for size " + size + " slot " + i, "Slot " + i, clientTabList.getText(i)); assertEquals("Ping check failed for size " + size + " slot " + i, i, clientTabList.getPing(i)); } } }
@Override public <R> R enterContentOperationMode(ContentOperationMode<R> operationMode) { AbstractContentOperationModeHandler<?> handler; if (operationMode == ContentOperationMode.PASS_TROUGH) { handler = new PassThroughContentHandler(); } else if (operationMode == ContentOperationMode.SIMPLE) { handler = new SimpleOperationModeHandler(); } else if (operationMode == ContentOperationMode.RECTANGULAR) { handler = new RectangularSizeHandler(); } else { throw new UnsupportedOperationException(); } nextActiveContentHandlerQueue.add(handler); scheduleUpdate(); return (R) handler.getTabOverlay(); }
AbstractTabOverlayHandler implements PacketHandler, TabOverlayHandler { @Override public <R> R enterContentOperationMode(ContentOperationMode<R> operationMode) { AbstractContentOperationModeHandler<?> handler; if (operationMode == ContentOperationMode.PASS_TROUGH) { handler = new PassThroughContentHandler(); } else if (operationMode == ContentOperationMode.SIMPLE) { handler = new SimpleOperationModeHandler(); } else if (operationMode == ContentOperationMode.RECTANGULAR) { handler = new RectangularSizeHandler(); } else { throw new UnsupportedOperationException(); } nextActiveContentHandlerQueue.add(handler); scheduleUpdate(); return (R) handler.getTabOverlay(); } }
AbstractTabOverlayHandler implements PacketHandler, TabOverlayHandler { @Override public <R> R enterContentOperationMode(ContentOperationMode<R> operationMode) { AbstractContentOperationModeHandler<?> handler; if (operationMode == ContentOperationMode.PASS_TROUGH) { handler = new PassThroughContentHandler(); } else if (operationMode == ContentOperationMode.SIMPLE) { handler = new SimpleOperationModeHandler(); } else if (operationMode == ContentOperationMode.RECTANGULAR) { handler = new RectangularSizeHandler(); } else { throw new UnsupportedOperationException(); } nextActiveContentHandlerQueue.add(handler); scheduleUpdate(); return (R) handler.getTabOverlay(); } AbstractTabOverlayHandler(Logger logger, Executor eventLoopExecutor, UUID viewerUuid, boolean is18, boolean is13OrLater); }
AbstractTabOverlayHandler implements PacketHandler, TabOverlayHandler { @Override public <R> R enterContentOperationMode(ContentOperationMode<R> operationMode) { AbstractContentOperationModeHandler<?> handler; if (operationMode == ContentOperationMode.PASS_TROUGH) { handler = new PassThroughContentHandler(); } else if (operationMode == ContentOperationMode.SIMPLE) { handler = new SimpleOperationModeHandler(); } else if (operationMode == ContentOperationMode.RECTANGULAR) { handler = new RectangularSizeHandler(); } else { throw new UnsupportedOperationException(); } nextActiveContentHandlerQueue.add(handler); scheduleUpdate(); return (R) handler.getTabOverlay(); } AbstractTabOverlayHandler(Logger logger, Executor eventLoopExecutor, UUID viewerUuid, boolean is18, 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); }
AbstractTabOverlayHandler implements PacketHandler, TabOverlayHandler { @Override public <R> R enterContentOperationMode(ContentOperationMode<R> operationMode) { AbstractContentOperationModeHandler<?> handler; if (operationMode == ContentOperationMode.PASS_TROUGH) { handler = new PassThroughContentHandler(); } else if (operationMode == ContentOperationMode.SIMPLE) { handler = new SimpleOperationModeHandler(); } else if (operationMode == ContentOperationMode.RECTANGULAR) { handler = new RectangularSizeHandler(); } else { throw new UnsupportedOperationException(); } nextActiveContentHandlerQueue.add(handler); scheduleUpdate(); return (R) handler.getTabOverlay(); } AbstractTabOverlayHandler(Logger logger, Executor eventLoopExecutor, UUID viewerUuid, boolean is18, 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);  }