Skip to content

Commit a6ecb51

Browse files
committed
Fix game tests failing on dedicated servers with other mods
Creative break tests now set creative mode explicitly, as the server's default game mode applies otherwise. The sound tests' listening player uses the mock player name, so Cyclops Core skips sending mod packets to its connection, which negotiated no channels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RSz5r6eowhjNuANBjZE2v6
1 parent fd0d573 commit a6ecb51

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎loader-common/src/main/java/org/cyclops/colossalchests2/gametest/GameTestsCommon.java‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1422,6 +1422,8 @@ public void testSurvivalBreakDropsCoreOnPlayerSide(GameTestHelper helper) {
14221422

14231423
private static ServerPlayer makePlayerNorthOf(GameTestHelper helper, BlockPos corePos) {
14241424
ServerPlayer player = helper.makeMockServerPlayerInLevel();
1425+
// Block breaking follows the server's default game mode, which is survival outside the game test server.
1426+
player.gameMode.changeGameModeForPlayer(GameType.CREATIVE);
14251427
BlockPos absolute = helper.absolutePos(corePos);
14261428
player.snapTo(absolute.getX() + 0.5, absolute.getY(), absolute.getZ() - 2.5, 0, 0);
14271429
return player;
@@ -2749,7 +2751,8 @@ public void testUncolossalChestSounds(GameTestHelper helper) {
27492751
* Like {@link GameTestHelper#makeMockServerPlayerInLevel()}, but the packets it receives can be read from the channel.
27502752
*/
27512753
private static ListeningPlayer makeListeningPlayer(GameTestHelper helper) {
2752-
CommonListenerCookie cookie = CommonListenerCookie.createInitial(new GameProfile(UUID.randomUUID(), "test-sound-player"), false);
2754+
// Cyclops Core sends no mod packets to this name, as this connection did not negotiate any channels.
2755+
CommonListenerCookie cookie = CommonListenerCookie.createInitial(new GameProfile(UUID.randomUUID(), "test-mock-player"), false);
27532756
ServerPlayer player = new ServerPlayer(helper.getLevel().getServer(), helper.getLevel(), cookie.gameProfile(), cookie.clientInformation());
27542757
Connection connection = new Connection(PacketFlow.SERVERBOUND);
27552758
EmbeddedChannel channel = new EmbeddedChannel(connection);

0 commit comments

Comments
 (0)