當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。