Use ASM instead of inheritance to override methods in RenderGlobal

This commit is contained in:
johni0702
2015-05-25 13:13:21 +02:00
parent 538e95ad95
commit c7d974b24d
4 changed files with 310 additions and 29 deletions

View File

@@ -42,6 +42,7 @@ public class VideoRenderer {
private int fps;
private boolean mouseWasGrabbed;
private ChunkLoadingRenderGlobal chunkLoadingRenderGlobal;
private Interpolation<Position> movement;
private Interpolation<Integer> time;
@@ -160,7 +161,7 @@ public class VideoRenderer {
gui.setWorldAndResolution(mc, scaled.getScaledWidth(), scaled.getScaledHeight());
if (options.isWaitForChunks()) {
ChunkLoadingRenderGlobal.install(mc);
chunkLoadingRenderGlobal = new ChunkLoadingRenderGlobal(mc.renderGlobal);
}
}
@@ -178,9 +179,10 @@ public class VideoRenderer {
if (mouseWasGrabbed) {
Mouse.setGrabbed(true);
}
MCTimerHandler.setActiveTimer();
mc.displayGuiScreen(null);
if (mc.renderGlobal instanceof ChunkLoadingRenderGlobal) {
((ChunkLoadingRenderGlobal) mc.renderGlobal).uninstall();
if (chunkLoadingRenderGlobal != null) {
chunkLoadingRenderGlobal.uninstall();
}
}