本文整理汇总了C#中Player.SendPackage方法的典型用法代码示例。如果您正苦于以下问题:C# Player.SendPackage方法的具体用法?C# Player.SendPackage怎么用?C# Player.SendPackage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Player
的用法示例。
在下文中一共展示了Player.SendPackage方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddToMapListeners
public virtual void AddToMapListeners(Player player, long mapId)
{
if (mapId == EntityId)
{
if (ImageProvider == null) return;
var data = ImageProvider.GetData(MapInfo, true);
if (data != null)
{
MapInfo.Data = data;
var mapInfo = (MapInfo)MapInfo.Clone();
McpeClientboundMapItemData msg = McpeClientboundMapItemData.CreateObject();
msg.mapinfo = mapInfo;
player.SendPackage(msg);
return;
}
var packet = ImageProvider.GetClientboundMapItemData(MapInfo);
if (packet != null)
{
player.SendPackage(packet);
return;
}
var batchPacket = ImageProvider.GetBatch(MapInfo, true);
if (batchPacket != null)
{
player.SendPackage(batchPacket);
}
}
}
示例2: SendRemove
public virtual void SendRemove(Player player)
{
var message = McpeMobEffect.CreateObject();
message.entityId = 0;
message.eventId = 3;
message.effectId = (byte) EffectId;
player.SendPackage(message);
}
示例3: SendUpdate
public virtual void SendUpdate(Player player)
{
var message = McpeMobEffect.CreateObject();
message.entityId = 0;
message.eventId = 2;
message.effectId = (byte) EffectId;
message.duration = 20*Duration;
message.amplifier = (byte) Level;
message.particles = (byte) (Particles ? 1 : 0);
player.SendPackage(message);
}
示例4: SpawnToPlayer
public override void SpawnToPlayer(Player player)
{
McpeAddItemEntity mcpeAddItemEntity = McpeAddItemEntity.CreateObject();
mcpeAddItemEntity.entityId = EntityId;
mcpeAddItemEntity.item = GetMetadataSlot();
mcpeAddItemEntity.x = KnownPosition.X;
mcpeAddItemEntity.y = KnownPosition.Y;
mcpeAddItemEntity.z = KnownPosition.Z;
mcpeAddItemEntity.speedX = (float) Velocity.X;
mcpeAddItemEntity.speedY = (float) Velocity.Y;
mcpeAddItemEntity.speedZ = (float) Velocity.Z;
player.SendPackage(mcpeAddItemEntity);
}
示例5: SpawnToPlayer
public override void SpawnToPlayer(Player player)
{
{
Player fake = new Player(null, null, 0)
{
ClientUuid = Uuid,
EntityId = EntityId,
NameTag = NameTag ?? Name,
Skin = Skin
};
McpePlayerList playerList = McpePlayerList.CreateObject();
playerList.records = new PlayerAddRecords { fake };
player.SendPackage(playerList);
//player.SendDirectPackage(playerList);
}
{
McpeAddPlayer message = McpeAddPlayer.CreateObject();
message.uuid = Uuid;
message.username = NameTag ?? Name;
message.entityId = EntityId;
message.x = KnownPosition.X;
message.y = KnownPosition.Y;
message.z = KnownPosition.Z;
message.yaw = KnownPosition.Yaw;
message.headYaw = KnownPosition.HeadYaw;
message.pitch = KnownPosition.Pitch;
message.metadata = GetMetadata();
player.SendPackage(message);
}
{
McpePlayerEquipment message = McpePlayerEquipment.CreateObject();
message.entityId = EntityId;
message.item = ItemInHand;
message.slot = 0;
player.SendPackage(message);
}
{
McpePlayerArmorEquipment armorEquipment = McpePlayerArmorEquipment.CreateObject();
armorEquipment.entityId = EntityId;
armorEquipment.helmet = new MetadataSlot(new ItemStack());
armorEquipment.chestplate = new MetadataSlot(new ItemStack());
armorEquipment.leggings = new MetadataSlot(new ItemStack());
armorEquipment.boots = new MetadataSlot(new ItemStack());
player.SendPackage(armorEquipment);
}
}
示例6: DespawnFromPlayer
public override void DespawnFromPlayer(Player player)
{
{
Player fake = new Player(null, null, 0)
{
ClientUuid = Uuid,
EntityId = EntityId,
NameTag = NameTag ?? Name,
Skin = Skin
};
McpePlayerList playerList = McpePlayerList.CreateObject();
playerList.records = new PlayerRemoveRecords { fake };
player.SendPackage(playerList);
}
McpeRemovePlayer mcpeRemovePlayer = McpeRemovePlayer.CreateObject();
mcpeRemovePlayer.entityId = EntityId;
mcpeRemovePlayer.clientUuid = Uuid;
player.SendPackage(mcpeRemovePlayer);
}
示例7: SpawnToPlayer
public virtual void SpawnToPlayer(Player player)
{
var addEntity = McpeAddEntity.CreateObject();
addEntity.entityType = EntityTypeId;
addEntity.entityId = EntityId;
addEntity.x = KnownPosition.X;
addEntity.y = KnownPosition.Y;
addEntity.z = KnownPosition.Z;
addEntity.yaw = KnownPosition.Yaw;
addEntity.pitch = KnownPosition.Pitch;
addEntity.metadata = GetMetadata();
addEntity.speedX = (float) Velocity.X;
addEntity.speedY = (float) Velocity.Y;
addEntity.speedZ = (float) Velocity.Z;
player.SendPackage(addEntity);
McpeSetEntityData mcpeSetEntityData = McpeSetEntityData.CreateObject();
mcpeSetEntityData.entityId = EntityId;
mcpeSetEntityData.metadata = GetMetadata();
player.SendPackage(mcpeSetEntityData);
}
示例8: DespawnFromPlayer
public virtual void DespawnFromPlayer(Player player)
{
McpeRemoveEntity mcpeRemoveEntity = McpeRemoveEntity.CreateObject();
mcpeRemoveEntity.entityId = EntityId;
player.SendPackage(mcpeRemoveEntity);
}
示例9: DespawnFromPlayer
public override void DespawnFromPlayer(Player player)
{
McpeRemovePlayer mcpeRemovePlayer = McpeRemovePlayer.CreateObject();
mcpeRemovePlayer.entityId = EntityId;
player.SendPackage(mcpeRemovePlayer);
}
示例10: SpawnToPlayer
public override void SpawnToPlayer(Player player)
{
{
McpeAddPlayer message = McpeAddPlayer.CreateObject();
message.clientId = EntityId;
message.username = NameTag ?? Name;
message.entityId = EntityId;
message.x = KnownPosition.X;
message.y = KnownPosition.Y;
message.z = KnownPosition.Z;
message.yaw = KnownPosition.Yaw;
message.headYaw = KnownPosition.HeadYaw;
message.pitch = KnownPosition.Pitch;
message.skin = Skin;
message.metadata = GetMetadata().GetBytes();
player.SendPackage(message);
}
{
McpePlayerEquipment message = McpePlayerEquipment.CreateObject();
message.entityId = EntityId;
message.item = ItemInHand.Id;
message.meta = ItemInHand.Metadata;
message.slot = 0;
player.SendPackage(message);
}
{
McpePlayerArmorEquipment message = McpePlayerArmorEquipment.CreateObject();
message.entityId = EntityId;
message.helmet = (byte) (Helmet - 256);
message.chestplate = (byte) (Chest - 256);
message.leggings = (byte) (Leggings - 256);
message.boots = (byte) (Boots - 256);
player.SendPackage(message);
}
}
示例11: SendAdd
public virtual void SendAdd(Player player)
{
var message = McpeMobEffect.CreateObject();
message.entityId = 0;
message.eventId = 1;
message.effectId = (byte) EffectId;
message.duration = Duration;
message.amplifier = (byte) Level;
message.particles = (byte) (Particles ? 1 : 0);
player.SendPackage(message);
player.BroadcastSetEntityData();
}
示例12: SendUpdate
public void SendUpdate(Player player)
{
{
var message = McpeMobEffect.CreateObject();
message.entityId = 0;
message.eventId = 2;
message.effectId = (byte) EffectId;
message.duration = 20*Duration;
message.amplifier = (byte) Level;
message.particles = (byte) (Particles ? 1 : 0);
player.SendPackage(message, true);
}
{
var message = McpeMobEffect.CreateObject();
message.entityId = player.EntityId;
message.eventId = 2;
message.effectId = (byte) EffectId;
message.duration = 20*Duration;
message.amplifier = (byte) Level;
message.particles = (byte) (Particles ? 1 : 0);
player.Level.RelayBroadcast(player, message, true);
}
}
示例13: SendRemove
public void SendRemove(Player player)
{
{
var message = McpeMobEffect.CreateObject();
message.entityId = 0;
message.eventId = 3;
message.effectId = (byte) EffectId;
player.SendPackage(message, true);
}
{
var message = McpeMobEffect.CreateObject();
message.entityId = player.EntityId;
message.eventId = 3;
message.effectId = (byte) EffectId;
player.Level.RelayBroadcast(player, message, true);
}
}