forked from minerllabs/minerl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump version to 0.4.2 (minerllabs#585)
* Bump version to 0.4.2 * Ensure 0.4.1 release is tagged properly * Fix issue with chunks not loading durring render Co-authored-by: Adrien Ecoffet <[email protected]>
- Loading branch information
1 parent
9963db0
commit e4e1147
Showing
4 changed files
with
71 additions
and
8 deletions.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
.../Malmo/Minecraft/src/main/java/com/microsoft/Malmo/Mixins/MixinUpdateChunksNoTimeout.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
|
||
|
||
package com.microsoft.Malmo.Mixins; | ||
|
||
|
||
import java.util.Iterator; | ||
import java.util.Random; | ||
import java.util.Set; | ||
|
||
import com.microsoft.Malmo.Utils.SeedHelper; | ||
import com.microsoft.Malmo.Utils.TimeHelper; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
import org.spongepowered.asm.mixin.Overwrite; | ||
|
||
import net.minecraft.client.renderer.chunk.ChunkRenderDispatcher; | ||
import net.minecraft.client.renderer.chunk.RenderChunk; | ||
import net.minecraft.client.renderer.RenderGlobal; | ||
|
||
|
||
@Mixin(RenderGlobal.class) | ||
public abstract class MixinUpdateChunksNoTimeout { | ||
// /* Overrides methods within the RenderGlobal class. | ||
// */ | ||
|
||
@Shadow private boolean displayListEntitiesDirty; | ||
@Shadow private ChunkRenderDispatcher renderDispatcher; | ||
@Shadow private Set<RenderChunk> chunksToUpdate; | ||
|
||
@Overwrite | ||
public void updateChunks(long finishTimeNano) | ||
{ | ||
// This is the implementation of updateChunks as of 1.11, with some code removed | ||
this.displayListEntitiesDirty |= this.renderDispatcher.runChunkUploads(finishTimeNano); | ||
|
||
if (!this.chunksToUpdate.isEmpty()) | ||
{ | ||
Iterator<RenderChunk> iterator = this.chunksToUpdate.iterator(); | ||
|
||
while (iterator.hasNext()) | ||
{ | ||
RenderChunk renderchunk = (RenderChunk)iterator.next(); | ||
boolean flag; | ||
|
||
flag = this.renderDispatcher.updateChunkNow(renderchunk); | ||
|
||
if (!flag) | ||
{ | ||
break; | ||
} | ||
|
||
renderchunk.clearNeedsUpdate(); | ||
iterator.remove(); | ||
|
||
long i = finishTimeNano - System.nanoTime(); | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters