Rendering optimisations
This commit is contained in:
@@ -33,8 +33,10 @@ public class ClientEventHandler
|
||||
// double maxY = Math.max(BlockHelper.getPos1().getY(), BlockHelper.getPos2().getY()) + constant - projected.getY() + 1;
|
||||
// double maxZ = Math.max(BlockHelper.getPos1().getZ(), BlockHelper.getPos2().getZ()) + constant - projected.getZ() + 1;
|
||||
//
|
||||
// IVertexBuilder builder = Minecraft.getInstance().func_228019_au_().func_228487_b_().getBuffer(RenderType.func_228659_m_());
|
||||
// WorldRenderer.func_228427_a_(event.getMatrixStack(), builder, minX, minY, minZ, maxX, maxY, maxZ, 1.0F, 0.5F, 0.5F, 1.0F);
|
||||
//// event.getMatrixStack().push();
|
||||
// IVertexBuilder builder = Minecraft.getInstance().getRenderTypeBuffers().getBufferSource().getBuffer(RenderType.lines());
|
||||
// WorldRenderer.drawBoundingBox(event.getMatrixStack(), builder, minX, minY, minZ, maxX, maxY, maxZ, 1.0F, 0.5F, 0.5F, 1.0F);
|
||||
//// event.getMatrixStack().pop();
|
||||
//
|
||||
// RenderSystem.pushMatrix();
|
||||
// RenderSystem.disableAlphaTest();
|
||||
@@ -53,24 +55,24 @@ public class ClientEventHandler
|
||||
//
|
||||
// RenderSystem.lineWidth(2.0F);
|
||||
// buffer.begin(3, DefaultVertexFormats.POSITION_COLOR);
|
||||
// buffer.func_225582_a_(minX, minY, minZ).func_225586_a_(color1, color1, color1, 0).endVertex();
|
||||
// buffer.func_225582_a_(minX, minY, minZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(maxX, minY, minZ).func_225586_a_(color1, color2, color2, alpha).endVertex();
|
||||
// buffer.func_225582_a_(maxX, minY, maxZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(minX, minY, maxZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(minX, minY, minZ).func_225586_a_(color2, color2, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(minX, maxY, minZ).func_225586_a_(color2, color1, color2, alpha).endVertex();
|
||||
// buffer.func_225582_a_(maxX, maxY, minZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(maxX, maxY, maxZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(minX, maxY, maxZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(minX, maxY, minZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(minX, maxY, maxZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(minX, minY, maxZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(maxX, minY, maxZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(maxX, maxY, maxZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(maxX, maxY, minZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(maxX, minY, minZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(maxX, minY, minZ).func_225586_a_(color1, color1, color1, 0).endVertex();
|
||||
// buffer.pos(minX, minY, minZ).color(color1, color1, color1, 0).endVertex();
|
||||
// buffer.pos(minX, minY, minZ).color(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.pos(maxX, minY, minZ).color(color1, color2, color2, alpha).endVertex();
|
||||
// buffer.pos(maxX, minY, maxZ).color(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.pos(minX, minY, maxZ).color(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.pos(minX, minY, minZ).color(color2, color2, color1, alpha).endVertex();
|
||||
// buffer.pos(minX, maxY, minZ).color(color2, color1, color2, alpha).endVertex();
|
||||
// buffer.pos(maxX, maxY, minZ).color(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.pos(maxX, maxY, maxZ).color(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.pos(minX, maxY, maxZ).color(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.pos(minX, maxY, minZ).color(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.pos(minX, maxY, maxZ).color(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.pos(minX, minY, maxZ).color(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.pos(maxX, minY, maxZ).color(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.pos(maxX, maxY, maxZ).color(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.pos(maxX, maxY, minZ).color(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.pos(maxX, minY, minZ).color(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.pos(maxX, minY, minZ).color(color1, color1, color1, 0).endVertex();
|
||||
// tesselator.draw();
|
||||
//
|
||||
// RenderSystem.lineWidth(1.0F);
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package exopandora.worldhandler.gui.button;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import exopandora.worldhandler.util.ActionHandler;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
@@ -30,14 +27,6 @@ public class GuiButtonItem extends GuiButtonBase
|
||||
public void renderButton(int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
super.renderBg(Minecraft.getInstance(), mouseX, mouseY);
|
||||
|
||||
RenderSystem.enableRescaleNormal();
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
|
||||
Minecraft.getInstance().getItemRenderer().renderItemIntoGUI(this.stack, this.x + this.width / 2 - 8, this.y + 2);
|
||||
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
RenderSystem.disableRescaleNormal();
|
||||
RenderSystem.enableAlphaTest();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.NoteBlock;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.properties.NoteBlockInstrument;
|
||||
@@ -196,14 +195,12 @@ public class ContentNoteEditor extends Content
|
||||
|
||||
RenderSystem.color3f(1.0F, 1.0F, 1.0F);
|
||||
RenderSystem.pushMatrix();
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
|
||||
RenderSystem.translatef(container.width / 2 - 8 * scale, container.height / 2 - 15 - 8 * scale, 0);
|
||||
RenderSystem.scalef(scale, scale, scale);
|
||||
Minecraft.getInstance().getItemRenderer().renderItemIntoGUI(new ItemStack(Blocks.NOTE_BLOCK), 0, 0);
|
||||
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
RenderSystem.popMatrix();
|
||||
|
||||
RenderSystem.popMatrix();
|
||||
|
||||
String displayString = I18n.format("gui.worldhandler.blocks.note_block_editor.look_at_note_block", KeyHandler.KEY_WORLD_HANDLER.getLocalizedName());
|
||||
FontRenderer fontRenderer = Minecraft.getInstance().fontRenderer;
|
||||
|
||||
@@ -23,7 +23,6 @@ import exopandora.worldhandler.util.CommandHelper;
|
||||
import net.minecraft.block.AbstractSignBlock;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
@@ -181,13 +180,11 @@ public class ContentSignEditor extends Content
|
||||
|
||||
RenderSystem.color3f(1.0F, 1.0F, 1.0F);
|
||||
RenderSystem.pushMatrix();
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
|
||||
RenderSystem.translatef(container.width / 2 - 8.5F * scale, container.height / 2 - 15 - 8.5F * scale, 0);
|
||||
RenderSystem.scalef(scale, scale, scale);
|
||||
Minecraft.getInstance().getItemRenderer().renderItemIntoGUI(new ItemStack(Items.OAK_SIGN), 0, 0);
|
||||
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
RenderSystem.popMatrix();
|
||||
|
||||
String displayString = I18n.format("gui.worldhandler.blocks.sign_editor.look_at_sign", KeyHandler.KEY_WORLD_HANDLER.getLocalizedName());
|
||||
|
||||
Reference in New Issue
Block a user