当前位置: 首页>>代码示例>>Java>>正文


Java Entity.mountEntity方法代码示例

本文整理汇总了Java中net.minecraft.entity.Entity.mountEntity方法的典型用法代码示例。如果您正苦于以下问题:Java Entity.mountEntity方法的具体用法?Java Entity.mountEntity怎么用?Java Entity.mountEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.entity.Entity的用法示例。


在下文中一共展示了Entity.mountEntity方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: removeEntity

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
/**
 * Schedule the entity for removal during the next tick. Marks the entity dead in anticipation.
 */
public void removeEntity(Entity entityIn)
{
    if (entityIn.riddenByEntity != null)
    {
        entityIn.riddenByEntity.mountEntity((Entity)null);
    }

    if (entityIn.ridingEntity != null)
    {
        entityIn.mountEntity((Entity)null);
    }

    entityIn.setDead();

    if (entityIn instanceof EntityPlayer)
    {
        this.playerEntities.remove(entityIn);
        this.updateAllPlayersSleepingFlag();
        this.onEntityRemoved(entityIn);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:25,代码来源:World.java

示例2: handleEntityAttach

import net.minecraft.entity.Entity; //导入方法依赖的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

示例3: handleEntityAttach

import net.minecraft.entity.Entity; //导入方法依赖的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


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