Skip to content

Commit

Permalink
Bump version to 0.4.2 (minerllabs#585)
Browse files Browse the repository at this point in the history
* 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
brandonhoughton and AdrienLE authored Sep 7, 2021
1 parent 9963db0 commit e4e1147
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 8 deletions.
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();
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"MixinMergeStatsFix",
"MixinForgeHookStatsFix"
],
"server": [
],
"server": [],
"client": [
"MixinUpdateChunksNoTimeout"
],
"compatibilityLevel": "JAVA_8",
"minVersion": "0.6.11",
Expand Down
9 changes: 4 additions & 5 deletions minerl/env/malmo.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,18 +597,17 @@ def log_to_file(logdir):
mine_log.close()

logdir = os.environ.get('MALMO_MINECRAFT_OUTPUT_LOGDIR', '.')
self.running = True
self._logger_thread = threading.Thread(target=functools.partial(log_to_file, logdir=logdir))
self._logger_thread.setDaemon(True)
self._logger_thread.start()

self._starting = False

else:
assert port is not None, "No existing port specified."
self._port = port

self.running = True

self._starting = False
self._starting = False
self.running = True

# Make a hook to kill
if not daemonize:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def build_minecraft(source_dir, build_dir):
name='minerl',
# TODO(shwang): Load from minerl.version.VERSION or something so we don't have to update
# multiple version strings.
version=os.environ.get('MINERL_BUILD_VERSION', '0.4.2a'),
version=os.environ.get('MINERL_BUILD_VERSION', '0.4.2'),
description='MineRL environment and data loader for reinforcement learning from human demonstration in Minecraft',
long_description=markdown,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit e4e1147

Please sign in to comment.