當前位置: 首頁>>代碼示例>>Java>>正文


Java Entity.startRiding方法代碼示例

本文整理匯總了Java中net.minecraft.entity.Entity.startRiding方法的典型用法代碼示例。如果您正苦於以下問題:Java Entity.startRiding方法的具體用法?Java Entity.startRiding怎麽用?Java Entity.startRiding使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.entity.Entity的用法示例。


在下文中一共展示了Entity.startRiding方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setCarryingEntity

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
@Override
public void setCarryingEntity(Entity entity) {
    if (entity == null) {
        for (Entity e : getCarryingEntities()) {
            e.dismountRidingEntity();
        }
    } else {
        entity.startRiding(this);
    }
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:11,代碼來源:EntityDrone.java

示例2: handleSetPassengers

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
public void handleSetPassengers(SPacketSetPassengers packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());

    if (entity == null)
    {
        LOGGER.warn("Received passengers for unknown entity");
    }
    else
    {
        boolean flag = entity.isRidingOrBeingRiddenBy(this.gameController.player);
        entity.removePassengers();

        for (int i : packetIn.getPassengerIds())
        {
            Entity entity1 = this.clientWorldController.getEntityByID(i);

            if (entity1 != null)
            {
                entity1.startRiding(entity, true);

                if (entity1 == this.gameController.player && !flag)
                {
                    this.gameController.ingameGUI.setRecordPlaying(I18n.format("mount.onboard", new Object[] {GameSettings.getKeyDisplayString(this.gameController.gameSettings.keyBindSneak.getKeyCode())}), false);
                }
            }
        }
    }
}
 
開發者ID:NSExceptional,項目名稱:Zombe-Modpack,代碼行數:31,代碼來源:NetHandlerPlayClient.java

示例3: readChunkEntity

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
@Nullable
public static Entity readChunkEntity(NBTTagCompound compound, World worldIn, Chunk chunkIn)
{
    Entity entity = createEntityFromNBT(compound, worldIn);

    if (entity == null)
    {
        return null;
    }
    else
    {
        chunkIn.addEntity(entity);

        if (compound.hasKey("Passengers", 9))
        {
            NBTTagList nbttaglist = compound.getTagList("Passengers", 10);

            for (int i = 0; i < nbttaglist.tagCount(); ++i)
            {
                Entity entity1 = readChunkEntity(nbttaglist.getCompoundTagAt(i), worldIn, chunkIn);

                if (entity1 != null)
                {
                    entity1.startRiding(entity, true);
                }
            }
        }

        return entity;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:32,代碼來源:AnvilChunkLoader.java

示例4: readWorldEntityPos

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
@Nullable
public static Entity readWorldEntityPos(NBTTagCompound compound, World worldIn, double x, double y, double z, boolean attemptSpawn)
{
    Entity entity = createEntityFromNBT(compound, worldIn);

    if (entity == null)
    {
        return null;
    }
    else
    {
        entity.setLocationAndAngles(x, y, z, entity.rotationYaw, entity.rotationPitch);

        if (attemptSpawn && !worldIn.spawnEntityInWorld(entity))
        {
            return null;
        }
        else
        {
            if (compound.hasKey("Passengers", 9))
            {
                NBTTagList nbttaglist = compound.getTagList("Passengers", 10);

                for (int i = 0; i < nbttaglist.tagCount(); ++i)
                {
                    Entity entity1 = readWorldEntityPos(nbttaglist.getCompoundTagAt(i), worldIn, x, y, z, attemptSpawn);

                    if (entity1 != null)
                    {
                        entity1.startRiding(entity, true);
                    }
                }
            }

            return entity;
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:39,代碼來源:AnvilChunkLoader.java

示例5: readWorldEntity

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
@Nullable
public static Entity readWorldEntity(NBTTagCompound compound, World worldIn, boolean p_186051_2_)
{
    Entity entity = createEntityFromNBT(compound, worldIn);

    if (entity == null)
    {
        return null;
    }
    else if (p_186051_2_ && !worldIn.spawnEntityInWorld(entity))
    {
        return null;
    }
    else
    {
        if (compound.hasKey("Passengers", 9))
        {
            NBTTagList nbttaglist = compound.getTagList("Passengers", 10);

            for (int i = 0; i < nbttaglist.tagCount(); ++i)
            {
                Entity entity1 = readWorldEntity(nbttaglist.getCompoundTagAt(i), worldIn, p_186051_2_);

                if (entity1 != null)
                {
                    entity1.startRiding(entity, true);
                }
            }
        }

        return entity;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:34,代碼來源:AnvilChunkLoader.java

示例6: handleSetPassengers

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
public void handleSetPassengers(SPacketSetPassengers packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());

    if (entity == null)
    {
        LOGGER.warn("Received passengers for unknown entity");
    }
    else
    {
        boolean flag = entity.isRidingOrBeingRiddenBy(this.gameController.thePlayer);
        entity.removePassengers();

        for (int i : packetIn.getPassengerIds())
        {
            Entity entity1 = this.clientWorldController.getEntityByID(i);

            if (entity1 == null)
            {
                LOGGER.warn("Received unknown passenger for {}", new Object[] {entity});
            }
            else
            {
                entity1.startRiding(entity, true);

                if (entity1 == this.gameController.thePlayer && !flag)
                {
                    this.gameController.ingameGUI.setRecordPlaying(I18n.format("mount.onboard", new Object[] {this.gameController.gameSettings.keyBindSneak.getDisplayName()}), false);
                }
            }
        }
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:35,代碼來源:NetHandlerPlayClient.java


注:本文中的net.minecraft.entity.Entity.startRiding方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。