9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-29 20:09:23 +00:00
This commit is contained in:
Lumine1909
2025-07-02 22:30:46 -07:00
parent 80f6f68078
commit 27cf615a69
3 changed files with 6 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
package org.leavesmc.leaves.replay;
import com.mojang.serialization.DynamicOps;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.local.LocalChannel;
import net.minecraft.SharedConstants;
import net.minecraft.core.LayeredRegistryAccess;
@@ -87,7 +88,7 @@ public class Recorder extends Connection {
metaData.singleplayer = false;
metaData.serverName = recorderOption.serverName;
metaData.date = startTime;
metaData.mcversion = SharedConstants.getCurrentVersion().getName();
metaData.mcversion = SharedConstants.getCurrentVersion().name();
// TODO start event
this.savePacket(new ClientboundLoginFinishedPacket(photographer.getGameProfile()), ConnectionProtocol.LOGIN);
@@ -169,7 +170,7 @@ public class Recorder extends Connection {
}
@Override
public void send(@NotNull Packet<?> packet, @Nullable PacketSendListener callbacks, boolean flush) {
public void send(@NotNull Packet<?> packet, @Nullable ChannelFutureListener callbacks, boolean flush) {
if (!stopped) {
if (packet instanceof BundlePacket<?> packet1) {
packet1.subPackets().forEach(subPacket -> send(subPacket, null));

View File

@@ -111,7 +111,7 @@ public class ReplayFile {
public void saveMetaData(@NotNull RecordMetaData data) throws IOException {
data.fileFormat = "MCPR";
data.fileFormatVersion = RecordMetaData.CURRENT_FILE_FORMAT_VERSION;
data.protocol = SharedConstants.getCurrentVersion().getProtocolVersion();
data.protocol = SharedConstants.getCurrentVersion().protocolVersion();
data.generator = ProtocolUtils.buildProtocolVersion("replay");
try (Writer writer = new OutputStreamWriter(new FileOutputStream(metaFile), StandardCharsets.UTF_8)) {

View File

@@ -61,7 +61,7 @@ public class ServerPhotographer extends ServerPlayer {
photographer.recorder.start();
MinecraftServer.getServer().getPlayerList().placeNewPhotographer(photographer.recorder, photographer, world);
photographer.serverLevel().chunkSource.move(photographer);
photographer.level().chunkSource.move(photographer);
photographer.setInvisible(true);
photographers.add(photographer);
@@ -79,7 +79,7 @@ public class ServerPhotographer extends ServerPlayer {
if (this.server.getTickCount() % 10 == 0) {
connection.resetPosition();
this.serverLevel().chunkSource.move(this);
this.level().chunkSource.move(this);
}
if (this.followPlayer != null) {