Skip to content

Commit

Permalink
Workaround for @OverRide failure in dev dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
grondag committed Apr 20, 2019
1 parent ced1d86 commit 65ab37f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/main/java/grondag/canvas/mixin/MixinChunkRenderWorker.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
package grondag.canvas.mixin;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import net.minecraft.block.BlockRenderLayer;
import net.minecraft.client.render.chunk.BlockLayeredBufferBuilder;
Expand All @@ -44,16 +46,16 @@ private static boolean shouldUploadLayer(ChunkRenderData chunkData, BlockRenderL
/**
* Should never be called/used by canvas - avoids memory use and overhead of BlockLayeredBufferBuilders
*/
@Overwrite
private BlockLayeredBufferBuilder getBufferBuilders() throws InterruptedException {
return DUMMY_LAYERS;
@Inject(method = "getBufferBuilders", at = @At("HEAD"), cancellable = true, require = 1)
private void onGetBufferBuilders(CallbackInfoReturnable<BlockLayeredBufferBuilder> ci) throws InterruptedException {
ci.setReturnValue(DUMMY_LAYERS);
}

/**
* Should never be needed with canvas - avoids memory use and overhead of BlockLayeredBufferBuilders
*/
@Overwrite
private void freeRenderTask(ChunkRenderTask chunkRenderTask_1) {
//NOOP
@Inject(method = "freeRenderTask", at = @At("HEAD"), cancellable = true, require = 1)
private void onFreeRenderTask(ChunkRenderTask chunkRenderTask_1, CallbackInfo ci) {
ci.cancel();
}
}

0 comments on commit 65ab37f

Please sign in to comment.