当前位置: 首页>>代码示例>>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;未经允许,请勿转载。