|
97 | 97 | this.wakeAllPlayers(); |
98 | 98 | } |
99 | 99 |
|
| 100 | +- this.profiler.startSection("spawner"); |
100 | 101 | + //CM profiler |
101 | 102 | + int did = this.dimension.getType().getId(); |
102 | 103 | + String world_name = (did==0)?"Overworld":((did<0?"The Nether":"The End")); |
103 | 104 | + // CM end |
104 | | -+ |
| 105 | + |
| 106 | +- if (this.getGameRules().getBoolean("doMobSpawning") && this.worldInfo.getGenerator() != WorldType.DEBUG_ALL_BLOCK_STATES) |
| 107 | +- { |
| 108 | +- this.entitySpawner.findChunksForSpawning(this, this.spawnHostileMobs, this.spawnPeacefulMobs, this.worldInfo.getGameTime() % 400L == 0L); |
| 109 | +- this.getChunkProvider().spawnMobs(this, this.spawnHostileMobs, this.spawnPeacefulMobs); |
105 | 110 | + if (TickSpeed.process_entities) |
106 | 111 | + { // [CM] extra indent to skip processing of entities |
107 | | - this.profiler.startSection("spawner"); |
108 | | -+ CarpetProfiler.start_section(world_name, "Spawning"); |
109 | | -+ MicroTimingLoggerManager.setTickStage(this, TickStage.SPAWNING); // TISCM Micro Timing logger |
110 | | - |
111 | | - if (this.getGameRules().getBoolean("doMobSpawning") && this.worldInfo.getGenerator() != WorldType.DEBUG_ALL_BLOCK_STATES) |
112 | | - { |
113 | | - this.entitySpawner.findChunksForSpawning(this, this.spawnHostileMobs, this.spawnPeacefulMobs, this.worldInfo.getGameTime() % 400L == 0L); |
114 | | - this.getChunkProvider().spawnMobs(this, this.spawnHostileMobs, this.spawnPeacefulMobs); |
| 112 | ++ this.profiler.startSection("spawner"); |
| 113 | ++ CarpetProfiler.start_section(world_name, "Spawning"); |
| 114 | ++ MicroTimingLoggerManager.setTickStage(this, TickStage.SPAWNING); // TISCM Micro Timing logger |
| 115 | ++ |
| 116 | ++ if (this.getGameRules().getBoolean("doMobSpawning") && this.worldInfo.getGenerator() != WorldType.DEBUG_ALL_BLOCK_STATES) |
| 117 | ++ { |
| 118 | ++ this.entitySpawner.findChunksForSpawning(this, this.spawnHostileMobs, this.spawnPeacefulMobs, this.worldInfo.getGameTime() % 400L == 0L); |
| 119 | ++ this.getChunkProvider().spawnMobs(this, this.spawnHostileMobs, this.spawnPeacefulMobs); |
| 120 | ++ } |
| 121 | ++ CarpetProfiler.end_current_section(); |
115 | 122 | } |
116 | | -+ CarpetProfiler.end_current_section(); |
117 | | -+ } |
118 | 123 | + // [CM] end extra indent |
119 | 124 |
|
120 | 125 | this.profiler.endStartSection("chunkSource"); |
121 | 126 | + MicroTimingLoggerManager.setTickStage(this, TickStage.CHUNK_UNLOADING); // TISCM Micro Timing logger |
122 | 127 | this.chunkProvider.tick(hasTimeLeft); |
123 | 128 | int j = this.calculateSkylightSubtracted(1.0F); |
124 | 129 |
|
125 | | -@@ -208,25 +264,57 @@ |
| 130 | +@@ -208,26 +264,64 @@ |
126 | 131 | this.setSkylightSubtracted(j); |
127 | 132 | } |
128 | 133 |
|
129 | 134 | - this.worldInfo.setGameTime(this.worldInfo.getGameTime() + 1L); |
130 | 135 | + if (TickSpeed.process_entities) |
131 | 136 | + { // CM extra indent to skip processing of entities |
132 | 137 |
|
133 | | -+ // TISCM Micro Timing logger |
134 | | -+ // Flushes messages right before overworld gametime increases |
135 | | -+ if (this.getDimension().getType() == DimensionType.OVERWORLD) |
136 | | -+ { |
137 | | -+ MicroTimingLoggerManager.flushMessages(this.getGameTime()); |
138 | | -+ } |
139 | | -+ |
140 | | -+ this.worldInfo.setGameTime(this.worldInfo.getGameTime() + 1L); |
141 | | - if (this.getGameRules().getBoolean("doDaylightCycle")) |
142 | | - { |
143 | | - this.worldInfo.setDayTime(this.worldInfo.getDayTime() + 1L); |
144 | | - } |
| 138 | +- if (this.getGameRules().getBoolean("doDaylightCycle")) |
| 139 | +- { |
| 140 | +- this.worldInfo.setDayTime(this.worldInfo.getDayTime() + 1L); |
| 141 | +- } |
| 142 | ++ // TISCM Micro Timing logger |
| 143 | ++ // Flushes messages right before overworld gametime increases |
| 144 | ++ if (this.getDimension().getType() == DimensionType.OVERWORLD) |
| 145 | ++ { |
| 146 | ++ MicroTimingLoggerManager.flushMessages(this.getGameTime()); |
| 147 | ++ } |
145 | 148 |
|
146 | | - this.profiler.endStartSection("tickPending"); |
147 | | -+ CarpetProfiler.start_section(world_name, "Blocks"); |
148 | | -+ MicroTimingLoggerManager.setTickStage(this, TickStage.TILE_TICK); // TISCM Micro Timing logger |
149 | | - this.tickPending(); |
150 | | -+ CarpetProfiler.end_current_section(); |
| 149 | +- this.profiler.endStartSection("tickPending"); |
| 150 | +- this.tickPending(); |
| 151 | ++ this.worldInfo.setGameTime(this.worldInfo.getGameTime() + 1L); |
| 152 | ++ if (this.getGameRules().getBoolean("doDaylightCycle")) |
| 153 | ++ { |
| 154 | ++ this.worldInfo.setDayTime(this.worldInfo.getDayTime() + 1L); |
| 155 | ++ } |
| 156 | ++ |
| 157 | ++ this.profiler.endStartSection("tickPending"); |
| 158 | ++ CarpetProfiler.start_section(world_name, "Tile Tick"); |
| 159 | ++ MicroTimingLoggerManager.setTickStage(this, TickStage.TILE_TICK); // TISCM Micro Timing logger |
| 160 | ++ this.tickPending(); |
| 161 | ++ CarpetProfiler.end_current_section(); |
151 | 162 | + } // end extra indent |
| 163 | ++ |
152 | 164 | this.profiler.endStartSection("tickBlocks"); |
153 | | -+ CarpetProfiler.start_section(world_name, "Blocks"); |
| 165 | ++ CarpetProfiler.start_section(world_name, "Chunk Tick"); |
154 | 166 | this.tickBlocks(); |
155 | 167 | + CarpetProfiler.end_current_section(); |
156 | | -+ MicroTimingLoggerManager.setTickStage(this, TickStage.PLAYER_CHUNK_MAP); // TISCM Micro Timing logger |
| 168 | ++ |
157 | 169 | this.profiler.endStartSection("chunkMap"); |
| 170 | ++ CarpetProfiler.start_section(world_name, "Player Chunk Map"); |
| 171 | ++ MicroTimingLoggerManager.setTickStage(this, TickStage.PLAYER_CHUNK_MAP); // TISCM Micro Timing logger |
158 | 172 | this.playerChunkMap.tick(); |
| 173 | ++ CarpetProfiler.end_current_section(); |
159 | 174 | + |
160 | 175 | + if (TickSpeed.process_entities) |
161 | 176 | + { // CM extra indent to skip processing of entities |
|
177 | 192 | + this.getLightingEngine().procLightUpdates(); |
178 | 193 | + } |
179 | 194 | this.profiler.endSection(); |
| 195 | ++ CarpetProfiler.start_section(world_name, "Block Events"); |
180 | 196 | + MicroTimingLoggerManager.setTickStage(this, TickStage.BLOCK_EVENT); // TISCM Micro Timing logger |
181 | 197 | this.sendQueuedBlockEvents(); |
| 198 | ++ CarpetProfiler.end_current_section(); |
182 | 199 | this.insideTick = false; |
183 | 200 | } |
184 | | -@@ -270,7 +358,7 @@ |
| 201 | + |
| 202 | +@@ -270,7 +364,7 @@ |
185 | 203 | } |
186 | 204 | } |
187 | 205 |
|
|
190 | 208 | } |
191 | 209 | } |
192 | 210 |
|
193 | | -@@ -306,6 +394,13 @@ |
| 211 | +@@ -306,6 +400,13 @@ |
194 | 212 | { |
195 | 213 | if (this.allPlayersSleeping && !this.isRemote) |
196 | 214 | { |
|
204 | 222 | for (EntityPlayer entityplayer : this.playerEntities) |
205 | 223 | { |
206 | 224 | if (!entityplayer.isSpectator() && !entityplayer.isPlayerFullyAsleep()) |
207 | | -@@ -397,9 +492,11 @@ |
| 225 | +@@ -397,9 +498,11 @@ |
208 | 226 | boolean flag1 = this.isThundering(); |
209 | 227 | this.profiler.startSection("pollingChunks"); |
210 | 228 |
|
|
216 | 234 | Chunk chunk = iterator.next(); |
217 | 235 | int j = chunk.x * 16; |
218 | 236 | int k = chunk.z * 16; |
219 | | -@@ -407,7 +504,20 @@ |
| 237 | +@@ -407,7 +510,20 @@ |
220 | 238 | chunk.enqueueRelightChecks(); |
221 | 239 | this.profiler.endStartSection("tickChunk"); |
222 | 240 | chunk.tick(false); |
|
237 | 255 |
|
238 | 256 | if (flag && flag1 && this.rand.nextInt(100000) == 0) |
239 | 257 | { |
240 | | -@@ -434,6 +544,7 @@ |
| 258 | +@@ -434,6 +550,7 @@ |
241 | 259 | } |
242 | 260 |
|
243 | 261 | this.profiler.endStartSection("iceandsnow"); |
244 | 262 | + MicroTimingLoggerManager.setTickStageDetail(this, "Ice&Snow"); // TISCM Micro Timing logger |
245 | 263 |
|
246 | 264 | if (this.rand.nextInt(16) == 0) |
247 | 265 | { |
248 | | -@@ -460,6 +571,7 @@ |
| 266 | +@@ -460,6 +577,7 @@ |
249 | 267 | } |
250 | 268 |
|
251 | 269 | this.profiler.endStartSection("tickBlocks"); |
252 | 270 | + MicroTimingLoggerManager.setTickStageDetail(this, "RandomTick"); // TISCM Micro Timing logger |
253 | 271 |
|
254 | 272 | if (i > 0) |
255 | 273 | { |
256 | | -@@ -493,13 +605,21 @@ |
| 274 | +@@ -493,13 +611,21 @@ |
257 | 275 | } |
258 | 276 | } |
259 | 277 | } |
|
276 | 294 | { |
277 | 295 | BlockPos blockpos = this.getHeight(Heightmap.Type.MOTION_BLOCKING, pos); |
278 | 296 | AxisAlignedBB axisalignedbb = (new AxisAlignedBB(blockpos, new BlockPos(blockpos.getX(), this.getHeight(), blockpos.getZ()))).grow(3.0D); |
279 | | -@@ -625,12 +745,16 @@ |
| 297 | +@@ -625,12 +751,16 @@ |
280 | 298 |
|
281 | 299 | private void tickBlock(NextTickListEntry<Block> blockTickEntry) |
282 | 300 | { |
|
293 | 311 | } |
294 | 312 |
|
295 | 313 | public void tickEntity(Entity entityIn, boolean forceUpdate) |
296 | | -@@ -1021,26 +1145,54 @@ |
| 314 | +@@ -1021,26 +1151,54 @@ |
297 | 315 |
|
298 | 316 | public void addBlockEvent(BlockPos pos, Block blockIn, int eventID, int eventParam) |
299 | 317 | { |
|
0 commit comments