Skip to content

Commit f7c20f8

Browse files
committed
Just keep lighting disabled on JEI page
Immersive, Astral, and others do the same, so ¯\_(ツ)_/¯
1 parent 3cab6e5 commit f7c20f8

1 file changed

Lines changed: 5 additions & 47 deletions

File tree

src/main/java/com/robotgryphon/compactcrafting/compat/jei/JeiMiniaturizationCraftingCategory.java

Lines changed: 5 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.robotgryphon.compactcrafting.compat.jei;
22

33
import com.mojang.blaze3d.matrix.MatrixStack;
4-
import com.mojang.blaze3d.vertex.IVertexBuilder;
54
import com.robotgryphon.compactcrafting.CompactCrafting;
65
import com.robotgryphon.compactcrafting.client.render.RenderTickCounter;
6+
import com.robotgryphon.compactcrafting.client.render.RenderTypesExtensions;
77
import com.robotgryphon.compactcrafting.core.Registration;
88
import com.robotgryphon.compactcrafting.recipes.MiniaturizationRecipe;
99
import com.robotgryphon.compactcrafting.recipes.layers.IRecipeLayer;
@@ -19,7 +19,6 @@
1919
import net.minecraft.client.Minecraft;
2020
import net.minecraft.client.renderer.BlockRendererDispatcher;
2121
import net.minecraft.client.renderer.IRenderTypeBuffer;
22-
import net.minecraft.client.renderer.RenderType;
2322
import net.minecraft.client.renderer.Tessellator;
2423
import net.minecraft.client.renderer.texture.OverlayTexture;
2524
import net.minecraft.client.resources.I18n;
@@ -29,8 +28,6 @@
2928
import net.minecraft.util.math.AxisAlignedBB;
3029
import net.minecraft.util.math.BlockPos;
3130
import net.minecraft.util.math.vector.Quaternion;
32-
import net.minecraft.util.math.vector.Vector3d;
33-
import net.minecraft.util.math.vector.Vector3f;
3431
import net.minecraft.util.text.IFormattableTextComponent;
3532
import net.minecraft.util.text.TextFormatting;
3633
import net.minecraft.util.text.TranslationTextComponent;
@@ -251,6 +248,7 @@ public boolean handleClick(MiniaturizationRecipe recipe, double mouseX, double m
251248
public void draw(MiniaturizationRecipe recipe, MatrixStack mx, double mouseX, double mouseY) {
252249
AxisAlignedBB dims = recipe.getDimensions();
253250

251+
//region JEI controls
254252
IDrawableStatic jei = guiHelper
255253
.drawableBuilder(
256254
new ResourceLocation(CompactCrafting.MOD_ID, "textures/nope.png"),
@@ -268,10 +266,10 @@ public void draw(MiniaturizationRecipe recipe, MatrixStack mx, double mouseX, do
268266
if (singleLayerOffset > 0)
269267
jei.draw(mx, layerDown.x, layerDown.y);
270268
}
269+
//endregion
271270

272271
try {
273272
IRenderTypeBuffer.Impl buffers = IRenderTypeBuffer.getImpl(Tessellator.getInstance().getBuffer());
274-
IVertexBuilder lines = buffers.getBuffer(RenderType.getLines());
275273

276274
mx.push();
277275

@@ -287,12 +285,6 @@ public void draw(MiniaturizationRecipe recipe, MatrixStack mx, double mouseX, do
287285
0,
288286
true));
289287

290-
if (debugMode) {
291-
// DEBUG Line
292-
addColoredVertex(lines, mx, Color.RED, new Vector3f(0, (float) -10, 0));
293-
addColoredVertex(lines, mx, Color.RED, new Vector3f(0, (float) 10, 0));
294-
}
295-
296288
double ySize = recipe.getDimensions().getYSize();
297289

298290
// Variable explode based on mouse position (clamped)
@@ -325,39 +317,6 @@ public void draw(MiniaturizationRecipe recipe, MatrixStack mx, double mouseX, do
325317
}
326318
}
327319

328-
private void drawRect(MatrixStack mx, IVertexBuilder field, Rectangle rect, Color color) {
329-
mx.push();
330-
mx.translate(rect.getX(), rect.getY(), 0);
331-
addColoredVertex(field, mx, color, new Vector3d(rect.getX(), rect.getY(), 0));
332-
addColoredVertex(field, mx, color, new Vector3d(rect.getX() + rect.getWidth(), rect.getY(), 0));
333-
334-
addColoredVertex(field, mx, color, new Vector3d(rect.getX() + rect.getWidth(), rect.getY(), 0));
335-
addColoredVertex(field, mx, color, new Vector3d(rect.getX() + rect.getWidth(), rect.getY() + rect.getHeight(), 0));
336-
337-
addColoredVertex(field, mx, color, new Vector3d(rect.getX() + rect.getWidth(), rect.getY() + rect.getHeight(), 0));
338-
addColoredVertex(field, mx, color, new Vector3d(rect.getX(), rect.getY() + rect.getHeight(), 0));
339-
340-
addColoredVertex(field, mx, color, new Vector3d(rect.getX(), rect.getY() + rect.getHeight(), 0));
341-
addColoredVertex(field, mx, color, new Vector3d(rect.getX(), rect.getY(), 0));
342-
mx.pop();
343-
}
344-
345-
private void addColoredVertex(IVertexBuilder renderer, MatrixStack stack, Color color, Vector3d position) {
346-
renderer.pos(position.getX(), position.getY(), position.getZ())
347-
.color(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha())
348-
.lightmap(0, 240)
349-
.normal(1, 0, 0)
350-
.endVertex();
351-
}
352-
353-
private void addColoredVertex(IVertexBuilder renderer, MatrixStack stack, Color color, Vector3f position) {
354-
renderer.pos(position.getX(), position.getY(), position.getZ())
355-
.color(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha())
356-
.lightmap(0, 240)
357-
.normal(1, 0, 0)
358-
.endVertex();
359-
}
360-
361320
private void renderRecipeLayer(MiniaturizationRecipe recipe, MatrixStack mx, IRenderTypeBuffer.Impl buffers, IRecipeLayer l, int layerY) {
362321
// Begin layer
363322
mx.push();
@@ -377,9 +336,8 @@ private void renderRecipeLayer(MiniaturizationRecipe recipe, MatrixStack mx, IRe
377336
recipeComponent.ifPresent(state -> {
378337
// renderer.render(renderTe, pos.getX(), pos.getY(), pos.getZ(), 0.0f);
379338

380-
// 0xf000f0
381-
// TODO: RenderTypesExtensions.disableLighting(buffers);
382-
blocks.renderBlock(state, mx, buffers,
339+
// Thanks Immersive, Astral, and others
340+
blocks.renderBlock(state, mx, RenderTypesExtensions.disableLighting(buffers),
383341
0xf000f0, OverlayTexture.NO_OVERLAY, EmptyModelData.INSTANCE);
384342
});
385343

0 commit comments

Comments
 (0)