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

Java S1BPacketEntityAttach类代码示例

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

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



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

示例1: clearLeashed

import net.minecraft.network.play.server.S1BPacketEntityAttach; //导入依赖的package包/类
/**
 * Removes the leash from this entity
 */
public void clearLeashed(boolean sendPacket, boolean dropLead)
{
    if (this.isLeashed)
    {
        this.isLeashed = false;
        this.leashedToEntity = null;

        if (!this.worldObj.isRemote && dropLead)
        {
            this.dropItem(Items.lead, 1);
        }

        if (!this.worldObj.isRemote && sendPacket && this.worldObj instanceof WorldServer)
        {
            ((WorldServer)this.worldObj).getEntityTracker().sendToAllTrackingEntity(this, new S1BPacketEntityAttach(1, this, (Entity)null));
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:22,代码来源:EntityLiving.java


示例2: clearLeashed

import net.minecraft.network.play.server.S1BPacketEntityAttach; //导入依赖的package包/类
/**
 * Removes the leash from this entity. Second parameter tells whether to send a packet to surrounding players.
 */
public void clearLeashed(boolean par1, boolean par2)
{
    if (this.isLeashed)
    {
        this.isLeashed = false;
        this.leashedToEntity = null;

        if (!this.worldObj.isClient && par2)
        {
            this.func_145779_a(Items.lead, 1);
        }

        if (!this.worldObj.isClient && par1 && this.worldObj instanceof WorldServer)
        {
            ((WorldServer)this.worldObj).getEntityTracker().func_151247_a(this, new S1BPacketEntityAttach(1, this, (Entity)null));
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:22,代码来源:EntityLiving.java


示例3: clearLeashed

import net.minecraft.network.play.server.S1BPacketEntityAttach; //导入依赖的package包/类
public void clearLeashed(boolean p_110160_1_, boolean p_110160_2_)
{
    if (this.isLeashed)
    {
        this.isLeashed = false;
        this.leashedToEntity = null;

        if (!this.worldObj.isRemote && p_110160_2_)
        {
            this.dropItem(Items.lead, 1);
        }

        if (!this.worldObj.isRemote && p_110160_1_ && this.worldObj instanceof WorldServer)
        {
            ((WorldServer)this.worldObj).getEntityTracker().func_151247_a(this, new S1BPacketEntityAttach(1, this, (Entity)null));
        }
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:19,代码来源:EntityLiving.java


示例4: setPassengerOf

import net.minecraft.network.play.server.S1BPacketEntityAttach; //导入依赖的package包/类
public void setPassengerOf(Entity entity)
{
    // mount(null) doesn't really fly for overloaded methods,
    // so this method is needed
    Entity currentVehicle = this.ridingEntity;
    super.setPassengerOf(entity);

    // Check if the vehicle actually changed.
    if (currentVehicle != this.ridingEntity)
    {
        this.playerNetServerHandler.sendPacket(new S1BPacketEntityAttach(0, this, this.ridingEntity));
        this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
    }

    // CraftBukkit end
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:17,代码来源:EntityPlayerMP.java


示例5: setLeashedToEntity

import net.minecraft.network.play.server.S1BPacketEntityAttach; //导入依赖的package包/类
/**
 * Sets the entity to be leashed to.
 */
public void setLeashedToEntity(Entity entityIn, boolean sendAttachNotification)
{
    this.isLeashed = true;
    this.leashedToEntity = entityIn;

    if (!this.worldObj.isRemote && sendAttachNotification && this.worldObj instanceof WorldServer)
    {
        ((WorldServer)this.worldObj).getEntityTracker().sendToAllTrackingEntity(this, new S1BPacketEntityAttach(1, this, this.leashedToEntity));
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:14,代码来源:EntityLiving.java


示例6: mountEntity

import net.minecraft.network.play.server.S1BPacketEntityAttach; //导入依赖的package包/类
/**
 * Called when a player mounts an entity. e.g. mounts a pig, mounts a boat.
 */
public void mountEntity(Entity entityIn)
{
    Entity entity = this.ridingEntity;
    super.mountEntity(entityIn);

    if (entityIn != entity)
    {
        this.playerNetServerHandler.sendPacket(new S1BPacketEntityAttach(0, this, this.ridingEntity));
        this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:15,代码来源:EntityPlayerMP.java


示例7: sendFairyMount

import net.minecraft.network.play.server.S1BPacketEntityAttach; //导入依赖的package包/类
public void sendFairyMount(final Entity rider, final Entity vehicle) {
	final Entity newVehicle;
	if (rider.ridingEntity != null && rider.ridingEntity == vehicle) {
		newVehicle = null;
	} else {
		newVehicle = vehicle;
	}
		
	final S1BPacketEntityAttach packet = new S1BPacketEntityAttach(0, rider, newVehicle);
	sendToAllPlayers(packet);

	if (!(rider instanceof FairyEntityFishHook)) {
		rider.mountEntity(newVehicle);
	}
}
 
开发者ID:allaryin,项目名称:FairyFactions,代码行数:16,代码来源:CommonProxy.java


示例8: setLeashedToEntity

import net.minecraft.network.play.server.S1BPacketEntityAttach; //导入依赖的package包/类
/**
 * Sets the entity to be leashed to.\nArgs:\[email protected] par1Entity: The entity to be tethered to.\[email protected] par2: Whether
 * to send an attaching notification packet to surrounding players.
 */
public void setLeashedToEntity(Entity par1Entity, boolean par2)
{
    this.isLeashed = true;
    this.leashedToEntity = par1Entity;

    if (!this.worldObj.isClient && par2 && this.worldObj instanceof WorldServer)
    {
        ((WorldServer)this.worldObj).getEntityTracker().func_151247_a(this, new S1BPacketEntityAttach(1, this, this.leashedToEntity));
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:15,代码来源:EntityLiving.java


示例9: mountEntity

import net.minecraft.network.play.server.S1BPacketEntityAttach; //导入依赖的package包/类
/**
 * Called when a player mounts an entity. e.g. mounts a pig, mounts a boat.
 */
public void mountEntity(Entity par1Entity)
{
    super.mountEntity(par1Entity);
    this.playerNetServerHandler.sendPacket(new S1BPacketEntityAttach(0, this, this.ridingEntity));
    this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:10,代码来源:EntityPlayerMP.java


示例10: setLeashedToEntity

import net.minecraft.network.play.server.S1BPacketEntityAttach; //导入依赖的package包/类
public void setLeashedToEntity(Entity p_110162_1_, boolean p_110162_2_)
{
    this.isLeashed = true;
    this.leashedToEntity = p_110162_1_;

    if (!this.worldObj.isRemote && p_110162_2_ && this.worldObj instanceof WorldServer)
    {
        ((WorldServer)this.worldObj).getEntityTracker().func_151247_a(this, new S1BPacketEntityAttach(1, this, this.leashedToEntity));
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:11,代码来源:EntityLiving.java


示例11: handleEntityAttach

import net.minecraft.network.play.server.S1BPacketEntityAttach; //导入依赖的package包/类
public void handleEntityAttach(S1BPacketEntityAttach packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());
    Entity entity1 = this.clientWorldController.getEntityByID(packetIn.getVehicleEntityId());

    if (packetIn.getLeash() == 0)
    {
        boolean flag = false;

        if (packetIn.getEntityId() == this.gameController.thePlayer.getEntityId())
        {
            entity = this.gameController.thePlayer;

            if (entity1 instanceof EntityBoat)
            {
                ((EntityBoat)entity1).setIsBoatEmpty(false);
            }

            flag = entity.ridingEntity == null && entity1 != null;
        }
        else if (entity1 instanceof EntityBoat)
        {
            ((EntityBoat)entity1).setIsBoatEmpty(true);
        }

        if (entity == null)
        {
            return;
        }

        entity.mountEntity(entity1);

        if (flag)
        {
            GameSettings gamesettings = this.gameController.gameSettings;
            this.gameController.ingameGUI.setRecordPlaying(I18n.format("mount.onboard", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindSneak.getKeyCode())}), false);
        }
    }
    else if (packetIn.getLeash() == 1 && entity instanceof EntityLiving)
    {
        if (entity1 != null)
        {
            ((EntityLiving)entity).setLeashedToEntity(entity1, false);
        }
        else
        {
            ((EntityLiving)entity).clearLeashed(false, false);
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:52,代码来源:NetHandlerPlayClient.java


示例12: handleEntityAttach

import net.minecraft.network.play.server.S1BPacketEntityAttach; //导入依赖的package包/类
public void handleEntityAttach(S1BPacketEntityAttach packetIn) {
	PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
	Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());
	Entity entity1 = this.clientWorldController.getEntityByID(packetIn.getVehicleEntityId());

	if (packetIn.getLeash() == 0) {
		boolean flag = false;

		if (packetIn.getEntityId() == this.gameController.thePlayer.getEntityId()) {
			entity = this.gameController.thePlayer;

			if (entity1 instanceof EntityBoat) {
				((EntityBoat) entity1).setIsBoatEmpty(false);
			}

			flag = entity.ridingEntity == null && entity1 != null;
		} else if (entity1 instanceof EntityBoat) {
			((EntityBoat) entity1).setIsBoatEmpty(true);
		}

		if (entity == null) {
			return;
		}

		entity.mountEntity(entity1);

		if (flag) {
			GameSettings gamesettings = this.gameController.gameSettings;
			this.gameController.ingameGUI.setRecordPlaying(
					I18n.format("mount.onboard",
							new Object[] {
									GameSettings.getKeyDisplayString(gamesettings.keyBindSneak.getKeyCode()) }),
					false);
		}
	} else if (packetIn.getLeash() == 1 && entity instanceof EntityLiving) {
		if (entity1 != null) {
			((EntityLiving) entity).setLeashedToEntity(entity1, false);
		} else {
			((EntityLiving) entity).clearLeashed(false, false);
		}
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:43,代码来源:NetHandlerPlayClient.java


示例13: handleEntityAttach

import net.minecraft.network.play.server.S1BPacketEntityAttach; //导入依赖的package包/类
public void handleEntityAttach(S1BPacketEntityAttach p_147243_1_)
{
    Object var2 = this.clientWorldController.getEntityByID(p_147243_1_.func_149403_d());
    Entity var3 = this.clientWorldController.getEntityByID(p_147243_1_.func_149402_e());

    if (p_147243_1_.func_149404_c() == 0)
    {
        boolean var4 = false;

        if (p_147243_1_.func_149403_d() == this.gameController.thePlayer.getEntityId())
        {
            var2 = this.gameController.thePlayer;

            if (var3 instanceof EntityBoat)
            {
                ((EntityBoat)var3).setIsBoatEmpty(false);
            }

            var4 = ((Entity)var2).ridingEntity == null && var3 != null;
        }
        else if (var3 instanceof EntityBoat)
        {
            ((EntityBoat)var3).setIsBoatEmpty(true);
        }

        if (var2 == null)
        {
            return;
        }

        ((Entity)var2).mountEntity(var3);

        if (var4)
        {
            GameSettings var5 = this.gameController.gameSettings;
            this.gameController.ingameGUI.func_110326_a(I18n.format("mount.onboard", new Object[] {GameSettings.getKeyDisplayString(var5.keyBindSneak.getKeyCode())}), false);
        }
    }
    else if (p_147243_1_.func_149404_c() == 1 && var2 != null && var2 instanceof EntityLiving)
    {
        if (var3 != null)
        {
            ((EntityLiving)var2).setLeashedToEntity(var3, false);
        }
        else
        {
            ((EntityLiving)var2).clearLeashed(false, false);
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:51,代码来源:NetHandlerPlayClient.java


示例14: interactFirst

import net.minecraft.network.play.server.S1BPacketEntityAttach; //导入依赖的package包/类
public final boolean interactFirst(EntityPlayer p_130002_1_)
{
    if (this.getLeashed() && this.getLeashedToEntity() == p_130002_1_)
    {
        // CraftBukkit start
        if (CraftEventFactory.callPlayerUnleashEntityEvent(this, p_130002_1_).isCancelled())
        {
            ((EntityPlayerMP) p_130002_1_).playerNetServerHandler.sendPacket(new S1BPacketEntityAttach(1, this, this.getLeashedToEntity()));
            return false;
        }

        // CraftBukkit end
        this.clearLeashed(true, !p_130002_1_.capabilities.isCreativeMode);
        return true;
    }
    else
    {
        ItemStack itemstack = p_130002_1_.inventory.getCurrentItem();

        if (itemstack != null && itemstack.getItem() == Items.lead && this.allowLeashing())
        {
            if (!(this instanceof EntityTameable) || !((EntityTameable)this).isTamed())
            {
                // CraftBukkit start
                if (CraftEventFactory.callPlayerLeashEntityEvent(this, p_130002_1_, p_130002_1_).isCancelled())
                {
                    ((EntityPlayerMP) p_130002_1_).playerNetServerHandler.sendPacket(new S1BPacketEntityAttach(1, this, this.getLeashedToEntity()));
                    return false;
                }

                // CraftBukkit end
                this.setLeashedToEntity(p_130002_1_, true);
                --itemstack.stackSize;
                return true;
            }

            if (((EntityTameable)this).func_152114_e(p_130002_1_))
            {
                // CraftBukkit start
                if (CraftEventFactory.callPlayerLeashEntityEvent(this, p_130002_1_, p_130002_1_).isCancelled())
                {
                    ((EntityPlayerMP) p_130002_1_).playerNetServerHandler.sendPacket(new S1BPacketEntityAttach(1, this, this.getLeashedToEntity()));
                    return false;
                }

                // CraftBukkit end
                this.setLeashedToEntity(p_130002_1_, true);
                --itemstack.stackSize;
                return true;
            }
        }

        return this.interact(p_130002_1_) ? true : super.interactFirst(p_130002_1_);
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:56,代码来源:EntityLiving.java


示例15: handleEntityAttach

import net.minecraft.network.play.server.S1BPacketEntityAttach; //导入依赖的package包/类
public void handleEntityAttach(S1BPacketEntityAttach p_147243_1_)
{
    Object object = this.clientWorldController.getEntityByID(p_147243_1_.func_149403_d());
    Entity entity = this.clientWorldController.getEntityByID(p_147243_1_.func_149402_e());

    if (p_147243_1_.func_149404_c() == 0)
    {
        boolean flag = false;

        if (p_147243_1_.func_149403_d() == this.gameController.thePlayer.getEntityId())
        {
            object = this.gameController.thePlayer;

            if (entity instanceof EntityBoat)
            {
                ((EntityBoat)entity).setIsBoatEmpty(false);
            }

            flag = ((Entity)object).ridingEntity == null && entity != null;
        }
        else if (entity instanceof EntityBoat)
        {
            ((EntityBoat)entity).setIsBoatEmpty(true);
        }

        if (object == null)
        {
            return;
        }

        ((Entity)object).mountEntity(entity);

        if (flag)
        {
            GameSettings gamesettings = this.gameController.gameSettings;
            this.gameController.ingameGUI.func_110326_a(I18n.format("mount.onboard", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindSneak.getKeyCode())}), false);
        }
    }
    else if (p_147243_1_.func_149404_c() == 1 && object != null && object instanceof EntityLiving)
    {
        if (entity != null)
        {
            ((EntityLiving)object).setLeashedToEntity(entity, false);
        }
        else
        {
            ((EntityLiving)object).clearLeashed(false, false);
        }
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:51,代码来源:NetHandlerPlayClient.java


示例16: mountEntity

import net.minecraft.network.play.server.S1BPacketEntityAttach; //导入依赖的package包/类
public void mountEntity(Entity p_70078_1_)
{
    super.mountEntity(p_70078_1_);
    this.playerNetServerHandler.sendPacket(new S1BPacketEntityAttach(0, this, this.ridingEntity));
    this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:7,代码来源:EntityPlayerMP.java


示例17: handleEntityAttach

import net.minecraft.network.play.server.S1BPacketEntityAttach; //导入依赖的package包/类
void handleEntityAttach(S1BPacketEntityAttach packetIn); 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:2,代码来源:INetHandlerPlayClient.java


示例18: handleEntityAttach

import net.minecraft.network.play.server.S1BPacketEntityAttach; //导入依赖的package包/类
void handleEntityAttach(S1BPacketEntityAttach var1); 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:2,代码来源:INetHandlerPlayClient.java


示例19: handleEntityAttach

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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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