Skip to content

Commit

Permalink
Fixed lighting for TE's
Browse files Browse the repository at this point in the history
and some other things
  • Loading branch information
Asek3 committed Jan 25, 2024
1 parent aa0e5a0 commit c48d35b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ private void postRenderDamagedBlocks() {
GlStateManager.popMatrix();
}

public void renderTileEntities(Entity entity, ICamera camera, float partialTicks, Map<Integer, DestroyBlockProgress> damagedBlocks) {
public void renderTileEntities(float partialTicks, Map<Integer, DestroyBlockProgress> damagedBlocks) {
int pass = MinecraftForgeClient.getRenderPass();
TileEntityRendererDispatcher.instance.preDrawBatch();
for (TileEntity tileEntity : this.chunkRenderManager.getVisibleBlockEntities()) {
Expand All @@ -359,8 +359,8 @@ public void renderTileEntities(Entity entity, ICamera camera, float partialTicks
for (TileEntity tileEntity : this.globalBlockEntities) {
renderTE(tileEntity, pass, partialTicks, -1);
}
TileEntityRendererDispatcher.instance.drawBatch(pass);

// TODO Damaged Block Renderer is still very broken
this.preRenderDamagedBlocks();
for (DestroyBlockProgress destroyProgress : damagedBlocks.values()) {
BlockPos pos = destroyProgress.getPosition();
Expand All @@ -387,8 +387,6 @@ public void renderTileEntities(Entity entity, ICamera camera, float partialTicks
}
}
this.postRenderDamagedBlocks();

TileEntityRendererDispatcher.instance.drawBatch(pass);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,13 @@ private void onReload(CallbackInfo ci) {
}
}

@Inject(method = "renderEntities", at = @At(value = "INVOKE", target="Lnet/minecraft/client/renderer/RenderHelper;enableStandardItemLighting()V", shift = At.Shift.AFTER, ordinal = 1))
@Inject(method = "renderEntities", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/RenderHelper;enableStandardItemLighting()V", shift = At.Shift.AFTER, ordinal = 1), cancellable = true)
public void sodium$renderTileEntities(Entity entity, ICamera camera, float partialTicks, CallbackInfo ci) {
this.renderer.renderTileEntities(entity, camera, partialTicks, damagedBlocks);
this.renderer.renderTileEntities(partialTicks, damagedBlocks);

this.mc.entityRenderer.disableLightmap();
this.mc.profiler.endSection();
ci.cancel();
}

/**
Expand Down

0 comments on commit c48d35b

Please sign in to comment.