Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
Expand Down Expand Up @@ -74,7 +75,8 @@ public static void renderBoard(CCRenderState renderState, Matrix4 translation, I
translation.translate(0.5, 0.5, 0.5);
translation.rotate(Math.toRadians(90.0 * rotations.indexOf(rotation)), Rotation.axes[1]);
translation.translate(-0.5, -0.5, -0.5);

World world = clipboard.getWorld();
if (world != null) renderState.setBrightness(world, clipboard.getPos());
// Render Clipboard
for (EnumFacing renderSide : EnumFacing.VALUES) {
boxTextureMap.forEach((box, sprite) -> Textures.renderFace(renderState, translation, pipeline, renderSide,
Expand All @@ -89,7 +91,17 @@ public static void renderGUI(double x, double y, double z, EnumFacing rotation,
GlStateManager.pushMatrix();
float lastBrightnessX = OpenGlHelper.lastBrightnessX;
float lastBrightnessY = OpenGlHelper.lastBrightnessY;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 240.0F);

float lx = 240, ly = 240;
World world = clipboard.getWorld();
if (world != null) {
int light = world.getCombinedLight(clipboard.getPos(), 0);

lx = (float) light % 0x10000;
ly = (float) light / 0x10000;
}

OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lx, ly);
RenderHelper.disableStandardItemLighting();

// All of these are done in reverse order, by the way, if you're reviewing this :P
Expand Down
Loading