MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / update

Method update

src/main/java/net/optifine/DynamicLight.java:37–113  ·  view source on GitHub ↗
(RenderGlobal renderGlobal)

Source from the content-addressed store, hash-verified

35 }
36
37 public void update(RenderGlobal renderGlobal)
38 {
39 if (Config.isDynamicLightsFast())
40 {
41 long i = System.currentTimeMillis();
42
43 if (i < this.timeCheckMs + 500L)
44 {
45 return;
46 }
47
48 this.timeCheckMs = i;
49 }
50
51 double d6 = this.entity.posX - 0.5D;
52 double d0 = this.entity.posY - 0.5D + this.offsetY;
53 double d1 = this.entity.posZ - 0.5D;
54 int j = DynamicLights.getLightLevel(this.entity);
55 double d2 = d6 - this.lastPosX;
56 double d3 = d0 - this.lastPosY;
57 double d4 = d1 - this.lastPosZ;
58 double d5 = 0.1D;
59
60 if (Math.abs(d2) > d5 || Math.abs(d3) > d5 || Math.abs(d4) > d5 || this.lastLightLevel != j)
61 {
62 this.lastPosX = d6;
63 this.lastPosY = d0;
64 this.lastPosZ = d1;
65 this.lastLightLevel = j;
66 this.underwater = false;
67 World world = renderGlobal.getWorld();
68
69 if (world != null)
70 {
71 this.blockPosMutable.func_181079_c(MathHelper.floor_double(d6), MathHelper.floor_double(d0), MathHelper.floor_double(d1));
72 IBlockState iblockstate = world.getBlockState(this.blockPosMutable);
73 Block block = iblockstate.getBlock();
74 this.underwater = block == Blocks.water;
75 }
76
77 Set<BlockPos> set = new HashSet();
78
79 if (j > 0)
80 {
81 EnumFacing enumfacing2 = (MathHelper.floor_double(d6) & 15) >= 8 ? EnumFacing.EAST : EnumFacing.WEST;
82 EnumFacing enumfacing = (MathHelper.floor_double(d0) & 15) >= 8 ? EnumFacing.UP : EnumFacing.DOWN;
83 EnumFacing enumfacing1 = (MathHelper.floor_double(d1) & 15) >= 8 ? EnumFacing.SOUTH : EnumFacing.NORTH;
84 BlockPos blockpos = new BlockPos(d6, d0, d1);
85 RenderChunk renderchunk = renderGlobal.getRenderChunk(blockpos);
86 BlockPos blockpos1 = this.getChunkPos(renderchunk, blockpos, enumfacing2);
87 RenderChunk renderchunk1 = renderGlobal.getRenderChunk(blockpos1);
88 BlockPos blockpos2 = this.getChunkPos(renderchunk, blockpos, enumfacing1);
89 RenderChunk renderchunk2 = renderGlobal.getRenderChunk(blockpos2);
90 BlockPos blockpos3 = this.getChunkPos(renderchunk1, blockpos1, enumfacing1);
91 RenderChunk renderchunk3 = renderGlobal.getRenderChunk(blockpos3);
92 BlockPos blockpos4 = this.getChunkPos(renderchunk, blockpos, enumfacing);
93 RenderChunk renderchunk4 = renderGlobal.getRenderChunk(blockpos4);
94 BlockPos blockpos5 = this.getChunkPos(renderchunk4, blockpos4, enumfacing2);

Callers 1

updateMethod · 0.95

Calls 13

isDynamicLightsFastMethod · 0.95
getLightLevelMethod · 0.95
floor_doubleMethod · 0.95
getBlockStateMethod · 0.95
getBlockMethod · 0.95
getChunkPosMethod · 0.95
updateChunkLightMethod · 0.95
updateLitChunksMethod · 0.95
currentTimeMillisMethod · 0.80
absMethod · 0.80
func_181079_cMethod · 0.80
getWorldMethod · 0.65

Tested by

no test coverage detected