• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java S08PacketPlayerPosLook类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.minecraft.network.play.server.S08PacketPlayerPosLook的典型用法代码示例。如果您正苦于以下问题:Java S08PacketPlayerPosLook类的具体用法?Java S08PacketPlayerPosLook怎么用?Java S08PacketPlayerPosLook使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



S08PacketPlayerPosLook类属于net.minecraft.network.play.server包,在下文中一共展示了S08PacketPlayerPosLook类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: handlePlayerPosLook

import net.minecraft.network.play.server.S08PacketPlayerPosLook; //导入依赖的package包/类
/**
 * Handles changes in player positioning and rotation such as when travelling to a new dimension, (re)spawning,
 * mounting horses etc. Seems to immediately reply to the server with the clients post-processing perspective on the
 * player positioning
 */
public void handlePlayerPosLook(S08PacketPlayerPosLook p_147258_1_)
{
    EntityClientPlayerMP var2 = this.gameController.thePlayer;
    double var3 = p_147258_1_.func_148932_c();
    double var5 = p_147258_1_.func_148928_d();
    double var7 = p_147258_1_.func_148933_e();
    float var9 = p_147258_1_.func_148931_f();
    float var10 = p_147258_1_.func_148930_g();
    var2.ySize = 0.0F;
    var2.motionX = var2.motionY = var2.motionZ = 0.0D;
    var2.setPositionAndRotation(var3, var5, var7, var9, var10);
    this.netManager.scheduleOutboundPacket(new C03PacketPlayer.C06PacketPlayerPosLook(var2.posX, var2.boundingBox.minY, var2.posY, var2.posZ, p_147258_1_.func_148931_f(), p_147258_1_.func_148930_g(), p_147258_1_.func_148929_h()), new GenericFutureListener[0]);

    if (!this.doneLoadingTerrain)
    {
        this.gameController.thePlayer.prevPosX = this.gameController.thePlayer.posX;
        this.gameController.thePlayer.prevPosY = this.gameController.thePlayer.posY;
        this.gameController.thePlayer.prevPosZ = this.gameController.thePlayer.posZ;
        this.doneLoadingTerrain = true;
        this.gameController.displayGuiScreen((GuiScreen)null);
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:28,代码来源:NetHandlerPlayClient.java


示例2: handlePlayerPosLook

import net.minecraft.network.play.server.S08PacketPlayerPosLook; //导入依赖的package包/类
public void handlePlayerPosLook(S08PacketPlayerPosLook p_147258_1_)
{
    EntityClientPlayerMP entityclientplayermp = this.gameController.thePlayer;
    double d0 = p_147258_1_.func_148932_c();
    double d1 = p_147258_1_.func_148928_d();
    double d2 = p_147258_1_.func_148933_e();
    float f = p_147258_1_.func_148931_f();
    float f1 = p_147258_1_.func_148930_g();
    entityclientplayermp.ySize = 0.0F;
    entityclientplayermp.motionX = entityclientplayermp.motionY = entityclientplayermp.motionZ = 0.0D;
    entityclientplayermp.setPositionAndRotation(d0, d1, d2, f, f1);
    this.netManager.scheduleOutboundPacket(new C03PacketPlayer.C06PacketPlayerPosLook(entityclientplayermp.posX, entityclientplayermp.boundingBox.minY, entityclientplayermp.posY, entityclientplayermp.posZ, p_147258_1_.func_148931_f(), p_147258_1_.func_148930_g(), p_147258_1_.func_148929_h()), new GenericFutureListener[0]);

    if (!this.doneLoadingTerrain)
    {
        this.gameController.thePlayer.prevPosX = this.gameController.thePlayer.posX;
        this.gameController.thePlayer.prevPosY = this.gameController.thePlayer.posY;
        this.gameController.thePlayer.prevPosZ = this.gameController.thePlayer.posZ;
        this.doneLoadingTerrain = true;
        this.gameController.displayGuiScreen((GuiScreen)null);
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:23,代码来源:NetHandlerPlayClient.java


示例3: setPlayerLocation

import net.minecraft.network.play.server.S08PacketPlayerPosLook; //导入依赖的package包/类
public void setPlayerLocation(double x, double y, double z, float yaw, float pitch, Set<S08PacketPlayerPosLook.EnumFlags> relativeSet)
{
    this.hasMoved = false;
    this.lastPosX = x;
    this.lastPosY = y;
    this.lastPosZ = z;

    if (relativeSet.contains(S08PacketPlayerPosLook.EnumFlags.X))
    {
        this.lastPosX += this.playerEntity.posX;
    }

    if (relativeSet.contains(S08PacketPlayerPosLook.EnumFlags.Y))
    {
        this.lastPosY += this.playerEntity.posY;
    }

    if (relativeSet.contains(S08PacketPlayerPosLook.EnumFlags.Z))
    {
        this.lastPosZ += this.playerEntity.posZ;
    }

    float f = yaw;
    float f1 = pitch;

    if (relativeSet.contains(S08PacketPlayerPosLook.EnumFlags.Y_ROT))
    {
        f = yaw + this.playerEntity.rotationYaw;
    }

    if (relativeSet.contains(S08PacketPlayerPosLook.EnumFlags.X_ROT))
    {
        f1 = pitch + this.playerEntity.rotationPitch;
    }

    this.playerEntity.setPositionAndRotation(this.lastPosX, this.lastPosY, this.lastPosZ, f, f1);
    this.playerEntity.playerNetServerHandler.sendPacket(new S08PacketPlayerPosLook(x, y, z, yaw, pitch, relativeSet));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:39,代码来源:NetHandlerPlayServer.java


示例4: onMessage

import net.minecraft.network.play.server.S08PacketPlayerPosLook; //导入依赖的package包/类
@Override
public IMessage onMessage(final TeleportMessage message, final MessageContext ctx)
{
    // Don't act here - if we cause chunk loading on this thread (netty) then chunks will get
    // lost from the server.
    IThreadListener mainThread = null;
    if (ctx.side == Side.CLIENT)
        mainThread = Minecraft.getMinecraft();
    else
        mainThread = MinecraftServer.getServer();
    mainThread.addScheduledTask(new Runnable()
    {
        @Override
        public void run()
        {
            EnumSet<S08PacketPlayerPosLook.EnumFlags> enumset = EnumSet.noneOf(S08PacketPlayerPosLook.EnumFlags.class);
            if (!message.setX)
                enumset.add(S08PacketPlayerPosLook.EnumFlags.X);
            if (!message.setY)
                enumset.add(S08PacketPlayerPosLook.EnumFlags.Y);
            if (!message.setZ)
                enumset.add(S08PacketPlayerPosLook.EnumFlags.Z);
            if (!message.setYaw)
                enumset.add(S08PacketPlayerPosLook.EnumFlags.Y_ROT);
            if (!message.setPitch)
                enumset.add(S08PacketPlayerPosLook.EnumFlags.X_ROT);

            EntityPlayerMP player = ctx.getServerHandler().playerEntity;
            player.mountEntity((Entity) null);
            player.playerNetServerHandler.setPlayerLocation(message.x, message.y, message.z, message.yaw, message.pitch, enumset);
            player.setRotationYawHead(message.yaw);
        }
    });
    return null;
}
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:36,代码来源:AbsoluteMovementCommandsImplementation.java


示例5: setPlayerLocation

import net.minecraft.network.play.server.S08PacketPlayerPosLook; //导入依赖的package包/类
public void setPlayerLocation(double p_147364_1_, double p_147364_3_, double p_147364_5_, float p_147364_7_, float p_147364_8_)
{
    this.hasMoved = false;
    this.lastPosX = p_147364_1_;
    this.lastPosY = p_147364_3_;
    this.lastPosZ = p_147364_5_;
    this.playerEntity.setPositionAndRotation(p_147364_1_, p_147364_3_, p_147364_5_, p_147364_7_, p_147364_8_);
    this.playerEntity.playerNetServerHandler.sendPacket(new S08PacketPlayerPosLook(p_147364_1_, p_147364_3_ + 1.6200000047683716D, p_147364_5_, p_147364_7_, p_147364_8_, false));
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:10,代码来源:NetHandlerPlayServer.java


示例6: teleport

import net.minecraft.network.play.server.S08PacketPlayerPosLook; //导入依赖的package包/类
public void teleport(Location dest)
{
    double d0, d1, d2;
    float f, f1;
    d0 = dest.getX();
    d1 = dest.getY();
    d2 = dest.getZ();
    f = dest.getYaw();
    f1 = dest.getPitch();

    // TODO: make sure this is the best way to address this.
    if (Float.isNaN(f))
    {
        f = 0;
    }

    if (Float.isNaN(f1))
    {
        f1 = 0;
    }

    this.lastPosX = d0;
    this.lastPosY = d1;
    this.lastPosZ = d2;
    this.lastYaw = f;
    this.lastPitch = f1;
    this.justTeleported = true;
    // CraftBukkit end
    this.hasMoved = false;
    this.lastPosX = d0;
    this.lastPosY = d1;
    this.lastPosZ = d2;
    this.playerEntity.setPositionAndRotation(d0, d1, d2, f, f1);
    this.playerEntity.playerNetServerHandler.sendPacket(new S08PacketPlayerPosLook(d0, d1 + 1.6200000047683716D, d2, f, f1, false));
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:36,代码来源:NetHandlerPlayServer.java


示例7: handlePlayerPosLook

import net.minecraft.network.play.server.S08PacketPlayerPosLook; //导入依赖的package包/类
/**
 * Handles changes in player positioning and rotation such as when travelling to a new dimension, (re)spawning,
 * mounting horses etc. Seems to immediately reply to the server with the clients post-processing perspective on the
 * player positioning
 */
public void handlePlayerPosLook(S08PacketPlayerPosLook packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    EntityPlayer entityplayer = this.gameController.thePlayer;
    double d0 = packetIn.getX();
    double d1 = packetIn.getY();
    double d2 = packetIn.getZ();
    float f = packetIn.getYaw();
    float f1 = packetIn.getPitch();

    if (packetIn.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.X))
    {
        d0 += entityplayer.posX;
    }
    else
    {
        entityplayer.motionX = 0.0D;
    }

    if (packetIn.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.Y))
    {
        d1 += entityplayer.posY;
    }
    else
    {
        entityplayer.motionY = 0.0D;
    }

    if (packetIn.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.Z))
    {
        d2 += entityplayer.posZ;
    }
    else
    {
        entityplayer.motionZ = 0.0D;
    }

    if (packetIn.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.X_ROT))
    {
        f1 += entityplayer.rotationPitch;
    }

    if (packetIn.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.Y_ROT))
    {
        f += entityplayer.rotationYaw;
    }

    entityplayer.setPositionAndRotation(d0, d1, d2, f, f1);
    this.netManager.sendPacket(new C03PacketPlayer.C06PacketPlayerPosLook(entityplayer.posX, entityplayer.getEntityBoundingBox().minY, entityplayer.posZ, entityplayer.rotationYaw, entityplayer.rotationPitch, false));

    if (!this.doneLoadingTerrain)
    {
        this.gameController.thePlayer.prevPosX = this.gameController.thePlayer.posX;
        this.gameController.thePlayer.prevPosY = this.gameController.thePlayer.posY;
        this.gameController.thePlayer.prevPosZ = this.gameController.thePlayer.posZ;
        this.doneLoadingTerrain = true;
        this.gameController.displayGuiScreen((GuiScreen)null);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:65,代码来源:NetHandlerPlayClient.java


示例8: handlePlayerPosLook

import net.minecraft.network.play.server.S08PacketPlayerPosLook; //导入依赖的package包/类
/**
 * Handles changes in player positioning and rotation such as when travelling to
 * a new dimension, (re)spawning, mounting horses etc. Seems to immediately
 * reply to the server with the clients post-processing perspective on the
 * player positioning
 */
public void handlePlayerPosLook(S08PacketPlayerPosLook packetIn) {
	PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
	EntityPlayer entityplayer = this.gameController.thePlayer;
	double d0 = packetIn.getX();
	double d1 = packetIn.getY();
	double d2 = packetIn.getZ();
	float f = packetIn.getYaw();
	float f1 = packetIn.getPitch();

	if (packetIn.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.X)) {
		d0 += entityplayer.posX;
	} else {
		entityplayer.motionX = 0.0D;
	}

	if (packetIn.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.Y)) {
		d1 += entityplayer.posY;
	} else {
		entityplayer.motionY = 0.0D;
	}

	if (packetIn.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.Z)) {
		d2 += entityplayer.posZ;
	} else {
		entityplayer.motionZ = 0.0D;
	}

	if (packetIn.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.X_ROT)) {
		f1 += entityplayer.rotationPitch;
	}

	if (packetIn.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.Y_ROT)) {
		f += entityplayer.rotationYaw;
	}

	entityplayer.setPositionAndRotation(d0, d1, d2, f, f1);
	this.netManager.sendPacket(
			new C03PacketPlayer.C06PacketPlayerPosLook(entityplayer.posX, entityplayer.getEntityBoundingBox().minY,
					entityplayer.posZ, entityplayer.rotationYaw, entityplayer.rotationPitch, false));

	if (!this.doneLoadingTerrain) {
		this.gameController.thePlayer.prevPosX = this.gameController.thePlayer.posX;
		this.gameController.thePlayer.prevPosY = this.gameController.thePlayer.posY;
		this.gameController.thePlayer.prevPosZ = this.gameController.thePlayer.posZ;
		this.doneLoadingTerrain = true;
		this.gameController.displayGuiScreen((GuiScreen) null);
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:55,代码来源:NetHandlerPlayClient.java


示例9: playerPositionLook

import net.minecraft.network.play.server.S08PacketPlayerPosLook; //导入依赖的package包/类
@Override
public Packet playerPositionLook(double x, double y, double z, float yaw, float pitch, boolean onGround) {
    return (Packet) new S08PacketPlayerPosLook(x, y, z, yaw, pitch, Sets.newHashSet());
}
 
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:5,代码来源:NeptunePacketFactory.java


示例10: handlePlayerPosLook

import net.minecraft.network.play.server.S08PacketPlayerPosLook; //导入依赖的package包/类
/**
 * Handles changes in player positioning and rotation such as when travelling to a new dimension, (re)spawning,
 * mounting horses etc. Seems to immediately reply to the server with the clients post-processing perspective on the
 * player positioning
 */
void handlePlayerPosLook(S08PacketPlayerPosLook packetIn);
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:7,代码来源:INetHandlerPlayClient.java


示例11: handlePlayerPosLook

import net.minecraft.network.play.server.S08PacketPlayerPosLook; //导入依赖的package包/类
/**
 * Handles changes in player positioning and rotation such as when travelling to a new dimension, (re)spawning,
 * mounting horses etc. Seems to immediately reply to the server with the clients post-processing perspective on the
 * player positioning
 */
void handlePlayerPosLook(S08PacketPlayerPosLook var1);
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:7,代码来源:INetHandlerPlayClient.java


示例12: handlePlayerPosLook

import net.minecraft.network.play.server.S08PacketPlayerPosLook; //导入依赖的package包/类
void handlePlayerPosLook(S08PacketPlayerPosLook p_147258_1_); 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:2,代码来源:INetHandlerPlayClient.java



注:本文中的net.minecraft.network.play.server.S08PacketPlayerPosLook类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TupleBuilder类代码示例发布时间:2022-05-22
下一篇:
Java SelfPopulatingCache类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap