Skip to content

Commit 0645ac0

Browse files
committed
Remove requirement of valid room code for history tracking
1 parent dfe5da7 commit 0645ac0

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

neoforge-main/src/main/java/dev/compactmods/machines/player/PlayerEntryPointHistoryManager.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import dev.compactmods.feather.edge.impl.EmptyEdge;
77
import dev.compactmods.feather.node.Node;
88
import dev.compactmods.feather.traversal.GraphNodeTransformationFunction;
9-
import dev.compactmods.machines.api.CompactMachines;
109
import dev.compactmods.machines.api.room.data.CMRoomDataLocations;
1110
import dev.compactmods.machines.api.room.history.IPlayerEntryPointHistoryManager;
1211
import dev.compactmods.machines.api.room.history.PlayerRoomHistoryEntry;
@@ -137,9 +136,6 @@ private Map<UUID, List<PlayerRoomHistoryEntry>> playerRoomHistory() {
137136
}
138137

139138
public RoomEntryResult enterRoom(UUID player, PlayerRoomHistoryEntry history) {
140-
if (!CompactMachines.roomRegistrar().isRegistered(history.roomCode()))
141-
return RoomEntryResult.FAILED_ROOM_INVALID;
142-
143139
return addRoomEntryUnsafe(player, history);
144140
}
145141

neoforge-main/src/test/java/dev/compactmods/machines/test/gametest/data/PlayerHistoryTrackerTests.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ public class PlayerHistoryTrackerTests {
2525
@TestHolder
2626
@EmptyTemplate(EmptyTestSizes.ONE_CUBED)
2727
public static void failsPlayerGoingTooFar(final GameTestHelper test) {
28-
CompactMachines.reloadServices("dev.compactmods.machines.test", test.getLevel().getServer());
29-
3028
final var history = new PlayerEntryPointHistoryManager(1);
3129

3230
final var player = test.makeMockPlayer(GameType.SURVIVAL);
@@ -43,8 +41,6 @@ public static void failsPlayerGoingTooFar(final GameTestHelper test) {
4341
@GameTest(timeoutTicks = 1400)
4442
@EmptyTemplate(EmptyTestSizes.ONE_CUBED)
4543
public static void canGetPlayerHistory(final GameTestHelper test) throws InterruptedException {
46-
CompactMachines.reloadServices("dev.compactmods.machines.test", test.getLevel().getServer());
47-
4844
final var history = new PlayerEntryPointHistoryManager(5);
4945

5046
final var player = test.makeMockPlayer(GameType.SURVIVAL);
@@ -74,8 +70,6 @@ public static void canGetPlayerHistory(final GameTestHelper test) throws Interru
7470
@GameTest(timeoutTicks = 1400)
7571
@EmptyTemplate(EmptyTestSizes.ONE_CUBED)
7672
public static void canRemovePlayerHistory(final GameTestHelper test) throws InterruptedException {
77-
CompactMachines.reloadServices("dev.compactmods.machines.test", test.getLevel().getServer());
78-
7973
final var history = new PlayerEntryPointHistoryManager(5);
8074
final var player = test.makeMockPlayer(GameType.SURVIVAL);
8175

@@ -103,8 +97,6 @@ public static void canRemovePlayerHistory(final GameTestHelper test) throws Inte
10397
@GameTest(timeoutTicks = 1400)
10498
@EmptyTemplate(EmptyTestSizes.ONE_CUBED)
10599
public static void testDataLogic(final GameTestHelper test) throws InterruptedException {
106-
CompactMachines.reloadServices("dev.compactmods.machines.test", test.getLevel().getServer());
107-
108100
final var history = new PlayerEntryPointHistoryManager(5);
109101

110102
final var player = test.makeMockPlayer(GameType.SURVIVAL);

0 commit comments

Comments
 (0)