This commit is contained in:
gnembon committed 2024-09-04 20:23:21 +02:00
1 parent 00e48df363
commit 72b298ea5f
8 files changed
+29 -22

No files matched your search

@@ -37,6 +37,7 @@ import carpet.fakes.ServerPlayerInterface;
import carpet.utils.Messenger;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
@SuppressWarnings("EntityConstructor")
@@ -77,7 +78,7 @@ public class EntityPlayerMPFake extends ServerPlayer
EntityPlayerMPFake instance = new EntityPlayerMPFake(server, worldIn, current, ClientInformation.createDefault(), false);
instance.fixStartingPosition = () -> instance.moveTo(pos.x, pos.y, pos.z, (float) yaw, (float) pitch);
server.getPlayerList().placeNewPlayer(new FakeClientConnection(PacketFlow.SERVERBOUND), instance, new CommonListenerCookie(current, 0, instance.clientInformation(), false));
instance.teleportTo(worldIn, pos.x, pos.y, pos.z, (float) yaw, (float) pitch, true);
instance.teleportTo(worldIn, pos.x, pos.y, pos.z, Set.of(), (float) yaw, (float) pitch, true);
instance.setHealth(20.0F);
instance.unsetRemoved();
instance.getAttribute(Attributes.STEP_HEIGHT).setBaseValue(0.6F);
@@ -151,7 +152,7 @@ public class EntityPlayerMPFake extends ServerPlayer
if (reason.getContents() instanceof TranslatableContents text && text.getKey().equals("multiplayer.disconnect.duplicate_login")) {
this.connection.onDisconnect(new DisconnectionDetails(reason));
} else {
this.server.tell(new TickTask(this.server.getTickCount(), () -> {
this.server.schedule(new TickTask(this.server.getTickCount(), () -> {
this.connection.onDisconnect(new DisconnectionDetails(reason));
}));
}