本文整理汇总了Java中net.minecraft.network.play.server.SPacketEntityTeleport类的典型用法代码示例。如果您正苦于以下问题:Java SPacketEntityTeleport类的具体用法?Java SPacketEntityTeleport怎么用?Java SPacketEntityTeleport使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SPacketEntityTeleport类属于net.minecraft.network.play.server包,在下文中一共展示了SPacketEntityTeleport类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: handleEntityTeleport
import net.minecraft.network.play.server.SPacketEntityTeleport; //导入依赖的package包/类
/**
* Updates an entity's position and rotation as specified by the packet
*/
public void handleEntityTeleport(SPacketEntityTeleport packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());
if (entity != null)
{
double d0 = packetIn.getX();
double d1 = packetIn.getY();
double d2 = packetIn.getZ();
EntityTracker.updateServerPosition(entity, d0, d1, d2);
if (!entity.canPassengerSteer())
{
float f = (float)(packetIn.getYaw() * 360) / 256.0F;
float f1 = (float)(packetIn.getPitch() * 360) / 256.0F;
if (Math.abs(entity.posX - d0) < 0.03125D && Math.abs(entity.posY - d1) < 0.015625D && Math.abs(entity.posZ - d2) < 0.03125D)
{
entity.setPositionAndRotationDirect(entity.posX, entity.posY, entity.posZ, f, f1, 0, true);
}
else
{
entity.setPositionAndRotationDirect(d0, d1, d2, f, f1, 3, true);
}
entity.onGround = packetIn.getOnGround();
}
}
}
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:34,代码来源:NetHandlerPlayClient.java
示例2: teleport
import net.minecraft.network.play.server.SPacketEntityTeleport; //导入依赖的package包/类
public void teleport(EntityPlayer player, BlockPos pos, int dimension) {
EntityPlayerMP playerMP = (EntityPlayerMP) player;
playerMP.setPositionAndUpdate(pos.getX()+0.5, pos.getY(), pos.getZ()+0.5);
playerMP.motionX = playerMP.motionY = playerMP.motionZ = 0;
playerMP.setPositionAndUpdate(pos.getX()+0.5, pos.getY(), pos.getZ()+0.5);
if (player.world.provider.getDimension() != dimension)
playerMP.mcServer.getPlayerList().transferPlayerToDimension(playerMP, dimension, this);
playerMP.setPositionAndUpdate(pos.getX()+0.5, pos.getY(), pos.getZ()+0.5);
playerMP.connection.sendPacket(new SPacketEntityTeleport(playerMP));
playerMP.connection.sendPacket(new SPacketEntity(playerMP.getEntityId()));
}
开发者ID:Wehavecookies56,项目名称:Kingdom-Keys-Re-Coded,代码行数:12,代码来源:TeleporterOrgPortal.java
示例3: handleEntityTeleport
import net.minecraft.network.play.server.SPacketEntityTeleport; //导入依赖的package包/类
/**
* Updates an entity's position and rotation as specified by the packet
*/
void handleEntityTeleport(SPacketEntityTeleport packetIn);
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:INetHandlerPlayClient.java
注:本文中的net.minecraft.network.play.server.SPacketEntityTeleport类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论