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


Java Entity.getRidingEntity方法代碼示例

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


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

示例1: func_191324_b

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
public static Predicate<Entity> func_191324_b(final Entity p_191324_0_)
{
    return new Predicate<Entity>()
    {
        public boolean apply(@Nullable Entity p_apply_1_)
        {
            while (true)
            {
                if (p_apply_1_.isRiding())
                {
                    p_apply_1_ = p_apply_1_.getRidingEntity();

                    if (p_apply_1_ != p_191324_0_)
                    {
                        continue;
                    }

                    return false;
                }

                return true;
            }
        }
    };
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:26,代碼來源:EntitySelectors.java

示例2: getMouseOverServer

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
public static RayTraceResult getMouseOverServer(EntityLivingBase lookingEntity, double range) {

        RayTraceResult mop = raytraceEntityBlocks(lookingEntity, range);
        double d1 = range;
        Pair<Vec3d, Vec3d> startAndEnd = getStartAndEndLookVec(lookingEntity, (float) range);
        Vec3d vec3 = startAndEnd.getLeft();

        if (mop != null) {
            d1 = mop.hitVec.distanceTo(vec3);
        }

        Vec3d vec31 = lookingEntity.getLookVec();
        Vec3d vec32 = startAndEnd.getRight();
        Entity pointedEntity = null;
        Vec3d vec33 = null;
        float f1 = 1.0F;
        List<Entity> list = lookingEntity.world.getEntitiesWithinAABBExcludingEntity(lookingEntity, lookingEntity.getEntityBoundingBox()
                .grow(vec31.x * range, vec31.y * range, vec31.z * range).grow(f1, f1, f1));
        double d2 = d1;

        for (Entity entity : list) {
            if (entity.canBeCollidedWith()) {
                float f2 = entity.getCollisionBorderSize();
                AxisAlignedBB axisalignedbb = entity.getEntityBoundingBox().grow(f2, f2, f2);
                RayTraceResult movingobjectposition = axisalignedbb.calculateIntercept(vec3, vec32);

                if (axisalignedbb.contains(vec3)) {
                    if (0.0D < d2 || d2 == 0.0D) {
                        pointedEntity = entity;
                        vec33 = movingobjectposition == null ? vec3 : movingobjectposition.hitVec;
                        d2 = 0.0D;
                    }
                } else if (movingobjectposition != null) {
                    double d3 = vec3.distanceTo(movingobjectposition.hitVec);

                    if (d3 < d2 || d2 == 0.0D) {
                        if (entity == entity.getRidingEntity() && !entity.canRiderInteract()) {
                            if (d2 == 0.0D) {
                                pointedEntity = entity;
                                vec33 = movingobjectposition.hitVec;
                            }
                        } else {
                            pointedEntity = entity;
                            vec33 = movingobjectposition.hitVec;
                            d2 = d3;
                        }
                    }
                }
            }
        }

        if (pointedEntity != null && (d2 < d1 || mop == null)) {
            mop = new RayTraceResult(pointedEntity, vec33);
        }
        return mop;
    }
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:57,代碼來源:PneumaticCraftUtils.java

示例3: tickPlayers

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
protected void tickPlayers()
{
    super.tickPlayers();
    this.theProfiler.endStartSection("players");

    for (int i = 0; i < this.playerEntities.size(); ++i)
    {
        Entity entity = (Entity)this.playerEntities.get(i);
        Entity entity1 = entity.getRidingEntity();

        if (entity1 != null)
        {
            if (!entity1.isDead && entity1.isPassenger(entity))
            {
                continue;
            }

            entity.dismountRidingEntity();
        }

        this.theProfiler.startSection("tick");

        if (!entity.isDead)
        {
            try
            {
                this.updateEntity(entity);
            }
            catch (Throwable throwable)
            {
                CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Ticking player");
                CrashReportCategory crashreportcategory = crashreport.makeCategory("Player being ticked");
                entity.addEntityCrashInfo(crashreportcategory);
                throw new ReportedException(crashreport);
            }
        }

        this.theProfiler.endSection();
        this.theProfiler.startSection("remove");

        if (entity.isDead)
        {
            int j = entity.chunkCoordX;
            int k = entity.chunkCoordZ;

            if (entity.addedToChunk && this.isChunkLoaded(j, k, true))
            {
                this.getChunkFromChunkCoords(j, k).removeEntity(entity);
            }

            this.loadedEntityList.remove(entity);
            this.onEntityRemoved(entity);
        }

        this.theProfiler.endSection();
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:58,代碼來源:WorldServer.java

示例4: removeAllEntities

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
/**
 * also releases skins.
 */
public void removeAllEntities()
{
    this.loadedEntityList.removeAll(this.unloadedEntityList);

    for (int i = 0; i < this.unloadedEntityList.size(); ++i)
    {
        Entity entity = (Entity)this.unloadedEntityList.get(i);
        int j = entity.chunkCoordX;
        int k = entity.chunkCoordZ;

        if (entity.addedToChunk && this.isChunkLoaded(j, k, true))
        {
            this.getChunkFromChunkCoords(j, k).removeEntity(entity);
        }
    }

    for (int i1 = 0; i1 < this.unloadedEntityList.size(); ++i1)
    {
        this.onEntityRemoved((Entity)this.unloadedEntityList.get(i1));
    }

    this.unloadedEntityList.clear();

    for (int j1 = 0; j1 < this.loadedEntityList.size(); ++j1)
    {
        Entity entity1 = (Entity)this.loadedEntityList.get(j1);
        Entity entity2 = entity1.getRidingEntity();

        if (entity2 != null)
        {
            if (!entity2.isDead && entity2.isPassenger(entity1))
            {
                continue;
            }

            entity1.dismountRidingEntity();
        }

        if (entity1.isDead)
        {
            int k1 = entity1.chunkCoordX;
            int l = entity1.chunkCoordZ;

            if (entity1.addedToChunk && this.isChunkLoaded(k1, l, true))
            {
                this.getChunkFromChunkCoords(k1, l).removeEntity(entity1);
            }

            this.loadedEntityList.remove(j1--);
            this.onEntityRemoved(entity1);
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:57,代碼來源:WorldClient.java

示例5: getOnEntity

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
public static Entity getOnEntity(Entity ent) { return ent.getRidingEntity(); } 
開發者ID:NSExceptional,項目名稱:Zombe-Modpack,代碼行數:2,代碼來源:ZWrapper.java


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