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


Java RenderGlobal.getWorld方法代碼示例

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


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

示例1: updateMapDynamicLights

import net.minecraft.client.renderer.RenderGlobal; //導入方法依賴的package包/類
private static void updateMapDynamicLights(RenderGlobal p_updateMapDynamicLights_0_)
{
    World world = p_updateMapDynamicLights_0_.getWorld();

    if (world != null)
    {
        for (Entity entity : world.getLoadedEntityList())
        {
            int i = getLightLevel(entity);

            if (i > 0)
            {
                Integer integer = IntegerCache.valueOf(entity.getEntityId());
                DynamicLight dynamiclight = (DynamicLight)mapDynamicLights.get(integer);

                if (dynamiclight == null)
                {
                    dynamiclight = new DynamicLight(entity);
                    mapDynamicLights.put(integer, dynamiclight);
                }
            }
            else
            {
                Integer integer1 = IntegerCache.valueOf(entity.getEntityId());
                DynamicLight dynamiclight1 = (DynamicLight)mapDynamicLights.remove(integer1);

                if (dynamiclight1 != null)
                {
                    dynamiclight1.updateLitChunks(p_updateMapDynamicLights_0_);
                }
            }
        }
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:35,代碼來源:DynamicLights.java

示例2: updateMapDynamicLights

import net.minecraft.client.renderer.RenderGlobal; //導入方法依賴的package包/類
private static void updateMapDynamicLights(RenderGlobal p_updateMapDynamicLights_0_)
{
    World world = p_updateMapDynamicLights_0_.getWorld();

    if (world != null)
    {
        for (Entity entity : world.getLoadedEntityList())
        {
            int i = getLightLevel(entity);

            if (i > 0)
            {
                Integer integer = net.minecraft.util.IntegerCache.getInteger(entity.getEntityId());
                DynamicLight dynamiclight = (DynamicLight)mapDynamicLights.get(integer);

                if (dynamiclight == null)
                {
                    dynamiclight = new DynamicLight(entity);
                    mapDynamicLights.put(integer, dynamiclight);
                }
            }
            else
            {
                Integer integer1 = net.minecraft.util.IntegerCache.getInteger(entity.getEntityId());
                DynamicLight dynamiclight1 = (DynamicLight)mapDynamicLights.remove(integer1);

                if (dynamiclight1 != null)
                {
                    dynamiclight1.updateLitChunks(p_updateMapDynamicLights_0_);
                }
            }
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:35,代碼來源:DynamicLights.java

示例3: update

import net.minecraft.client.renderer.RenderGlobal; //導入方法依賴的package包/類
public void update(RenderGlobal p_update_1_)
{
    if (Config.isDynamicLightsFast())
    {
        long i = System.currentTimeMillis();

        if (i < this.timeCheckMs + 500L)
        {
            return;
        }

        this.timeCheckMs = i;
    }

    double d6 = this.entity.posX - 0.5D;
    double d0 = this.entity.posY - 0.5D + this.offsetY;
    double d1 = this.entity.posZ - 0.5D;
    int j = DynamicLights.getLightLevel(this.entity);
    double d2 = d6 - this.lastPosX;
    double d3 = d0 - this.lastPosY;
    double d4 = d1 - this.lastPosZ;
    double d5 = 0.1D;

    if (Math.abs(d2) > d5 || Math.abs(d3) > d5 || Math.abs(d4) > d5 || this.lastLightLevel != j)
    {
        this.lastPosX = d6;
        this.lastPosY = d0;
        this.lastPosZ = d1;
        this.lastLightLevel = j;
        this.underwater = false;
        World world = p_update_1_.getWorld();

        if (world != null)
        {
            this.blockPosMutable.func_181079_c(MathHelper.floor_double(d6), MathHelper.floor_double(d0), MathHelper.floor_double(d1));
            IBlockState iblockstate = world.getBlockState(this.blockPosMutable);
            Block block = iblockstate.getBlock();
            this.underwater = block == Blocks.water;
        }

        Set<BlockPos> set = new HashSet();

        if (j > 0)
        {
            EnumFacing enumfacing2 = (MathHelper.floor_double(d6) & 15) >= 8 ? EnumFacing.EAST : EnumFacing.WEST;
            EnumFacing enumfacing = (MathHelper.floor_double(d0) & 15) >= 8 ? EnumFacing.UP : EnumFacing.DOWN;
            EnumFacing enumfacing1 = (MathHelper.floor_double(d1) & 15) >= 8 ? EnumFacing.SOUTH : EnumFacing.NORTH;
            BlockPos blockpos = new BlockPos(d6, d0, d1);
            RenderChunk renderchunk = p_update_1_.getRenderChunk(blockpos);
            RenderChunk renderchunk1 = p_update_1_.getRenderChunk(renderchunk, enumfacing2);
            RenderChunk renderchunk2 = p_update_1_.getRenderChunk(renderchunk, enumfacing1);
            RenderChunk renderchunk3 = p_update_1_.getRenderChunk(renderchunk1, enumfacing1);
            RenderChunk renderchunk4 = p_update_1_.getRenderChunk(renderchunk, enumfacing);
            RenderChunk renderchunk5 = p_update_1_.getRenderChunk(renderchunk4, enumfacing2);
            RenderChunk renderchunk6 = p_update_1_.getRenderChunk(renderchunk4, enumfacing1);
            RenderChunk renderchunk7 = p_update_1_.getRenderChunk(renderchunk5, enumfacing1);
            this.updateChunkLight(renderchunk, this.setLitChunkPos, set);
            this.updateChunkLight(renderchunk1, this.setLitChunkPos, set);
            this.updateChunkLight(renderchunk2, this.setLitChunkPos, set);
            this.updateChunkLight(renderchunk3, this.setLitChunkPos, set);
            this.updateChunkLight(renderchunk4, this.setLitChunkPos, set);
            this.updateChunkLight(renderchunk5, this.setLitChunkPos, set);
            this.updateChunkLight(renderchunk6, this.setLitChunkPos, set);
            this.updateChunkLight(renderchunk7, this.setLitChunkPos, set);
        }

        this.updateLitChunks(p_update_1_);
        this.setLitChunkPos = set;
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:71,代碼來源:DynamicLight.java

示例4: update

import net.minecraft.client.renderer.RenderGlobal; //導入方法依賴的package包/類
public void update(RenderGlobal p_update_1_)
{
    if (Config.isDynamicLightsFast())
    {
        long i = System.currentTimeMillis();

        if (i < this.timeCheckMs + 500L)
        {
            return;
        }

        this.timeCheckMs = i;
    }

    double d6 = this.entity.posX - 0.5D;
    double d0 = this.entity.posY - 0.5D + this.offsetY;
    double d1 = this.entity.posZ - 0.5D;
    int j = DynamicLights.getLightLevel(this.entity);
    double d2 = d6 - this.lastPosX;
    double d3 = d0 - this.lastPosY;
    double d4 = d1 - this.lastPosZ;
    double d5 = 0.1D;

    if (Math.abs(d2) > d5 || Math.abs(d3) > d5 || Math.abs(d4) > d5 || this.lastLightLevel != j)
    {
        this.lastPosX = d6;
        this.lastPosY = d0;
        this.lastPosZ = d1;
        this.lastLightLevel = j;
        this.underwater = false;
        World world = p_update_1_.getWorld();

        if (world != null)
        {
            this.blockPosMutable.setPos(MathHelper.floor(d6), MathHelper.floor(d0), MathHelper.floor(d1));
            IBlockState iblockstate = world.getBlockState(this.blockPosMutable);
            Block block = iblockstate.getBlock();
            this.underwater = block == Blocks.WATER;
        }

        Set<BlockPos> set = new HashSet();

        if (j > 0)
        {
            EnumFacing enumfacing2 = (MathHelper.floor(d6) & 15) >= 8 ? EnumFacing.EAST : EnumFacing.WEST;
            EnumFacing enumfacing = (MathHelper.floor(d0) & 15) >= 8 ? EnumFacing.UP : EnumFacing.DOWN;
            EnumFacing enumfacing1 = (MathHelper.floor(d1) & 15) >= 8 ? EnumFacing.SOUTH : EnumFacing.NORTH;
            BlockPos blockpos = new BlockPos(d6, d0, d1);
            RenderChunk renderchunk = p_update_1_.getRenderChunk(blockpos);
            BlockPos blockpos1 = this.getChunkPos(renderchunk, blockpos, enumfacing2);
            RenderChunk renderchunk1 = p_update_1_.getRenderChunk(blockpos1);
            BlockPos blockpos2 = this.getChunkPos(renderchunk, blockpos, enumfacing1);
            RenderChunk renderchunk2 = p_update_1_.getRenderChunk(blockpos2);
            BlockPos blockpos3 = this.getChunkPos(renderchunk1, blockpos1, enumfacing1);
            RenderChunk renderchunk3 = p_update_1_.getRenderChunk(blockpos3);
            BlockPos blockpos4 = this.getChunkPos(renderchunk, blockpos, enumfacing);
            RenderChunk renderchunk4 = p_update_1_.getRenderChunk(blockpos4);
            BlockPos blockpos5 = this.getChunkPos(renderchunk4, blockpos4, enumfacing2);
            RenderChunk renderchunk5 = p_update_1_.getRenderChunk(blockpos5);
            BlockPos blockpos6 = this.getChunkPos(renderchunk4, blockpos4, enumfacing1);
            RenderChunk renderchunk6 = p_update_1_.getRenderChunk(blockpos6);
            BlockPos blockpos7 = this.getChunkPos(renderchunk5, blockpos5, enumfacing1);
            RenderChunk renderchunk7 = p_update_1_.getRenderChunk(blockpos7);
            this.updateChunkLight(renderchunk, this.setLitChunkPos, set);
            this.updateChunkLight(renderchunk1, this.setLitChunkPos, set);
            this.updateChunkLight(renderchunk2, this.setLitChunkPos, set);
            this.updateChunkLight(renderchunk3, this.setLitChunkPos, set);
            this.updateChunkLight(renderchunk4, this.setLitChunkPos, set);
            this.updateChunkLight(renderchunk5, this.setLitChunkPos, set);
            this.updateChunkLight(renderchunk6, this.setLitChunkPos, set);
            this.updateChunkLight(renderchunk7, this.setLitChunkPos, set);
        }

        this.updateLitChunks(p_update_1_);
        this.setLitChunkPos = set;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:78,代碼來源:DynamicLight.java


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