Add workaround for mods that use non-standard entity spawn packets

This commit is contained in:
Moulberry committed 2024-11-14 19:23:24 +08:00
1 parent bc06f67861
commit 51986d4af5
6 files changed
+62 -5

No files matched your search

@@ -93,8 +93,8 @@ public class ReplayReader {
RegistryFriendlyByteBuf registryFriendlyByteBuf = new RegistryFriendlyByteBuf(slice, this.registryAccess);
action.handle(replayServer, registryFriendlyByteBuf);
if (slice.readerIndex() < size) {
throw new RuntimeException("Action " + this.lastActionName + " failed to fully read. Had " + size + " bytes available, only read " + slice.readerIndex());
if (slice.readerIndex() < slice.writerIndex()) {
throw new RuntimeException("Action " + this.lastActionName + " failed to fully read. Had " + slice.writerIndex() + " bytes available, only read " + slice.readerIndex());
}
}
@@ -127,8 +127,8 @@ public class ReplayReader {
RegistryFriendlyByteBuf registryFriendlyByteBuf = new RegistryFriendlyByteBuf(slice, this.registryAccess);
action.handle(replayServer, registryFriendlyByteBuf);
if (slice.readerIndex() < size) {
throw new RuntimeException("Action " + this.lastActionName + " failed to fully read. Had " + size + " bytes available, only read " + slice.readerIndex());
if (slice.readerIndex() < slice.writerIndex()) {
throw new RuntimeException("Action " + this.lastActionName + " failed to fully read. Had " + slice.writerIndex() + " bytes available, only read " + slice.readerIndex());
}
return true;