This commit is contained in:
gnembon committed 2022-10-26 23:26:27 +02:00
1 parent 1c2b1dfa2a
commit e0b6aae07b
9 files changed
+30 -30

No files matched your search

@@ -4,7 +4,6 @@ import carpet.CarpetSettings;
import com.mojang.authlib.GameProfile;
import net.minecraft.core.UUIDUtil;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.RemoteChatSession;
import net.minecraft.network.protocol.PacketFlow;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import net.minecraft.network.protocol.game.ClientboundRotateHeadPacket;
@@ -62,7 +61,7 @@ public class EntityPlayerMPFake extends ServerPlayer
SkullBlockEntity.updateGameprofile(gameprofile, result::set);
gameprofile = result.get();
}
EntityPlayerMPFake instance = new EntityPlayerMPFake(server, worldIn, gameprofile, false, RemoteChatSession.UNVERIFIED);
EntityPlayerMPFake instance = new EntityPlayerMPFake(server, worldIn, gameprofile, false);
instance.fixStartingPosition = () -> instance.moveTo(d0, d1, d2, (float) yaw, (float) pitch);
server.getPlayerList().placeNewPlayer(new FakeClientConnection(PacketFlow.SERVERBOUND), instance);
instance.teleportTo(worldIn, d0, d1, d2, (float)yaw, (float)pitch);
@@ -84,7 +83,8 @@ public class EntityPlayerMPFake extends ServerPlayer
player.connection.disconnect(Component.translatable("multiplayer.disconnect.duplicate_login"));
ServerLevel worldIn = player.getLevel();//.getWorld(player.dimension);
GameProfile gameprofile = player.getGameProfile();
EntityPlayerMPFake playerShadow = new EntityPlayerMPFake(server, worldIn, gameprofile, true, player.getChatSession());
EntityPlayerMPFake playerShadow = new EntityPlayerMPFake(server, worldIn, gameprofile, true);
playerShadow.setChatSession(player.getChatSession());
server.getPlayerList().placeNewPlayer(new FakeClientConnection(PacketFlow.SERVERBOUND), playerShadow);
playerShadow.setHealth(player.getHealth());
@@ -102,9 +102,9 @@ public class EntityPlayerMPFake extends ServerPlayer
return playerShadow;
}
private EntityPlayerMPFake(MinecraftServer server, ServerLevel worldIn, GameProfile profile, boolean shadow, RemoteChatSession chatSession)
private EntityPlayerMPFake(MinecraftServer server, ServerLevel worldIn, GameProfile profile, boolean shadow)
{
super(server, worldIn, profile, chatSession);
super(server, worldIn, profile);
isAShadow = shadow;
}