From 563f235b2f7fbb33644a6a00b4df6ffab1dfbd59 Mon Sep 17 00:00:00 2001 From: Sen Date: Thu, 28 Aug 2025 15:04:19 +0200 Subject: [PATCH] add shaders, remove multi block layer --- client/src/main/java/client/Client.java | 170 ++++--- client/src/main/java/client/gui/Font.java | 6 +- client/src/main/java/client/gui/Gui.java | 4 +- .../java/client/gui/character/GuiChar.java | 29 +- .../client/gui/container/GuiContainer.java | 23 +- .../client/gui/container/GuiMerchant.java | 6 +- .../main/java/client/gui/element/Element.java | 6 +- .../main/java/client/gui/element/Textbox.java | 6 +- .../main/java/client/renderer/Drawing.java | 48 +- .../java/client/renderer/EffectRenderer.java | 12 +- .../main/java/client/renderer/Frustum.java | 6 +- .../main/java/client/renderer/GlState.java | 98 ++-- .../java/client/renderer/ItemRenderer.java | 153 +++--- .../java/client/renderer/MatrixState.java | 16 +- .../main/java/client/renderer/Project.java | 8 +- .../renderer/RegionRenderCacheBuilder.java | 19 +- .../main/java/client/renderer/Renderer.java | 446 +++++++++--------- .../src/main/java/client/renderer/Shader.java | 316 +++++++++++++ .../java/client/renderer/Tessellator.java | 37 +- .../java/client/renderer/VertexBuffer.java | 15 +- .../client/renderer/VertexFormatElement.java | 16 +- .../client/renderer/chunk/BlockLayer.java | 16 - .../chunk/ChunkCompileTaskGenerator.java | 8 +- .../renderer/chunk/ChunkRenderDispatcher.java | 21 +- .../renderer/chunk/ChunkRenderWorker.java | 17 +- .../client/renderer/chunk/CompiledChunk.java | 25 +- .../client/renderer/chunk/RenderChunk.java | 68 ++- .../renderer/entity/RenderArachnoid.java | 8 +- .../client/renderer/entity/RenderArrow.java | 34 +- .../client/renderer/entity/RenderBat.java | 8 +- .../renderer/entity/RenderBlockEntity.java | 14 +- .../client/renderer/entity/RenderBoat.java | 18 +- .../client/renderer/entity/RenderBullet.java | 32 +- .../client/renderer/entity/RenderCat.java | 4 +- .../client/renderer/entity/RenderCrystal.java | 8 +- .../client/renderer/entity/RenderDie.java | 12 +- .../client/renderer/entity/RenderEntity.java | 8 +- .../renderer/entity/RenderEntityItem.java | 30 +- .../renderer/entity/RenderFallingBlock.java | 10 +- .../renderer/entity/RenderFireball.java | 16 +- .../client/renderer/entity/RenderFish.java | 18 +- .../renderer/entity/RenderFlyingBox.java | 12 +- .../client/renderer/entity/RenderHorse.java | 4 +- .../renderer/entity/RenderHumanoid.java | 4 +- .../client/renderer/entity/RenderItem.java | 150 +++--- .../renderer/entity/RenderItemEntity.java | 14 +- .../renderer/entity/RenderLeashKnot.java | 10 +- .../renderer/entity/RenderLightning.java | 6 +- .../client/renderer/entity/RenderLiving.java | 9 +- .../client/renderer/entity/RenderManager.java | 37 +- .../renderer/entity/RenderMinecart.java | 30 +- .../client/renderer/entity/RenderSlime.java | 4 +- .../renderer/entity/RenderSpaceMarine.java | 4 +- .../renderer/entity/RenderTntMinecart.java | 10 +- .../renderer/entity/RenderTntPrimed.java | 16 +- .../java/client/renderer/entity/RenderXp.java | 19 +- .../renderer/entity/RendererLivingEntity.java | 63 ++- .../client/renderer/layers/LayerArmor.java | 26 +- .../client/renderer/layers/LayerArrow.java | 8 +- .../client/renderer/layers/LayerCape.java | 18 +- .../client/renderer/layers/LayerCharge.java | 22 +- .../renderer/layers/LayerEntityBreak.java | 28 +- .../client/renderer/layers/LayerExtra.java | 46 +- .../client/renderer/layers/LayerHeldItem.java | 10 +- .../client/renderer/layers/LayerSlimeGel.java | 4 +- .../client/renderer/model/ModelArachnoid.java | 12 +- .../client/renderer/model/ModelBiped.java | 8 +- .../java/client/renderer/model/ModelCat.java | 18 +- .../client/renderer/model/ModelChicken.java | 16 +- .../client/renderer/model/ModelCrystal.java | 28 +- .../client/renderer/model/ModelDragon.java | 34 +- .../java/client/renderer/model/ModelFox.java | 16 +- .../client/renderer/model/ModelHorse.java | 28 +- .../client/renderer/model/ModelHumanoid.java | 8 +- .../client/renderer/model/ModelMouse.java | 10 +- .../client/renderer/model/ModelQuadruped.java | 16 +- .../client/renderer/model/ModelRabbit.java | 16 +- .../client/renderer/model/ModelRenderer.java | 70 +-- .../java/client/renderer/model/ModelWolf.java | 16 +- .../client/renderer/model/TexturedQuad.java | 4 +- .../java/client/renderer/texture/Texture.java | 4 +- .../client/renderer/texture/TextureUtil.java | 25 +- .../renderer/tileentity/DisplayRenderer.java | 14 +- .../renderer/tileentity/ItemPipeRenderer.java | 14 +- .../renderer/tileentity/SignRenderer.java | 30 +- .../renderer/tileentity/SpecialRenderer.java | 4 +- .../src/main/java/client/util/FileUtils.java | 12 +- .../src/main/java/client/window/Window.java | 171 ++++--- .../main/java/client/window/WindowAction.java | 1 - client/src/main/resources/shaders/blit.fsh | 9 + client/src/main/resources/shaders/blit.vsh | 8 + client/src/main/resources/shaders/grid.fsh | 38 ++ client/src/main/resources/shaders/grid.vsh | 16 + .../src/main/resources/shaders/lightmap.fsh | 8 + .../src/main/resources/shaders/lightmap.vsh | 7 + client/src/main/resources/shaders/vis.fsh | 7 + client/src/main/resources/shaders/vis.vsh | 15 + client/src/main/resources/shaders/world.fsh | 87 ++++ client/src/main/resources/shaders/world.vsh | 20 + common/src/main/java/common/block/Block.java | 5 - .../common/block/artificial/BlockBed.java | 5 - .../common/block/artificial/BlockCake.java | 6 - .../common/block/artificial/BlockDoor.java | 5 - .../block/artificial/BlockFlowerPot.java | 6 - .../common/block/artificial/BlockGlass.java | 6 - .../common/block/artificial/BlockLadder.java | 6 - .../common/block/artificial/BlockPane.java | 6 - .../common/block/artificial/BlockSlab.java | 6 - .../block/artificial/BlockTrapDoor.java | 6 - .../java/common/block/foliage/BlockBush.java | 6 - .../common/block/foliage/BlockCactus.java | 6 - .../java/common/block/foliage/BlockGrass.java | 6 - .../common/block/foliage/BlockLeavesBase.java | 6 - .../common/block/foliage/BlockMycelium.java | 6 - .../java/common/block/foliage/BlockReed.java | 6 - .../java/common/block/foliage/BlockSwamp.java | 6 - .../common/block/foliage/BlockTianSoil.java | 6 - .../java/common/block/foliage/BlockVine.java | 6 - .../java/common/block/natural/BlockFire.java | 6 - .../common/block/natural/BlockPodzol.java | 6 - .../java/common/block/natural/BlockWeb.java | 6 - .../common/block/tech/BlockBrewingStand.java | 5 - .../block/tech/BlockEffectGenerator.java | 6 - .../java/common/block/tech/BlockHook.java | 6 - .../java/common/block/tech/BlockPipe.java | 5 - .../java/common/block/tech/BlockRail.java | 6 - .../java/common/block/tech/BlockString.java | 6 - .../java/common/block/tech/BlockTorch.java | 6 - .../java/common/block/tech/BlockWire.java | 6 - 129 files changed, 1848 insertions(+), 1486 deletions(-) create mode 100644 client/src/main/java/client/renderer/Shader.java delete mode 100755 client/src/main/java/client/renderer/chunk/BlockLayer.java create mode 100644 client/src/main/resources/shaders/blit.fsh create mode 100644 client/src/main/resources/shaders/blit.vsh create mode 100644 client/src/main/resources/shaders/grid.fsh create mode 100644 client/src/main/resources/shaders/grid.vsh create mode 100644 client/src/main/resources/shaders/lightmap.fsh create mode 100644 client/src/main/resources/shaders/lightmap.vsh create mode 100644 client/src/main/resources/shaders/vis.fsh create mode 100644 client/src/main/resources/shaders/vis.vsh create mode 100644 client/src/main/resources/shaders/world.fsh create mode 100644 client/src/main/resources/shaders/world.vsh diff --git a/client/src/main/java/client/Client.java b/client/src/main/java/client/Client.java index 7aa10a09..a2bc6da9 100755 --- a/client/src/main/java/client/Client.java +++ b/client/src/main/java/client/Client.java @@ -30,8 +30,7 @@ import javax.imageio.ImageIO; import javax.swing.JFileChooser; import org.lwjgl.opengl.GL; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL13; +import org.lwjgl.opengl.GL46; import client.audio.AudioInterface; import client.audio.MidiBank; @@ -63,6 +62,7 @@ import client.network.DummyConnection; import client.renderer.Drawing; import client.renderer.EffectRenderer; import client.renderer.Renderer; +import client.renderer.Shader; import client.renderer.GlState; import client.renderer.ItemRenderer; import client.renderer.blockmodel.ModelManager; @@ -201,7 +201,7 @@ import common.world.World; Gehäuse : Pappkarton, Bierkasten oder auch gar keins Tastatur : Hlb fktonrnd odr bsr Maus : Aus Plastik oder mit extra Quietsch-Effekt - Monitor : Olle Röhre oder gebrochener Flachbild (Mindestens 1280x800) + Monitor : Olle Röhre oder gebrochener Flachbild (Mindestens 800x450) Stuhl : Interessiert niemanden (sonst siehe Gehäuse) [[oder einfach einen Toaster mit nem LCD und Maus]] @@ -286,6 +286,12 @@ public class Client implements IThreadListener { Client.CLIENT.setMidiDebug(); } } + + public static class MaxLightFunction implements IntFunction { + public void apply(IntVar cv, int value) { + Client.CLIENT.lightSetup(); + } + } private interface DebugRunner { void execute(Keysym key); @@ -654,6 +660,36 @@ public class Client implements IThreadListener { public boolean midiDebug = false; @Variable(name = "mid_visualizer", category = CVarCategory.SOUND, display = "Visualisation") public boolean midiVisualizer = true; + + @Variable(name = "gl_light_blend", category = CVarCategory.RENDER, min = 0.0f, max = 1.0f, precision = 2, unit = "%", display = "Lichtüberdeckung") + public float lightBlend = 0.5f; + @Variable(name = "gl_dynlight_maxdist", category = CVarCategory.RENDER, min = 1.0f, max = 10000.0f, display = "Entfernung Lichtq. -> Mitte") + public float lightDistVert = 128.0f; + @Variable(name = "gl_dynlight_viewdist", category = CVarCategory.RENDER, min = 1.0f, max = 10000.0f, display = "Entfernung Lichtq. -> Kamera") + public float lightDistCam = 256.0f; + + public float ambientX = 0.1f; + public float ambientY = -1.0f; + public float ambientZ = 0.2f; + + @Variable(name = "gl_dynlight_max", category = CVarCategory.RENDER, min = 0, max = 112, display = "Max. Dyn. Lichtquellen", callback = MaxLightFunction.class) + public int lightMaximum = 64; + @Variable(name = "gl_dynlight_chunkrange", category = CVarCategory.RENDER, min = 0, max = 64, display = "Lichtq. Sichtweite") + public int lightDistance = 8; + +// int ldist_chunk_xz; +// int ldist_chunk_y; + +// "gl_tex_filter", "Texturfilterung", tex_filter, true +// "gl_tex_mipmaps", "Mipmaps", tex_miptype, MIP_NONE, MIP_NEAREST, MIP_LINEAR, "off", "nearest", "linear", "Keine", "Nächster nachbar", "Linear interpoliert", MIP_LINEAR +// "gl_tex_anisotropic", "Anisotrope Filterung", tex_aniso, 1.0f (1.0f - 16.0f) + +// float aniso_max; +// float tex_aniso; +// +// byte tex_miptype; +// byte tex_miplevel; +// byte tex_filter; public static final Client CLIENT = new Client(); @@ -805,22 +841,22 @@ public class Client implements IThreadListener { this.textureManager.onReload(); this.soundManager = new SoundManager(this); GlState.enableTexture2D(); - GlState.shadeModel(GL11.GL_SMOOTH); - GL11.glClearDepth(1.0D); + GlState.shadeModel(GL46.GL_SMOOTH); + GL46.glClearDepth(1.0D); GlState.enableDepth(); - GlState.depthFunc(GL11.GL_LEQUAL); + GlState.depthFunc(GL46.GL_LEQUAL); GlState.enableAlpha(); - GlState.alphaFunc(GL11.GL_GREATER, 0.1F); - GlState.cullFace(GL11.GL_BACK); + GlState.alphaFunc(GL46.GL_GREATER, 0.1F); + GlState.cullFace(GL46.GL_BACK); GlState.enableCull(); - GL11.glMatrixMode(GL11.GL_PROJECTION); - GL11.glLoadIdentity(); - GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL46.glMatrixMode(GL46.GL_PROJECTION); + GL46.glLoadIdentity(); + GL46.glMatrixMode(GL46.GL_MODELVIEW); this.textureMap = new TextureMap(); this.textureManager.loadTexture(TextureMap.BLOCKS, this.textureMap); this.textureManager.bindTexture(TextureMap.BLOCKS); - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); + GL46.glTexParameteri(GL46.GL_TEXTURE_2D, GL46.GL_TEXTURE_MIN_FILTER, GL46.GL_NEAREST); + GL46.glTexParameteri(GL46.GL_TEXTURE_2D, GL46.GL_TEXTURE_MAG_FILTER, GL46.GL_NEAREST); this.modelManager = new ModelManager(this.textureMap); this.modelManager.onReload(); this.renderItem = new RenderItem(this.textureManager, this.modelManager); @@ -1046,13 +1082,13 @@ public class Client implements IThreadListener { } public void render() { - GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA, GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA); GlState.enableDepth(); GlState.clearColor(0.0f, 0.0f, 0.0f, 1.0f); - GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); + GL46.glClear(GL46.GL_COLOR_BUFFER_BIT | GL46.GL_DEPTH_BUFFER_BIT); if(this.wireframe) { - GL11.glLineWidth(1.0f); - GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_LINE); + GL46.glLineWidth(1.0f); + GL46.glPolygonMode(GL46.GL_FRONT_AND_BACK, GL46.GL_LINE); } if(this.open == null) { if(this.player != null && this.viewEntity == this.player) @@ -1065,18 +1101,18 @@ public class Client implements IThreadListener { this.soundManager.setListener(this.player, (float)this.tickFraction); if(this.player != null && (this.player.isEntityInsideOpaqueBlock() || this.viewEntity != this.player)) this.thirdPersonView = 0; - GL11.glPushMatrix(); - GL11.glClear(16640); + GL46.glPushMatrix(); + GL46.glClear(16640); GlState.enableTexture2D(); if(this.world != null) this.renderer.renderWorld((float)this.tickFraction, System.nanoTime() - this.tickStart); - GL11.glPopMatrix(); + GL46.glPopMatrix(); GlState.disableTexture2D(); GlState.disableCull(); GlState.enableBlend(); if(this.wireframe) - GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_FILL); + GL46.glPolygonMode(GL46.GL_FRONT_AND_BACK, GL46.GL_FILL); } private int drawStat(int x, int y, String name, int value, int max, int color) { @@ -1273,17 +1309,17 @@ public class Client implements IThreadListener { } GlState.bindTexture(0); - GlState.setActiveTexture(GL13.GL_TEXTURE0); + GlState.setActiveTexture(GL46.GL_TEXTURE0); GlState.enableTexture2D(); if(this.world != null && this.open == null && this.player != null && this.viewEntity == this.player) { GlState.enableRescaleNormal(); GlState.enableBlend(); GlState.color(1.0F, 1.0F, 1.0F, 1.0F); ItemRenderer.enableGUIStandardItemLighting(); - GL11.glPushMatrix(); - GL11.glTranslatef(0.0f, (float)by, 0.0f); + GL46.glPushMatrix(); + GL46.glTranslatef(0.0f, (float)by, 0.0f); if(this.scaleHotbar) - GL11.glScalef(2.0f, 2.0f, 2.0f); + GL46.glScalef(2.0f, 2.0f, 2.0f); int xPos = xoff; for(int index = 0; index < size; ++index) { @@ -1291,12 +1327,12 @@ public class Client implements IThreadListener { if(itemstack != null) { if(width < 20 && selected != index && selected != index + 1 && index != size - 1) { this.scissor(xPos * scale, this.fbY - (by + 16 * scale), (width - 1) * scale, 16 * scale); - GL11.glEnable(GL11.GL_SCISSOR_TEST); + GL46.glEnable(GL46.GL_SCISSOR_TEST); } GlState.enableDepth(); this.renderItem.renderItemAndEffectIntoGUI(itemstack, xPos, 0); if(width < 20 && selected != index && selected != index + 1 && index != size - 1) - GL11.glDisable(GL11.GL_SCISSOR_TEST); + GL46.glDisable(GL46.GL_SCISSOR_TEST); } xPos += width >= 20 || selected == index || selected == index + 1 ? 20 : width; } @@ -1308,16 +1344,16 @@ public class Client implements IThreadListener { else if(this.pointed != null && this.pointed.type == ObjectType.ENTITY && this.pointed.entity != null) item = this.pointed.entity.getItem(); if(item != null) { - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef((float)(this.fbX / 2 - 180 + 4 + 1), (float)(this.hudMargin + 20 + 1), 0.0f); - GL11.glScalef(2.0f, 2.0f, 2.0f); + GL46.glPopMatrix(); + GL46.glPushMatrix(); + GL46.glTranslatef((float)(this.fbX / 2 - 180 + 4 + 1), (float)(this.hudMargin + 20 + 1), 0.0f); + GL46.glScalef(2.0f, 2.0f, 2.0f); GlState.enableDepth(); this.renderItem.renderItemAndEffectIntoGUI(new ItemStack(item), 0, 0); } } - GL11.glPopMatrix(); + GL46.glPopMatrix(); ItemRenderer.disableStandardItemLighting(); GlState.disableRescaleNormal(); GlState.disableBlend(); @@ -1386,8 +1422,8 @@ public class Client implements IThreadListener { "Tickrate: %s%.2f" + Color.RESET + " %s [" + Color.GREEN + "%.1f" + Color.RESET + "], %.3f ms, E %d ms" + "%s%s" , - GL11.glGetString(GL11.GL_VERSION), - GL11.glGetString(GL11.GL_RENDERER), GL11.glGetString(GL11.GL_VENDOR), + GL46.glGetString(GL46.GL_VERSION), + GL46.glGetString(GL46.GL_RENDERER), GL46.glGetString(GL46.GL_VENDOR), this.framecode(), this.framerate < 1.0f ? 1.0f / this.framerate : this.framerate, this.framerate < 1.0f ? "SPF" : "FPS", this.vsync ? Color.DARK_GRAY + "VSYNC" : (this.syncLimited ? Color.GREEN + "" + this.syncLimit : Color.RED + "UNL"), (float)PerfSection.getTotal(false) / 1000.0f, this.fbRawX, this.fbRawY, @@ -2072,7 +2108,7 @@ public class Client implements IThreadListener { } private void fbsize(int x, int y) { - GL11.glViewport(0, 0, x, y); + GL46.glViewport(0, 0, x, y); this.fbRawX = x; this.fbRawY = y; this.rescale(); @@ -2209,9 +2245,6 @@ public class Client implements IThreadListener { case POSITION: pos(event.param1(), event.param2()); break; - case REDRAW: - // redraw(); disable as it is pretty useless - break; case RESIZE: fbsize(event.param1(), event.param2()); break; @@ -2258,22 +2291,22 @@ public class Client implements IThreadListener { public void setupOverlay() { GlState.disableDepth(); - GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); - GlState.setActiveTexture(GL13.GL_TEXTURE0); + GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ONE_MINUS_SRC_ALPHA); + GlState.setActiveTexture(GL46.GL_TEXTURE0); GlState.color(1.0f, 1.0f, 1.0f, 1.0f); - GL11.glClear(256); - GL11.glMatrixMode(GL11.GL_PROJECTION); - GL11.glLoadIdentity(); - GL11.glOrtho(0.0D, (double)this.fbRawX, (double)this.fbRawY, 0.0D, 1000.0D, 3000.0D); - GL11.glMatrixMode(GL11.GL_MODELVIEW); - GL11.glLoadIdentity(); - GL11.glTranslatef(0.0F, 0.0F, -2000.0F); + GL46.glClear(256); + GL46.glMatrixMode(GL46.GL_PROJECTION); + GL46.glLoadIdentity(); + GL46.glOrtho(0.0D, (double)this.fbRawX, (double)this.fbRawY, 0.0D, 1000.0D, 3000.0D); + GL46.glMatrixMode(GL46.GL_MODELVIEW); + GL46.glLoadIdentity(); + GL46.glTranslatef(0.0F, 0.0F, -2000.0F); if(this.scale != 1) - GL11.glScalef((float)this.scale, (float)this.scale, 1.0f); + GL46.glScalef((float)this.scale, (float)this.scale, 1.0f); } public void scissor(int x, int y, int width, int height) { - GL11.glScissor(x * this.scale, y * this.scale, width * this.scale, height * this.scale); + GL46.glScissor(x * this.scale, y * this.scale, width * this.scale, height * this.scale); } private void addFrame(long runningTime) @@ -2312,13 +2345,14 @@ public class Client implements IThreadListener { public void run(long time) { if(!Window.createWindow(VERSION, System.getProperty("opengl.debug") != null)) System.exit(1); - if(!GL.getCapabilities().OpenGL15) { + GL.createCapabilities(); + if(!GL.getCapabilities().OpenGL46) { Window.destroyWindow(); - Util.panic("Inkompatible OpenGL-Version", "OpenGL 1.5 oder höher ist erforderlich, um dieses Programm auszuführen."); + Util.panic("Inkompatible OpenGL-Version", "OpenGL 4.6 oder höher ist erforderlich, um dieses Programm auszuführen."); } - Log.SYSTEM.info("OpenGL %s", GL11.glGetString(GL11.GL_VERSION)); - Log.SYSTEM.info("GL_VENDOR: %s", GL11.glGetString(GL11.GL_VENDOR)); - Log.SYSTEM.info("GL_RENDERER: %s", GL11.glGetString(GL11.GL_RENDERER)); + Log.SYSTEM.info("OpenGL %s", GL46.glGetString(GL46.GL_VERSION)); + Log.SYSTEM.info("GL_VENDOR: %s", GL46.glGetString(GL46.GL_VENDOR)); + Log.SYSTEM.info("GL_RENDERER: %s", GL46.glGetString(GL46.GL_RENDERER)); Log.SYSTEM.info("Starte ..."); this.init(); @@ -2328,8 +2362,9 @@ public class Client implements IThreadListener { Font.loadFonts(); Font.select(this.font); GlState.enableBlend(); - GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlState.blendFunc(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA); this.initConsole(); + Shader.loadShaders(); this.startSound(true); this.vidMode = Window.getDisplayMode(); if(this.vidMode != null && (this.vidMode.width() < MIN_WIDTH || this.vidMode.height() < MIN_HEIGHT)) @@ -2358,7 +2393,7 @@ public class Client implements IThreadListener { Bind.updateBinds(); this.input(); Bind.enableInput(); - GlState.setActiveTexture(GL13.GL_TEXTURE0); + GlState.setActiveTexture(GL46.GL_TEXTURE0); GlState.bindTexture(0); this.inputGui(); if(this.open != null) @@ -2375,7 +2410,7 @@ public class Client implements IThreadListener { this.finish(); PerfSection.SWAP.enter(); if(this.glFlush) - GL11.glFlush(); + GL46.glFlush(); Window.swapBuffers(); PerfSection.EVENTS.enter(); Log.flushLog(); @@ -2399,6 +2434,7 @@ public class Client implements IThreadListener { Log.flushLog(); this.save(); Font.unloadFonts(); + Shader.unloadShaders(); Window.destroyWindow(); Log.SYSTEM.info("Beendet."); } @@ -2469,7 +2505,7 @@ public class Client implements IThreadListener { this.saving = true; final int stride = ((this.fbRawX * 3) & 3) != 0 ? 4 + ((this.fbRawX * 3) & ~3) : (this.fbRawX * 3); final ByteBuffer data = ByteBuffer.allocateDirect(stride * this.fbRawY).order(ByteOrder.nativeOrder()); - GL11.glReadPixels(0, 0, this.fbRawX, this.fbRawY, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, data); + GL46.glReadPixels(0, 0, this.fbRawX, this.fbRawY, GL46.GL_RGB, GL46.GL_UNSIGNED_BYTE, data); new Thread(new Runnable() { public void run() { byte[] pixels = new byte[stride * Client.this.fbRawY]; @@ -3209,17 +3245,17 @@ public class Client implements IThreadListener { private void renderWorldDirections(float partialTicks) { GlState.enableBlend(); - GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); - GL11.glLineWidth(1.0F); + GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ZERO); + GL46.glLineWidth(1.0F); GlState.disableTexture2D(); GlState.depthMask(false); - GL11.glPushMatrix(); - GL11.glTranslatef((float)(this.fbX / 2), (float)(this.fbY / 2), 0.0F); + GL46.glPushMatrix(); + GL46.glTranslatef((float)(this.fbX / 2), (float)(this.fbY / 2), 0.0F); this.renderer.rotateCamera(this.viewEntity, partialTicks, true); Renderer.drawOutlinedBoundingBox(new BoundingBox(0.0D, 0.0D, 0.0D, 24D, 1D, 1D), 255, 0, 0, 255); Renderer.drawOutlinedBoundingBox(new BoundingBox(0.0D, 0.0D, 0.0D, 1D, 1D, 24D), 0, 0, 255, 255); Renderer.drawOutlinedBoundingBox(new BoundingBox(0.0D, 0.0D, 0.0D, 1D, -20D, 1D), 0, 255, 0, 255); - GL11.glPopMatrix(); + GL46.glPopMatrix(); GlState.depthMask(true); GlState.enableTexture2D(); GlState.disableBlend(); @@ -3775,6 +3811,14 @@ public class Client implements IThreadListener { public List getTiles() { return this.tiles; } + + public void lightSetup() { + Shader.WORLD.update(); +// if(win->world) { +// glNamedBufferData(win->world->light_buf, LIGHT_SSIZE * gdr.light_max, NULL, GL_DYNAMIC_DRAW); +// light_calc(win->world); +// } + } private static byte[] genTriwave(int w, int h, int color1, int color2, int color3, int color4, int color5, int color6) { byte[] data = new byte[w * h * 4]; diff --git a/client/src/main/java/client/gui/Font.java b/client/src/main/java/client/gui/Font.java index 7fcf1266..7516f31a 100644 --- a/client/src/main/java/client/gui/Font.java +++ b/client/src/main/java/client/gui/Font.java @@ -4,7 +4,7 @@ import java.awt.image.BufferedImage; import java.io.FileNotFoundException; import java.io.IOException; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.GlState; import client.renderer.texture.TextureUtil; @@ -110,7 +110,7 @@ public enum Font implements Identifyable, Displayable { int[] data = new int[width * 16 * height * 16]; img.getRGB(0, 0, width * 16, height * 16, data, 0, width * 16); calculate(data, font.sizes, width, height, 0); - font.texture = GL11.glGenTextures(); + font.texture = GL46.glGenTextures(); TextureUtil.uploadImage(font.texture, img); Log.RENDER.debug("Font-Textur wurde mit ID #%d geladen", font.texture); } @@ -141,7 +141,7 @@ public enum Font implements Identifyable, Displayable { public static void unloadFonts() { for(Font font : values()) { if(font.texture != 0) { - GL11.glDeleteTextures(font.texture); + GL46.glDeleteTextures(font.texture); Log.RENDER.debug("Font-Textur mit ID #%d wurde gelöscht", font.texture); font.texture = 0; } diff --git a/client/src/main/java/client/gui/Gui.java b/client/src/main/java/client/gui/Gui.java index 753d011d..e9fc01da 100644 --- a/client/src/main/java/client/gui/Gui.java +++ b/client/src/main/java/client/gui/Gui.java @@ -2,7 +2,7 @@ package client.gui; import java.util.List; -import org.lwjgl.opengl.GL13; +import org.lwjgl.opengl.GL46; import client.Client; import client.gui.element.Dropdown; @@ -230,7 +230,7 @@ public abstract class Gui { if(this.gm.fbX != 0 && this.gm.fbY != 0) this.draw(); GlState.bindTexture(0); - GlState.setActiveTexture(GL13.GL_TEXTURE0); + GlState.setActiveTexture(GL46.GL_TEXTURE0); GlState.enableTexture2D(); GlState.disableDepth(); this.drawPost(); diff --git a/client/src/main/java/client/gui/character/GuiChar.java b/client/src/main/java/client/gui/character/GuiChar.java index af880a77..c476178c 100755 --- a/client/src/main/java/client/gui/character/GuiChar.java +++ b/client/src/main/java/client/gui/character/GuiChar.java @@ -12,8 +12,7 @@ import java.util.List; import javax.imageio.ImageIO; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL13; +import org.lwjgl.opengl.GL46; import client.Client; import client.Client.FileMode; @@ -614,41 +613,41 @@ public class GuiChar extends GuiList GlState.color(1.0F, 1.0F, 1.0F, 1.0F); GlState.enableDepth(); GlState.enableColorMaterial(); - GL11.glPushMatrix(); - GL11.glTranslatef((float)posX, (float)posY, 200.0F); - GL11.glScalef(-scale, scale, scale); - GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + GL46.glPushMatrix(); + GL46.glTranslatef((float)posX, (float)posY, 200.0F); + GL46.glScalef(-scale, scale, scale); + GL46.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); float f = ent.yawOffset; float f1 = ent.rotYaw; float f2 = ent.rotPitch; float f3 = ent.prevHeadYaw; float f4 = ent.headYaw; - GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(135.0F, 0.0F, 1.0F, 0.0F); ItemRenderer.enableStandardItemLighting(); - GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(0.0F, ent.height / 2, 0.0F); - GL11.glRotatef(-pitch, 1.0F, 0.0F, 0.0F); + GL46.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); + GL46.glTranslatef(0.0F, ent.height / 2, 0.0F); + GL46.glRotatef(-pitch, 1.0F, 0.0F, 0.0F); ent.yawOffset = yaw; ent.rotYaw = yaw; ent.rotPitch = 0.0f; ent.headYaw = ent.rotYaw; ent.prevHeadYaw = ent.rotYaw; - GL11.glTranslatef(0.0F, -(ent.height / 2), 0.0F); + GL46.glTranslatef(0.0F, -(ent.height / 2), 0.0F); RenderManager rendermanager = Client.CLIENT.getRenderManager(); rendermanager.setPlayerViewY(180.0F); rendermanager.renderEntity(ent, 0.0D, 0.0D, 0.0D, 1.0F); -// GL11.glTranslatef(0.0F, 0.0F, 0.0F); +// GL46.glTranslatef(0.0F, 0.0F, 0.0F); ent.yawOffset = f; ent.rotYaw = f1; ent.rotPitch = f2; ent.prevHeadYaw = f3; ent.headYaw = f4; - GL11.glPopMatrix(); + GL46.glPopMatrix(); ItemRenderer.disableStandardItemLighting(); GlState.disableRescaleNormal(); - GlState.setActiveTexture(GL13.GL_TEXTURE1); + GlState.setActiveTexture(GL46.GL_TEXTURE1); GlState.disableTexture2D(); - GlState.setActiveTexture(GL13.GL_TEXTURE0); + GlState.setActiveTexture(GL46.GL_TEXTURE0); GlState.disableDepth(); } } diff --git a/client/src/main/java/client/gui/container/GuiContainer.java b/client/src/main/java/client/gui/container/GuiContainer.java index 7ca5a3fb..f140c5c9 100755 --- a/client/src/main/java/client/gui/container/GuiContainer.java +++ b/client/src/main/java/client/gui/container/GuiContainer.java @@ -7,8 +7,7 @@ import java.util.Map; import java.util.Set; import java.util.Map.Entry; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL13; +import org.lwjgl.opengl.GL46; import client.Client; import client.gui.Font; @@ -333,10 +332,10 @@ public abstract class GuiContainer extends Gui } if(this.gm.itemCheat) { - GL11.glPushMatrix(); - GL11.glTranslatef(-(float)((this.gm.fbX - this.xSize * this.container_scale) / 2) * (1.0f / (float)this.container_scale), -(float)((this.gm.fbY - this.ySize * this.container_scale) / 2) * (1.0f / (float)this.container_scale), 0.0f); + GL46.glPushMatrix(); + GL46.glTranslatef(-(float)((this.gm.fbX - this.xSize * this.container_scale) / 2) * (1.0f / (float)this.container_scale), -(float)((this.gm.fbY - this.ySize * this.container_scale) / 2) * (1.0f / (float)this.container_scale), 0.0f); if(this.container_scale != 1) - GL11.glScalef(1.0f / (float)this.container_scale, 1.0f / (float)this.container_scale, 1.0f / (float)this.container_scale); + GL46.glScalef(1.0f / (float)this.container_scale, 1.0f / (float)this.container_scale, 1.0f / (float)this.container_scale); int i = (ITEM_LIST.size() + this.cheatWidth - 1) / this.cheatWidth - this.cheatHeight; int j = (int)((double)(this.currentScroll * (float)i) + 0.5D); @@ -367,7 +366,7 @@ public abstract class GuiContainer extends Gui { this.drawTab(tabs); } - GL11.glPopMatrix(); + GL46.glPopMatrix(); } } @@ -422,7 +421,7 @@ public abstract class GuiContainer extends Gui this.theSlot = null; int k = 240; int l = 240; - GL13.glMultiTexCoord2f(GL13.GL_TEXTURE1, (float)k / 1.0F, (float)l / 1.0F); + GL46.glMultiTexCoord2f(GL46.GL_TEXTURE1, (float)k / 1.0F, (float)l / 1.0F); GlState.color(1.0F, 1.0F, 1.0F, 1.0F); this.drawSlots(mouseX, mouseY); @@ -488,7 +487,7 @@ public abstract class GuiContainer extends Gui private void drawItemStack(ItemStack stack, int x, int y, String altText) { - GL11.glTranslatef(0.0F, 0.0F, 32.0F); + GL46.glTranslatef(0.0F, 0.0F, 32.0F); this.itemRender.zLevel = 200.0F; this.itemRender.renderItemAndEffectIntoGUI(stack, x, y); this.drawnOverlays.add(new Overlay(stack, x, y, altText)); @@ -527,12 +526,12 @@ public abstract class GuiContainer extends Gui } public void drawPost() { - GL11.glPushMatrix(); - GL11.glTranslatef((float)((this.gm.fbX - this.xSize * this.container_scale) / 2), (float)((this.gm.fbY - this.ySize * this.container_scale) / 2), 0.0f); + GL46.glPushMatrix(); + GL46.glTranslatef((float)((this.gm.fbX - this.xSize * this.container_scale) / 2), (float)((this.gm.fbY - this.ySize * this.container_scale) / 2), 0.0f); if(this.container_scale != 1) - GL11.glScalef((float)this.container_scale, (float)this.container_scale, (float)this.container_scale); + GL46.glScalef((float)this.container_scale, (float)this.container_scale, (float)this.container_scale); this.drawScreen((this.gm.mouseX - this.container_x) / this.container_scale, (this.gm.mouseY - this.container_y) / this.container_scale); - GL11.glPopMatrix(); + GL46.glPopMatrix(); ItemRenderer.disableStandardItemLighting(); } diff --git a/client/src/main/java/client/gui/container/GuiMerchant.java b/client/src/main/java/client/gui/container/GuiMerchant.java index 8e786752..333df8da 100755 --- a/client/src/main/java/client/gui/container/GuiMerchant.java +++ b/client/src/main/java/client/gui/container/GuiMerchant.java @@ -1,6 +1,6 @@ package client.gui.container; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.gui.element.ActButton; import client.gui.element.ButtonCallback; @@ -96,7 +96,7 @@ public class GuiMerchant extends GuiContainer implements ButtonCallback { ItemStack itemstack = merchantrecipe.first(); ItemStack itemstack1 = merchantrecipe.second(); ItemStack itemstack2 = merchantrecipe.result(); - GL11.glPushMatrix(); + GL46.glPushMatrix(); ItemRenderer.enableGUIStandardItemLighting(); GlState.disableLighting(); GlState.enableRescaleNormal(); @@ -123,7 +123,7 @@ public class GuiMerchant extends GuiContainer implements ButtonCallback { this.renderToolTip(itemstack2, mouseX, mouseY); } - GL11.glPopMatrix(); + GL46.glPopMatrix(); GlState.enableLighting(); GlState.enableDepth(); ItemRenderer.enableStandardItemLighting(); diff --git a/client/src/main/java/client/gui/element/Element.java b/client/src/main/java/client/gui/element/Element.java index 966c7970..e4b437df 100644 --- a/client/src/main/java/client/gui/element/Element.java +++ b/client/src/main/java/client/gui/element/Element.java @@ -1,6 +1,6 @@ package client.gui.element; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.Client; import client.gui.Formatter; @@ -222,7 +222,7 @@ public abstract class Element { int y2 = this.size_y - (this.margin_y1 + this.margin_y2); // if(elem.type == ElemType.FIELD) { this.gm.scissor(x1 < 0 ? 0 : x1, (this.gm.fbY - (y1 + y2)) < 0 ? 0 : (this.gm.fbY - (y1 + y2)), x2 < 0 ? 0 : x2, y2 < 0 ? 0 : y2); - GL11.glEnable(GL11.GL_SCISSOR_TEST); + GL46.glEnable(GL46.GL_SCISSOR_TEST); // } // if(this.type == ElemType.CUSTOM) // this.func(this, 1); @@ -230,7 +230,7 @@ public abstract class Element { this.drawForeground(x1, y1, x2, y2); // logd("DBG", "%d @ %d %d -> %d %d", elem.id, x1, y1, elem.pos_x + x2, elem.pos_y + y2); // if(elem.type == ElemType.FIELD) { - GL11.glDisable(GL11.GL_SCISSOR_TEST); + GL46.glDisable(GL46.GL_SCISSOR_TEST); // glScissor(0, 0, sys.fb_x, sys.fb_y); // } } diff --git a/client/src/main/java/client/gui/element/Textbox.java b/client/src/main/java/client/gui/element/Textbox.java index 7dc94f69..3b78d555 100644 --- a/client/src/main/java/client/gui/element/Textbox.java +++ b/client/src/main/java/client/gui/element/Textbox.java @@ -1,6 +1,6 @@ package client.gui.element; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.gui.Font; import client.renderer.Drawing; @@ -242,9 +242,9 @@ abstract class Textbox extends Element { int x2 = this.size_x - (this.margin_x1 + this.margin_x2); int y2 = this.size_y - (this.margin_y1 + this.margin_y2); this.gm.scissor(x1 < 0 ? 0 : x1, (this.gm.fbY - (y1 + y2)) < 0 ? 0 : (this.gm.fbY - (y1 + y2)), x2 < 0 ? 0 : x2, y2 < 0 ? 0 : y2); - GL11.glEnable(GL11.GL_SCISSOR_TEST); + GL46.glEnable(GL46.GL_SCISSOR_TEST); Drawing.drawRect(this.getCursorX(x1, x2), this.getCursorY(y1, y2), 1, Font.HEIGHT, 0xff000000 | (~Util.mixColor(this.gm.style.field_top, this.gm.style.field_btm))); - GL11.glDisable(GL11.GL_SCISSOR_TEST); + GL46.glDisable(GL46.GL_SCISSOR_TEST); } } diff --git a/client/src/main/java/client/renderer/Drawing.java b/client/src/main/java/client/renderer/Drawing.java index 0d44105a..1442bb41 100644 --- a/client/src/main/java/client/renderer/Drawing.java +++ b/client/src/main/java/client/renderer/Drawing.java @@ -1,6 +1,6 @@ package client.renderer; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.Client; import client.gui.Font; @@ -33,12 +33,12 @@ public abstract class Drawing { GlState.enableTexture2D(); GlState.enableBlend(); GlState.disableAlpha(); - GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); - GlState.shadeModel(GL11.GL_SMOOTH); + GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ZERO); + GlState.shadeModel(GL46.GL_SMOOTH); GlState.color(1.0f, 1.0f, 1.0f, 1.0f); Font.bindTexture(); RenderBuffer rb = Tessellator.getBuffer(); - rb.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR); + rb.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR); int h = Font.HEIGHT; int tx, ty, u, v; FontChar glyph; @@ -79,7 +79,7 @@ public abstract class Drawing { x += u; } Tessellator.draw(); - GlState.shadeModel(GL11.GL_FLAT); + GlState.shadeModel(GL46.GL_FLAT); GlState.disableBlend(); GlState.enableAlpha(); GlState.enableTexture2D(); @@ -292,12 +292,12 @@ public abstract class Drawing { GlState.enableTexture2D(); GlState.enableBlend(); GlState.disableAlpha(); - GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); - GlState.shadeModel(GL11.GL_SMOOTH); + GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ZERO); + GlState.shadeModel(GL46.GL_SMOOTH); GlState.color(1.0f, 1.0f, 1.0f, 1.0f); Font.bindTexture(); RenderBuffer rb = Tessellator.getBuffer(); - rb.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR); + rb.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR); int ox = x; int ncolor = color; FontChar glyph; @@ -361,7 +361,7 @@ public abstract class Drawing { x += glyph.u + 3 - glyph.s; } Tessellator.draw(); - GlState.shadeModel(GL11.GL_FLAT); + GlState.shadeModel(GL46.GL_FLAT); GlState.disableBlend(); GlState.enableAlpha(); GlState.enableTexture2D(); @@ -403,16 +403,16 @@ public abstract class Drawing { GlState.disableTexture2D(); GlState.enableBlend(); GlState.disableAlpha(); - GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); - GlState.shadeModel(GL11.GL_SMOOTH); + GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ZERO); + GlState.shadeModel(GL46.GL_SMOOTH); RenderBuffer buf = Tessellator.getBuffer(); - buf.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR); + buf.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_COLOR); buf.pos((double)(x + w), (double)y, 0.0).color(top).endVertex(); buf.pos((double)x, (double)y, 0.0).color(top).endVertex(); buf.pos((double)x, (double)(y + h), 0.0).color(bottom).endVertex(); buf.pos((double)(x + w), (double)(y + h), 0.0).color(bottom).endVertex(); Tessellator.draw(); - GlState.shadeModel(GL11.GL_FLAT); + GlState.shadeModel(GL46.GL_FLAT); GlState.disableBlend(); GlState.enableAlpha(); GlState.enableTexture2D(); @@ -423,16 +423,16 @@ public abstract class Drawing { // GlState.disableTexture2D(); // GlState.enableBlend(); // GlState.disableAlpha(); -// GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); -// GlState.shadeModel(GL11.GL_SMOOTH); +// GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ZERO); +// GlState.shadeModel(GL46.GL_SMOOTH); // RenderBuffer buf = Tessellator.getBuffer(); -// buf.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR); +// buf.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_COLOR); // buf.pos((double)(x + w), (double)y, 0.0).color(topright).endVertex(); // buf.pos((double)x, (double)y, 0.0).color(topleft).endVertex(); // buf.pos((double)x, (double)(y + h), 0.0).color(btmleft).endVertex(); // buf.pos((double)(x + w), (double)(y + h), 0.0).color(btmright).endVertex(); // Tessellator.draw(); -// GlState.shadeModel(GL11.GL_FLAT); +// GlState.shadeModel(GL46.GL_FLAT); // GlState.disableBlend(); // GlState.enableAlpha(); // GlState.enableTexture2D(); @@ -444,16 +444,16 @@ public abstract class Drawing { GlState.enableBlend(); GlState.disableAlpha(); GlState.disableTexture2D(); - GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); - GlState.shadeModel(GL11.GL_SMOOTH); + GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ZERO); + GlState.shadeModel(GL46.GL_SMOOTH); GlState.color(color); - rb.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); + rb.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION); rb.pos((double)x, (double)(y + h), 0.0D).endVertex(); rb.pos((double)(x + w), (double)(y + h), 0.0D).endVertex(); rb.pos((double)(x + w), (double)y, 0.0D).endVertex(); rb.pos((double)x, (double)y, 0.0D).endVertex(); Tessellator.draw(); - GlState.shadeModel(GL11.GL_FLAT); + GlState.shadeModel(GL46.GL_FLAT); GlState.enableTexture2D(); GlState.disableBlend(); GlState.enableAlpha(); @@ -575,7 +575,7 @@ public abstract class Drawing { gm.getTextureManager().bindTexture(texture); GlState.color(color); double scale = 32.0; - buf.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + buf.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_TEX); buf.pos((double)x, (double)y + (double)height, 0.0D).tex(0.0D, (double)height / scale).endVertex(); buf.pos((double)x + (double)width, (double)y + (double)height, 0.0D).tex((double)width / scale, (double)height / scale).endVertex(); buf.pos((double)x + (double)width, (double)y, 0.0D).tex((double)width / scale, 0.0).endVertex(); @@ -594,13 +594,13 @@ public abstract class Drawing { // GlState.color(color); float xs = 1.0f / (float)texWidth; // 0.00390625F; float ys = 1.0f / (float)texHeight; // 0.00390625F; - buf.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + buf.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_TEX); buf.pos((double)(x + 0), (double)(y + height), 0.0).tex((double)((float)(u + 0) * xs), (double)((float)(v + height) * ys)).endVertex(); buf.pos((double)(x + width), (double)(y + height), 0.0).tex((double)((float)(u + width) * xs), (double)((float)(v + height) * ys)).endVertex(); buf.pos((double)(x + width), (double)(y + 0), 0.0).tex((double)((float)(u + width) * xs), (double)((float)(v + 0) * ys)).endVertex(); buf.pos((double)(x + 0), (double)(y + 0), 0.0).tex((double)((float)(u + 0) * xs), (double)((float)(v + 0) * ys)).endVertex(); // double scale = 32.0; -// buf.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); +// buf.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_TEX); // buf.pos((double)x, (double)y + (double)height, 0.0D).tex(0.0D, (double)height / scale).endVertex(); // buf.pos((double)x + (double)width, (double)y + (double)height, 0.0D).tex((double)width / scale, (double)height / scale).endVertex(); // buf.pos((double)x + (double)width, (double)y, 0.0D).tex((double)width / scale, 0.0).endVertex(); diff --git a/client/src/main/java/client/renderer/EffectRenderer.java b/client/src/main/java/client/renderer/EffectRenderer.java index 1717fe2f..5c730690 100755 --- a/client/src/main/java/client/renderer/EffectRenderer.java +++ b/client/src/main/java/client/renderer/EffectRenderer.java @@ -3,7 +3,7 @@ package client.renderer; import java.util.List; import java.util.Map; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.Client; import client.renderer.texture.Sprite; @@ -815,7 +815,7 @@ public class EffectRenderer { GlState.color(1.0F, 1.0F, 1.0F, 1.0F); GlState.disableLighting(); ItemRenderer.disableStandardItemLighting(); - rb.begin(GL11.GL_QUADS, VERTEX_FORMAT); + rb.begin(GL46.GL_QUADS, VERTEX_FORMAT); rb.pos((double)(x - rotX * scale - rotXY * scale), (double)(y - rotZ * scale), (double)(z - rotYZ * scale - rotXZ * scale)) .tex((double)u2, (double)v2).color(this.brightness, this.brightness, this.brightness, 1.0F).lightmap(0, 240) .normal(0.0F, 1.0F, 0.0F).endVertex(); @@ -1002,8 +1002,8 @@ public class EffectRenderer { this.interpPosY = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)partial; this.interpPosZ = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double)partial; GlState.enableBlend(); - GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GlState.alphaFunc(GL11.GL_GREATER, 0.003921569F); + GlState.blendFunc(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA); + GlState.alphaFunc(GL46.GL_GREATER, 0.003921569F); for(int i = 0; i < 2; ++i) { if(!this.layers[i].isEmpty()) { @@ -1021,7 +1021,7 @@ public class EffectRenderer { GlState.color(1.0F, 1.0F, 1.0F, 1.0F); RenderBuffer worldrenderer = Tessellator.getBuffer(); - worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP); + worldrenderer.begin(GL46.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP); for(int k = 0; k < this.layers[i].size(); ++k) { this.layers[i].get(k).render(worldrenderer, partial, f, f4, f1, f2, f3); @@ -1033,7 +1033,7 @@ public class EffectRenderer { GlState.depthMask(true); GlState.disableBlend(); - GlState.alphaFunc(GL11.GL_GREATER, 0.1F); + GlState.alphaFunc(GL46.GL_GREATER, 0.1F); } public void renderTextured(Entity entity, float partial) { diff --git a/client/src/main/java/client/renderer/Frustum.java b/client/src/main/java/client/renderer/Frustum.java index 581321be..aca41c5e 100755 --- a/client/src/main/java/client/renderer/Frustum.java +++ b/client/src/main/java/client/renderer/Frustum.java @@ -4,7 +4,7 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import common.util.BoundingBox; import common.util.ExtMath; @@ -44,8 +44,8 @@ public class Frustum { public void init() { this.projection.clear(); this.modelview.clear(); - GL11.glGetFloatv(2983, this.projection); - GL11.glGetFloatv(2982, this.modelview); + GL46.glGetFloatv(2983, this.projection); + GL46.glGetFloatv(2982, this.modelview); float[] proj = this.projectionMat; float[] view = this.modelviewMat; this.projection.flip().limit(16); diff --git a/client/src/main/java/client/renderer/GlState.java b/client/src/main/java/client/renderer/GlState.java index d9eea4c2..85742ff3 100755 --- a/client/src/main/java/client/renderer/GlState.java +++ b/client/src/main/java/client/renderer/GlState.java @@ -1,13 +1,11 @@ package client.renderer; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL13; -import org.lwjgl.opengl.GL14; +import org.lwjgl.opengl.GL46; public class GlState { private static GlState.AlphaState alphaState = new GlState.AlphaState(); - private static GlState.BooleanState lightingState = new GlState.BooleanState(GL11.GL_LIGHTING); + private static GlState.BooleanState lightingState = new GlState.BooleanState(GL46.GL_LIGHTING); private static GlState.BooleanState[] lightState = new GlState.BooleanState[2]; private static GlState.ColorMaterialState colorMaterialState = new GlState.ColorMaterialState(); private static GlState.BlendState blendState = new GlState.BlendState(); @@ -16,11 +14,11 @@ public class GlState private static GlState.CullState cullState = new GlState.CullState(); private static GlState.PolygonOffsetState polygonOffsetState = new GlState.PolygonOffsetState(); private static GlState.Color clearState = new GlState.Color(); - private static GlState.BooleanState normalizeState = new GlState.BooleanState(GL11.GL_NORMALIZE); + private static GlState.BooleanState normalizeState = new GlState.BooleanState(GL46.GL_NORMALIZE); private static int activeTextureUnit = 0; private static GlState.TextureState[] textureState = new GlState.TextureState[2]; - private static int activeShadeModel = GL11.GL_SMOOTH; - private static GlState.BooleanState rescaleNormalState = new GlState.BooleanState(GL13.GL_RESCALE_NORMAL); + private static int activeShadeModel = GL46.GL_SMOOTH; + private static GlState.BooleanState rescaleNormalState = new GlState.BooleanState(GL46.GL_RESCALE_NORMAL); private static GlState.ColorMask colorMaskState = new GlState.ColorMask(); private static GlState.Color colorState = new GlState.Color(); @@ -40,7 +38,7 @@ public class GlState { alphaState.func = func; alphaState.ref = ref; - GL11.glAlphaFunc(func, ref); + GL46.glAlphaFunc(func, ref); } } @@ -80,7 +78,7 @@ public class GlState { colorMaterialState.face = face; colorMaterialState.mode = mode; - GL11.glColorMaterial(face, mode); + GL46.glColorMaterial(face, mode); } } @@ -99,7 +97,7 @@ public class GlState if (depthFunc != depthState.depthFunc) { depthState.depthFunc = depthFunc; - GL11.glDepthFunc(depthFunc); + GL46.glDepthFunc(depthFunc); } } @@ -108,7 +106,7 @@ public class GlState if (flagIn != depthState.maskEnabled) { depthState.maskEnabled = flagIn; - GL11.glDepthMask(flagIn); + GL46.glDepthMask(flagIn); } } @@ -128,7 +126,7 @@ public class GlState { blendState.srcFactor = srcFactor; blendState.dstFactor = dstFactor; - GL11.glBlendFunc(srcFactor, dstFactor); + GL46.glBlendFunc(srcFactor, dstFactor); } } @@ -140,7 +138,7 @@ public class GlState blendState.dstFactor = dstFactor; blendState.srcFactorAlpha = srcFactorAlpha; blendState.dstFactorAlpha = dstFactorAlpha; - GL14.glBlendFuncSeparate(srcFactor, dstFactor, srcFactorAlpha, dstFactorAlpha); + GL46.glBlendFuncSeparate(srcFactor, dstFactor, srcFactorAlpha, dstFactorAlpha); } } @@ -173,7 +171,7 @@ public class GlState if (param != fogState.mode) { fogState.mode = param; - GL11.glFogi(GL11.GL_FOG_MODE, param); + GL46.glFogi(GL46.GL_FOG_MODE, param); } } @@ -182,7 +180,7 @@ public class GlState if (param != fogState.density) { fogState.density = param; - GL11.glFogf(GL11.GL_FOG_DENSITY, param); + GL46.glFogf(GL46.GL_FOG_DENSITY, param); } } @@ -191,7 +189,7 @@ public class GlState if (param != fogState.start) { fogState.start = param; - GL11.glFogf(GL11.GL_FOG_START, param); + GL46.glFogf(GL46.GL_FOG_START, param); } } @@ -200,7 +198,7 @@ public class GlState if (param != fogState.end) { fogState.end = param; - GL11.glFogf(GL11.GL_FOG_END, param); + GL46.glFogf(GL46.GL_FOG_END, param); } } @@ -224,7 +222,7 @@ public class GlState if (mode != cullState.mode) { cullState.mode = mode; - GL11.glCullFace(mode); + GL46.glCullFace(mode); } } @@ -244,16 +242,16 @@ public class GlState { polygonOffsetState.factor = factor; polygonOffsetState.units = units; - GL11.glPolygonOffset(factor, units); + GL46.glPolygonOffset(factor, units); } } public static void setActiveTexture(int texture) { - if (activeTextureUnit != texture - GL13.GL_TEXTURE0) + if (activeTextureUnit != texture - GL46.GL_TEXTURE0) { - activeTextureUnit = texture - GL13.GL_TEXTURE0; - GL13.glActiveTexture(texture); + activeTextureUnit = texture - GL46.GL_TEXTURE0; + GL46.glActiveTexture(texture); } } @@ -269,7 +267,7 @@ public class GlState public static void deleteTexture(int texture) { - GL11.glDeleteTextures(texture); + GL46.glDeleteTextures(texture); for (GlState.TextureState glstatemanager$texturestate : textureState) { @@ -285,7 +283,7 @@ public class GlState if (texture != textureState[activeTextureUnit].textureName) { textureState[activeTextureUnit].textureName = texture; - GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture); + GL46.glBindTexture(GL46.GL_TEXTURE_2D, texture); } } @@ -304,7 +302,7 @@ public class GlState if (mode != activeShadeModel) { activeShadeModel = mode; - GL11.glShadeModel(mode); + GL46.glShadeModel(mode); } } @@ -326,7 +324,7 @@ public class GlState colorMaskState.green = green; colorMaskState.blue = blue; colorMaskState.alpha = alpha; - GL11.glColorMask(red, green, blue, alpha); + GL46.glColorMask(red, green, blue, alpha); } } @@ -338,7 +336,7 @@ public class GlState clearState.green = green; clearState.blue = blue; clearState.alpha = alpha; - GL11.glClearColor(red, green, blue, alpha); + GL46.glClearColor(red, green, blue, alpha); } } @@ -350,7 +348,7 @@ public class GlState colorState.green = colorGreen; colorState.blue = colorBlue; colorState.alpha = colorAlpha; - GL11.glColor4f(colorRed, colorGreen, colorBlue, colorAlpha); + GL46.glColor4f(colorRed, colorGreen, colorBlue, colorAlpha); } } @@ -371,7 +369,7 @@ public class GlState { for (int i = 0; i < lightState.length; ++i) { - lightState[i] = new GlState.BooleanState(GL11.GL_LIGHT0 + i); + lightState[i] = new GlState.BooleanState(GL46.GL_LIGHT0 + i); } for (int j = 0; j < textureState.length; ++j) @@ -388,8 +386,8 @@ public class GlState private AlphaState() { - this.alphaTest = new GlState.BooleanState(GL11.GL_ALPHA_TEST); - this.func = GL11.GL_ALWAYS; + this.alphaTest = new GlState.BooleanState(GL46.GL_ALPHA_TEST); + this.func = GL46.GL_ALWAYS; this.ref = -1.0F; } } @@ -404,11 +402,11 @@ public class GlState private BlendState() { - this.blend = new GlState.BooleanState(GL11.GL_BLEND); - this.srcFactor = GL11.GL_ONE; - this.dstFactor = GL11.GL_ZERO; - this.srcFactorAlpha = GL11.GL_ONE; - this.dstFactorAlpha = GL11.GL_ZERO; + this.blend = new GlState.BooleanState(GL46.GL_BLEND); + this.srcFactor = GL46.GL_ONE; + this.dstFactor = GL46.GL_ZERO; + this.srcFactorAlpha = GL46.GL_ONE; + this.dstFactorAlpha = GL46.GL_ZERO; } } @@ -440,11 +438,11 @@ public class GlState if (state) { - GL11.glEnable(this.capability); + GL46.glEnable(this.capability); } else { - GL11.glDisable(this.capability); + GL46.glDisable(this.capability); } } } @@ -486,9 +484,9 @@ public class GlState private ColorMaterialState() { - this.colorMaterial = new GlState.BooleanState(GL11.GL_COLOR_MATERIAL); - this.face = GL11.GL_FRONT_AND_BACK; - this.mode = GL11.GL_AMBIENT_AND_DIFFUSE; + this.colorMaterial = new GlState.BooleanState(GL46.GL_COLOR_MATERIAL); + this.face = GL46.GL_FRONT_AND_BACK; + this.mode = GL46.GL_AMBIENT_AND_DIFFUSE; } } @@ -499,8 +497,8 @@ public class GlState private CullState() { - this.cullFace = new GlState.BooleanState(GL11.GL_CULL_FACE); - this.mode = GL11.GL_BACK; + this.cullFace = new GlState.BooleanState(GL46.GL_CULL_FACE); + this.mode = GL46.GL_BACK; } } @@ -512,9 +510,9 @@ public class GlState private DepthState() { - this.depthTest = new GlState.BooleanState(GL11.GL_DEPTH_TEST); + this.depthTest = new GlState.BooleanState(GL46.GL_DEPTH_TEST); this.maskEnabled = true; - this.depthFunc = GL11.GL_LESS; + this.depthFunc = GL46.GL_LESS; } } @@ -529,9 +527,9 @@ public class GlState private FogState() { - this.fog = new GlState.BooleanState(GL11.GL_FOG); + this.fog = new GlState.BooleanState(GL46.GL_FOG); this.enabled = true; - this.mode = GL11.GL_EXP; + this.mode = GL46.GL_EXP; this.density = 1.0F; this.start = 0.0F; this.end = 1.0F; @@ -547,8 +545,8 @@ public class GlState private PolygonOffsetState() { - this.polygonOffsetFill = new GlState.BooleanState(GL11.GL_POLYGON_OFFSET_FILL); - this.polygonOffsetLine = new GlState.BooleanState(GL11.GL_POLYGON_OFFSET_LINE); + this.polygonOffsetFill = new GlState.BooleanState(GL46.GL_POLYGON_OFFSET_FILL); + this.polygonOffsetLine = new GlState.BooleanState(GL46.GL_POLYGON_OFFSET_LINE); this.factor = 0.0F; this.units = 0.0F; } @@ -561,7 +559,7 @@ public class GlState private TextureState() { - this.texture2DState = new GlState.BooleanState(GL11.GL_TEXTURE_2D); + this.texture2DState = new GlState.BooleanState(GL46.GL_TEXTURE_2D); this.textureName = 0; } } diff --git a/client/src/main/java/client/renderer/ItemRenderer.java b/client/src/main/java/client/renderer/ItemRenderer.java index e745f89b..80f8e82c 100755 --- a/client/src/main/java/client/renderer/ItemRenderer.java +++ b/client/src/main/java/client/renderer/ItemRenderer.java @@ -4,8 +4,7 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL13; +import org.lwjgl.opengl.GL46; import client.Client; import client.renderer.entity.RenderItem; @@ -51,11 +50,11 @@ public class ItemRenderer public static void enableGUIStandardItemLighting() { - GL11.glPushMatrix(); - GL11.glRotatef(-30.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(165.0F, 1.0F, 0.0F, 0.0F); + GL46.glPushMatrix(); + GL46.glRotatef(-30.0F, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(165.0F, 1.0F, 0.0F, 0.0F); enableStandardItemLighting(); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } public static void enableStandardItemLighting() @@ -64,22 +63,22 @@ public class ItemRenderer GlState.enableLight(0); GlState.enableLight(1); GlState.enableColorMaterial(); - GlState.colorMaterial(GL11.GL_FRONT_AND_BACK, GL11.GL_AMBIENT_AND_DIFFUSE); + GlState.colorMaterial(GL46.GL_FRONT_AND_BACK, GL46.GL_AMBIENT_AND_DIFFUSE); float f = 0.4F; float f1 = 0.6F; float f2 = 0.0F; - GL11.glLightfv(GL11.GL_LIGHT0, GL11.GL_POSITION, setColorBuffer( + GL46.glLightfv(GL46.GL_LIGHT0, GL46.GL_POSITION, setColorBuffer( (float)LIGHT0_POS.xCoord, (float)LIGHT0_POS.yCoord, (float)LIGHT0_POS.zCoord, 0.0f)); - GL11.glLightfv(GL11.GL_LIGHT0, GL11.GL_DIFFUSE, setColorBuffer(f1, f1, f1, 1.0F)); - GL11.glLightfv(GL11.GL_LIGHT0, GL11.GL_AMBIENT, setColorBuffer(0.0F, 0.0F, 0.0F, 1.0F)); - GL11.glLightfv(GL11.GL_LIGHT0, GL11.GL_SPECULAR, setColorBuffer(f2, f2, f2, 1.0F)); - GL11.glLightfv(GL11.GL_LIGHT1, GL11.GL_POSITION, setColorBuffer( + GL46.glLightfv(GL46.GL_LIGHT0, GL46.GL_DIFFUSE, setColorBuffer(f1, f1, f1, 1.0F)); + GL46.glLightfv(GL46.GL_LIGHT0, GL46.GL_AMBIENT, setColorBuffer(0.0F, 0.0F, 0.0F, 1.0F)); + GL46.glLightfv(GL46.GL_LIGHT0, GL46.GL_SPECULAR, setColorBuffer(f2, f2, f2, 1.0F)); + GL46.glLightfv(GL46.GL_LIGHT1, GL46.GL_POSITION, setColorBuffer( (float)LIGHT1_POS.xCoord, (float)LIGHT1_POS.yCoord, (float)LIGHT1_POS.zCoord, 0.0f)); - GL11.glLightfv(GL11.GL_LIGHT1, GL11.GL_DIFFUSE, setColorBuffer(f1, f1, f1, 1.0F)); - GL11.glLightfv(GL11.GL_LIGHT1, GL11.GL_AMBIENT, setColorBuffer(0.0F, 0.0F, 0.0F, 1.0F)); - GL11.glLightfv(GL11.GL_LIGHT1, GL11.GL_SPECULAR, setColorBuffer(f2, f2, f2, 1.0F)); - GlState.shadeModel(GL11.GL_FLAT); - GL11.glLightModelfv(GL11.GL_LIGHT_MODEL_AMBIENT, setColorBuffer(f, f, f, 1.0F)); + GL46.glLightfv(GL46.GL_LIGHT1, GL46.GL_DIFFUSE, setColorBuffer(f1, f1, f1, 1.0F)); + GL46.glLightfv(GL46.GL_LIGHT1, GL46.GL_AMBIENT, setColorBuffer(0.0F, 0.0F, 0.0F, 1.0F)); + GL46.glLightfv(GL46.GL_LIGHT1, GL46.GL_SPECULAR, setColorBuffer(f2, f2, f2, 1.0F)); + GlState.shadeModel(GL46.GL_FLAT); + GL46.glLightModelfv(GL46.GL_LIGHT_MODEL_AMBIENT, setColorBuffer(f, f, f, 1.0F)); } public static void disableStandardItemLighting() @@ -103,26 +102,26 @@ public class ItemRenderer { Item item = heldStack.getItem(); Block block = item.getBlock(); - GL11.glPushMatrix(); + GL46.glPushMatrix(); if (this.itemRenderer.shouldRenderItemIn3D(heldStack)) { - GL11.glScalef(2.0F, 2.0F, 2.0F); + GL46.glScalef(2.0F, 2.0F, 2.0F); } this.itemRenderer.renderItemForEntity(heldStack, entityIn, third); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } } private void rotateArroundXAndY(float angle, float angleY) { - GL11.glPushMatrix(); - GL11.glRotatef(angle, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(angleY, 0.0F, 1.0F, 0.0F); + GL46.glPushMatrix(); + GL46.glRotatef(angle, 1.0F, 0.0F, 0.0F); + GL46.glRotatef(angleY, 0.0F, 1.0F, 0.0F); ItemRenderer.enableStandardItemLighting(); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } private void setLightMapFromPlayer(EntityNPC clientPlayer) @@ -130,15 +129,15 @@ public class ItemRenderer int i = this.gm.world.getCombinedLight(new BlockPos(clientPlayer.posX, clientPlayer.posY + (double)clientPlayer.getEyeHeight(), clientPlayer.posZ), 0); float f = (float)(i & 65535); float f1 = (float)(i >> 16); - GL13.glMultiTexCoord2f(GL13.GL_TEXTURE1, f, f1); + GL46.glMultiTexCoord2f(GL46.GL_TEXTURE1, f, f1); } private void rotateWithPlayerRotations(EntityNPC entityplayerspIn, float partialTicks) { float f = entityplayerspIn.prevRenderArmPitch + (entityplayerspIn.renderArmPitch - entityplayerspIn.prevRenderArmPitch) * partialTicks; float f1 = entityplayerspIn.prevRenderArmYaw + (entityplayerspIn.renderArmYaw - entityplayerspIn.prevRenderArmYaw) * partialTicks; - GL11.glRotatef((entityplayerspIn.rotPitch - f) * 0.1F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef((entityplayerspIn.rotYaw - f1) * 0.1F, 0.0F, 1.0F, 0.0F); + GL46.glRotatef((entityplayerspIn.rotPitch - f) * 0.1F, 1.0F, 0.0F, 0.0F); + GL46.glRotatef((entityplayerspIn.rotYaw - f1) * 0.1F, 0.0F, 1.0F, 0.0F); } private float getMapAngleFromPitch(float pitch) @@ -215,7 +214,7 @@ public class ItemRenderer //// Tessellator tessellator = Tessellator.getInstance(); // RenderBuffer worldrenderer = Tessellator.getBuffer(); // SKC.glNormal3f(0.0F, 0.0F, -1.0F); -// worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); +// worldrenderer.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_TEX); // worldrenderer.pos(-7.0D, 135.0D, 0.0D).tex(0.0D, 1.0D).endVertex(); // worldrenderer.pos(135.0D, 135.0D, 0.0D).tex(1.0D, 1.0D).endVertex(); // worldrenderer.pos(135.0D, -7.0D, 0.0D).tex(1.0D, 0.0D).endVertex(); @@ -234,21 +233,21 @@ public class ItemRenderer float f = -0.3F * ExtMath.sin(ExtMath.sqrtf(swingProgress) * (float)Math.PI); float f1 = 0.4F * ExtMath.sin(ExtMath.sqrtf(swingProgress) * (float)Math.PI * 2.0F); float f2 = -0.4F * ExtMath.sin(swingProgress * (float)Math.PI); - GL11.glTranslatef(f, f1, f2); - GL11.glTranslatef(0.64000005F, -0.6F, -0.71999997F); - GL11.glTranslatef(0.0F, equipProgress * -0.6F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + GL46.glTranslatef(f, f1, f2); + GL46.glTranslatef(0.64000005F, -0.6F, -0.71999997F); + GL46.glTranslatef(0.0F, equipProgress * -0.6F, 0.0F); + GL46.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); float f3 = ExtMath.sin(swingProgress * swingProgress * (float)Math.PI); float f4 = ExtMath.sin(ExtMath.sqrtf(swingProgress) * (float)Math.PI); - GL11.glRotatef(f4 * 70.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(f3 * -20.0F, 0.0F, 0.0F, 1.0F); + GL46.glRotatef(f4 * 70.0F, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(f3 * -20.0F, 0.0F, 0.0F, 1.0F); this.gm.getTextureManager().bindTexture(EntityTexManager.getSkin(clientPlayer)); - GL11.glTranslatef(-1.0F, 3.6F, 3.5F); - GL11.glRotatef(120.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(200.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(1.0F, 1.0F, 1.0F); - GL11.glTranslatef(5.6F, 0.0F, 0.0F); + GL46.glTranslatef(-1.0F, 3.6F, 3.5F); + GL46.glRotatef(120.0F, 0.0F, 0.0F, 1.0F); + GL46.glRotatef(200.0F, 1.0F, 0.0F, 0.0F); + GL46.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); + GL46.glScalef(1.0F, 1.0F, 1.0F); + GL46.glTranslatef(5.6F, 0.0F, 0.0F); RenderNpc render = this.renderManager.getRenderObject(this.gm.player.getModel()); GlState.disableCull(); render.renderPlayerArm(this.gm.player); @@ -260,7 +259,7 @@ public class ItemRenderer float f = -0.4F * ExtMath.sin(ExtMath.sqrtf(swingProgress) * (float)Math.PI); float f1 = 0.2F * ExtMath.sin(ExtMath.sqrtf(swingProgress) * (float)Math.PI * 2.0F); float f2 = -0.2F * ExtMath.sin(swingProgress * (float)Math.PI); - GL11.glTranslatef(f, f1, f2); + GL46.glTranslatef(f, f1, f2); } private void performDrinking(EntityNPC clientPlayer, float partialTicks) @@ -274,33 +273,33 @@ public class ItemRenderer f2 = 0.0F; } - GL11.glTranslatef(0.0F, f2, 0.0F); + GL46.glTranslatef(0.0F, f2, 0.0F); float f3 = 1.0F - (float)Math.pow((double)f1, 27.0D); - GL11.glTranslatef(f3 * 0.6F, f3 * -0.5F, f3 * 0.0F); - GL11.glRotatef(f3 * 90.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(f3 * 10.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(f3 * 30.0F, 0.0F, 0.0F, 1.0F); + GL46.glTranslatef(f3 * 0.6F, f3 * -0.5F, f3 * 0.0F); + GL46.glRotatef(f3 * 90.0F, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(f3 * 10.0F, 1.0F, 0.0F, 0.0F); + GL46.glRotatef(f3 * 30.0F, 0.0F, 0.0F, 1.0F); } private void transformFirstPersonItem(float equipProgress, float swingProgress) { - GL11.glTranslatef(0.56F, -0.52F, -0.71999997F); - GL11.glTranslatef(0.0F, equipProgress * -0.6F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + GL46.glTranslatef(0.56F, -0.52F, -0.71999997F); + GL46.glTranslatef(0.0F, equipProgress * -0.6F, 0.0F); + GL46.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); float f = ExtMath.sin(swingProgress * swingProgress * (float)Math.PI); float f1 = ExtMath.sin(ExtMath.sqrtf(swingProgress) * (float)Math.PI); - GL11.glRotatef(f * -20.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(f1 * -20.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(f1 * -80.0F, 1.0F, 0.0F, 0.0F); - GL11.glScalef(0.4F, 0.4F, 0.4F); + GL46.glRotatef(f * -20.0F, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(f1 * -20.0F, 0.0F, 0.0F, 1.0F); + GL46.glRotatef(f1 * -80.0F, 1.0F, 0.0F, 0.0F); + GL46.glScalef(0.4F, 0.4F, 0.4F); } private void doBowTransformations(float partialTicks, EntityNPC clientPlayer) { - GL11.glRotatef(-18.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-12.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-8.0F, 1.0F, 0.0F, 0.0F); - GL11.glTranslatef(-0.9F, 0.2F, 0.0F); + GL46.glRotatef(-18.0F, 0.0F, 0.0F, 1.0F); + GL46.glRotatef(-12.0F, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(-8.0F, 1.0F, 0.0F, 0.0F); + GL46.glTranslatef(-0.9F, 0.2F, 0.0F); float f = (float)this.itemToRender.getMaxItemUseDuration() - ((float)clientPlayer.getItemInUseCount() - partialTicks + 1.0F); float f1 = f / 20.0F; f1 = (f1 * f1 + f1 * 2.0F) / 3.0F; @@ -315,19 +314,19 @@ public class ItemRenderer float f2 = ExtMath.sin((f - 0.1F) * 1.3F); float f3 = f1 - 0.1F; float f4 = f2 * f3; - GL11.glTranslatef(f4 * 0.0F, f4 * 0.01F, f4 * 0.0F); + GL46.glTranslatef(f4 * 0.0F, f4 * 0.01F, f4 * 0.0F); } - GL11.glTranslatef(f1 * 0.0F, f1 * 0.0F, f1 * 0.1F); - GL11.glScalef(1.0F, 1.0F, 1.0F + f1 * 0.2F); + GL46.glTranslatef(f1 * 0.0F, f1 * 0.0F, f1 * 0.1F); + GL46.glScalef(1.0F, 1.0F, 1.0F + f1 * 0.2F); } private void doBlockTransformations() { - GL11.glTranslatef(-0.5F, 0.2F, 0.0F); - GL11.glRotatef(30.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-80.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(60.0F, 0.0F, 1.0F, 0.0F); + GL46.glTranslatef(-0.5F, 0.2F, 0.0F); + GL46.glRotatef(30.0F, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(-80.0F, 1.0F, 0.0F, 0.0F); + GL46.glRotatef(60.0F, 0.0F, 1.0F, 0.0F); } public void renderItemInFirstPerson(float partialTicks) @@ -341,7 +340,7 @@ public class ItemRenderer this.setLightMapFromPlayer(clientplayer); this.rotateWithPlayerRotations(clientplayer, partialTicks); GlState.enableRescaleNormal(); - GL11.glPushMatrix(); + GL46.glPushMatrix(); if (this.itemToRender != null && (this.itemToRender.getItem().getWieldType() != null || (clientplayer.getItemInUseCount() > 0 && this.itemToRender.getItemUseAction() != ItemAction.NONE))) { @@ -384,7 +383,7 @@ public class ItemRenderer this.renderPlayerArm(clientplayer, f, f1); } - GL11.glPopMatrix(); + GL46.glPopMatrix(); GlState.disableRescaleNormal(); ItemRenderer.disableStandardItemLighting(); } @@ -431,7 +430,7 @@ public class ItemRenderer RenderBuffer worldrenderer = Tessellator.getBuffer(); float f = 0.1F; GlState.color(0.1F, 0.1F, 0.1F, 0.5F); - GL11.glPushMatrix(); + GL46.glPushMatrix(); float f1 = -1.0F; float f2 = 1.0F; float f3 = -1.0F; @@ -441,13 +440,13 @@ public class ItemRenderer float f7 = atlas.getMaxU(); float f8 = atlas.getMinV(); float f9 = atlas.getMaxV(); - worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + worldrenderer.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_TEX); worldrenderer.pos(-1.0D, -1.0D, -0.5D).tex((double)f7, (double)f9).endVertex(); worldrenderer.pos(1.0D, -1.0D, -0.5D).tex((double)f6, (double)f9).endVertex(); worldrenderer.pos(1.0D, 1.0D, -0.5D).tex((double)f6, (double)f8).endVertex(); worldrenderer.pos(-1.0D, 1.0D, -0.5D).tex((double)f7, (double)f8).endVertex(); Tessellator.draw(); - GL11.glPopMatrix(); + GL46.glPopMatrix(); GlState.color(1.0F, 1.0F, 1.0F, 1.0F); } @@ -455,15 +454,15 @@ public class ItemRenderer { RenderBuffer worldrenderer = Tessellator.getBuffer(); GlState.color(1.0F, 1.0F, 1.0F, 0.9F); - GlState.depthFunc(GL11.GL_ALWAYS); + GlState.depthFunc(GL46.GL_ALWAYS); GlState.depthMask(false); GlState.enableBlend(); - GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); + GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ZERO); float f = 1.0F; for (int i = 0; i < 2; ++i) { - GL11.glPushMatrix(); + GL46.glPushMatrix(); Sprite textureatlassprite = this.gm.getTextureMapBlocks().getAtlasSprite("blocks/fire_layer_1"); this.gm.getTextureManager().bindTexture(TextureMap.BLOCKS); float f1 = textureatlassprite.getMinU(); @@ -475,21 +474,21 @@ public class ItemRenderer float f7 = 0.0F - f / 2.0F; float f8 = f7 + f; float f9 = -0.5F; - GL11.glTranslatef((float)(-(i * 2 - 1)) * 0.24F, -0.3F, 0.0F); - GL11.glRotatef((float)(i * 2 - 1) * 10.0F, 0.0F, 1.0F, 0.0F); - worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + GL46.glTranslatef((float)(-(i * 2 - 1)) * 0.24F, -0.3F, 0.0F); + GL46.glRotatef((float)(i * 2 - 1) * 10.0F, 0.0F, 1.0F, 0.0F); + worldrenderer.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_TEX); worldrenderer.pos((double)f5, (double)f7, (double)f9).tex((double)f2, (double)f4).endVertex(); worldrenderer.pos((double)f6, (double)f7, (double)f9).tex((double)f1, (double)f4).endVertex(); worldrenderer.pos((double)f6, (double)f8, (double)f9).tex((double)f1, (double)f3).endVertex(); worldrenderer.pos((double)f5, (double)f8, (double)f9).tex((double)f2, (double)f3).endVertex(); Tessellator.draw(); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } GlState.color(1.0F, 1.0F, 1.0F, 1.0F); GlState.disableBlend(); GlState.depthMask(true); - GlState.depthFunc(GL11.GL_LEQUAL); + GlState.depthFunc(GL46.GL_LEQUAL); } public void update() diff --git a/client/src/main/java/client/renderer/MatrixState.java b/client/src/main/java/client/renderer/MatrixState.java index 4d4b3112..f923383a 100755 --- a/client/src/main/java/client/renderer/MatrixState.java +++ b/client/src/main/java/client/renderer/MatrixState.java @@ -5,7 +5,7 @@ import java.nio.ByteOrder; import java.nio.FloatBuffer; import java.nio.IntBuffer; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import common.block.Block; import common.block.liquid.BlockLiquid; @@ -32,9 +32,9 @@ public class MatrixState { private static float rotationXY; public static void update(EntityNPC player, boolean flip) { - GL11.glGetFloatv(GL11.GL_MODELVIEW_MATRIX, MODELVIEW); - GL11.glGetFloatv(GL11.GL_PROJECTION_MATRIX, PROJECTION); - GL11.glGetIntegerv(GL11.GL_VIEWPORT, VIEWPORT); + GL46.glGetFloatv(GL46.GL_MODELVIEW_MATRIX, MODELVIEW); + GL46.glGetFloatv(GL46.GL_PROJECTION_MATRIX, PROJECTION); + GL46.glGetIntegerv(GL46.GL_VIEWPORT, VIEWPORT); float x = (float)((VIEWPORT.get(0) + VIEWPORT.get(2)) / 2); float y = (float)((VIEWPORT.get(1) + VIEWPORT.get(3)) / 2); Project.gluUnProject(x, y, 0.0F, MODELVIEW, PROJECTION, VIEWPORT, OBJECTCOORDS); @@ -100,4 +100,12 @@ public class MatrixState { public static float getRotationXY() { return rotationXY; } + + public static FloatBuffer getProjection() { + return PROJECTION; + } + + public static FloatBuffer getModelView() { + return MODELVIEW; + } } diff --git a/client/src/main/java/client/renderer/Project.java b/client/src/main/java/client/renderer/Project.java index 83f07597..d2aa0751 100644 --- a/client/src/main/java/client/renderer/Project.java +++ b/client/src/main/java/client/renderer/Project.java @@ -36,7 +36,7 @@ import java.nio.ByteOrder; import java.nio.FloatBuffer; import java.nio.IntBuffer; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; // 11-jan-2004 Erik Duijs public class Project { @@ -201,7 +201,7 @@ public class Project { matrix.put(3 * 4 + 2, -2 * zNear * zFar / deltaZ); matrix.put(3 * 4 + 3, 0); - GL11.glMultMatrixf(matrix); + GL46.glMultMatrixf(matrix); } public static void gluLookAt( @@ -248,8 +248,8 @@ public class Project { matrix.put(1 * 4 + 2, -forward[1]); matrix.put(2 * 4 + 2, -forward[2]); - GL11.glMultMatrixf(matrix); - GL11.glTranslatef(-eyex, -eyey, -eyez); + GL46.glMultMatrixf(matrix); + GL46.glTranslatef(-eyex, -eyey, -eyez); } public static boolean gluProject( diff --git a/client/src/main/java/client/renderer/RegionRenderCacheBuilder.java b/client/src/main/java/client/renderer/RegionRenderCacheBuilder.java index 9ca2d254..9bf2138d 100755 --- a/client/src/main/java/client/renderer/RegionRenderCacheBuilder.java +++ b/client/src/main/java/client/renderer/RegionRenderCacheBuilder.java @@ -1,24 +1,11 @@ package client.renderer; -import client.renderer.chunk.BlockLayer; - public class RegionRenderCacheBuilder { - private final RenderBuffer[] buffers = new RenderBuffer[BlockLayer.values().length]; + private final RenderBuffer buffer = new RenderBuffer(4194304); - public RegionRenderCacheBuilder() + public RenderBuffer getWorldRenderer() { - this.buffers[BlockLayer.SOLID.ordinal()] = new RenderBuffer(2097152); - this.buffers[BlockLayer.CUTOUT.ordinal()] = new RenderBuffer(524288); - } - - public RenderBuffer getWorldRendererByLayer(BlockLayer layer) - { - return this.buffers[layer.ordinal()]; - } - - public RenderBuffer getWorldRendererByLayerId(int id) - { - return this.buffers[id]; + return this.buffer; } } diff --git a/client/src/main/java/client/renderer/Renderer.java b/client/src/main/java/client/renderer/Renderer.java index a5f3bcfa..b0f8a75b 100755 --- a/client/src/main/java/client/renderer/Renderer.java +++ b/client/src/main/java/client/renderer/Renderer.java @@ -16,16 +16,13 @@ import java.util.Queue; import java.util.Set; import java.util.function.Predicate; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL13; -import org.lwjgl.opengl.GL15; +import org.lwjgl.opengl.GL46; import client.Client; import client.renderer.blockmodel.BakedModel; import client.renderer.blockmodel.BakedQuad; import client.renderer.blockmodel.IBakedModel; import client.renderer.blockmodel.ModelManager; -import client.renderer.chunk.BlockLayer; import client.renderer.chunk.ChunkRenderDispatcher; import client.renderer.chunk.CompiledChunk; import client.renderer.chunk.RenderChunk; @@ -245,6 +242,26 @@ public class Renderer { this.generateSky(); this.generateSky2(); } + + public float getNearPlane() { + return 0.05f; + } + + public float getFarPlane() { + return this.farPlaneDistance * SQRT_2; + } + + public float getFogColorRed() { + return this.fogColorRed; + } + + public float getFogColorGreen() { + return this.fogColorGreen; + } + + public float getFogColorBlue() { + return this.fogColorBlue; + } public ModelManager getModelManager() { @@ -545,7 +562,7 @@ public class Renderer { if (entitylivingbase.getHealth() <= 0) { float f1 = (float)entitylivingbase.deathTime + partialTicks; - GL11.glRotatef(40.0F - 8000.0F / (f1 + 200.0F), 0.0F, 0.0F, 1.0F); + GL46.glRotatef(40.0F - 8000.0F / (f1 + 200.0F), 0.0F, 0.0F, 1.0F); } if (f < 0.0F || entitylivingbase.hasEffect(Effect.STABILITY)) @@ -556,9 +573,9 @@ public class Renderer { f = f / (float)entitylivingbase.maxHurtTime; f = ExtMath.sin(f * f * f * f * (float)Math.PI); float f2 = entitylivingbase.attackedYaw; - GL11.glRotatef(-f2, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-f * 14.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(f2, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(-f2, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(-f * 14.0F, 0.0F, 0.0F, 1.0F); + GL46.glRotatef(f2, 0.0F, 1.0F, 0.0F); } } @@ -571,10 +588,10 @@ public class Renderer { float f1 = -(entityplayer.walkDistMod + f * partialTicks); float f2 = entityplayer.prevCameraYaw + (entityplayer.cameraYaw - entityplayer.prevCameraYaw) * partialTicks; float f3 = entityplayer.prevCamPitch + (entityplayer.camPitch - entityplayer.prevCamPitch) * partialTicks; - GL11.glTranslatef(ExtMath.sin(f1 * (float)Math.PI) * f2 * 0.5F, -Math.abs(ExtMath.cos(f1 * (float)Math.PI) * f2), 0.0F); - GL11.glRotatef(ExtMath.sin(f1 * (float)Math.PI) * f2 * 3.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(Math.abs(ExtMath.cos(f1 * (float)Math.PI - 0.2F) * f2) * 5.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(f3, 1.0F, 0.0F, 0.0F); + GL46.glTranslatef(ExtMath.sin(f1 * (float)Math.PI) * f2 * 0.5F, -Math.abs(ExtMath.cos(f1 * (float)Math.PI) * f2), 0.0F); + GL46.glRotatef(ExtMath.sin(f1 * (float)Math.PI) * f2 * 3.0F, 0.0F, 0.0F, 1.0F); + GL46.glRotatef(Math.abs(ExtMath.cos(f1 * (float)Math.PI - 0.2F) * f2) * 5.0F, 1.0F, 0.0F, 0.0F); + GL46.glRotatef(f3, 1.0F, 0.0F, 0.0F); } } @@ -614,7 +631,7 @@ public class Renderer { if (this.gm.debugCamEnable) { - GL11.glTranslatef(0.0F, 0.0F, (float)(-d3)); + GL46.glTranslatef(0.0F, 0.0F, (float)(-d3)); } else { @@ -653,19 +670,19 @@ public class Renderer { if (this.gm.thirdPersonView == 2) { - GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); } - GL11.glRotatef(entity.rotPitch - f2, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(entity.rotYaw - f1, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(0.0F, 0.0F, (float)(-d3)); - GL11.glRotatef(f1 - entity.rotYaw, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(f2 - entity.rotPitch, 1.0F, 0.0F, 0.0F); + GL46.glRotatef(entity.rotPitch - f2, 1.0F, 0.0F, 0.0F); + GL46.glRotatef(entity.rotYaw - f1, 0.0F, 1.0F, 0.0F); + GL46.glTranslatef(0.0F, 0.0F, (float)(-d3)); + GL46.glRotatef(f1 - entity.rotYaw, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(f2 - entity.rotPitch, 1.0F, 0.0F, 0.0F); } } else { - GL11.glTranslatef(0.0F, 0.0F, -0.1F); + GL46.glTranslatef(0.0F, 0.0F, -0.1F); } if (!this.gm.debugCamEnable || this.gm.thirdPersonView == 0) @@ -673,29 +690,29 @@ public class Renderer { this.rotateCamera(entity, partialTicks, false); } - GL11.glTranslatef(0.0F, -f, 0.0F); + GL46.glTranslatef(0.0F, -f, 0.0F); } public void rotateCamera(Entity entity, float partialTicks, boolean invert) { if(invert) - GL11.glRotatef(360.0f - (entity.prevPitch + (entity.rotPitch - entity.prevPitch) * partialTicks), 1.0F, 0.0F, 0.0F); + GL46.glRotatef(360.0f - (entity.prevPitch + (entity.rotPitch - entity.prevPitch) * partialTicks), 1.0F, 0.0F, 0.0F); else - GL11.glRotatef(entity.prevPitch + (entity.rotPitch - entity.prevPitch) * partialTicks, 1.0F, 0.0F, 0.0F); + GL46.glRotatef(entity.prevPitch + (entity.rotPitch - entity.prevPitch) * partialTicks, 1.0F, 0.0F, 0.0F); if(entity instanceof EntityAnimal) { EntityAnimal entityanimal = (EntityAnimal)entity; - GL11.glRotatef(entityanimal.prevHeadYaw + (entityanimal.headYaw - entityanimal.prevHeadYaw) * partialTicks + 180.0F, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(entityanimal.prevHeadYaw + (entityanimal.headYaw - entityanimal.prevHeadYaw) * partialTicks + 180.0F, 0.0F, 1.0F, 0.0F); } else { - GL11.glRotatef(entity.prevYaw + (entity.rotYaw - entity.prevYaw) * partialTicks + 180.0F, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(entity.prevYaw + (entity.rotYaw - entity.prevYaw) * partialTicks + 180.0F, 0.0F, 1.0F, 0.0F); } } private void setupCameraTransform(float partialTicks) { this.farPlaneDistance = (float)(this.gm.renderDistance * 16); - GL11.glMatrixMode(GL11.GL_PROJECTION); - GL11.glLoadIdentity(); + GL46.glMatrixMode(GL46.GL_PROJECTION); + GL46.glLoadIdentity(); float f = 0.07F; // if (this.cameraZoom != 1.0D) @@ -705,8 +722,8 @@ public class Renderer { // } Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.gm.fbRawX / (float)this.gm.fbRawY, 0.05F, this.farPlaneDistance * SQRT_2); - GL11.glMatrixMode(GL11.GL_MODELVIEW); - GL11.glLoadIdentity(); + GL46.glMatrixMode(GL46.GL_MODELVIEW); + GL46.glLoadIdentity(); this.hurtCameraEffect(partialTicks); @@ -765,15 +782,15 @@ public class Renderer { { // if (!this.debugView) // { - GL11.glMatrixMode(GL11.GL_PROJECTION); - GL11.glLoadIdentity(); + GL46.glMatrixMode(GL46.GL_PROJECTION); + GL46.glLoadIdentity(); float f = 0.07F; Project.gluPerspective(this.getFOVModifier(partialTicks, false), (float)this.gm.fbRawX / (float)this.gm.fbRawY, 0.05F, this.farPlaneDistance * 2.0F); - GL11.glMatrixMode(GL11.GL_MODELVIEW); - GL11.glLoadIdentity(); + GL46.glMatrixMode(GL46.GL_MODELVIEW); + GL46.glLoadIdentity(); - GL11.glPushMatrix(); + GL46.glPushMatrix(); this.hurtCameraEffect(partialTicks); // if (this.gm.viewBobbing) @@ -790,7 +807,7 @@ public class Renderer { this.disableLightmap(); } - GL11.glPopMatrix(); + GL46.glPopMatrix(); if (this.gm.thirdPersonView == 0) // && !flag) { @@ -807,28 +824,28 @@ public class Renderer { private void disableLightmap() { - GlState.setActiveTexture(GL13.GL_TEXTURE1); + GlState.setActiveTexture(GL46.GL_TEXTURE1); GlState.disableTexture2D(); - GlState.setActiveTexture(GL13.GL_TEXTURE0); + GlState.setActiveTexture(GL46.GL_TEXTURE0); } private void enableLightmap() { - GlState.setActiveTexture(GL13.GL_TEXTURE1); - GL11.glMatrixMode(GL11.GL_TEXTURE); - GL11.glLoadIdentity(); + GlState.setActiveTexture(GL46.GL_TEXTURE1); + GL46.glMatrixMode(GL46.GL_TEXTURE); + GL46.glLoadIdentity(); float f = 0.00390625F; - GL11.glScalef(f, f, f); - GL11.glTranslatef(8.0F, 8.0F, 8.0F); - GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL46.glScalef(f, f, f); + GL46.glTranslatef(8.0F, 8.0F, 8.0F); + GL46.glMatrixMode(GL46.GL_MODELVIEW); this.gm.getTextureManager().bindTexture(TEX_LIGHTMAP); - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP); - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP); + GL46.glTexParameteri(GL46.GL_TEXTURE_2D, GL46.GL_TEXTURE_MIN_FILTER, GL46.GL_LINEAR); + GL46.glTexParameteri(GL46.GL_TEXTURE_2D, GL46.GL_TEXTURE_MAG_FILTER, GL46.GL_LINEAR); + GL46.glTexParameteri(GL46.GL_TEXTURE_2D, GL46.GL_TEXTURE_WRAP_S, GL46.GL_CLAMP); + GL46.glTexParameteri(GL46.GL_TEXTURE_2D, GL46.GL_TEXTURE_WRAP_T, GL46.GL_CLAMP); GlState.color(1.0F, 1.0F, 1.0F, 1.0F); GlState.enableTexture2D(); - GlState.setActiveTexture(GL13.GL_TEXTURE0); + GlState.setActiveTexture(GL46.GL_TEXTURE0); } private void updateTorchFlicker() @@ -1161,12 +1178,12 @@ public class Renderer { this.getMouseOver(partialTicks); GlState.enableDepth(); GlState.enableAlpha(); - GlState.alphaFunc(GL11.GL_GREATER, 0.5F); + GlState.alphaFunc(GL46.GL_GREATER, 0.5F); boolean flag = this.gm.getRenderViewEntity() != null && this.gm.getRenderViewEntity().isPlayer(); GlState.enableCull(); this.updateFogColor(partialTicks); - GL11.glClear(16640); + GL46.glClear(16640); this.setupCameraTransform(partialTicks); MatrixState.update(this.gm.player, this.gm.thirdPersonView == 2); Entity entity = this.gm.getRenderViewEntity(); @@ -1177,19 +1194,19 @@ public class Renderer { if (this.gm.renderDistance >= 4) { this.setupFog(-1, partialTicks); - GL11.glMatrixMode(GL11.GL_PROJECTION); - GL11.glLoadIdentity(); + GL46.glMatrixMode(GL46.GL_PROJECTION); + GL46.glLoadIdentity(); Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.gm.fbRawX / (float)this.gm.fbRawY, 0.05F, this.farPlaneDistance * 2.0F); - GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL46.glMatrixMode(GL46.GL_MODELVIEW); this.renderSky(partialTicks); - GL11.glMatrixMode(GL11.GL_PROJECTION); - GL11.glLoadIdentity(); + GL46.glMatrixMode(GL46.GL_PROJECTION); + GL46.glLoadIdentity(); Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.gm.fbRawX / (float)this.gm.fbRawY, 0.05F, this.farPlaneDistance * SQRT_2); - GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL46.glMatrixMode(GL46.GL_MODELVIEW); } this.setupFog(0, partialTicks); - GlState.shadeModel(GL11.GL_SMOOTH); + GlState.shadeModel(GL46.GL_SMOOTH); if (entity.posY + (double)entity.getEyeHeight() < (double)this.gm.world.dimension.getCloudHeight()) { @@ -1200,27 +1217,24 @@ public class Renderer { ItemRenderer.disableStandardItemLighting(); this.setupTerrain(entity, (double)partialTicks, this.frameCount++, entity != this.gm.player || this.gm.player.noclip); this.updateChunks(finishTimeNano); - GL11.glMatrixMode(GL11.GL_MODELVIEW); - GL11.glPushMatrix(); - GlState.disableAlpha(); - this.renderBlockLayer(BlockLayer.SOLID, (double)partialTicks, entity); - GlState.enableAlpha(); - this.renderBlockLayer(BlockLayer.CUTOUT, (double)partialTicks, entity); - GlState.shadeModel(GL11.GL_FLAT); - GlState.alphaFunc(GL11.GL_GREATER, 0.1F); + GL46.glMatrixMode(GL46.GL_MODELVIEW); + GL46.glPushMatrix(); + this.renderBlockLayer((double)partialTicks, entity); + GlState.shadeModel(GL46.GL_FLAT); + GlState.alphaFunc(GL46.GL_GREATER, 0.1F); // if (!this.debugView) // { - GL11.glMatrixMode(GL11.GL_MODELVIEW); - GL11.glPopMatrix(); - GL11.glPushMatrix(); + GL46.glMatrixMode(GL46.GL_MODELVIEW); + GL46.glPopMatrix(); + GL46.glPushMatrix(); ItemRenderer.enableStandardItemLighting(); this.renderEntities(entity, partialTicks); ItemRenderer.disableStandardItemLighting(); this.disableLightmap(); - GL11.glMatrixMode(GL11.GL_MODELVIEW); - GL11.glPopMatrix(); - GL11.glPushMatrix(); + GL46.glMatrixMode(GL46.GL_MODELVIEW); + GL46.glPopMatrix(); + GL46.glPushMatrix(); if (this.gm.pointed != null && entity.isInsideOfLiquid() && flag) { @@ -1231,8 +1245,8 @@ public class Renderer { } // } - GL11.glMatrixMode(GL11.GL_MODELVIEW); - GL11.glPopMatrix(); + GL46.glMatrixMode(GL46.GL_MODELVIEW); + GL46.glPopMatrix(); if (flag && this.gm.pointed != null && !entity.isInsideOfLiquid()) { @@ -1242,7 +1256,7 @@ public class Renderer { GlState.enableAlpha(); } GlState.enableBlend(); - GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE, GL11.GL_ZERO); + GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ONE, GL46.GL_ZERO); this.drawBlockDamageTexture(Tessellator.getBuffer(), entity, partialTicks); GlState.disableBlend(); @@ -1263,15 +1277,15 @@ public class Renderer { // renderglobal.renderWorldBorder(entity, partialTicks); GlState.disableBlend(); GlState.enableCull(); - GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); - GlState.alphaFunc(GL11.GL_GREATER, 0.1F); + GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ZERO); + GlState.alphaFunc(GL46.GL_GREATER, 0.1F); // this.setupFog(0, partialTicks); // GlState.enableBlend(); // GlState.depthMask(false); // this.gm.getTextureManager().bindTexture(TextureMap.BLOCKS); -// GlState.shadeModel(GL11.GL_SMOOTH); +// GlState.shadeModel(GL46.GL_SMOOTH); // this.renderBlockLayer(BlockLayer.TRANSLUCENT, (double)partialTicks, entity); -// GlState.shadeModel(GL11.GL_FLAT); +// GlState.shadeModel(GL46.GL_FLAT); // GlState.depthMask(true); // GlState.enableCull(); // GlState.disableBlend(); @@ -1284,7 +1298,7 @@ public class Renderer { if (entity == this.gm.player && !(this.gm.player instanceof EntityCameraHolder)) { - GL11.glClear(256); + GL46.glClear(256); this.renderHand(partialTicks); } } @@ -1293,21 +1307,21 @@ public class Renderer { { if (this.gm.renderDistance >= 4) { - GL11.glMatrixMode(GL11.GL_PROJECTION); - GL11.glLoadIdentity(); + GL46.glMatrixMode(GL46.GL_PROJECTION); + GL46.glLoadIdentity(); Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.gm.fbRawX / (float)this.gm.fbRawY, 0.05F, this.farPlaneDistance * 4.0F); - GL11.glMatrixMode(GL11.GL_MODELVIEW); - GL11.glPushMatrix(); + GL46.glMatrixMode(GL46.GL_MODELVIEW); + GL46.glPushMatrix(); this.setupFog(0, partialTicks); float alpha = 0.8F * (1.0f - this.getSpaceFactor()); if(this.gm.world.dimension.hasWeather() && alpha > 0.5f) this.renderClouds(alpha, partialTicks); GlState.disableFog(); - GL11.glPopMatrix(); - GL11.glMatrixMode(GL11.GL_PROJECTION); - GL11.glLoadIdentity(); + GL46.glPopMatrix(); + GL46.glMatrixMode(GL46.GL_PROJECTION); + GL46.glLoadIdentity(); Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.gm.fbRawX / (float)this.gm.fbRawY, 0.05F, this.farPlaneDistance * SQRT_2); - GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL46.glMatrixMode(GL46.GL_MODELVIEW); } } @@ -1422,10 +1436,10 @@ public class Renderer { int ez = ExtMath.floord(entity.posZ); RenderBuffer buf = Tessellator.getBuffer(); GlState.disableCull(); - GL11.glNormal3f(0.0F, 1.0F, 0.0F); + GL46.glNormal3f(0.0F, 1.0F, 0.0F); GlState.enableBlend(); - GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); - GlState.alphaFunc(GL11.GL_GREATER, 0.1F); + GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ZERO); + GlState.alphaFunc(GL46.GL_GREATER, 0.1F); double ax = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)partial; double ay = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)partial; double az = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double)partial; @@ -1475,7 +1489,7 @@ public class Renderer { mode = temp >= 194.0f ? 2 : (temp <= 5.0f ? 3 : 0); this.gm.getTextureManager() .bindTexture(temp >= 194.0f ? TEX_MOLTEN : (temp <= 5.0f ? TEX_HAIL : TEX_RAIN)); - buf.begin(GL11.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP); + buf.begin(GL46.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP); } double offset = ((double)(this.rendererUpdateCount + x * x * 3121 + x * 45238971 + z * z * 418711 + z * 13761 & 31) @@ -1503,7 +1517,7 @@ public class Renderer { Tessellator.draw(); mode = 1; this.gm.getTextureManager().bindTexture(TEX_SNOW); - buf.begin(GL11.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP); + buf.begin(GL46.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP); } double offset = (double)(((float)(this.rendererUpdateCount & 511) + partial) / 512.0F); @@ -1535,7 +1549,7 @@ public class Renderer { buf.setTranslation(0.0D, 0.0D, 0.0D); GlState.enableCull(); GlState.disableBlend(); - GlState.alphaFunc(GL11.GL_GREATER, 0.1F); + GlState.alphaFunc(GL46.GL_GREATER, 0.1F); this.disableLightmap(); } @@ -1686,8 +1700,8 @@ public class Renderer { float distance = Math.min(0.995f, Math.max(0.005f, FOG_DISTANCE - (0.3f * fog))); float density = 1.0f - Math.min(1.0f, FOG_DENSITY * (1.0f - fog * 0.1f)); - GL11.glFogfv(GL11.GL_FOG_COLOR, (FloatBuffer)this.setFogColorBuffer(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 1.0F)); - GL11.glNormal3f(0.0F, -1.0F, 0.0F); + GL46.glFogfv(GL46.GL_FOG_COLOR, (FloatBuffer)this.setFogColorBuffer(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 1.0F)); + GL46.glNormal3f(0.0F, -1.0F, 0.0F); GlState.color(1.0F, 1.0F, 1.0F, 1.0F); Block block = MatrixState.getLookedBlock(this.gm.world, entity, partial); @@ -1704,7 +1718,7 @@ public class Renderer { far = 5.0F + (this.farPlaneDistance - 5.0F) * (1.0F - (float)effect / 20.0F); } - GlState.setFog(GL11.GL_LINEAR); + GlState.setFog(GL46.GL_LINEAR); if (start == -1) { @@ -1729,7 +1743,7 @@ public class Renderer { // } else if (block.getMaterial().isColdLiquid()) { - GlState.setFog(GL11.GL_EXP); + GlState.setFog(GL46.GL_EXP); // if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).hasEffect(Potion.waterBreathing)) // { @@ -1742,13 +1756,13 @@ public class Renderer { } else if (block.getMaterial().isHotLiquid()) { - GlState.setFog(GL11.GL_EXP); + GlState.setFog(GL46.GL_EXP); GlState.setFogDensity(2.0F); } else { float far = this.farPlaneDistance; - GlState.setFog(GL11.GL_LINEAR); + GlState.setFog(GL46.GL_LINEAR); if (start == -1) { @@ -1775,7 +1789,7 @@ public class Renderer { GlState.enableColorMaterial(); GlState.setFogEnabled(distance < 1.0f); - GlState.colorMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT); + GlState.colorMaterial(GL46.GL_FRONT, GL46.GL_AMBIENT); } private FloatBuffer setFogColorBuffer(float red, float green, float blue, float alpha) @@ -1871,7 +1885,7 @@ public class Renderer { { int i = 64; int j = 6; - worldRendererIn.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); + worldRendererIn.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION); for (int k = -384; k <= 384; k += 64) { @@ -1970,7 +1984,7 @@ public class Renderer { { max -= min; Random rand = new Random(seed); - rend.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); + rend.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION); for (int n = 0; n < nstars; ++n) { @@ -2133,12 +2147,12 @@ public class Renderer { if (this.gm.tileOverlay) { - GlState.depthFunc(GL11.GL_ALWAYS); + GlState.depthFunc(GL46.GL_ALWAYS); GlState.disableFog(); ItemRenderer.disableStandardItemLighting(); GlState.enableBlend(); - GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); - GL11.glLineWidth(2.0F); + GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ZERO); + GL46.glLineWidth(2.0F); GlState.disableTexture2D(); GlState.depthMask(false); @@ -2166,19 +2180,19 @@ public class Renderer { GlState.depthMask(true); GlState.enableFog(); GlState.enableColorMaterial(); - GlState.depthFunc(GL11.GL_LEQUAL); + GlState.depthFunc(GL46.GL_LEQUAL); GlState.enableDepth(); GlState.enableAlpha(); } if (this.gm.renderOutlines && this.gm.player != null) { - GlState.depthFunc(GL11.GL_ALWAYS); + GlState.depthFunc(GL46.GL_ALWAYS); GlState.disableFog(); ItemRenderer.disableStandardItemLighting(); GlState.enableBlend(); - GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); - GL11.glLineWidth(2.0F); + GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ZERO); + GL46.glLineWidth(2.0F); GlState.disableTexture2D(); GlState.depthMask(false); @@ -2205,7 +2219,7 @@ public class Renderer { GlState.depthMask(true); GlState.enableFog(); GlState.enableColorMaterial(); - GlState.depthFunc(GL11.GL_LEQUAL); + GlState.depthFunc(GL46.GL_LEQUAL); GlState.enableDepth(); GlState.enableAlpha(); } @@ -2547,7 +2561,7 @@ public class Renderer { return new Vector3f(f3 * f4, f5, f2 * f4); } - private int renderBlockLayer(BlockLayer blockLayerIn, double partialTicks, Entity entityIn) + private int renderBlockLayer(double partialTicks, Entity entityIn) { ItemRenderer.disableStandardItemLighting(); @@ -2558,33 +2572,33 @@ public class Renderer { { RenderChunk renderchunk = ((RenderInfo)this.renderInfos.get(j)).chunk; - if (!renderchunk.getCompiledChunk().isLayerEmpty(blockLayerIn)) + if (!renderchunk.getCompiledChunk().isLayerEmpty()) { ++l; - this.addRenderChunk(renderchunk, blockLayerIn); + this.addRenderChunk(renderchunk); } } - this.renderBlockLayer(blockLayerIn); + this.renderBlockLayer(); return l; } - private void renderBlockLayer(BlockLayer blockLayerIn) + private void renderBlockLayer() { this.gm.renderer.enableLightmap(); // if (OpenGl.useVbo()) // { - GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); - GL13.glClientActiveTexture(GL13.GL_TEXTURE0); - GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); - GL13.glClientActiveTexture(GL13.GL_TEXTURE1); - GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); - GL13.glClientActiveTexture(GL13.GL_TEXTURE0); - GL11.glEnableClientState(GL11.GL_COLOR_ARRAY); + GL46.glEnableClientState(GL46.GL_VERTEX_ARRAY); + GL46.glClientActiveTexture(GL46.GL_TEXTURE0); + GL46.glEnableClientState(GL46.GL_TEXTURE_COORD_ARRAY); + GL46.glClientActiveTexture(GL46.GL_TEXTURE1); + GL46.glEnableClientState(GL46.GL_TEXTURE_COORD_ARRAY); + GL46.glClientActiveTexture(GL46.GL_TEXTURE0); + GL46.glEnableClientState(GL46.GL_COLOR_ARRAY); // } - this.renderChunkLayer(blockLayerIn); + this.renderChunkLayer(); // if (OpenGl.useVbo()) // { @@ -2596,17 +2610,17 @@ public class Renderer { switch (vertexformatelement$enumusage) { case POSITION: - GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); + GL46.glDisableClientState(GL46.GL_VERTEX_ARRAY); break; case UV: - GL13.glClientActiveTexture(GL13.GL_TEXTURE0 + i); - GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); - GL13.glClientActiveTexture(GL13.GL_TEXTURE0); + GL46.glClientActiveTexture(GL46.GL_TEXTURE0 + i); + GL46.glDisableClientState(GL46.GL_TEXTURE_COORD_ARRAY); + GL46.glClientActiveTexture(GL46.GL_TEXTURE0); break; case COLOR: - GL11.glDisableClientState(GL11.GL_COLOR_ARRAY); + GL46.glDisableClientState(GL46.GL_COLOR_ARRAY); GlState.resetColor(); } } @@ -2634,7 +2648,7 @@ public class Renderer { GlState.disableFog(); GlState.disableAlpha(); GlState.enableBlend(); - GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); + GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ZERO); ItemRenderer.disableStandardItemLighting(); GlState.depthMask(false); this.renderEngine.bindTexture(texture); @@ -2643,40 +2657,40 @@ public class Renderer { for (int i = 0; i < 6; ++i) { - GL11.glPushMatrix(); + GL46.glPushMatrix(); if (i == 1) { - GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + GL46.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); } if (i == 2) { - GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); + GL46.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); } if (i == 3) { - GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); + GL46.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); } if (i == 4) { - GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); + GL46.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); } if (i == 5) { - GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F); + GL46.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F); } - worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR); worldrenderer.pos(-100.0D, -100.0D, -100.0D).tex(0.0D, 0.0D).color(40, 40, 40, 255).endVertex(); worldrenderer.pos(-100.0D, -100.0D, 100.0D).tex(0.0D, 16.0D).color(40, 40, 40, 255).endVertex(); worldrenderer.pos(100.0D, -100.0D, 100.0D).tex(16.0D, 16.0D).color(40, 40, 40, 255).endVertex(); worldrenderer.pos(100.0D, -100.0D, -100.0D).tex(16.0D, 0.0D).color(40, 40, 40, 255).endVertex(); Tessellator.draw(); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } GlState.depthMask(true); @@ -2719,11 +2733,11 @@ public class Renderer { // if (this.vboEnabled) // { this.skyVBO.bindBuffer(); - GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); - GL11.nglVertexPointer(3, GL11.GL_FLOAT, 12, 0L); - this.skyVBO.drawArrays(GL11.GL_QUADS); + GL46.glEnableClientState(GL46.GL_VERTEX_ARRAY); + GL46.nglVertexPointer(3, GL46.GL_FLOAT, 12, 0L); + this.skyVBO.drawArrays(GL46.GL_QUADS); this.skyVBO.unbindBuffer(); - GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); + GL46.glDisableClientState(GL46.GL_VERTEX_ARRAY); // } // else // { @@ -2733,7 +2747,7 @@ public class Renderer { GlState.disableFog(); GlState.disableAlpha(); GlState.enableBlend(); - GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); + GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ZERO); ItemRenderer.disableStandardItemLighting(); float[] afloat = this.theWorld.dimension.hasDaylight() && !this.theWorld.dimension.isBaseDestroyed() ? @@ -2741,11 +2755,11 @@ public class Renderer { if (afloat != null) { GlState.disableTexture2D(); - GlState.shadeModel(GL11.GL_SMOOTH); - GL11.glPushMatrix(); - GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(ExtMath.sin(this.theWorld.getDayPhase(partialTicks)) < 0.0F ? 180.0F : 0.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); + GlState.shadeModel(GL46.GL_SMOOTH); + GL46.glPushMatrix(); + GL46.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + GL46.glRotatef(ExtMath.sin(this.theWorld.getDayPhase(partialTicks)) < 0.0F ? 180.0F : 0.0F, 0.0F, 0.0F, 1.0F); + GL46.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); float f6 = afloat[0]; float f7 = afloat[1]; float f8 = afloat[2]; @@ -2760,7 +2774,7 @@ public class Renderer { // f8 = f11; // } - worldrenderer.begin(GL11.GL_TRIANGLE_FAN, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.begin(GL46.GL_TRIANGLE_FAN, DefaultVertexFormats.POSITION_COLOR); worldrenderer.pos(0.0D, 100.0D, 0.0D).color(f6, f7, f8, afloat[3]).endVertex(); int j = 16; @@ -2773,16 +2787,16 @@ public class Renderer { } Tessellator.draw(); - GL11.glPopMatrix(); - GlState.shadeModel(GL11.GL_FLAT); + GL46.glPopMatrix(); + GlState.shadeModel(GL46.GL_FLAT); } GlState.enableTexture2D(); - GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE, GL11.GL_ZERO); - GL11.glPushMatrix(); + GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ONE, GL46.GL_ZERO); + GL46.glPushMatrix(); float f16 = 1.0F - Math.max(this.theWorld.getRainStrength(), this.theWorld.getFogStrength()); - GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(this.theWorld.getCelestialAngle(partialTicks), 1.0F, 0.0F, 0.0F); + GL46.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(this.theWorld.getCelestialAngle(partialTicks), 1.0F, 0.0F, 0.0F); if(this.gm.world.dimension.getType() == DimType.PLANET || this.gm.world.dimension.getType() == DimType.MOON) { float size = 30.0F; int color = this.gm.world.dimension.getSunColor(); @@ -2791,7 +2805,7 @@ public class Renderer { Vec3 ncolor = new Vec3(color); float mul = Math.min(1.0f / (float)ncolor.xCoord, Math.min(1.0f / (float)ncolor.yCoord, 1.0f / (float)ncolor.zCoord)); GlState.color((float)ncolor.xCoord * mul, (float)ncolor.yCoord * mul, (float)ncolor.zCoord * mul, f16); - worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + worldrenderer.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_TEX); worldrenderer.pos((double)(-size), 100.0D, (double)(-size)).tex(0.0D, 0.0D).endVertex(); worldrenderer.pos((double)size, 100.0D, (double)(-size)).tex(1.0D, 0.0D).endVertex(); worldrenderer.pos((double)size, 100.0D, (double)size).tex(1.0D, 1.0D).endVertex(); @@ -2816,7 +2830,7 @@ public class Renderer { float v1 = destroyed ? 0.0f : (float)(ty + 0) / 2.0F; float u2 = destroyed ? 1.0f : (float)(tx + 1) / 4.0F; float v2 = destroyed ? 1.0f : (float)(ty + 1) / 2.0F; - worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + worldrenderer.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_TEX); worldrenderer.pos((double)(-size + mx), -100.0D, (double)(size + mz)).tex((double)u2, (double)v2).endVertex(); worldrenderer.pos((double)(size + mx), -100.0D, (double)(size + mz)).tex((double)u1, (double)v2).endVertex(); worldrenderer.pos((double)(size + mx), -100.0D, (double)(-size + mz)).tex((double)u1, (double)v1).endVertex(); @@ -2843,11 +2857,11 @@ public class Renderer { // if (this.vboEnabled) // { this.starVBO.bindBuffer(); - GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); - GL11.nglVertexPointer(3, GL11.GL_FLOAT, 12, 0L); - this.starVBO.drawArrays(GL11.GL_QUADS); + GL46.glEnableClientState(GL46.GL_VERTEX_ARRAY); + GL46.nglVertexPointer(3, GL46.GL_FLOAT, 12, 0L); + this.starVBO.drawArrays(GL46.GL_QUADS); this.starVBO.unbindBuffer(); - GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); + GL46.glDisableClientState(GL46.GL_VERTEX_ARRAY); // } // else // { @@ -2870,11 +2884,11 @@ public class Renderer { // if (this.vboEnabled) // { this.dstarVBO.bindBuffer(); - GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); - GL11.nglVertexPointer(3, GL11.GL_FLOAT, 12, 0L); - this.dstarVBO.drawArrays(GL11.GL_QUADS); + GL46.glEnableClientState(GL46.GL_VERTEX_ARRAY); + GL46.nglVertexPointer(3, GL46.GL_FLOAT, 12, 0L); + this.dstarVBO.drawArrays(GL46.GL_QUADS); this.dstarVBO.unbindBuffer(); - GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); + GL46.glDisableClientState(GL46.GL_VERTEX_ARRAY); // } // else // { @@ -2886,7 +2900,7 @@ public class Renderer { GlState.disableBlend(); GlState.enableAlpha(); GlState.enableFog(); - GL11.glPopMatrix(); + GL46.glPopMatrix(); GlState.enableTexture2D(); GlState.depthMask(true); } @@ -2910,7 +2924,7 @@ public class Renderer { d2 = d2 - (double)(j * 2048); this.renderEngine.bindTexture(this.gm.world.dimension.getCloudTexture()); GlState.enableBlend(); - GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); + GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ZERO); Vec3 vec3 = this.gm.renderer.getCloudColor(this.gm.getRenderViewEntity(), partialTicks); float f4 = (float)vec3.xCoord; float f5 = (float)vec3.yCoord; @@ -2943,7 +2957,7 @@ public class Renderer { int k = 8; int l = 4; float f21 = 9.765625E-4F; - GL11.glScalef(12.0F, 1.0F, 12.0F); + GL46.glScalef(12.0F, 1.0F, 12.0F); for (int i1 = 0; i1 < 2; ++i1) { @@ -2972,7 +2986,7 @@ public class Renderer { { for (int k1 = -3; k1 <= 4; ++k1) { - worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL); + worldrenderer.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL); float f22 = (float)(j1 * 8); float f23 = (float)(k1 * 8); float f24 = f22 - f19; @@ -3079,14 +3093,14 @@ public class Renderer { private void preRenderDamagedBlocks() { - GlState.tryBlendFuncSeparate(GL11.GL_DST_COLOR, GL11.GL_SRC_COLOR, GL11.GL_ONE, GL11.GL_ZERO); + GlState.tryBlendFuncSeparate(GL46.GL_DST_COLOR, GL46.GL_SRC_COLOR, GL46.GL_ONE, GL46.GL_ZERO); GlState.enableBlend(); GlState.color(1.0F, 1.0F, 1.0F, 0.5F); GlState.doPolygonOffset(-3.0F, -3.0F); GlState.enablePolygonOffset(); - GlState.alphaFunc(GL11.GL_GREATER, 0.1F); + GlState.alphaFunc(GL46.GL_GREATER, 0.1F); GlState.enableAlpha(); - GL11.glPushMatrix(); + GL46.glPushMatrix(); } private void postRenderDamagedBlocks() @@ -3096,7 +3110,7 @@ public class Renderer { GlState.disablePolygonOffset(); GlState.enableAlpha(); GlState.depthMask(true); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } private void drawBlockDamageTexture(RenderBuffer worldRendererIn, Entity entityIn, float partialTicks) @@ -3109,7 +3123,7 @@ public class Renderer { { this.renderEngine.bindTexture(TextureMap.BLOCKS); this.preRenderDamagedBlocks(); - worldRendererIn.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK); + worldRendererIn.begin(GL46.GL_QUADS, DefaultVertexFormats.BLOCK); worldRendererIn.setTranslation(-d0, -d1, -d2); worldRendererIn.noColor(); Iterator iterator = this.damagedBlocks.values().iterator(); @@ -3156,9 +3170,9 @@ public class Renderer { if (movingObjectPositionIn.type == HitPosition.ObjectType.BLOCK) { GlState.enableBlend(); - GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); + GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ZERO); GlState.color(0.0F, 0.0F, 0.0F, 0.4F); - GL11.glLineWidth(2.0F); + GL46.glLineWidth(2.0F); GlState.disableTexture2D(); GlState.depthMask(false); float f = 0.002F; @@ -3184,21 +3198,21 @@ public class Renderer { { // Tessellator tessellator = Tessellator.getInstance(); RenderBuffer worldrenderer = Tessellator.getBuffer(); - worldrenderer.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION); + worldrenderer.begin(GL46.GL_LINE_STRIP, DefaultVertexFormats.POSITION); worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.minZ).endVertex(); worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.minZ).endVertex(); worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.maxZ).endVertex(); worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.maxZ).endVertex(); worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.minZ).endVertex(); Tessellator.draw(); - worldrenderer.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION); + worldrenderer.begin(GL46.GL_LINE_STRIP, DefaultVertexFormats.POSITION); worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.minZ).endVertex(); worldrenderer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.minZ).endVertex(); worldrenderer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ).endVertex(); worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.maxZ).endVertex(); worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.minZ).endVertex(); Tessellator.draw(); - worldrenderer.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION); + worldrenderer.begin(GL46.GL_LINES, DefaultVertexFormats.POSITION); worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.minZ).endVertex(); worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.minZ).endVertex(); worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.minZ).endVertex(); @@ -3214,21 +3228,21 @@ public class Renderer { { // Tessellator tessellator = Tessellator.getInstance(); RenderBuffer worldrenderer = Tessellator.getBuffer(); - worldrenderer.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.begin(GL46.GL_LINE_STRIP, DefaultVertexFormats.POSITION_COLOR); worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.minZ).color(red, green, blue, alpha).endVertex(); worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.minZ).color(red, green, blue, alpha).endVertex(); worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.maxZ).color(red, green, blue, alpha).endVertex(); worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.maxZ).color(red, green, blue, alpha).endVertex(); worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.minZ).color(red, green, blue, alpha).endVertex(); Tessellator.draw(); - worldrenderer.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.begin(GL46.GL_LINE_STRIP, DefaultVertexFormats.POSITION_COLOR); worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.minZ).color(red, green, blue, alpha).endVertex(); worldrenderer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.minZ).color(red, green, blue, alpha).endVertex(); worldrenderer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ).color(red, green, blue, alpha).endVertex(); worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.maxZ).color(red, green, blue, alpha).endVertex(); worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.minZ).color(red, green, blue, alpha).endVertex(); Tessellator.draw(); - worldrenderer.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.begin(GL46.GL_LINES, DefaultVertexFormats.POSITION_COLOR); worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.minZ).color(red, green, blue, alpha).endVertex(); worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.minZ).color(red, green, blue, alpha).endVertex(); worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.minZ).color(red, green, blue, alpha).endVertex(); @@ -3292,31 +3306,31 @@ public class Renderer { private void preRenderChunk(RenderChunk renderChunkIn) { BlockPos blockpos = renderChunkIn.getPosition(); - GL11.glTranslatef((float)((double)blockpos.getX() - this.viewEntityX), (float)((double)blockpos.getY() - this.viewEntityY), (float)((double)blockpos.getZ() - this.viewEntityZ)); + GL46.glTranslatef((float)((double)blockpos.getX() - this.viewEntityX), (float)((double)blockpos.getY() - this.viewEntityY), (float)((double)blockpos.getZ() - this.viewEntityZ)); } - private void addRenderChunk(RenderChunk renderChunkIn, BlockLayer layer) + private void addRenderChunk(RenderChunk renderChunkIn) { this.renderChunks.add(renderChunkIn); } - private void renderChunkLayer(BlockLayer layer) + private void renderChunkLayer() { if (this.initialized) { for (RenderChunk renderchunk : this.renderChunks) { - VertexBuffer vertexbuffer = renderchunk.getVertexBufferByLayer(layer.ordinal()); - GL11.glPushMatrix(); + VertexBuffer vertexbuffer = renderchunk.getVertexBuffer(); + GL46.glPushMatrix(); this.preRenderChunk(renderchunk); renderchunk.multModelviewMatrix(); vertexbuffer.bindBuffer(); this.setupArrayPointers(); - vertexbuffer.drawArrays(GL11.GL_QUADS); - GL11.glPopMatrix(); + vertexbuffer.drawArrays(GL46.GL_QUADS); + GL46.glPopMatrix(); } - GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0); + GL46.glBindBuffer(GL46.GL_ARRAY_BUFFER, 0); GlState.resetColor(); this.renderChunks.clear(); } @@ -3324,12 +3338,12 @@ public class Renderer { private void setupArrayPointers() { - GL11.nglVertexPointer(3, GL11.GL_FLOAT, 28, 0L); - GL11.nglColorPointer(4, GL11.GL_UNSIGNED_BYTE, 28, 12L); - GL11.glTexCoordPointer(2, GL11.GL_FLOAT, 28, 16L); - GL13.glClientActiveTexture(GL13.GL_TEXTURE1); - GL11.glTexCoordPointer(2, GL11.GL_SHORT, 28, 24L); - GL13.glClientActiveTexture(GL13.GL_TEXTURE0); + GL46.nglVertexPointer(3, GL46.GL_FLOAT, 28, 0L); + GL46.nglColorPointer(4, GL46.GL_UNSIGNED_BYTE, 28, 12L); + GL46.glTexCoordPointer(2, GL46.GL_FLOAT, 28, 16L); + GL46.glClientActiveTexture(GL46.GL_TEXTURE1); + GL46.glTexCoordPointer(2, GL46.GL_SHORT, 28, 24L); + GL46.glClientActiveTexture(GL46.GL_TEXTURE0); } public void renderStarField(int w, int h, int bg, int color, float ticks, Random rand) { @@ -3342,18 +3356,18 @@ public class Renderer { Drawing.drawRect(0, 0, w, h, bg | 0xff000000); // Gui.drawRect(0, 0, w, h, bg | 0xff000000); for(int z = 0; z < 6; z++) { - GL11.glMatrixMode(GL11.GL_MODELVIEW); - GL11.glLoadIdentity(); + GL46.glMatrixMode(GL46.GL_MODELVIEW); + GL46.glLoadIdentity(); float shift = ticks % 30.0f - (float)z * 30.0f; int n = z + (int)(ticks / 30.0f); // WCF.glTranslatef(0.0f, 0.0f, (float)n * -30.0f); rand.setSeed((long)n * 8436723957L); - GL11.glRotatef(rand.floatv() * 360.0f, 0.0f, 0.0f, 1.0f); + GL46.glRotatef(rand.floatv() * 360.0f, 0.0f, 0.0f, 1.0f); float timer = (float)((double)(System.nanoTime() / 1000L) / 1000000.0) * 0.12f; // Project.gluLookAt(0.0f, 0.0f, shift, ExtMath.sin(timer), ExtMath.cos(timer * 2.0f), shift + ExtMath.cos(timer * 0.33f), 0.0f, ExtMath.sin(timer), ExtMath.cos(timer)); Project.gluLookAt(0.0f, 0.0f, shift, 0.0f, 0.0f, shift + 1.0f, 0.0f, 1.0f, 0.0f); - GL11.glMatrixMode(GL11.GL_PROJECTION); - GL11.glLoadIdentity(); + GL46.glMatrixMode(GL46.GL_PROJECTION); + GL46.glLoadIdentity(); Project.gluPerspective(90.0f, (float)w / (float)h, 0.05f, 1024.0f); // WCF.glTranslatef(w / 2.0f, h / 2.0f, 0.0f); // GlState.disableDepth(); @@ -3362,31 +3376,31 @@ public class Renderer { // this.skyVBO.bindBuffer(); // WCF.glEnableClientState(WCF.GL_VERTEX_ARRAY); // WCF.glVertexPointer(3, WCF.GL_FLOAT, 12, 0L); - // this.skyVBO.drawArrays(GL11.GL_QUADS); + // this.skyVBO.drawArrays(GL46.GL_QUADS); // this.skyVBO.unbindBuffer(); // WCF.glDisableClientState(WCF.GL_VERTEX_ARRAY); GlState.disableAlpha(); GlState.enableBlend(); - GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE, GL11.GL_ZERO); + GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ONE, GL46.GL_ZERO); ItemRenderer.disableStandardItemLighting(); GlState.color((float)stars.xCoord, (float)stars.yCoord, (float)stars.zCoord, 1.0f); this.starVBO.bindBuffer(); - GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); - GL11.nglVertexPointer(3, GL11.GL_FLOAT, 12, 0L); - this.starVBO.drawArrays(GL11.GL_QUADS); + GL46.glEnableClientState(GL46.GL_VERTEX_ARRAY); + GL46.nglVertexPointer(3, GL46.GL_FLOAT, 12, 0L); + this.starVBO.drawArrays(GL46.GL_QUADS); this.starVBO.unbindBuffer(); - GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); + GL46.glDisableClientState(GL46.GL_VERTEX_ARRAY); this.dstarVBO.bindBuffer(); - GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); - GL11.nglVertexPointer(3, GL11.GL_FLOAT, 12, 0L); - this.dstarVBO.drawArrays(GL11.GL_QUADS); + GL46.glEnableClientState(GL46.GL_VERTEX_ARRAY); + GL46.nglVertexPointer(3, GL46.GL_FLOAT, 12, 0L); + this.dstarVBO.drawArrays(GL46.GL_QUADS); this.dstarVBO.unbindBuffer(); - GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); + GL46.glDisableClientState(GL46.GL_VERTEX_ARRAY); GlState.enableTexture2D(); - GL11.glMatrixMode(GL11.GL_PROJECTION); - GL11.glLoadIdentity(); - GL11.glMatrixMode(GL11.GL_MODELVIEW); - GL11.glLoadIdentity(); + GL46.glMatrixMode(GL46.GL_PROJECTION); + GL46.glLoadIdentity(); + GL46.glMatrixMode(GL46.GL_MODELVIEW); + GL46.glLoadIdentity(); } GlState.enableCull(); this.gm.setupOverlay(); @@ -3456,7 +3470,7 @@ public class Renderer { { IBakedModel model = this.manager.getModelForState(state); Block block = state.getBlock(); - GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); for (Facing enumfacing : Facing.values()) { @@ -3473,7 +3487,7 @@ public class Renderer { for (BakedQuad bakedquad : listQuads) { - worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.ITEM); + worldrenderer.begin(GL46.GL_QUADS, DefaultVertexFormats.ITEM); worldrenderer.addVertexData(bakedquad.getVertexData()); worldrenderer.putColorRGB_F4(brightness, brightness, brightness); Vec3i vec3i = bakedquad.getFace().getDirectionVec(); diff --git a/client/src/main/java/client/renderer/Shader.java b/client/src/main/java/client/renderer/Shader.java new file mode 100644 index 00000000..8115c51a --- /dev/null +++ b/client/src/main/java/client/renderer/Shader.java @@ -0,0 +1,316 @@ +package client.renderer; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; +import java.util.Map; +import java.util.Map.Entry; +import java.util.function.Consumer; +import java.util.function.Supplier; + +import org.lwjgl.opengl.GL46; + +import client.Client; +import client.util.FileUtils; +import common.collect.Maps; +import common.log.Log; +import common.util.Matrix4f; +import common.util.Util; +import common.util.Vec3; +import common.util.Vector3f; +import common.util.Vector4f; + +public enum Shader { + WORLD("world", "world", context -> {context.integer("tex", 0); GL46.glUniformBlockBinding(context.getProgram(), GL46.glGetUniformBlockIndex(context.getProgram(), "light_block"), 0);}, context -> { + context.vec("clip_near", Client.CLIENT.renderer.getNearPlane()); + context.vec("clip_far", Client.CLIENT.renderer.getFarPlane()); + context.vec("screen", (float)Client.CLIENT.fbRawX, (float)Client.CLIENT.fbRawY); + Vec3 cam = MatrixState.getPosition(); + context.vec("cam_pos", (float)cam.xCoord, (float)cam.yCoord, (float)cam.zCoord); + context.matrix("view", MatrixState.getModelView()); + context.matrix("projection", MatrixState.getProjection()); + context.vec("dir_direction", Client.CLIENT.ambientX, Client.CLIENT.ambientY, Client.CLIENT.ambientZ); + float clear_r = Client.CLIENT.renderer.getFogColorRed(); + float clear_g = Client.CLIENT.renderer.getFogColorGreen(); + float clear_b = Client.CLIENT.renderer.getFogColorBlue(); + context.vec("dir_ambient", clear_r, clear_g, clear_b); + context.vec("dir_diffuse", clear_r * 1.25f, clear_g * 1.25f, clear_b * 1.25f); + context.vec("dir_specular", clear_r * 1.5f, clear_g * 1.5f, clear_b * 1.5f); + context.vec("light_factor", Client.CLIENT.lightBlend); + context.vec("max_vert_dist", Client.CLIENT.lightDistVert); + context.vec("max_cam_dist", Client.CLIENT.lightDistCam); + context.integer("n_lights", 0); + GlState.setActiveTexture(GL46.GL_TEXTURE0); +// glBindBufferBase(GL_UNIFORM_BUFFER, 0, world->light_buf); + }, "MAX_LIGHTS", (Supplier)() -> Client.CLIENT.lightMaximum), + + VIS("vis", "vis", null, context -> { + context.matrix("view", MatrixState.getModelView()); + context.matrix("projection", MatrixState.getProjection()); + }), + + GRID("grid", "grid", null, context -> { + context.vec("clip_near", Client.CLIENT.renderer.getNearPlane()); + context.vec("clip_far", Client.CLIENT.renderer.getFarPlane()); + context.vec("screen", (float)Client.CLIENT.fbRawX, (float)Client.CLIENT.fbRawY); + context.matrix("view", MatrixState.getModelView()); + context.matrix("projection", MatrixState.getProjection()); + context.vec("time", (float)Util.ftime()); + }); + +// BLIT("blit", "blit", context -> context.integer("tex", 0), context -> { +// GL46.glBindVertexArray(QUAD); +// GlState.setActiveTexture(GL46.GL_TEXTURE0); +// }); + + public class ShaderContext { + private final int program; + + private ShaderContext(int program) { + this.program = program; + } + + public int getProgram() { + return this.program; + } + + public ShaderContext bool(String name, boolean x) { + GL46.glUniform1i(GL46.glGetUniformLocation(this.program, name), x ? 1 : 0); + return this; + } + + public ShaderContext integer(String name, int x) { + GL46.glUniform1i(GL46.glGetUniformLocation(this.program, name), x); + return this; + } + + public ShaderContext vec(String name, float x) { + GL46.glUniform1f(GL46.glGetUniformLocation(this.program, name), x); + return this; + } + + public ShaderContext vec(String name, float x, float y) { + GL46.glUniform2f(GL46.glGetUniformLocation(this.program, name), x, y); + return this; + } + + public ShaderContext vec(String name, float x, float y, float z) { + GL46.glUniform3f(GL46.glGetUniformLocation(this.program, name), x, y, z); + return this; + } + + public ShaderContext vec(String name, float x, float y, float z, float w) { + GL46.glUniform4f(GL46.glGetUniformLocation(this.program, name), x, y, z, w); + return this; + } + + public ShaderContext vec(String name, Vec3 vec) { + GL46.glUniform3f(GL46.glGetUniformLocation(this.program, name), (float)vec.xCoord, (float)vec.yCoord, (float)vec.zCoord); + return this; + } + + public ShaderContext vec(String name, Vector3f vec) { + GL46.glUniform3f(GL46.glGetUniformLocation(this.program, name), vec.x, vec.y, vec.z); + return this; + } + + public ShaderContext vec(String name, Vector4f vec) { + GL46.glUniform4f(GL46.glGetUniformLocation(this.program, name), vec.x, vec.y, vec.z, vec.w); + return this; + } + + public ShaderContext matrix(String name, FloatBuffer mat) { + GL46.glUniformMatrix4fv(GL46.glGetUniformLocation(this.program, name), false, mat); + return this; + } + + public ShaderContext matrix(String name, Matrix4f mat) { + mat.store(BUFFER); + GL46.glUniformMatrix4fv(GL46.glGetUniformLocation(this.program, name), false, BUFFER); + return this; + } + + public ShaderContext color(String name, int color) { + GL46.glUniform4f(GL46.glGetUniformLocation(this.program, name), + (float)((int)((color >> 16) & 0xff)) / 255.0f, (float)((int)((color >> 8) & 0xff)) / 255.0f, + (float)((int)(color & 0xff)) / 255.0f, (float)((int)((color >> 24) & 0xff)) / 255.0f + ); + return this; + } + + public ShaderContext color3(String name, int color) { + GL46.glUniform3f(GL46.glGetUniformLocation(this.program, name), + (float)((int)((color >> 16) & 0xff)) / 255.0f, (float)((int)((color >> 8) & 0xff)) / 255.0f, + (float)((int)(color & 0xff)) / 255.0f + ); + return this; + } + + public void finish() { + if(context != this) + throw new IllegalStateException("Der Shader-Kontext wird nicht mehr verwendet"); + GL46.glUseProgram(0); + context = null; + } + } + + private static final FloatBuffer BUFFER = ByteBuffer.allocateDirect(16 << 2).order(ByteOrder.nativeOrder()).asFloatBuffer(); + + private static ShaderContext context; + + private final String vertex; + private final String fragment; + private final Consumer init; + private final Consumer draw; + private final Map> variables; + + private int program; + + public static void loadShaders() { + for(Shader shader : values()) { + if(!shader.load()) { + if(shader.program == 0) + throw new IllegalStateException("Konnte erforderliches Shader-Programm '" + shader.name() + "' nicht erstellen"); + else + Log.RENDER.error("Konnte Shader-Programm '%s' nicht neu laden", shader.name()); + } + } + } + + public static void unloadShaders() { + for(Shader shader : values()) { + shader.unload(); + } + } + + private Shader(String vertex, String fragment, Consumer init, Consumer draw, Object ... vars) { + this.vertex = vertex; + this.fragment = fragment; + this.init = init; + this.draw = draw; + if(vars.length % 2 == 1) + throw new IllegalArgumentException("Es muss eine gerade Zahl an Argmumenten angegeben werden"); + this.variables = vars.length == 0 ? null : Maps.newLinkedHashMap(); + for(int z = 0; z < vars.length / 2; z++) { + this.variables.put((String)vars[z / 2], (Supplier)vars[z / 2 + 1]); + } + } + + private String buildInclude() { + if(this.variables == null) + return ""; + StringBuilder sb = new StringBuilder(); + for(Entry> entry : this.variables.entrySet()) { + sb.append("#define ").append(entry.getKey()).append(' ').append(entry.getValue().get()).append('\n'); + } + return sb.toString(); + } + + private boolean compile(String vcode, String fcode) { + String include = this.buildInclude(); + int vs = GL46.glCreateShader(GL46.GL_VERTEX_SHADER); + GL46.glShaderSource(vs, "#version 460 compatibility\n" + include + vcode); + GL46.glCompileShader(vs); + int ok = GL46.glGetShaderi(vs, GL46.GL_COMPILE_STATUS); + if(ok == 0) { + Log.RENDER.error(GL46.glGetShaderInfoLog(vs)); + Log.RENDER.error("Fehler beim Kompilieren des Vertex-Shaders '%s'", this.vertex); + GL46.glDeleteShader(vs); + return false; + } + int fs = GL46.glCreateShader(GL46.GL_FRAGMENT_SHADER); + GL46.glShaderSource(fs, "#version 460 compatibility\n" + include + fcode); + GL46.glCompileShader(fs); + ok = GL46.glGetShaderi(fs, GL46.GL_COMPILE_STATUS); + if(ok == 0) { + Log.RENDER.error(GL46.glGetShaderInfoLog(fs)); + Log.RENDER.error("Fehler beim Kompilieren des Fragment-Shaders '%s'", this.fragment); + GL46.glDeleteShader(vs); + GL46.glDeleteShader(fs); + return false; + } + int pr = GL46.glCreateProgram(); + GL46.glAttachShader(pr, vs); + GL46.glAttachShader(pr, fs); + GL46.glLinkProgram(pr); + ok = GL46.glGetProgrami(pr, GL46.GL_LINK_STATUS); + if(ok == 0) { + Log.RENDER.error(GL46.glGetProgramInfoLog(pr)); + Log.RENDER.error("Fehler beim Verbinden des Shader-Programms '%s' / '%s'", this.vertex, this.fragment); + GL46.glDeleteShader(vs); + GL46.glDeleteShader(fs); + GL46.glDeleteProgram(pr); + return false; + } + GL46.glDeleteShader(vs); + GL46.glDeleteShader(fs); + if(this.program != 0) { + GL46.glDeleteProgram(this.program); + Log.RENDER.debug("Shader '%s' / '%s' / ID #%d wurde mit ID #%d neu geladen", this.vertex, this.fragment, this.program, pr); + } + else { + Log.RENDER.debug("Shader '%s' / '%s' wurde mit ID #%d geladen", this.vertex, this.fragment, pr); + } + this.program = pr; + if(this.init != null) { + context = this.use(); + this.init.accept(context); + context.finish(); + } + return true; + } + + private boolean load() { + String vcode; + try { + vcode = FileUtils.read("shaders/" + this.vertex + ".vsh"); + } + catch(IOException e) { + Log.RENDER.error(e, "Fehler beim Laden des Vertex-Shaders '%s'", this.vertex); + return false; + } + String fcode; + try { + fcode = FileUtils.read("shaders/" + this.fragment + ".fsh"); + } + catch(IOException e) { + Log.RENDER.error(e, "Fehler beim Laden des Fragment-Shaders '%s'", this.fragment); + return false; + } + return this.compile(vcode, fcode); + } + + private boolean unload() { + if(this.program == 0) + return false; + GL46.glDeleteProgram(this.program); + Log.RENDER.debug("Shader '%s' / '%s' / ID #%d wurde gelöscht", this.vertex, this.fragment, this.program); + this.program = 0; + return true; + } + + public ShaderContext use() { + if(context != null) + throw new IllegalStateException("Ein Shader wird bereits verwendet"); + GL46.glUseProgram(this.program); + context = new ShaderContext(this.program); + if(this.draw != null) + this.draw.accept(context); + return context; + } + + public void update() { + if(this.program != 0 && !this.load()) + Log.RENDER.error("Konnte Shader-Programm '%s' nicht neu laden", this.name()); + } + +// void shd_setint(int *pos, const char *vardef, int value) { +// *pos += sprintf(&gdr.shd_include[*pos], "#define %s %d\n", vardef, value); +// } +// +// void shd_setvars() { +// int pos = 0; +// shd_setint(&pos, "MAX_LIGHTS", gdr.light_max < 1 ? 1 : gdr.light_max); +// } +} diff --git a/client/src/main/java/client/renderer/Tessellator.java b/client/src/main/java/client/renderer/Tessellator.java index c7d69b99..4183e5d2 100755 --- a/client/src/main/java/client/renderer/Tessellator.java +++ b/client/src/main/java/client/renderer/Tessellator.java @@ -3,8 +3,7 @@ package client.renderer; import java.nio.ByteBuffer; import java.util.List; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL13; +import org.lwjgl.opengl.GL46; public abstract class Tessellator { @@ -36,29 +35,29 @@ public abstract class Tessellator switch (vertexformatelement$enumusage) { case POSITION: - GL11.glVertexPointer(vertexformatelement.count(), k, i, bytebuffer); - GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); + GL46.glVertexPointer(vertexformatelement.count(), k, i, bytebuffer); + GL46.glEnableClientState(GL46.GL_VERTEX_ARRAY); break; case UV: - GL13.glClientActiveTexture(GL13.GL_TEXTURE0 + l); - GL11.glTexCoordPointer(vertexformatelement.count(), k, i, bytebuffer); - GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); - GL13.glClientActiveTexture(GL13.GL_TEXTURE0); + GL46.glClientActiveTexture(GL46.GL_TEXTURE0 + l); + GL46.glTexCoordPointer(vertexformatelement.count(), k, i, bytebuffer); + GL46.glEnableClientState(GL46.GL_TEXTURE_COORD_ARRAY); + GL46.glClientActiveTexture(GL46.GL_TEXTURE0); break; case COLOR: - GL11.glColorPointer(vertexformatelement.count(), k, i, bytebuffer); - GL11.glEnableClientState(GL11.GL_COLOR_ARRAY); + GL46.glColorPointer(vertexformatelement.count(), k, i, bytebuffer); + GL46.glEnableClientState(GL46.GL_COLOR_ARRAY); break; case NORMAL: - GL11.glNormalPointer(k, i, bytebuffer); - GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY); + GL46.glNormalPointer(k, i, bytebuffer); + GL46.glEnableClientState(GL46.GL_NORMAL_ARRAY); } } - GL11.glDrawArrays(BUFFER.getDrawMode(), 0, BUFFER.getVertexCount()); + GL46.glDrawArrays(BUFFER.getDrawMode(), 0, BUFFER.getVertexCount()); int i1 = 0; for (int j1 = list.size(); i1 < j1; ++i1) @@ -70,22 +69,22 @@ public abstract class Tessellator switch (vertexformatelement$enumusage1) { case POSITION: - GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); + GL46.glDisableClientState(GL46.GL_VERTEX_ARRAY); break; case UV: - GL13.glClientActiveTexture(GL13.GL_TEXTURE0 + k1); - GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); - GL13.glClientActiveTexture(GL13.GL_TEXTURE0); + GL46.glClientActiveTexture(GL46.GL_TEXTURE0 + k1); + GL46.glDisableClientState(GL46.GL_TEXTURE_COORD_ARRAY); + GL46.glClientActiveTexture(GL46.GL_TEXTURE0); break; case COLOR: - GL11.glDisableClientState(GL11.GL_COLOR_ARRAY); + GL46.glDisableClientState(GL46.GL_COLOR_ARRAY); GlState.resetColor(); break; case NORMAL: - GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY); + GL46.glDisableClientState(GL46.GL_NORMAL_ARRAY); } } } diff --git a/client/src/main/java/client/renderer/VertexBuffer.java b/client/src/main/java/client/renderer/VertexBuffer.java index cf9f0954..4765bd91 100755 --- a/client/src/main/java/client/renderer/VertexBuffer.java +++ b/client/src/main/java/client/renderer/VertexBuffer.java @@ -2,8 +2,7 @@ package client.renderer; import java.nio.ByteBuffer; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL15; +import org.lwjgl.opengl.GL46; public class VertexBuffer { private int id; @@ -12,31 +11,31 @@ public class VertexBuffer { public VertexBuffer(VertexFormat format) { this.format = format; - this.id = GL15.glGenBuffers(); + this.id = GL46.glGenBuffers(); } public void bindBuffer() { - GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, this.id); + GL46.glBindBuffer(GL46.GL_ARRAY_BUFFER, this.id); } public void bufferData(ByteBuffer buffer) { this.bindBuffer(); - GL15.glBufferData(GL15.GL_ARRAY_BUFFER, buffer, GL15.GL_STATIC_DRAW); + GL46.glBufferData(GL46.GL_ARRAY_BUFFER, buffer, GL46.GL_STATIC_DRAW); this.unbindBuffer(); this.count = buffer.limit() / this.format.getNextOffset(); } public void drawArrays(int mode) { - GL11.glDrawArrays(mode, 0, this.count); + GL46.glDrawArrays(mode, 0, this.count); } public void unbindBuffer() { - GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0); + GL46.glBindBuffer(GL46.GL_ARRAY_BUFFER, 0); } public void deleteGlBuffers() { if(this.id >= 0) { - GL15.glDeleteBuffers(this.id); + GL46.glDeleteBuffers(this.id); this.id = -1; } } diff --git a/client/src/main/java/client/renderer/VertexFormatElement.java b/client/src/main/java/client/renderer/VertexFormatElement.java index 9062f918..fd0534ed 100755 --- a/client/src/main/java/client/renderer/VertexFormatElement.java +++ b/client/src/main/java/client/renderer/VertexFormatElement.java @@ -1,6 +1,6 @@ package client.renderer; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; public record VertexFormatElement(int index, VertexFormatElement.EnumType type, VertexFormatElement.EnumUsage usage, int count) { public String toString() { @@ -33,13 +33,13 @@ public record VertexFormatElement(int index, VertexFormatElement.EnumType type, } public static enum EnumType { - FLOAT(4, "Float", GL11.GL_FLOAT), - UBYTE(1, "Unsigned Byte", GL11.GL_UNSIGNED_BYTE), - BYTE(1, "Byte", GL11.GL_BYTE), - USHORT(2, "Unsigned Short", GL11.GL_UNSIGNED_SHORT), - SHORT(2, "Short", GL11.GL_SHORT), - UINT(4, "Unsigned Int", GL11.GL_UNSIGNED_INT), - INT(4, "Int", GL11.GL_INT); + FLOAT(4, "Float", GL46.GL_FLOAT), + UBYTE(1, "Unsigned Byte", GL46.GL_UNSIGNED_BYTE), + BYTE(1, "Byte", GL46.GL_BYTE), + USHORT(2, "Unsigned Short", GL46.GL_UNSIGNED_SHORT), + SHORT(2, "Short", GL46.GL_SHORT), + UINT(4, "Unsigned Int", GL46.GL_UNSIGNED_INT), + INT(4, "Int", GL46.GL_INT); private final int size; private final String name; diff --git a/client/src/main/java/client/renderer/chunk/BlockLayer.java b/client/src/main/java/client/renderer/chunk/BlockLayer.java deleted file mode 100755 index 4de9c4e2..00000000 --- a/client/src/main/java/client/renderer/chunk/BlockLayer.java +++ /dev/null @@ -1,16 +0,0 @@ -package client.renderer.chunk; - -public enum BlockLayer { - SOLID("Solid"), - CUTOUT("Cutout"); - - private final String name; - - private BlockLayer(String name) { - this.name = name; - } - - public String toString() { - return this.name; - } -} diff --git a/client/src/main/java/client/renderer/chunk/ChunkCompileTaskGenerator.java b/client/src/main/java/client/renderer/chunk/ChunkCompileTaskGenerator.java index 24202268..bf290388 100755 --- a/client/src/main/java/client/renderer/chunk/ChunkCompileTaskGenerator.java +++ b/client/src/main/java/client/renderer/chunk/ChunkCompileTaskGenerator.java @@ -3,7 +3,7 @@ package client.renderer.chunk; import java.util.List; import java.util.concurrent.locks.ReentrantLock; -import client.renderer.RegionRenderCacheBuilder; +import client.renderer.RenderBuffer; import common.collect.Lists; public class ChunkCompileTaskGenerator @@ -11,7 +11,7 @@ public class ChunkCompileTaskGenerator private final RenderChunk renderChunk; private final ReentrantLock lock = new ReentrantLock(); private final List listFinishRunnables = Lists.newArrayList(); - private RegionRenderCacheBuilder regionRenderCacheBuilder; + private RenderBuffer regionRenderCacheBuilder; private CompiledChunk compiledChunk; private ChunkCompileTaskGenerator.Status status = ChunkCompileTaskGenerator.Status.PENDING; private boolean finished; @@ -41,12 +41,12 @@ public class ChunkCompileTaskGenerator this.compiledChunk = compiledChunkIn; } - public RegionRenderCacheBuilder getRegionRenderCacheBuilder() + public RenderBuffer getRegionRenderCacheBuilder() { return this.regionRenderCacheBuilder; } - public void setRegionRenderCacheBuilder(RegionRenderCacheBuilder regionRenderCacheBuilderIn) + public void setRegionRenderCacheBuilder(RenderBuffer regionRenderCacheBuilderIn) { this.regionRenderCacheBuilder = regionRenderCacheBuilderIn; } diff --git a/client/src/main/java/client/renderer/chunk/ChunkRenderDispatcher.java b/client/src/main/java/client/renderer/chunk/ChunkRenderDispatcher.java index 21145738..62e3272b 100755 --- a/client/src/main/java/client/renderer/chunk/ChunkRenderDispatcher.java +++ b/client/src/main/java/client/renderer/chunk/ChunkRenderDispatcher.java @@ -6,7 +6,6 @@ import java.util.Queue; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import client.Client; -import client.renderer.RegionRenderCacheBuilder; import client.renderer.RenderBuffer; import client.renderer.VertexBuffer; import client.renderer.chunk.ChunkBuilder.ImmediateFuture; @@ -18,7 +17,7 @@ public class ChunkRenderDispatcher { private final List listThreadedWorkers = Lists.newArrayList(); private final BlockingQueue queueChunkUpdates = new ArrayBlockingQueue(100); - private final BlockingQueue queueFreeRenderBuilders = new ArrayBlockingQueue(5); + private final BlockingQueue queueFreeRenderBuilders = new ArrayBlockingQueue(5); private final Queue < ListenableFutureTask> queueChunkUploads = new ArrayDeque>(); private final ChunkRenderWorker renderWorker; @@ -37,10 +36,10 @@ public class ChunkRenderDispatcher for (int j = 0; j < 5; ++j) { - this.queueFreeRenderBuilders.add(new RegionRenderCacheBuilder()); + this.queueFreeRenderBuilders.add(new RenderBuffer(4194304)); } - this.renderWorker = new ChunkRenderWorker(this, new RegionRenderCacheBuilder()); + this.renderWorker = new ChunkRenderWorker(this, new RenderBuffer(4194304)); } public void kill() { @@ -157,7 +156,7 @@ public class ChunkRenderDispatcher ; } - List list = Lists.newArrayList(); + List list = Lists.newArrayList(); while (((List)list).size() != 5) { @@ -174,14 +173,14 @@ public class ChunkRenderDispatcher this.queueFreeRenderBuilders.addAll(list); } - public void freeRenderBuilder(RegionRenderCacheBuilder p_178512_1_) + public void freeRenderBuilder(RenderBuffer p_178512_1_) { this.queueFreeRenderBuilders.add(p_178512_1_); } - public RegionRenderCacheBuilder allocateRenderBuilder() throws InterruptedException + public RenderBuffer allocateRenderBuilder() throws InterruptedException { - return (RegionRenderCacheBuilder)this.queueFreeRenderBuilders.take(); + return this.queueFreeRenderBuilders.take(); } public ChunkCompileTaskGenerator getNextChunkUpdate() throws InterruptedException @@ -189,12 +188,12 @@ public class ChunkRenderDispatcher return (ChunkCompileTaskGenerator)this.queueChunkUpdates.take(); } - public ListenableFuture uploadChunk(final BlockLayer layer, final RenderBuffer buf, final RenderChunk renderer, final CompiledChunk compiled) + public ListenableFuture uploadChunk(final RenderBuffer buf, final RenderChunk renderer, final CompiledChunk compiled) { if (Client.CLIENT.isMainThread()) { buf.reset(); - renderer.getVertexBufferByLayer(layer.ordinal()).bufferData(buf.getByteBuffer()); + renderer.getVertexBuffer().bufferData(buf.getByteBuffer()); buf.setTranslation(0.0D, 0.0D, 0.0D); return new ImmediateFuture(); @@ -205,7 +204,7 @@ public class ChunkRenderDispatcher { public void run() { - ChunkRenderDispatcher.this.uploadChunk(layer, buf, renderer, compiled); + ChunkRenderDispatcher.this.uploadChunk(buf, renderer, compiled); } }, (Object)null); diff --git a/client/src/main/java/client/renderer/chunk/ChunkRenderWorker.java b/client/src/main/java/client/renderer/chunk/ChunkRenderWorker.java index b3872c91..07d51bbf 100755 --- a/client/src/main/java/client/renderer/chunk/ChunkRenderWorker.java +++ b/client/src/main/java/client/renderer/chunk/ChunkRenderWorker.java @@ -2,7 +2,7 @@ package client.renderer.chunk; import java.util.List; import client.Client; -import client.renderer.RegionRenderCacheBuilder; +import client.renderer.RenderBuffer; import client.renderer.chunk.ChunkBuilder.ListenableFuture; import common.collect.Lists; import common.entity.Entity; @@ -11,16 +11,16 @@ import common.log.Log; public class ChunkRenderWorker implements Runnable { private final ChunkRenderDispatcher chunkRenderDispatcher; - private final RegionRenderCacheBuilder regionRenderCacheBuilder; + private final RenderBuffer regionRenderCacheBuilder; private boolean running = true; public ChunkRenderWorker(ChunkRenderDispatcher p_i46201_1_) { - this(p_i46201_1_, (RegionRenderCacheBuilder)null); + this(p_i46201_1_, null); } - public ChunkRenderWorker(ChunkRenderDispatcher chunkRenderDispatcherIn, RegionRenderCacheBuilder regionRenderCacheBuilderIn) + public ChunkRenderWorker(ChunkRenderDispatcher chunkRenderDispatcherIn, RenderBuffer regionRenderCacheBuilderIn) { this.chunkRenderDispatcher = chunkRenderDispatcherIn; this.regionRenderCacheBuilder = regionRenderCacheBuilderIn; @@ -109,19 +109,16 @@ public class ChunkRenderWorker implements Runnable final CompiledChunk compiled = generator.getCompiledChunk(); List> list = Lists.newArrayList(); - for (BlockLayer enumworldblocklayer : BlockLayer.values()) + if (compiled.isLayerStarted()) { - if (compiled.isLayerStarted(enumworldblocklayer)) - { - list.add(this.chunkRenderDispatcher.uploadChunk(enumworldblocklayer, generator.getRegionRenderCacheBuilder().getWorldRendererByLayer(enumworldblocklayer), generator.getRenderChunk(), compiled)); - } + list.add(this.chunkRenderDispatcher.uploadChunk(generator.getRegionRenderCacheBuilder(), generator.getRenderChunk(), compiled)); } ChunkBuilder.addCallback(list, generator, compiled, this); } } - private RegionRenderCacheBuilder getRegionRenderCacheBuilder() throws InterruptedException + private RenderBuffer getRegionRenderCacheBuilder() throws InterruptedException { return this.regionRenderCacheBuilder != null ? this.regionRenderCacheBuilder : this.chunkRenderDispatcher.allocateRenderBuilder(); } diff --git a/client/src/main/java/client/renderer/chunk/CompiledChunk.java b/client/src/main/java/client/renderer/chunk/CompiledChunk.java index 46ca12ec..53d2fe2f 100755 --- a/client/src/main/java/client/renderer/chunk/CompiledChunk.java +++ b/client/src/main/java/client/renderer/chunk/CompiledChunk.java @@ -10,11 +10,11 @@ public class CompiledChunk { public static final CompiledChunk DUMMY = new CompiledChunk() { - protected void setLayerUsed(BlockLayer layer) + protected void setLayerUsed() { throw new UnsupportedOperationException(); } - public void setLayerStarted(BlockLayer layer) + public void setLayerStarted() { throw new UnsupportedOperationException(); } @@ -23,8 +23,9 @@ public class CompiledChunk return false; } }; - private final boolean[] layersUsed = new boolean[BlockLayer.values().length]; - private final boolean[] layersStarted = new boolean[BlockLayer.values().length]; + + private boolean layerUsed; + private boolean layerStarted; private boolean empty = true; private final List tileEntities = Lists.newArrayList(); private SetVisibility setVisibility = new SetVisibility(); @@ -34,25 +35,25 @@ public class CompiledChunk return this.empty; } - protected void setLayerUsed(BlockLayer layer) + protected void setLayerUsed() { this.empty = false; - this.layersUsed[layer.ordinal()] = true; + this.layerUsed = true; } - public boolean isLayerEmpty(BlockLayer layer) + public boolean isLayerEmpty() { - return !this.layersUsed[layer.ordinal()]; + return !this.layerUsed; } - public void setLayerStarted(BlockLayer layer) + public void setLayerStarted() { - this.layersStarted[layer.ordinal()] = true; + this.layerStarted = true; } - public boolean isLayerStarted(BlockLayer layer) + public boolean isLayerStarted() { - return this.layersStarted[layer.ordinal()]; + return this.layerStarted; } public List getTileEntities() diff --git a/client/src/main/java/client/renderer/chunk/RenderChunk.java b/client/src/main/java/client/renderer/chunk/RenderChunk.java index 51eb4e84..46fb5a90 100755 --- a/client/src/main/java/client/renderer/chunk/RenderChunk.java +++ b/client/src/main/java/client/renderer/chunk/RenderChunk.java @@ -8,7 +8,7 @@ import java.util.HashSet; import java.util.Set; import java.util.concurrent.locks.ReentrantLock; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.Client; import client.renderer.DefaultVertexFormats; @@ -42,7 +42,7 @@ public class RenderChunk private final Set setTileEntities = Sets.newHashSet(); private final int index; private final FloatBuffer modelviewMatrix = ByteBuffer.allocateDirect(16 << 2).order(ByteOrder.nativeOrder()).asFloatBuffer(); - private final VertexBuffer[] vertexBuffers = new VertexBuffer[BlockLayer.values().length]; + private VertexBuffer vertexBuffer; public BoundingBox boundingBox; private int frameIndex = -1; private boolean needsUpdate = true; @@ -59,10 +59,7 @@ public class RenderChunk this.setPosition(blockPosIn); } - for (int i = 0; i < BlockLayer.values().length; ++i) - { - this.vertexBuffers[i] = new VertexBuffer(DefaultVertexFormats.BLOCK); - } + this.vertexBuffer = new VertexBuffer(DefaultVertexFormats.BLOCK); } public boolean setFrameIndex(int frameIndexIn) @@ -78,9 +75,9 @@ public class RenderChunk } } - public VertexBuffer getVertexBufferByLayer(int layer) + public VertexBuffer getVertexBuffer() { - return this.vertexBuffers[layer]; + return this.vertexBuffer; } public void setPosition(BlockPos pos) @@ -127,7 +124,7 @@ public class RenderChunk if (!iblockaccess.isEmpty()) { ++renderChunksUpdated; - boolean[] aboolean = new boolean[BlockLayer.values().length]; + boolean aboolean = false; Renderer renderer = this.gm.renderer; for (BlockPos.MutableBlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(blockpos, blockpos1)) @@ -158,31 +155,26 @@ public class RenderChunk if (block != Blocks.air) { - BlockLayer layer = block.hasTransparency() ? BlockLayer.CUTOUT : BlockLayer.SOLID; - int idx = layer.ordinal(); - RenderBuffer worldrenderer = generator.getRegionRenderCacheBuilder().getWorldRendererByLayerId(idx); + RenderBuffer worldrenderer = generator.getRegionRenderCacheBuilder(); - if (!compiledchunk.isLayerStarted(layer)) + if (!compiledchunk.isLayerStarted()) { - compiledchunk.setLayerStarted(layer); + compiledchunk.setLayerStarted(); this.preRenderBlocks(worldrenderer, blockpos); } - aboolean[idx] |= renderer.renderBlock(iblockstate, blockpos$mutableblockpos, iblockaccess, worldrenderer); + aboolean |= renderer.renderBlock(iblockstate, blockpos$mutableblockpos, iblockaccess, worldrenderer); } } - for (BlockLayer enumworldblocklayer : BlockLayer.values()) + if (aboolean) { - if (aboolean[enumworldblocklayer.ordinal()]) - { - compiledchunk.setLayerUsed(enumworldblocklayer); - } + compiledchunk.setLayerUsed(); + } - if (compiledchunk.isLayerStarted(enumworldblocklayer)) - { - generator.getRegionRenderCacheBuilder().getWorldRendererByLayer(enumworldblocklayer).finishDrawing(); - } + if (compiledchunk.isLayerStarted()) + { + generator.getRegionRenderCacheBuilder().finishDrawing(); } } @@ -249,25 +241,25 @@ public class RenderChunk private void preRenderBlocks(RenderBuffer worldRendererIn, BlockPos pos) { - worldRendererIn.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK); + worldRendererIn.begin(GL46.GL_QUADS, DefaultVertexFormats.BLOCK); worldRendererIn.setTranslation((double)(-pos.getX()), (double)(-pos.getY()), (double)(-pos.getZ())); } private void initModelviewMatrix() { - GL11.glPushMatrix(); - GL11.glLoadIdentity(); + GL46.glPushMatrix(); + GL46.glLoadIdentity(); float f = 1.000001F; - GL11.glTranslatef(-8.0F, -8.0F, -8.0F); - GL11.glScalef(f, f, f); - GL11.glTranslatef(8.0F, 8.0F, 8.0F); - GL11.glGetFloatv(2982, this.modelviewMatrix); - GL11.glPopMatrix(); + GL46.glTranslatef(-8.0F, -8.0F, -8.0F); + GL46.glScalef(f, f, f); + GL46.glTranslatef(8.0F, 8.0F, 8.0F); + GL46.glGetFloatv(2982, this.modelviewMatrix); + GL46.glPopMatrix(); } public void multModelviewMatrix() { - GL11.glMultMatrixf(this.modelviewMatrix); + GL46.glMultMatrixf(this.modelviewMatrix); } public CompiledChunk getCompiledChunk() @@ -299,14 +291,8 @@ public class RenderChunk { this.stopCompileTask(); this.gm = null; - - for (int i = 0; i < BlockLayer.values().length; ++i) - { - if (this.vertexBuffers[i] != null) - { - this.vertexBuffers[i].deleteGlBuffers(); - } - } + if(this.vertexBuffer != null) + this.vertexBuffer.deleteGlBuffers(); } public BlockPos getPosition() diff --git a/client/src/main/java/client/renderer/entity/RenderArachnoid.java b/client/src/main/java/client/renderer/entity/RenderArachnoid.java index c34656dc..976941ed 100755 --- a/client/src/main/java/client/renderer/entity/RenderArachnoid.java +++ b/client/src/main/java/client/renderer/entity/RenderArachnoid.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.layers.LayerArachnoidArmor; import client.renderer.model.ModelArachnoid; @@ -22,10 +22,10 @@ public class RenderArachnoid extends RenderHumanoid // } protected void renderLayers(EntityNPC entity, float swing, float amount, float partial, float time, float dYaw, float dPitch, float scale) { - GL11.glPushMatrix(); - GL11.glTranslatef(0.0f, 3.0f / 16.0f, 0.0f); + GL46.glPushMatrix(); + GL46.glTranslatef(0.0f, 3.0f / 16.0f, 0.0f); super.renderLayers(entity, swing, amount, partial, time, dYaw, dPitch, scale); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } public ModelArachnoid getMainModel() diff --git a/client/src/main/java/client/renderer/entity/RenderArrow.java b/client/src/main/java/client/renderer/entity/RenderArrow.java index 9e816fc7..6f3a40b6 100755 --- a/client/src/main/java/client/renderer/entity/RenderArrow.java +++ b/client/src/main/java/client/renderer/entity/RenderArrow.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.DefaultVertexFormats; import client.renderer.GlState; @@ -26,10 +26,10 @@ public class RenderArrow extends Render { this.bindEntityTexture(entity); GlState.color(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPushMatrix(); - GL11.glTranslatef((float)x, (float)y, (float)z); - GL11.glRotatef(entity.prevYaw + (entity.rotYaw - entity.prevYaw) * partialTicks - 90.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(entity.prevPitch + (entity.rotPitch - entity.prevPitch) * partialTicks, 0.0F, 0.0F, 1.0F); + GL46.glPushMatrix(); + GL46.glTranslatef((float)x, (float)y, (float)z); + GL46.glRotatef(entity.prevYaw + (entity.rotYaw - entity.prevYaw) * partialTicks - 90.0F, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(entity.prevPitch + (entity.rotPitch - entity.prevPitch) * partialTicks, 0.0F, 0.0F, 1.0F); // Tessellator tessellator = Tessellator.getInstance(); RenderBuffer worldrenderer = Tessellator.getBuffer(); int i = 0; @@ -48,21 +48,21 @@ public class RenderArrow extends Render if (f9 > 0.0F) { float f10 = -ExtMath.sin(f9 * 3.0F) * f9; - GL11.glRotatef(f10, 0.0F, 0.0F, 1.0F); + GL46.glRotatef(f10, 0.0F, 0.0F, 1.0F); } - GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F); - GL11.glScalef(f8, f8, f8); - GL11.glTranslatef(-4.0F, 0.0F, 0.0F); - GL11.glNormal3f(f8, 0.0F, 0.0F); - worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + GL46.glRotatef(45.0F, 1.0F, 0.0F, 0.0F); + GL46.glScalef(f8, f8, f8); + GL46.glTranslatef(-4.0F, 0.0F, 0.0F); + GL46.glNormal3f(f8, 0.0F, 0.0F); + worldrenderer.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_TEX); worldrenderer.pos(-7.0D, -2.0D, -2.0D).tex((double)f4, (double)f6).endVertex(); worldrenderer.pos(-7.0D, -2.0D, 2.0D).tex((double)f5, (double)f6).endVertex(); worldrenderer.pos(-7.0D, 2.0D, 2.0D).tex((double)f5, (double)f7).endVertex(); worldrenderer.pos(-7.0D, 2.0D, -2.0D).tex((double)f4, (double)f7).endVertex(); Tessellator.draw(); - GL11.glNormal3f(-f8, 0.0F, 0.0F); - worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + GL46.glNormal3f(-f8, 0.0F, 0.0F); + worldrenderer.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_TEX); worldrenderer.pos(-7.0D, 2.0D, -2.0D).tex((double)f4, (double)f6).endVertex(); worldrenderer.pos(-7.0D, 2.0D, 2.0D).tex((double)f5, (double)f6).endVertex(); worldrenderer.pos(-7.0D, -2.0D, 2.0D).tex((double)f5, (double)f7).endVertex(); @@ -71,9 +71,9 @@ public class RenderArrow extends Render for (int j = 0; j < 4; ++j) { - GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); - GL11.glNormal3f(0.0F, 0.0F, f8); - worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + GL46.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + GL46.glNormal3f(0.0F, 0.0F, f8); + worldrenderer.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_TEX); worldrenderer.pos(-8.0D, -2.0D, 0.0D).tex((double)f, (double)f2).endVertex(); worldrenderer.pos(8.0D, -2.0D, 0.0D).tex((double)f1, (double)f2).endVertex(); worldrenderer.pos(8.0D, 2.0D, 0.0D).tex((double)f1, (double)f3).endVertex(); @@ -82,7 +82,7 @@ public class RenderArrow extends Render } GlState.disableRescaleNormal(); - GL11.glPopMatrix(); + GL46.glPopMatrix(); super.doRender(entity, x, y, z, partialTicks); } diff --git a/client/src/main/java/client/renderer/entity/RenderBat.java b/client/src/main/java/client/renderer/entity/RenderBat.java index 0e621efe..9ef40442 100755 --- a/client/src/main/java/client/renderer/entity/RenderBat.java +++ b/client/src/main/java/client/renderer/entity/RenderBat.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.model.ModelBat; import common.entity.animal.EntityBat; @@ -30,18 +30,18 @@ public class RenderBat extends RenderLiving */ protected void preRenderCallback(EntityBat entitylivingbaseIn, float partialTickTime) { - GL11.glScalef(0.35F, 0.35F, 0.35F); + GL46.glScalef(0.35F, 0.35F, 0.35F); } protected void rotateCorpse(EntityBat bat, float p_77043_2_, float p_77043_3_, float partialTicks) { if (!bat.getIsBatHanging()) { - GL11.glTranslatef(0.0F, ExtMath.cos(p_77043_2_ * 0.3F) * 0.1F, 0.0F); + GL46.glTranslatef(0.0F, ExtMath.cos(p_77043_2_ * 0.3F) * 0.1F, 0.0F); } else { - GL11.glTranslatef(0.0F, -0.1F, 0.0F); + GL46.glTranslatef(0.0F, -0.1F, 0.0F); } super.rotateCorpse(bat, p_77043_2_, p_77043_3_, partialTicks); diff --git a/client/src/main/java/client/renderer/entity/RenderBlockEntity.java b/client/src/main/java/client/renderer/entity/RenderBlockEntity.java index 0f532a3b..665a1e4d 100755 --- a/client/src/main/java/client/renderer/entity/RenderBlockEntity.java +++ b/client/src/main/java/client/renderer/entity/RenderBlockEntity.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.Client; import client.renderer.texture.TextureMap; @@ -27,8 +27,8 @@ public class RenderBlockEntity extends Render // if(entity.isInvisible()) { // return; // } - GL11.glPushMatrix(); - GL11.glTranslatef((float)x, (float)y + 0.5F, (float)z); + GL46.glPushMatrix(); + GL46.glTranslatef((float)x, (float)y + 0.5F, (float)z); // if ((float)entity.fuse - partialTicks + 1.0F < 10.0F) // { @@ -42,16 +42,16 @@ public class RenderBlockEntity extends Render // float f2 = (1.0F - ((float)entity.fuse - partialTicks + 1.0F) / 100.0F) * 0.8F; this.bindEntityTexture(entity); - GL11.glTranslatef(-0.5F, -0.5F, 0.5F); + GL46.glTranslatef(-0.5F, -0.5F, 0.5F); Client.CLIENT.renderer.renderBlockEntity(this.state, getBrightness(entity)); - GL11.glTranslatef(0.0F, 0.0F, 1.0F); + GL46.glTranslatef(0.0F, 0.0F, 1.0F); // if (entity.fuse / 5 % 2 == 0) // { // GlStateManager.disableTexture2D(); // GlStateManager.disableLighting(); // GlStateManager.enableBlend(); -// GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA); +// GlStateManager.blendFunc(GL46.GL_SRC_ALPHA, GL46.GL_DST_ALPHA); // GlStateManager.color(1.0F, 1.0F, 1.0F, f2); // GlStateManager.doPolygonOffset(-3.0F, -3.0F); // GlStateManager.enablePolygonOffset(); @@ -64,7 +64,7 @@ public class RenderBlockEntity extends Render // GlStateManager.enableTexture2D(); // } - GL11.glPopMatrix(); + GL46.glPopMatrix(); super.doRender(entity, x, y, z, partialTicks); } diff --git a/client/src/main/java/client/renderer/entity/RenderBoat.java b/client/src/main/java/client/renderer/entity/RenderBoat.java index 4bb7c7fe..9237f080 100755 --- a/client/src/main/java/client/renderer/entity/RenderBoat.java +++ b/client/src/main/java/client/renderer/entity/RenderBoat.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.model.ModelBase; import client.renderer.model.ModelBoat; @@ -26,9 +26,9 @@ public class RenderBoat extends Render */ public void doRender(EntityBoat entity, double x, double y, double z, float partialTicks) { - GL11.glPushMatrix(); - GL11.glTranslatef((float)x, (float)y + 0.25F, (float)z); - GL11.glRotatef(180.0F - (entity.prevYaw + (entity.rotYaw - entity.prevYaw) * partialTicks), 0.0F, 1.0F, 0.0F); + GL46.glPushMatrix(); + GL46.glTranslatef((float)x, (float)y + 0.25F, (float)z); + GL46.glRotatef(180.0F - (entity.prevYaw + (entity.rotYaw - entity.prevYaw) * partialTicks), 0.0F, 1.0F, 0.0F); float f = (float)entity.getTimeSinceHit() - partialTicks; float f1 = (float)entity.getDamageTaken() - partialTicks; @@ -39,16 +39,16 @@ public class RenderBoat extends Render if (f > 0.0F) { - GL11.glRotatef(ExtMath.sin(f) * f * f1 / 10.0F * (float)entity.getForwardDirection(), 1.0F, 0.0F, 0.0F); + GL46.glRotatef(ExtMath.sin(f) * f * f1 / 10.0F * (float)entity.getForwardDirection(), 1.0F, 0.0F, 0.0F); } float f2 = 0.75F; - GL11.glScalef(f2, f2, f2); - GL11.glScalef(1.0F / f2, 1.0F / f2, 1.0F / f2); + GL46.glScalef(f2, f2, f2); + GL46.glScalef(1.0F / f2, 1.0F / f2, 1.0F / f2); this.bindEntityTexture(entity); - GL11.glScalef(-1.0F, -1.0F, 1.0F); + GL46.glScalef(-1.0F, -1.0F, 1.0F); this.modelBoat.render(entity, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); - GL11.glPopMatrix(); + GL46.glPopMatrix(); super.doRender(entity, x, y, z, partialTicks); } diff --git a/client/src/main/java/client/renderer/entity/RenderBullet.java b/client/src/main/java/client/renderer/entity/RenderBullet.java index 6fe7ad2e..86f7b45f 100755 --- a/client/src/main/java/client/renderer/entity/RenderBullet.java +++ b/client/src/main/java/client/renderer/entity/RenderBullet.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.DefaultVertexFormats; import client.renderer.GlState; @@ -22,10 +22,10 @@ public class RenderBullet extends Render { this.bindEntityTexture(entity); GlState.color(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPushMatrix(); - GL11.glTranslatef((float)x, (float)y, (float)z); - GL11.glRotatef(entity.prevYaw + (entity.rotYaw - entity.prevYaw) * partialTicks - 90.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(entity.prevPitch + (entity.rotPitch - entity.prevPitch) * partialTicks, 0.0F, 0.0F, 1.0F); + GL46.glPushMatrix(); + GL46.glTranslatef((float)x, (float)y, (float)z); + GL46.glRotatef(entity.prevYaw + (entity.rotYaw - entity.prevYaw) * partialTicks - 90.0F, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(entity.prevPitch + (entity.rotPitch - entity.prevPitch) * partialTicks, 0.0F, 0.0F, 1.0F); RenderBuffer worldrenderer = Tessellator.getBuffer(); float f = 0.0F; float f1 = 0.5F; @@ -38,18 +38,18 @@ public class RenderBullet extends Render float f8 = 0.05625F; GlState.enableRescaleNormal(); - GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F); - GL11.glScalef(f8, f8, f8); - GL11.glTranslatef(-4.0F, 0.0F, 0.0F); - GL11.glNormal3f(f8, 0.0F, 0.0F); - worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + GL46.glRotatef(45.0F, 1.0F, 0.0F, 0.0F); + GL46.glScalef(f8, f8, f8); + GL46.glTranslatef(-4.0F, 0.0F, 0.0F); + GL46.glNormal3f(f8, 0.0F, 0.0F); + worldrenderer.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_TEX); worldrenderer.pos(-7.0D, -2.0D, -2.0D).tex((double)f4, (double)f6).endVertex(); worldrenderer.pos(-7.0D, -2.0D, 2.0D).tex((double)f5, (double)f6).endVertex(); worldrenderer.pos(-7.0D, 2.0D, 2.0D).tex((double)f5, (double)f7).endVertex(); worldrenderer.pos(-7.0D, 2.0D, -2.0D).tex((double)f4, (double)f7).endVertex(); Tessellator.draw(); - GL11.glNormal3f(-f8, 0.0F, 0.0F); - worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + GL46.glNormal3f(-f8, 0.0F, 0.0F); + worldrenderer.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_TEX); worldrenderer.pos(-7.0D, 2.0D, -2.0D).tex((double)f4, (double)f6).endVertex(); worldrenderer.pos(-7.0D, 2.0D, 2.0D).tex((double)f5, (double)f6).endVertex(); worldrenderer.pos(-7.0D, -2.0D, 2.0D).tex((double)f5, (double)f7).endVertex(); @@ -58,9 +58,9 @@ public class RenderBullet extends Render for (int j = 0; j < 4; ++j) { - GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); - GL11.glNormal3f(0.0F, 0.0F, f8); - worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + GL46.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + GL46.glNormal3f(0.0F, 0.0F, f8); + worldrenderer.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_TEX); worldrenderer.pos(-8.0D, -2.0D, 0.0D).tex((double)f, (double)f2).endVertex(); worldrenderer.pos(8.0D, -2.0D, 0.0D).tex((double)f1, (double)f2).endVertex(); worldrenderer.pos(8.0D, 2.0D, 0.0D).tex((double)f1, (double)f3).endVertex(); @@ -69,7 +69,7 @@ public class RenderBullet extends Render } GlState.disableRescaleNormal(); - GL11.glPopMatrix(); + GL46.glPopMatrix(); super.doRender(entity, x, y, z, partialTicks); } diff --git a/client/src/main/java/client/renderer/entity/RenderCat.java b/client/src/main/java/client/renderer/entity/RenderCat.java index 04a45412..33d2cce0 100755 --- a/client/src/main/java/client/renderer/entity/RenderCat.java +++ b/client/src/main/java/client/renderer/entity/RenderCat.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.model.ModelBase; import common.entity.animal.EntityCat; @@ -50,7 +50,7 @@ public class RenderCat extends RenderLiving if (entitylivingbaseIn.isTamed()) { - GL11.glScalef(0.8F, 0.8F, 0.8F); + GL46.glScalef(0.8F, 0.8F, 0.8F); } } } diff --git a/client/src/main/java/client/renderer/entity/RenderCrystal.java b/client/src/main/java/client/renderer/entity/RenderCrystal.java index bdaa469d..b06a4c49 100755 --- a/client/src/main/java/client/renderer/entity/RenderCrystal.java +++ b/client/src/main/java/client/renderer/entity/RenderCrystal.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.model.ModelBase; import client.renderer.model.ModelCrystal; @@ -26,13 +26,13 @@ public class RenderCrystal extends Render public void doRender(EntityCrystal entity, double x, double y, double z, float partialTicks) { float f = (float)entity.innerRotation + partialTicks; - GL11.glPushMatrix(); - GL11.glTranslatef((float)x, (float)y, (float)z); + GL46.glPushMatrix(); + GL46.glTranslatef((float)x, (float)y, (float)z); this.bindTexture(crystalTextures); float f1 = ExtMath.sin(f * 0.2F) / 2.0F + 0.5F; f1 = f1 * f1 + f1; this.modelCrystal.render(entity, 0.0F, f * 3.0F, f1 * 0.2F, 0.0F, 0.0F, 0.0625F); - GL11.glPopMatrix(); + GL46.glPopMatrix(); super.doRender(entity, x, y, z, partialTicks); } diff --git a/client/src/main/java/client/renderer/entity/RenderDie.java b/client/src/main/java/client/renderer/entity/RenderDie.java index 7829a254..4bf6340e 100755 --- a/client/src/main/java/client/renderer/entity/RenderDie.java +++ b/client/src/main/java/client/renderer/entity/RenderDie.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.GlState; import client.renderer.model.ModelDie; @@ -19,16 +19,16 @@ public class RenderDie extends Render { } public void doRender(EntityDie entity, double x, double y, double z, float partialTicks) { - GL11.glPushMatrix(); - GL11.glTranslatef((float)x, (float)y + 0.05F, (float)z); + GL46.glPushMatrix(); + GL46.glTranslatef((float)x, (float)y + 0.05F, (float)z); this.bindEntityTexture(entity); if(entity.getValue() == 0) - GL11.glRotatef((float)((entity.ticksExisted % 10) * (360 / 10)), 0.3f, 0.4f, 0.1f); - GL11.glScalef(-0.1f, -0.1f, 0.1f); + GL46.glRotatef((float)((entity.ticksExisted % 10) * (360 / 10)), 0.3f, 0.4f, 0.1f); + GL46.glScalef(-0.1f, -0.1f, 0.1f); GlState.disableCull(); this.model.render(entity, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GlState.enableCull(); - GL11.glPopMatrix(); + GL46.glPopMatrix(); super.doRender(entity, x, y, z, partialTicks); } } diff --git a/client/src/main/java/client/renderer/entity/RenderEntity.java b/client/src/main/java/client/renderer/entity/RenderEntity.java index a4ac78d0..2ce1d5ab 100755 --- a/client/src/main/java/client/renderer/entity/RenderEntity.java +++ b/client/src/main/java/client/renderer/entity/RenderEntity.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.DefaultVertexFormats; import client.renderer.GlState; @@ -18,7 +18,7 @@ public class RenderEntity extends Render RenderBuffer rb = Tessellator.getBuffer(); GlState.color(1.0F, 1.0F, 1.0F, 1.0F); rb.setTranslation(x, y, z); - rb.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_NORMAL); + rb.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_NORMAL); rb.pos(bb.minX, bb.maxY, bb.minZ).normal(0.0F, 0.0F, -1.0F).endVertex(); rb.pos(bb.maxX, bb.maxY, bb.minZ).normal(0.0F, 0.0F, -1.0F).endVertex(); rb.pos(bb.maxX, bb.minY, bb.minZ).normal(0.0F, 0.0F, -1.0F).endVertex(); @@ -55,9 +55,9 @@ public class RenderEntity extends Render public void doRender(Entity entity, double x, double y, double z, float partialTicks) { - GL11.glPushMatrix(); + GL46.glPushMatrix(); renderOffsetAABB(entity.getEntityBoundingBox(), x - entity.lastTickPosX, y - entity.lastTickPosY, z - entity.lastTickPosZ); - GL11.glPopMatrix(); + GL46.glPopMatrix(); super.doRender(entity, x, y, z, partialTicks); } diff --git a/client/src/main/java/client/renderer/entity/RenderEntityItem.java b/client/src/main/java/client/renderer/entity/RenderEntityItem.java index 167fc1ae..98c40ae1 100755 --- a/client/src/main/java/client/renderer/entity/RenderEntityItem.java +++ b/client/src/main/java/client/renderer/entity/RenderEntityItem.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.GlState; import client.renderer.blockmodel.IBakedModel; @@ -39,12 +39,12 @@ public class RenderEntityItem extends Render int i = this.getMultiplier(itemstack); float f = 0.25F; float f1 = ExtMath.sin(((float)itemIn.getAge() + p_177077_8_) / 10.0F + itemIn.hoverStart) * 0.1F + 0.1F; - GL11.glTranslatef((float)p_177077_2_, (float)p_177077_4_ + f1 + 0.25F, (float)p_177077_6_); + GL46.glTranslatef((float)p_177077_2_, (float)p_177077_4_ + f1 + 0.25F, (float)p_177077_6_); if (flag || this.manager.gm != null) { float f3 = (((float)itemIn.getAge() + p_177077_8_) / 20.0F + itemIn.hoverStart) * (180F / (float)Math.PI); - GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(f3, 0.0F, 1.0F, 0.0F); } if (!flag) @@ -52,7 +52,7 @@ public class RenderEntityItem extends Render float f6 = -0.0F * (float)(i - 1) * 0.5F; float f4 = -0.0F * (float)(i - 1) * 0.5F; float f5 = -0.046875F * (float)(i - 1) * 0.5F; - GL11.glTranslatef(f6, f4, f5); + GL46.glTranslatef(f6, f4, f5); } GlState.color(1.0F, 1.0F, 1.0F, 1.0F); @@ -102,10 +102,10 @@ public class RenderEntityItem extends Render // } GlState.enableRescaleNormal(); - GlState.alphaFunc(GL11.GL_GREATER, 0.1F); + GlState.alphaFunc(GL46.GL_GREATER, 0.1F); GlState.enableBlend(); - GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); - GL11.glPushMatrix(); + GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ZERO); + GL46.glPushMatrix(); IBakedModel ibakedmodel = this.itemRenderer.getItemModelMesher().getItemModel(itemstack); int i = this.func_177077_a(entity, x, y, z, partialTicks, ibakedmodel); @@ -113,30 +113,30 @@ public class RenderEntityItem extends Render { if (ibakedmodel.isGui3d()) { - GL11.glPushMatrix(); + GL46.glPushMatrix(); if (j > 0) { float f = (this.field_177079_e.floatv() * 2.0F - 1.0F) * 0.15F; float f1 = (this.field_177079_e.floatv() * 2.0F - 1.0F) * 0.15F; float f2 = (this.field_177079_e.floatv() * 2.0F - 1.0F) * 0.15F; - GL11.glTranslatef(f, f1, f2); + GL46.glTranslatef(f, f1, f2); } - GL11.glScalef(0.5F, 0.5F, 0.5F); + GL46.glScalef(0.5F, 0.5F, 0.5F); this.itemRenderer.renderItem(itemstack, ibakedmodel); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } else { - GL11.glPushMatrix(); + GL46.glPushMatrix(); this.itemRenderer.renderItem(itemstack, ibakedmodel); - GL11.glPopMatrix(); - GL11.glTranslatef(0.0F, 0.0F, 0.046875F); + GL46.glPopMatrix(); + GL46.glTranslatef(0.0F, 0.0F, 0.046875F); } } - GL11.glPopMatrix(); + GL46.glPopMatrix(); GlState.disableRescaleNormal(); GlState.disableBlend(); this.bindEntityTexture(entity); diff --git a/client/src/main/java/client/renderer/entity/RenderFallingBlock.java b/client/src/main/java/client/renderer/entity/RenderFallingBlock.java index 272923aa..df9c61f8 100755 --- a/client/src/main/java/client/renderer/entity/RenderFallingBlock.java +++ b/client/src/main/java/client/renderer/entity/RenderFallingBlock.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.Client; import client.renderer.DefaultVertexFormats; @@ -40,12 +40,12 @@ public class RenderFallingBlock extends Render if (state != world.getState(pos) && block != Blocks.air && !block.getMaterial().isLiquid()) { - GL11.glPushMatrix(); - GL11.glTranslatef((float)x, (float)y, (float)z); + GL46.glPushMatrix(); + GL46.glTranslatef((float)x, (float)y, (float)z); GlState.disableLighting(); // Tessellator tessellator = Tessellator.getInstance(); RenderBuffer rb = Tessellator.getBuffer(); - rb.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK); + rb.begin(GL46.GL_QUADS, DefaultVertexFormats.BLOCK); int i = pos.getX(); int j = pos.getY(); int k = pos.getZ(); @@ -56,7 +56,7 @@ public class RenderFallingBlock extends Render rb.setTranslation(0.0D, 0.0D, 0.0D); Tessellator.draw(); GlState.enableLighting(); - GL11.glPopMatrix(); + GL46.glPopMatrix(); super.doRender(entity, x, y, z, partialTicks); } } diff --git a/client/src/main/java/client/renderer/entity/RenderFireball.java b/client/src/main/java/client/renderer/entity/RenderFireball.java index cdc1caa2..bb8608d9 100755 --- a/client/src/main/java/client/renderer/entity/RenderFireball.java +++ b/client/src/main/java/client/renderer/entity/RenderFireball.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.Client; import client.renderer.DefaultVertexFormats; @@ -28,11 +28,11 @@ public class RenderFireball extends Render */ public void doRender(EntityProjectile entity, double x, double y, double z, float partialTicks) { - GL11.glPushMatrix(); + GL46.glPushMatrix(); this.bindEntityTexture(entity); - GL11.glTranslatef((float)x, (float)y, (float)z); + GL46.glTranslatef((float)x, (float)y, (float)z); GlState.enableRescaleNormal(); - GL11.glScalef(this.scale, this.scale, this.scale); + GL46.glScalef(this.scale, this.scale, this.scale); Sprite textureatlassprite = Client.CLIENT.getRenderItem().getItemModelMesher().getParticleIcon(Items.fireball); // Tessellator tessellator = Tessellator.getInstance(); RenderBuffer worldrenderer = Tessellator.getBuffer(); @@ -43,16 +43,16 @@ public class RenderFireball extends Render float f4 = 1.0F; float f5 = 0.5F; float f6 = 0.25F; - GL11.glRotatef(180.0F - this.manager.playerViewY, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-this.manager.playerViewX, 1.0F, 0.0F, 0.0F); - worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_NORMAL); + GL46.glRotatef(180.0F - this.manager.playerViewY, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(-this.manager.playerViewX, 1.0F, 0.0F, 0.0F); + worldrenderer.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_TEX_NORMAL); worldrenderer.pos(-0.5D, -0.25D, 0.0D).tex((double)f, (double)f3).normal(0.0F, 1.0F, 0.0F).endVertex(); worldrenderer.pos(0.5D, -0.25D, 0.0D).tex((double)f1, (double)f3).normal(0.0F, 1.0F, 0.0F).endVertex(); worldrenderer.pos(0.5D, 0.75D, 0.0D).tex((double)f1, (double)f2).normal(0.0F, 1.0F, 0.0F).endVertex(); worldrenderer.pos(-0.5D, 0.75D, 0.0D).tex((double)f, (double)f2).normal(0.0F, 1.0F, 0.0F).endVertex(); Tessellator.draw(); GlState.disableRescaleNormal(); - GL11.glPopMatrix(); + GL46.glPopMatrix(); super.doRender(entity, x, y, z, partialTicks); } diff --git a/client/src/main/java/client/renderer/entity/RenderFish.java b/client/src/main/java/client/renderer/entity/RenderFish.java index a5bbacbc..d81f39ec 100755 --- a/client/src/main/java/client/renderer/entity/RenderFish.java +++ b/client/src/main/java/client/renderer/entity/RenderFish.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.Client; import client.renderer.DefaultVertexFormats; @@ -25,10 +25,10 @@ public class RenderFish extends Render */ public void doRender(EntityHook entity, double x, double y, double z, float partialTicks) { - GL11.glPushMatrix(); - GL11.glTranslatef((float)x, (float)y, (float)z); + GL46.glPushMatrix(); + GL46.glTranslatef((float)x, (float)y, (float)z); GlState.enableRescaleNormal(); - GL11.glScalef(0.5F, 0.5F, 0.5F); + GL46.glScalef(0.5F, 0.5F, 0.5F); this.bindEntityTexture(entity); // Tessellator tessellator = Tessellator.getInstance(); RenderBuffer worldrenderer = Tessellator.getBuffer(); @@ -41,16 +41,16 @@ public class RenderFish extends Render float f4 = 1.0F; float f5 = 0.5F; float f6 = 0.5F; - GL11.glRotatef(180.0F - this.manager.playerViewY, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-this.manager.playerViewX, 1.0F, 0.0F, 0.0F); - worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_NORMAL); + GL46.glRotatef(180.0F - this.manager.playerViewY, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(-this.manager.playerViewX, 1.0F, 0.0F, 0.0F); + worldrenderer.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_TEX_NORMAL); worldrenderer.pos(-0.5D, -0.5D, 0.0D).tex(0.0D, 0.25D).normal(0.0F, 1.0F, 0.0F).endVertex(); worldrenderer.pos(0.5D, -0.5D, 0.0D).tex(0.25D, 0.25D).normal(0.0F, 1.0F, 0.0F).endVertex(); worldrenderer.pos(0.5D, 0.5D, 0.0D).tex(0.25D, 0.0D).normal(0.0F, 1.0F, 0.0F).endVertex(); worldrenderer.pos(-0.5D, 0.5D, 0.0D).tex(0.0D, 0.0D).normal(0.0F, 1.0F, 0.0F).endVertex(); Tessellator.draw(); GlState.disableRescaleNormal(); - GL11.glPopMatrix(); + GL46.glPopMatrix(); if (entity.angler != null) { @@ -87,7 +87,7 @@ public class RenderFish extends Render double d12 = (double)((float)(d2 - d7)); GlState.disableTexture2D(); GlState.disableLighting(); - worldrenderer.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.begin(GL46.GL_LINE_STRIP, DefaultVertexFormats.POSITION_COLOR); int k = 16; for (int l = 0; l <= 16; ++l) diff --git a/client/src/main/java/client/renderer/entity/RenderFlyingBox.java b/client/src/main/java/client/renderer/entity/RenderFlyingBox.java index b1ad0e8d..d367686c 100755 --- a/client/src/main/java/client/renderer/entity/RenderFlyingBox.java +++ b/client/src/main/java/client/renderer/entity/RenderFlyingBox.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.GlState; import client.renderer.model.ModelHead; @@ -40,19 +40,19 @@ public class RenderFlyingBox extends Render */ public void doRender(EntityBox entity, double x, double y, double z, float partialTicks) { - GL11.glPushMatrix(); + GL46.glPushMatrix(); GlState.disableCull(); float f = this.func_82400_a(entity.prevYaw, entity.rotYaw, partialTicks); float f1 = entity.prevPitch + (entity.rotPitch - entity.prevPitch) * partialTicks; - GL11.glTranslatef((float)x, (float)y, (float)z); - GL11.glRotatef((float)(entity.ticksExisted % 100) * 360.0f / 100.0f, 0.3f, 0.4f, 0.1f); + GL46.glTranslatef((float)x, (float)y, (float)z); + GL46.glRotatef((float)(entity.ticksExisted % 100) * 360.0f / 100.0f, 0.3f, 0.4f, 0.1f); float f2 = 0.0625F; GlState.enableRescaleNormal(); - GL11.glScalef(-1.0F, -1.0F, 1.0F); + GL46.glScalef(-1.0F, -1.0F, 1.0F); GlState.enableAlpha(); this.bindEntityTexture(entity); this.boxModel.render(entity, 0.0F, 0.0F, 0.0F, f, f1, f2); - GL11.glPopMatrix(); + GL46.glPopMatrix(); super.doRender(entity, x, y, z, partialTicks); } diff --git a/client/src/main/java/client/renderer/entity/RenderHorse.java b/client/src/main/java/client/renderer/entity/RenderHorse.java index b3160562..54437d81 100755 --- a/client/src/main/java/client/renderer/entity/RenderHorse.java +++ b/client/src/main/java/client/renderer/entity/RenderHorse.java @@ -2,7 +2,7 @@ package client.renderer.entity; import java.util.Set; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.Client; import client.renderer.model.ModelHorse; @@ -40,7 +40,7 @@ public class RenderHorse extends RenderLiving f *= 0.92F; } - GL11.glScalef(f, f, f); + GL46.glScalef(f, f, f); super.preRenderCallback(entitylivingbaseIn, partialTickTime); } diff --git a/client/src/main/java/client/renderer/entity/RenderHumanoid.java b/client/src/main/java/client/renderer/entity/RenderHumanoid.java index ab8540eb..13a8d30b 100755 --- a/client/src/main/java/client/renderer/entity/RenderHumanoid.java +++ b/client/src/main/java/client/renderer/entity/RenderHumanoid.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.GlState; import client.renderer.layers.LayerArmor; @@ -178,7 +178,7 @@ public class RenderHumanoid extends RenderNpc // SKC.glScalef(f2, f3, f2); // } float f = entitylivingbaseIn.getRenderScale(); // 0.9375F; - GL11.glScalef(f, f, f); + GL46.glScalef(f, f, f); } // protected int getColorMultiplier(EntityNPC entitylivingbaseIn, float lightBrightness, float partialTickTime) diff --git a/client/src/main/java/client/renderer/entity/RenderItem.java b/client/src/main/java/client/renderer/entity/RenderItem.java index a3f86ae1..08ef7a3a 100755 --- a/client/src/main/java/client/renderer/entity/RenderItem.java +++ b/client/src/main/java/client/renderer/entity/RenderItem.java @@ -2,7 +2,7 @@ package client.renderer.entity; import java.util.List; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.DefaultVertexFormats; import client.renderer.GlState; @@ -69,7 +69,7 @@ public class RenderItem private void renderModel(IBakedModel model, int color, ItemStack stack) { RenderBuffer worldrenderer = Tessellator.getBuffer(); - worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.ITEM); + worldrenderer.begin(GL46.GL_QUADS, DefaultVertexFormats.ITEM); for (Facing enumfacing : Facing.values()) { @@ -84,20 +84,20 @@ public class RenderItem { if (stack != null) { - GL11.glPushMatrix(); - GL11.glScalef(0.5F, 0.5F, 0.5F); + GL46.glPushMatrix(); + GL46.glScalef(0.5F, 0.5F, 0.5F); if (model.isBuiltin()) { - GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + GL46.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + GL46.glTranslatef(-0.5F, -0.5F, -0.5F); GlState.color(1.0F, 1.0F, 1.0F, 1.0F); GlState.enableRescaleNormal(); this.renderBuiltin(stack); } else { - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + GL46.glTranslatef(-0.5F, -0.5F, -0.5F); this.renderModel(model, stack); if (stack.getItem().isGleaming(stack)) @@ -106,14 +106,14 @@ public class RenderItem } } - GL11.glPopMatrix(); + GL46.glPopMatrix(); } } private void renderBuiltin(ItemStack stack) { if(stack.getItem() instanceof ItemArmor armor) { this.stack = stack; - GL11.glPushMatrix(); + GL46.glPushMatrix(); float offset = 0.0f; switch(armor.getArmorType()) { case HELMET: @@ -135,9 +135,9 @@ public class RenderItem offset = 0.0f; break; } - GL11.glTranslatef(1.0f, offset, 0.0f); - GL11.glRotatef(180.0f, 0.0f, 1.0f, 0.0f); - GL11.glScalef(1.4f, -1.4f, 1.4f); + GL46.glTranslatef(1.0f, offset, 0.0f); + GL46.glRotatef(180.0f, 0.0f, 1.0f, 0.0f); + GL46.glScalef(1.4f, -1.4f, 1.4f); boolean cull = GlState.isCullEnabled(); if(cull) GlState.disableCull(); @@ -149,14 +149,14 @@ public class RenderItem // if(cull) GlState.enableCull(); - GL11.glPopMatrix(); + GL46.glPopMatrix(); this.stack = null; } else if(stack.getItem() instanceof ItemAnimalArmor horseArmor) { - GL11.glPushMatrix(); - GL11.glTranslatef(0.9f, 0.5f, 0.0f); - GL11.glRotatef(180.0f, 0.0f, 1.0f, 0.0f); - GL11.glScalef(0.85f, -0.85f, 0.85f); + GL46.glPushMatrix(); + GL46.glTranslatef(0.9f, 0.5f, 0.0f); + GL46.glRotatef(180.0f, 0.0f, 1.0f, 0.0f); + GL46.glScalef(0.85f, -0.85f, 0.85f); Class clazz = horseArmor.getArmorType().getAnimalType(); boolean cull = GlState.isCullEnabled(); if(cull) @@ -167,36 +167,36 @@ public class RenderItem } if(cull) GlState.enableCull(); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } } private void renderEffect(IBakedModel model) { GlState.depthMask(false); - GlState.depthFunc(GL11.GL_EQUAL); + GlState.depthFunc(GL46.GL_EQUAL); GlState.disableLighting(); - GlState.blendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); + GlState.blendFunc(GL46.GL_SRC_COLOR, GL46.GL_ONE); this.manager.bindTexture(RES_ITEM_GLINT); - GL11.glMatrixMode(GL11.GL_TEXTURE); - GL11.glPushMatrix(); - GL11.glScalef(8.0F, 8.0F, 8.0F); + GL46.glMatrixMode(GL46.GL_TEXTURE); + GL46.glPushMatrix(); + GL46.glScalef(8.0F, 8.0F, 8.0F); float f = (float)(System.currentTimeMillis() % 3000L) / 3000.0F / 8.0F; - GL11.glTranslatef(f, 0.0F, 0.0F); - GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); + GL46.glTranslatef(f, 0.0F, 0.0F); + GL46.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); this.renderModel(model, -8372020); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(8.0F, 8.0F, 8.0F); + GL46.glPopMatrix(); + GL46.glPushMatrix(); + GL46.glScalef(8.0F, 8.0F, 8.0F); float f1 = (float)(System.currentTimeMillis() % 4873L) / 4873.0F / 8.0F; - GL11.glTranslatef(-f1, 0.0F, 0.0F); - GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); + GL46.glTranslatef(-f1, 0.0F, 0.0F); + GL46.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); this.renderModel(model, -8372020); - GL11.glPopMatrix(); - GL11.glMatrixMode(GL11.GL_MODELVIEW); - GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL46.glPopMatrix(); + GL46.glMatrixMode(GL46.GL_MODELVIEW); + GlState.blendFunc(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA); GlState.enableLighting(); - GlState.depthFunc(GL11.GL_LEQUAL); + GlState.depthFunc(GL46.GL_LEQUAL); GlState.depthMask(true); this.manager.bindTexture(TextureMap.BLOCKS); } @@ -251,7 +251,7 @@ public class RenderItem if (!flag) { - GL11.glScalef(2.0F, 2.0F, 2.0F); + GL46.glScalef(2.0F, 2.0F, 2.0F); } GlState.color(1.0F, 1.0F, 1.0F, 1.0F); @@ -291,45 +291,45 @@ public class RenderItem this.manager.bindTexture(TextureMap.BLOCKS); this.preTransform(stack); GlState.enableRescaleNormal(); - GlState.alphaFunc(GL11.GL_GREATER, 0.1F); + GlState.alphaFunc(GL46.GL_GREATER, 0.1F); GlState.enableBlend(); - GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); - GL11.glPushMatrix(); + GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ZERO); + GL46.glPushMatrix(); if(transform) { WieldType type = stack.getItem().getWieldType(); if(third && type != null) { switch(type) { case TOOL_FLIP: - GL11.glTranslatef(0.0f, 0.0f, -3.5f * 0.0625f); - GL11.glRotatef(90.0f, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(180.0f, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(-35.0f, 0.0F, 0.0F, 1.0F); - GL11.glScalef(0.85f, 0.85f, 0.85f); + GL46.glTranslatef(0.0f, 0.0f, -3.5f * 0.0625f); + GL46.glRotatef(90.0f, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(180.0f, 1.0F, 0.0F, 0.0F); + GL46.glRotatef(-35.0f, 0.0F, 0.0F, 1.0F); + GL46.glScalef(0.85f, 0.85f, 0.85f); break; case TOOL: - GL11.glTranslatef(0.0f, 1.25f * 0.0625f, -3.5f * 0.0625f); - GL11.glRotatef(90.0f, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-35.0f, 0.0F, 0.0F, 1.0F); - GL11.glScalef(0.85f, 0.85f, 0.85f); + GL46.glTranslatef(0.0f, 1.25f * 0.0625f, -3.5f * 0.0625f); + GL46.glRotatef(90.0f, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(-35.0f, 0.0F, 0.0F, 1.0F); + GL46.glScalef(0.85f, 0.85f, 0.85f); break; case RANGED: - GL11.glTranslatef(0.75f * 0.0625f, 0.0f, 0.25f * 0.0625f); - GL11.glRotatef(80.0f, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(5.0f, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(-45.0f, 0.0F, 0.0F, 1.0F); + GL46.glTranslatef(0.75f * 0.0625f, 0.0f, 0.25f * 0.0625f); + GL46.glRotatef(80.0f, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(5.0f, 1.0F, 0.0F, 0.0F); + GL46.glRotatef(-45.0f, 0.0F, 0.0F, 1.0F); break; } } else if(!third) { - GL11.glTranslatef(0.0f, 4.0f * 0.0625f, 2.0f * 0.0625f); - GL11.glRotatef(type == WieldType.TOOL_FLIP ? 45.0f : -135.0f, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(25.0f, 0.0F, 0.0F, 1.0F); - GL11.glScalef(1.7f, 1.7f, 1.7f); + GL46.glTranslatef(0.0f, 4.0f * 0.0625f, 2.0f * 0.0625f); + GL46.glRotatef(type == WieldType.TOOL_FLIP ? 45.0f : -135.0f, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(25.0f, 0.0F, 0.0F, 1.0F); + GL46.glScalef(1.7f, 1.7f, 1.7f); } } this.renderItem(stack, model); - GlState.cullFace(GL11.GL_BACK); - GL11.glPopMatrix(); + GlState.cullFace(GL46.GL_BACK); + GL46.glPopMatrix(); GlState.disableRescaleNormal(); GlState.disableBlend(); this.manager.bindTexture(TextureMap.BLOCKS); @@ -338,22 +338,22 @@ public class RenderItem private void renderItemIntoGUI(ItemStack stack, int x, int y) { IBakedModel ibakedmodel = this.mesher.getItemModel(stack); - GL11.glPushMatrix(); + GL46.glPushMatrix(); this.manager.bindTexture(TextureMap.BLOCKS); GlState.enableRescaleNormal(); GlState.enableAlpha(); - GlState.alphaFunc(GL11.GL_GREATER, 0.1F); + GlState.alphaFunc(GL46.GL_GREATER, 0.1F); GlState.enableBlend(); - GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlState.blendFunc(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA); GlState.color(1.0F, 1.0F, 1.0F, 1.0F); this.setupGuiTransform(x, y, ibakedmodel.isGui3d()); GuiPosition vec = ibakedmodel.getTransforms(); if(vec != GuiPosition.NORMAL) { - GL11.glTranslatef(vec.translationX(), vec.translationY(), vec.translationZ()); - GL11.glRotatef(vec.rotationY(), 0.0F, 1.0F, 0.0F); - GL11.glRotatef(vec.rotationX(), 1.0F, 0.0F, 0.0F); - GL11.glRotatef(vec.rotationZ(), 0.0F, 0.0F, 1.0F); - GL11.glScalef(vec.scale(), vec.scale(), vec.scale()); + GL46.glTranslatef(vec.translationX(), vec.translationY(), vec.translationZ()); + GL46.glRotatef(vec.rotationY(), 0.0F, 1.0F, 0.0F); + GL46.glRotatef(vec.rotationX(), 1.0F, 0.0F, 0.0F); + GL46.glRotatef(vec.rotationZ(), 0.0F, 0.0F, 1.0F); + GL46.glScalef(vec.scale(), vec.scale(), vec.scale()); } boolean cull = GlState.isCullEnabled(); if(!cull) @@ -364,28 +364,28 @@ public class RenderItem GlState.disableAlpha(); GlState.disableRescaleNormal(); GlState.disableLighting(); - GL11.glPopMatrix(); + GL46.glPopMatrix(); this.manager.bindTexture(TextureMap.BLOCKS); } private void setupGuiTransform(int xPosition, int yPosition, boolean isGui3d) { - GL11.glTranslatef((float)xPosition, (float)yPosition, 100.0F + this.zLevel); - GL11.glTranslatef(8.0F, 8.0F, 0.0F); - GL11.glScalef(1.0F, 1.0F, -1.0F); - GL11.glScalef(0.5F, 0.5F, 0.5F); + GL46.glTranslatef((float)xPosition, (float)yPosition, 100.0F + this.zLevel); + GL46.glTranslatef(8.0F, 8.0F, 0.0F); + GL46.glScalef(1.0F, 1.0F, -1.0F); + GL46.glScalef(0.5F, 0.5F, 0.5F); if (isGui3d) { - GL11.glScalef(40.0F, 40.0F, 40.0F); - GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); + GL46.glScalef(40.0F, 40.0F, 40.0F); + GL46.glRotatef(210.0F, 1.0F, 0.0F, 0.0F); + GL46.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); GlState.enableLighting(); } else { - GL11.glScalef(64.0F, 64.0F, 64.0F); - GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); + GL46.glScalef(64.0F, 64.0F, 64.0F); + GL46.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); GlState.disableLighting(); } } diff --git a/client/src/main/java/client/renderer/entity/RenderItemEntity.java b/client/src/main/java/client/renderer/entity/RenderItemEntity.java index a8745c2c..93e2699c 100755 --- a/client/src/main/java/client/renderer/entity/RenderItemEntity.java +++ b/client/src/main/java/client/renderer/entity/RenderItemEntity.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.GlState; import client.renderer.texture.TextureMap; @@ -23,16 +23,16 @@ public class RenderItemEntity extends Render public void doRender(T entity, double x, double y, double z, float partialTicks) { - GL11.glPushMatrix(); - GL11.glTranslatef((float)x, (float)y, (float)z); + GL46.glPushMatrix(); + GL46.glTranslatef((float)x, (float)y, (float)z); GlState.enableRescaleNormal(); - GL11.glScalef(0.5F, 0.5F, 0.5F); - GL11.glRotatef(-this.manager.playerViewY, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(this.manager.playerViewX, 1.0F, 0.0F, 0.0F); + GL46.glScalef(0.5F, 0.5F, 0.5F); + GL46.glRotatef(-this.manager.playerViewY, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(this.manager.playerViewX, 1.0F, 0.0F, 0.0F); this.bindTexture(TextureMap.BLOCKS); this.itemRenderer.renderItemAsGround(this.getStack(entity)); GlState.disableRescaleNormal(); - GL11.glPopMatrix(); + GL46.glPopMatrix(); super.doRender(entity, x, y, z, partialTicks); } diff --git a/client/src/main/java/client/renderer/entity/RenderLeashKnot.java b/client/src/main/java/client/renderer/entity/RenderLeashKnot.java index 722fd80e..62ccd59c 100755 --- a/client/src/main/java/client/renderer/entity/RenderLeashKnot.java +++ b/client/src/main/java/client/renderer/entity/RenderLeashKnot.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.GlState; import client.renderer.model.ModelLeashKnot; @@ -22,16 +22,16 @@ public class RenderLeashKnot extends Render */ public void doRender(EntityLeashKnot entity, double x, double y, double z, float partialTicks) { - GL11.glPushMatrix(); + GL46.glPushMatrix(); GlState.disableCull(); - GL11.glTranslatef((float)x, (float)y, (float)z); + GL46.glTranslatef((float)x, (float)y, (float)z); float f = 0.0625F; GlState.enableRescaleNormal(); - GL11.glScalef(-1.0F, -1.0F, 1.0F); + GL46.glScalef(-1.0F, -1.0F, 1.0F); GlState.enableAlpha(); this.bindEntityTexture(entity); this.leashKnotModel.render(entity, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, f); - GL11.glPopMatrix(); + GL46.glPopMatrix(); super.doRender(entity, x, y, z, partialTicks); } diff --git a/client/src/main/java/client/renderer/entity/RenderLightning.java b/client/src/main/java/client/renderer/entity/RenderLightning.java index 3cf33192..1705ca64 100755 --- a/client/src/main/java/client/renderer/entity/RenderLightning.java +++ b/client/src/main/java/client/renderer/entity/RenderLightning.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.DefaultVertexFormats; import client.renderer.GlState; @@ -27,7 +27,7 @@ public class RenderLightning extends Render GlState.disableTexture2D(); GlState.disableLighting(); GlState.enableBlend(); - GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + GlState.blendFunc(GL46.GL_SRC_ALPHA, GL46.GL_ONE); double[] adouble = new double[8]; double[] adouble1 = new double[8]; double d0 = 0.0D; @@ -83,7 +83,7 @@ public class RenderLightning extends Render d3 += (double)(random1.zrange(31) - 15); } - worldrenderer.begin(GL11.GL_TRIANGLE_STRIP, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.begin(GL46.GL_TRIANGLE_STRIP, DefaultVertexFormats.POSITION_COLOR); float f = 0.5F; float f1 = 0.45F; float f2 = 0.45F; diff --git a/client/src/main/java/client/renderer/entity/RenderLiving.java b/client/src/main/java/client/renderer/entity/RenderLiving.java index 2982780d..58233430 100755 --- a/client/src/main/java/client/renderer/entity/RenderLiving.java +++ b/client/src/main/java/client/renderer/entity/RenderLiving.java @@ -1,7 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL13; +import org.lwjgl.opengl.GL46; import client.renderer.DefaultVertexFormats; import client.renderer.Frustum; @@ -47,7 +46,7 @@ public abstract class RenderLiving extends RendererLivin int l = RenderManager.getBrightnessForRender(entity); int a = l % 65536; int b = l / 65536; - GL13.glMultiTexCoord2f(GL13.GL_TEXTURE1, (float)a / 1.0F, (float)b / 1.0F); + GL46.glMultiTexCoord2f(GL46.GL_TEXTURE1, (float)a / 1.0F, (float)b / 1.0F); } private static double interpolateValue(double start, double end, double pct) { @@ -96,7 +95,7 @@ public abstract class RenderLiving extends RendererLivin GlState.disableTexture2D(); GlState.disableLighting(); GlState.disableCull(); - renderer.begin(GL11.GL_TRIANGLE_STRIP, DefaultVertexFormats.POSITION_COLOR); + renderer.begin(GL46.GL_TRIANGLE_STRIP, DefaultVertexFormats.POSITION_COLOR); for(int n = 0; n <= 24; ++n) { float cr = r; float cg = g; @@ -119,7 +118,7 @@ public abstract class RenderLiving extends RendererLivin ).color(cr, cg, cb, 1.0F).endVertex(); } Tessellator.draw(); - renderer.begin(GL11.GL_TRIANGLE_STRIP, DefaultVertexFormats.POSITION_COLOR); + renderer.begin(GL46.GL_TRIANGLE_STRIP, DefaultVertexFormats.POSITION_COLOR); for(int n = 0; n <= 24; ++n) { float cr = r; float cg = g; diff --git a/client/src/main/java/client/renderer/entity/RenderManager.java b/client/src/main/java/client/renderer/entity/RenderManager.java index f8d2a0c9..d29e3559 100755 --- a/client/src/main/java/client/renderer/entity/RenderManager.java +++ b/client/src/main/java/client/renderer/entity/RenderManager.java @@ -2,8 +2,7 @@ package client.renderer.entity; import java.util.Map; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL13; +import org.lwjgl.opengl.GL46; import client.Client; import client.init.RenderRegistry; @@ -143,7 +142,7 @@ public class RenderManager { int j = i % 65536; int k = i / 65536; - GL13.glMultiTexCoord2f(GL13.GL_TEXTURE1, (float)j / 1.0F, (float)k / 1.0F); + GL46.glMultiTexCoord2f(GL46.GL_TEXTURE1, (float)j / 1.0F, (float)k / 1.0F); GlState.color(1.0F, 1.0F, 1.0F, 1.0F); return this.renderEntity(entity, d0 - this.renderPosX, d1 - this.renderPosY, d2 - this.renderPosZ, partialTicks); } @@ -181,22 +180,22 @@ public class RenderManager { if(dist > (double)(maxDistance * maxDistance) || !this.gm.canRenderHud()) return; float scale = 0.016666668F; - GL11.glPushMatrix(); - GL11.glTranslatef((float)x + 0.0F, (float)y + entity.height + 0.5F, (float)z); - GL11.glNormal3f(0.0F, 1.0F, 0.0F); - GL11.glRotatef(-this.playerViewY, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(this.playerViewX, 1.0F, 0.0F, 0.0F); - GL11.glScalef(-scale, -scale, scale); + GL46.glPushMatrix(); + GL46.glTranslatef((float)x + 0.0F, (float)y + entity.height + 0.5F, (float)z); + GL46.glNormal3f(0.0F, 1.0F, 0.0F); + GL46.glRotatef(-this.playerViewY, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(this.playerViewX, 1.0F, 0.0F, 0.0F); + GL46.glScalef(-scale, -scale, scale); GlState.disableLighting(); GlState.depthMask(false); GlState.enableBlend(); - GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); + GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ZERO); GlState.depthMask(true); Drawing.drawTextboxCentered(str, 0, 0, 0x3f000000); GlState.enableLighting(); GlState.disableBlend(); GlState.color(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } private void renderEntityFire(Entity entity, double x, double y, double z) { @@ -204,21 +203,21 @@ public class RenderManager { TextureMap map = this.gm.getTextureMapBlocks(); Sprite layer0 = map.getAtlasSprite("blocks/fire_layer_0"); Sprite layer1 = map.getAtlasSprite("blocks/fire_layer_1"); - GL11.glPushMatrix(); - GL11.glTranslatef((float)x, (float)y, (float)z); + GL46.glPushMatrix(); + GL46.glTranslatef((float)x, (float)y, (float)z); float scale = entity.width * 1.4F; - GL11.glScalef(scale, scale, scale); + GL46.glScalef(scale, scale, scale); RenderBuffer rb = Tessellator.getBuffer(); float f1 = 0.5F; float f2 = 0.0F; float f3 = entity.height / scale; float f4 = (float)(entity.posY - entity.getEntityBoundingBox().minY); - GL11.glRotatef(-this.playerViewY, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(0.0F, 0.0F, -0.3F + (float)((int)f3) * 0.02F); + GL46.glRotatef(-this.playerViewY, 0.0F, 1.0F, 0.0F); + GL46.glTranslatef(0.0F, 0.0F, -0.3F + (float)((int)f3) * 0.02F); GlState.color(1.0F, 1.0F, 1.0F, 1.0F); float f5 = 0.0F; int i = 0; - rb.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + rb.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_TEX); while(f3 > 0.0F) { Sprite layer = i % 2 == 0 ? layer0 : layer1; @@ -246,7 +245,7 @@ public class RenderManager { } Tessellator.draw(); - GL11.glPopMatrix(); + GL46.glPopMatrix(); GlState.enableLighting(); } @@ -270,7 +269,7 @@ public class RenderManager { RenderBuffer worldrenderer = Tessellator.getBuffer(); Vec3 vec3 = entityIn.getLook(partialTicks); - worldrenderer.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.begin(GL46.GL_LINE_STRIP, DefaultVertexFormats.POSITION_COLOR); worldrenderer.pos(x, y + (double)entityIn.getEyeHeight(), z).color(0, 0, 255, 255).endVertex(); worldrenderer.pos(x + vec3.xCoord * 2.0D, y + (double)entityIn.getEyeHeight() + vec3.yCoord * 2.0D, z + vec3.zCoord * 2.0D).color(0, 0, 255, 255).endVertex(); Tessellator.draw(); diff --git a/client/src/main/java/client/renderer/entity/RenderMinecart.java b/client/src/main/java/client/renderer/entity/RenderMinecart.java index abeaf6e9..7cea28f1 100755 --- a/client/src/main/java/client/renderer/entity/RenderMinecart.java +++ b/client/src/main/java/client/renderer/entity/RenderMinecart.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.Client; import client.renderer.GlState; @@ -32,14 +32,14 @@ public class RenderMinecart extends Render public void doRender(T entity, double x, double y, double z, float partialTicks) { float entityYaw = entity.prevYaw + (entity.rotYaw - entity.prevYaw) * partialTicks; - GL11.glPushMatrix(); + GL46.glPushMatrix(); this.bindEntityTexture(entity); long i = (long)entity.getId() * 493286711L; i = i * i * 4392167121L + i * 98761L; float f = (((float)(i >> 16 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; float f1 = (((float)(i >> 20 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; float f2 = (((float)(i >> 24 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; - GL11.glTranslatef(f, f1, f2); + GL46.glTranslatef(f, f1, f2); double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)partialTicks; double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)partialTicks; double d2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double)partialTicks; @@ -75,9 +75,9 @@ public class RenderMinecart extends Render } } - GL11.glTranslatef((float)x, (float)y + 0.375F, (float)z); - GL11.glRotatef(180.0F - entityYaw, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-f3, 0.0F, 0.0F, 1.0F); + GL46.glTranslatef((float)x, (float)y + 0.375F, (float)z); + GL46.glRotatef(180.0F - entityYaw, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(-f3, 0.0F, 0.0F, 1.0F); float f5 = (float)entity.getRollingAmplitude() - partialTicks; float f6 = (float)entity.getDamage() - partialTicks; @@ -88,7 +88,7 @@ public class RenderMinecart extends Render if (f5 > 0.0F) { - GL11.glRotatef(ExtMath.sin(f5) * f5 * f6 / 10.0F * (float)entity.getRollingDirection(), 1.0F, 0.0F, 0.0F); + GL46.glRotatef(ExtMath.sin(f5) * f5 * f6 / 10.0F * (float)entity.getRollingDirection(), 1.0F, 0.0F, 0.0F); } int j = entity.getDisplayTileOffset(); @@ -96,20 +96,20 @@ public class RenderMinecart extends Render if (iblockstate.getBlock() != Blocks.air && !iblockstate.getBlock().getMaterial().isLiquid()) { - GL11.glPushMatrix(); + GL46.glPushMatrix(); this.bindTexture(TextureMap.BLOCKS); float f4 = 0.75F; - GL11.glScalef(f4, f4, f4); - GL11.glTranslatef(-0.5F, (float)(j - 8) / 16.0F, 0.5F); + GL46.glScalef(f4, f4, f4); + GL46.glTranslatef(-0.5F, (float)(j - 8) / 16.0F, 0.5F); this.func_180560_a(entity, partialTicks, iblockstate); - GL11.glPopMatrix(); + GL46.glPopMatrix(); GlState.color(1.0F, 1.0F, 1.0F, 1.0F); this.bindEntityTexture(entity); } - GL11.glScalef(-1.0F, -1.0F, 1.0F); + GL46.glScalef(-1.0F, -1.0F, 1.0F); this.modelMinecart.render(entity, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); - GL11.glPopMatrix(); + GL46.glPopMatrix(); super.doRender(entity, x, y, z, partialTicks); } @@ -123,8 +123,8 @@ public class RenderMinecart extends Render protected void func_180560_a(T minecart, float partialTicks, State state) { - GL11.glPushMatrix(); + GL46.glPushMatrix(); Client.CLIENT.renderer.renderBlockEntity(state, getBrightness(minecart)); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } } diff --git a/client/src/main/java/client/renderer/entity/RenderSlime.java b/client/src/main/java/client/renderer/entity/RenderSlime.java index 9efa0415..233557c3 100755 --- a/client/src/main/java/client/renderer/entity/RenderSlime.java +++ b/client/src/main/java/client/renderer/entity/RenderSlime.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.layers.LayerSlimeGel; import client.renderer.model.ModelSlime; @@ -25,7 +25,7 @@ public class RenderSlime extends RenderNpc f1 = (slime.prevSquishFactor + (slime.squishFactor - slime.prevSquishFactor) * partialTickTime) / (f * 0.5F + 1.0F); } float f2 = 1.0F / (f1 + 1.0F); - GL11.glScalef(f2 * f, 1.0F / f2 * f, f2 * f); + GL46.glScalef(f2 * f, 1.0F / f2 * f, f2 * f); } public void doRender(EntityNPC entity, double x, double y, double z, float partialTicks) diff --git a/client/src/main/java/client/renderer/entity/RenderSpaceMarine.java b/client/src/main/java/client/renderer/entity/RenderSpaceMarine.java index 7692453c..7847e95b 100755 --- a/client/src/main/java/client/renderer/entity/RenderSpaceMarine.java +++ b/client/src/main/java/client/renderer/entity/RenderSpaceMarine.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.layers.LayerArrow; import client.renderer.layers.LayerHeldItem; @@ -83,7 +83,7 @@ public class RenderSpaceMarine extends RenderNpc protected void preRenderCallback(EntityNPC entitylivingbaseIn, float partialTickTime) { float f = entitylivingbaseIn.getRenderScale(); // 0.9375F; - GL11.glScalef(f, f, f); + GL46.glScalef(f, f, f); } // public void renderPlayerArm(EntityNPC entity) diff --git a/client/src/main/java/client/renderer/entity/RenderTntMinecart.java b/client/src/main/java/client/renderer/entity/RenderTntMinecart.java index 6170503f..36eb3c3c 100755 --- a/client/src/main/java/client/renderer/entity/RenderTntMinecart.java +++ b/client/src/main/java/client/renderer/entity/RenderTntMinecart.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.Client; import client.renderer.GlState; @@ -27,7 +27,7 @@ public class RenderTntMinecart extends RenderMinecart f = f * f; f = f * f; float f1 = 1.0F + f * 0.3F; - GL11.glScalef(f1, f1, f1); + GL46.glScalef(f1, f1, f1); } super.func_180560_a(minecart, partialTicks, state); @@ -37,11 +37,11 @@ public class RenderTntMinecart extends RenderMinecart GlState.disableTexture2D(); GlState.disableLighting(); GlState.enableBlend(); - GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA); + GlState.blendFunc(GL46.GL_SRC_ALPHA, GL46.GL_DST_ALPHA); GlState.color(1.0F, 1.0F, 1.0F, (1.0F - ((float)i - partialTicks + 1.0F) / 100.0F) * 0.8F); - GL11.glPushMatrix(); + GL46.glPushMatrix(); Client.CLIENT.renderer.renderBlockEntity(Blocks.tnt.getState(), 1.0F); - GL11.glPopMatrix(); + GL46.glPopMatrix(); GlState.color(1.0F, 1.0F, 1.0F, 1.0F); GlState.disableBlend(); GlState.enableLighting(); diff --git a/client/src/main/java/client/renderer/entity/RenderTntPrimed.java b/client/src/main/java/client/renderer/entity/RenderTntPrimed.java index e53a5831..cf81a985 100755 --- a/client/src/main/java/client/renderer/entity/RenderTntPrimed.java +++ b/client/src/main/java/client/renderer/entity/RenderTntPrimed.java @@ -1,6 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.Client; import client.renderer.GlState; @@ -22,8 +22,8 @@ public class RenderTntPrimed extends Render public void doRender(EntityTnt entity, double x, double y, double z, float partialTicks) { Renderer renderer = Client.CLIENT.renderer; - GL11.glPushMatrix(); - GL11.glTranslatef((float)x, (float)y + 0.5F, (float)z); + GL46.glPushMatrix(); + GL46.glTranslatef((float)x, (float)y + 0.5F, (float)z); if ((float)entity.fuse - partialTicks + 1.0F < 10.0F) { @@ -32,22 +32,22 @@ public class RenderTntPrimed extends Render f = f * f; f = f * f; float f1 = 1.0F + f * 0.3F; - GL11.glScalef(f1, f1, f1); + GL46.glScalef(f1, f1, f1); } float f2 = (1.0F - ((float)entity.fuse - partialTicks + 1.0F) / 100.0F) * 0.8F; this.bindEntityTexture(entity); - GL11.glTranslatef(-0.5F, -0.5F, 0.5F); + GL46.glTranslatef(-0.5F, -0.5F, 0.5F); Block tnt = BlockRegistry.byName("tnt" + (entity.explosionSize <= 0 || entity.explosionSize >= 8 ? "" : "_" + entity.explosionSize)); renderer.renderBlockEntity(tnt.getState(), getBrightness(entity)); - GL11.glTranslatef(0.0F, 0.0F, 1.0F); + GL46.glTranslatef(0.0F, 0.0F, 1.0F); if (entity.fuse / 5 % 2 == 0) { GlState.disableTexture2D(); GlState.disableLighting(); GlState.enableBlend(); - GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA); + GlState.blendFunc(GL46.GL_SRC_ALPHA, GL46.GL_DST_ALPHA); GlState.color(1.0F, 1.0F, 1.0F, f2); GlState.doPolygonOffset(-3.0F, -3.0F); GlState.enablePolygonOffset(); @@ -60,7 +60,7 @@ public class RenderTntPrimed extends Render GlState.enableTexture2D(); } - GL11.glPopMatrix(); + GL46.glPopMatrix(); super.doRender(entity, x, y, z, partialTicks); } diff --git a/client/src/main/java/client/renderer/entity/RenderXp.java b/client/src/main/java/client/renderer/entity/RenderXp.java index 25cf806f..61921ede 100755 --- a/client/src/main/java/client/renderer/entity/RenderXp.java +++ b/client/src/main/java/client/renderer/entity/RenderXp.java @@ -1,7 +1,6 @@ package client.renderer.entity; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL13; +import org.lwjgl.opengl.GL46; import client.renderer.DefaultVertexFormats; import client.renderer.GlState; @@ -18,8 +17,8 @@ public class RenderXp extends Render { } public void doRender(EntityXp entity, double x, double y, double z, float partial) { - GL11.glPushMatrix(); - GL11.glTranslatef((float)x, (float)y, (float)z); + GL46.glPushMatrix(); + GL46.glTranslatef((float)x, (float)y, (float)z); this.bindEntityTexture(entity); int value = entity.getXpValue(); float u1 = (float)(value % 4 * 16 + 0) / 64.0F; @@ -32,19 +31,19 @@ public class RenderXp extends Render { int light = RenderManager.getBrightnessForRender(entity); int block = light % 65536; int sky = light / 65536; - GL13.glMultiTexCoord2f(GL13.GL_TEXTURE1, (float)block / 1.0F, (float)sky / 1.0F); + GL46.glMultiTexCoord2f(GL46.GL_TEXTURE1, (float)block / 1.0F, (float)sky / 1.0F); GlState.color(1.0F, 1.0F, 1.0F, 1.0F); float color = ((float)entity.xpColor + partial) / 16.0F; int g = (int)((ExtMath.sin(color + 0.0F) + 1.0F) * 0.5F * 255.0F); float n = (int)((ExtMath.sin(color + (float)Math.PI) + 1.0F) * 0.5F * 255.0F); int r = (int)(n * (value / 10.0f)); int b = (int)(n * ((10 - value) / 10.0f)); - GL11.glRotatef(180.0F - this.manager.playerViewY, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-this.manager.playerViewX, 1.0F, 0.0F, 0.0F); + GL46.glRotatef(180.0F - this.manager.playerViewY, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(-this.manager.playerViewX, 1.0F, 0.0F, 0.0F); float size = 0.25F; - GL11.glScalef(size, size, size); + GL46.glScalef(size, size, size); RenderBuffer rb = Tessellator.getBuffer(); - rb.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL); + rb.begin(GL46.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL); rb.pos((double)(0.0F - dx), (double)(0.0F - dy), 0.0D).tex((double)u1, (double)v2).color(r, g, b, 128).normal(0.0F, 1.0F, 0.0F) .endVertex(); rb.pos((double)(bx - dx), (double)(0.0F - dy), 0.0D).tex((double)u2, (double)v2).color(r, g, b, 128).normal(0.0F, 1.0F, 0.0F) @@ -56,7 +55,7 @@ public class RenderXp extends Render { Tessellator.draw(); GlState.disableBlend(); GlState.disableRescaleNormal(); - GL11.glPopMatrix(); + GL46.glPopMatrix(); super.doRender(entity, x, y, z, partial); } diff --git a/client/src/main/java/client/renderer/entity/RendererLivingEntity.java b/client/src/main/java/client/renderer/entity/RendererLivingEntity.java index 05abf9fe..60cbe529 100755 --- a/client/src/main/java/client/renderer/entity/RendererLivingEntity.java +++ b/client/src/main/java/client/renderer/entity/RendererLivingEntity.java @@ -5,8 +5,7 @@ import java.nio.ByteOrder; import java.nio.FloatBuffer; import java.util.List; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL13; +import org.lwjgl.opengl.GL46; import client.renderer.DefaultVertexFormats; import client.renderer.GlState; @@ -87,7 +86,7 @@ public abstract class RendererLivingEntity extends Rende */ public void doRender(T entity, double x, double y, double z, float partialTicks) { - GL11.glPushMatrix(); + GL46.glPushMatrix(); GlState.disableCull(); this.mainModel.swingProgress = this.getSwingProgress(entity, partialTicks); this.mainModel.isRiding = entity.isRiding(); @@ -129,10 +128,10 @@ public abstract class RendererLivingEntity extends Rende float f8 = this.handleRotationFloat(entity, partialTicks); this.rotateCorpse(entity, f8, f, partialTicks); GlState.enableRescaleNormal(); - GL11.glScalef(-1.0F, -1.0F, 1.0F); + GL46.glScalef(-1.0F, -1.0F, 1.0F); this.preRenderCallback(entity, partialTicks); float f4 = 0.0625F; - GL11.glTranslatef(0.0F, -1.5078125F, 0.0F); + GL46.glTranslatef(0.0F, -1.5078125F, 0.0F); float f5 = entity.prevLswingAmount + (entity.lswingAmount - entity.prevLswingAmount) * partialTicks; float f6 = entity.limbSwing - entity.lswingAmount * (1.0F - partialTicks); @@ -185,11 +184,11 @@ public abstract class RendererLivingEntity extends Rende Log.RENDER.error((Throwable)exception, (String)"Konnte Objekt nicht rendern"); } - GlState.setActiveTexture(GL13.GL_TEXTURE1); + GlState.setActiveTexture(GL46.GL_TEXTURE1); GlState.enableTexture2D(); - GlState.setActiveTexture(GL13.GL_TEXTURE0); + GlState.setActiveTexture(GL46.GL_TEXTURE0); GlState.enableCull(); - GL11.glPopMatrix(); + GL46.glPopMatrix(); if (!this.renderOutlines) { @@ -223,23 +222,23 @@ public abstract class RendererLivingEntity extends Rende float g = (float)(c >> 8 & 255) / 255.0F; float b = (float)(c & 255) / 255.0F; GlState.disableLighting(); - GlState.setActiveTexture(GL13.GL_TEXTURE0); + GlState.setActiveTexture(GL46.GL_TEXTURE0); GlState.color(r, g, b, 1.0F); GlState.disableTexture2D(); - GlState.setActiveTexture(GL13.GL_TEXTURE1); + GlState.setActiveTexture(GL46.GL_TEXTURE1); GlState.disableTexture2D(); - GlState.setActiveTexture(GL13.GL_TEXTURE0); + GlState.setActiveTexture(GL46.GL_TEXTURE0); return true; } protected void unsetOutlineColor() { GlState.enableLighting(); - GlState.setActiveTexture(GL13.GL_TEXTURE0); + GlState.setActiveTexture(GL46.GL_TEXTURE0); GlState.enableTexture2D(); - GlState.setActiveTexture(GL13.GL_TEXTURE1); + GlState.setActiveTexture(GL46.GL_TEXTURE1); GlState.enableTexture2D(); - GlState.setActiveTexture(GL13.GL_TEXTURE0); + GlState.setActiveTexture(GL46.GL_TEXTURE0); } protected void renderModel(T entity, float x, float y, float z, float yaw, float pitch, float scale) @@ -256,13 +255,13 @@ public abstract class RendererLivingEntity extends Rende if (ghost) { - GL11.glPushMatrix(); + GL46.glPushMatrix(); GlState.color(1.0F, 1.0F, 1.0F, 0.3F); // GlState.color(entity.getRenderColor() | (vis ? 0x50000000 : 0x26000000)); GlState.depthMask(false); GlState.enableBlend(); - GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GlState.alphaFunc(GL11.GL_GREATER, 0.003921569F); + GlState.blendFunc(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA); + GlState.alphaFunc(GL46.GL_GREATER, 0.003921569F); } if(entity.isGlowing()) @@ -275,8 +274,8 @@ public abstract class RendererLivingEntity extends Rende if (ghost) { GlState.disableBlend(); - GlState.alphaFunc(GL11.GL_GREATER, 0.1F); - GL11.glPopMatrix(); + GlState.alphaFunc(GL46.GL_GREATER, 0.1F); + GL46.glPopMatrix(); GlState.depthMask(true); } // } @@ -415,12 +414,12 @@ public abstract class RendererLivingEntity extends Rende */ protected void renderLivingAt(T entityLivingBaseIn, double x, double y, double z) { - GL11.glTranslatef((float)x, (float)y, (float)z); + GL46.glTranslatef((float)x, (float)y, (float)z); } protected void rotateCorpse(T bat, float p_77043_2_, float p_77043_3_, float partialTicks) { - GL11.glRotatef(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F); if (bat.deathTime > 0) { @@ -432,7 +431,7 @@ public abstract class RendererLivingEntity extends Rende f = 1.0F; } - GL11.glRotatef(f * this.getDeathMaxRotation(bat), 0.0F, 0.0F, 1.0F); + GL46.glRotatef(f * this.getDeathMaxRotation(bat), 0.0F, 0.0F, 1.0F); } else { @@ -440,8 +439,8 @@ public abstract class RendererLivingEntity extends Rende if (s != null && (s.startsWith("Australia") || s.startsWith("Australien"))) // && (!(bat.isPlayer()) || ((EntityNPC)bat).isWearing(ModelPart.CAPE))) { - GL11.glTranslatef(0.0F, bat.height + 0.1F, 0.0F); - GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + GL46.glTranslatef(0.0F, bat.height + 0.1F, 0.0F); + GL46.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); } } } @@ -527,19 +526,19 @@ public abstract class RendererLivingEntity extends Rende float f4 = (float)(crystal.posZ - entity.posZ - (entity.prevZ - entity.posZ) * (double)(1.0F - p_180574_8_)); float f5 = ExtMath.sqrtf(f2 * f2 + f4 * f4); float f6 = ExtMath.sqrtf(f2 * f2 + f3 * f3 + f4 * f4); - GL11.glPushMatrix(); - GL11.glTranslatef((float)p_180574_2_, (float)p_180574_4_ + 2.0F, (float)p_180574_6_); - GL11.glRotatef((float)(-Math.atan2((double)f4, (double)f2)) * 180.0F / (float)Math.PI - 90.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef((float)(-Math.atan2((double)f5, (double)f3)) * 180.0F / (float)Math.PI - 90.0F, 1.0F, 0.0F, 0.0F); + GL46.glPushMatrix(); + GL46.glTranslatef((float)p_180574_2_, (float)p_180574_4_ + 2.0F, (float)p_180574_6_); + GL46.glRotatef((float)(-Math.atan2((double)f4, (double)f2)) * 180.0F / (float)Math.PI - 90.0F, 0.0F, 1.0F, 0.0F); + GL46.glRotatef((float)(-Math.atan2((double)f5, (double)f3)) * 180.0F / (float)Math.PI - 90.0F, 1.0F, 0.0F, 0.0F); // Tessellator tessellator = Tessellator.getInstance(); RenderBuffer worldrenderer = Tessellator.getBuffer(); ItemRenderer.disableStandardItemLighting(); GlState.disableCull(); this.bindTexture(crystalBeamTextures); - GlState.shadeModel(GL11.GL_SMOOTH); + GlState.shadeModel(GL46.GL_SMOOTH); float f7 = 0.0F - ((float)entity.ticksExisted + p_180574_8_) * 0.01F; float f8 = ExtMath.sqrtf(f2 * f2 + f3 * f3 + f4 * f4) / 32.0F - ((float)entity.ticksExisted + p_180574_8_) * 0.01F; - worldrenderer.begin(GL11.GL_TRIANGLE_STRIP, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.begin(GL46.GL_TRIANGLE_STRIP, DefaultVertexFormats.POSITION_TEX_COLOR); int i = 8; for (int j = 0; j <= 8; ++j) @@ -553,9 +552,9 @@ public abstract class RendererLivingEntity extends Rende Tessellator.draw(); GlState.enableCull(); - GlState.shadeModel(GL11.GL_FLAT); + GlState.shadeModel(GL46.GL_FLAT); ItemRenderer.enableStandardItemLighting(); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } static diff --git a/client/src/main/java/client/renderer/layers/LayerArmor.java b/client/src/main/java/client/renderer/layers/LayerArmor.java index 3f79a563..c4d77c99 100755 --- a/client/src/main/java/client/renderer/layers/LayerArmor.java +++ b/client/src/main/java/client/renderer/layers/LayerArmor.java @@ -2,7 +2,7 @@ package client.renderer.layers; import java.util.List; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.Client; import client.renderer.GlState; @@ -121,7 +121,7 @@ public class LayerArmor implements LayerRenderer else Client.CLIENT.getTextureManager().bindTexture(ENCHANTED_ITEM_GLINT_RES); GlState.enableBlend(); - GlState.depthFunc(GL11.GL_EQUAL); + GlState.depthFunc(GL46.GL_EQUAL); GlState.depthMask(false); float f1 = 0.5F; GlState.color(f1, f1, f1, 1.0F); @@ -129,25 +129,25 @@ public class LayerArmor implements LayerRenderer for (int i = 0; i < 2; ++i) { GlState.disableLighting(); - GlState.blendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); + GlState.blendFunc(GL46.GL_SRC_COLOR, GL46.GL_ONE); float f2 = 0.76F; GlState.color(0.5F * f2, 0.25F * f2, 0.8F * f2, 1.0F); - GL11.glMatrixMode(GL11.GL_TEXTURE); - GL11.glLoadIdentity(); + GL46.glMatrixMode(GL46.GL_TEXTURE); + GL46.glLoadIdentity(); float f3 = 0.33333334F; - GL11.glScalef(f3, f3, f3); - GL11.glRotatef(30.0F - (float)i * 60.0F, 0.0F, 0.0F, 1.0F); - GL11.glTranslatef(0.0F, f * (0.001F + (float)i * 0.003F) * 20.0F, 0.0F); - GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL46.glScalef(f3, f3, f3); + GL46.glRotatef(30.0F - (float)i * 60.0F, 0.0F, 0.0F, 1.0F); + GL46.glTranslatef(0.0F, f * (0.001F + (float)i * 0.003F) * 20.0F, 0.0F); + GL46.glMatrixMode(GL46.GL_MODELVIEW); modelbaseIn.render(entitylivingbaseIn, p_177183_3_, p_177183_4_, p_177183_6_, p_177183_7_, p_177183_8_, scale); } - GL11.glMatrixMode(GL11.GL_TEXTURE); - GL11.glLoadIdentity(); - GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL46.glMatrixMode(GL46.GL_TEXTURE); + GL46.glLoadIdentity(); + GL46.glMatrixMode(GL46.GL_MODELVIEW); GlState.enableLighting(); GlState.depthMask(true); - GlState.depthFunc(GL11.GL_LEQUAL); + GlState.depthFunc(GL46.GL_LEQUAL); GlState.disableBlend(); } diff --git a/client/src/main/java/client/renderer/layers/LayerArrow.java b/client/src/main/java/client/renderer/layers/LayerArrow.java index 6fa65897..902303d3 100755 --- a/client/src/main/java/client/renderer/layers/LayerArrow.java +++ b/client/src/main/java/client/renderer/layers/LayerArrow.java @@ -1,6 +1,6 @@ package client.renderer.layers; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.ItemRenderer; import client.renderer.entity.RendererLivingEntity; @@ -33,7 +33,7 @@ public class LayerArrow implements LayerRenderer for (int j = 0; j < i; ++j) { - GL11.glPushMatrix(); + GL46.glPushMatrix(); ModelRenderer modelrenderer = this.field_177168_a.getMainModel().getRandomModelBox(random); ModelBox modelbox = (ModelBox)modelrenderer.cubeList.get(random.zrange(modelrenderer.cubeList.size())); modelrenderer.postRender(0.0625F); @@ -43,7 +43,7 @@ public class LayerArrow implements LayerRenderer float f3 = (modelbox.posX1 + (modelbox.posX2 - modelbox.posX1) * f) / 16.0F; float f4 = (modelbox.posY1 + (modelbox.posY2 - modelbox.posY1) * f1) / 16.0F; float f5 = (modelbox.posZ1 + (modelbox.posZ2 - modelbox.posZ1) * f2) / 16.0F; - GL11.glTranslatef(f3, f4, f5); + GL46.glTranslatef(f3, f4, f5); f = f * 2.0F - 1.0F; f1 = f1 * 2.0F - 1.0F; f2 = f2 * 2.0F - 1.0F; @@ -57,7 +57,7 @@ public class LayerArrow implements LayerRenderer double d1 = 0.0D; double d2 = 0.0D; this.field_177168_a.getRenderManager().renderEntity(entity, d0, d1, d2, partialTicks); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } ItemRenderer.enableStandardItemLighting(); diff --git a/client/src/main/java/client/renderer/layers/LayerCape.java b/client/src/main/java/client/renderer/layers/LayerCape.java index 9e79b88f..2c485e7a 100755 --- a/client/src/main/java/client/renderer/layers/LayerCape.java +++ b/client/src/main/java/client/renderer/layers/LayerCape.java @@ -1,6 +1,6 @@ package client.renderer.layers; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.GlState; import client.renderer.entity.RenderHumanoid; @@ -31,8 +31,8 @@ public class LayerCape implements LayerRenderer entitylivingbaseIn.getCape() != null) { GlState.color(1.0F, 1.0F, 1.0F, 1.0F); this.renderer.bindTexture("textures/npc/cape_" + entitylivingbaseIn.getCape() + ".png"); - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, 0.0F, 0.125F); + GL46.glPushMatrix(); + GL46.glTranslatef(0.0F, 0.0F, 0.125F); if(entitylivingbaseIn.isPlayer()) { EntityNPC player = (EntityNPC)entitylivingbaseIn; double d0 = player.prevChasingPosX + (player.chasingPosX - player.prevChasingPosX) * (double)partialTicks - (entitylivingbaseIn.prevX + (entitylivingbaseIn.posX - entitylivingbaseIn.prevX) * (double)partialTicks); @@ -59,17 +59,17 @@ public class LayerCape implements LayerRenderer f1 += 25.0F; } - GL11.glRotatef(6.0F + f2 / 2.0F + f1, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(f3 / 2.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-f3 / 2.0F, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(6.0F + f2 / 2.0F + f1, 1.0F, 0.0F, 0.0F); + GL46.glRotatef(f3 / 2.0F, 0.0F, 0.0F, 1.0F); + GL46.glRotatef(-f3 / 2.0F, 0.0F, 1.0F, 0.0F); } else { - GL11.glRotatef(entitylivingbaseIn.isSneakingVisually() ? 25.0F : 5.0F, 1.0F, 0.0F, 0.0F); + GL46.glRotatef(entitylivingbaseIn.isSneakingVisually() ? 25.0F : 5.0F, 1.0F, 0.0F, 0.0F); } - GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); this.bipedCape.rotationPointY = this.shift + (entitylivingbaseIn.isSneakingVisually() ? 2.0f : 0.0f); this.bipedCape.render(0.0625F); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } } diff --git a/client/src/main/java/client/renderer/layers/LayerCharge.java b/client/src/main/java/client/renderer/layers/LayerCharge.java index 033b9368..b1817682 100755 --- a/client/src/main/java/client/renderer/layers/LayerCharge.java +++ b/client/src/main/java/client/renderer/layers/LayerCharge.java @@ -1,6 +1,6 @@ package client.renderer.layers; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.GlState; import client.renderer.entity.RenderHumanoid; @@ -27,23 +27,23 @@ public class LayerCharge implements LayerRenderer // boolean flag = entitylivingbaseIn.isInvisible(); GlState.depthMask(true); this.main.bindTexture(LIGHTNING_TEXTURE); - GL11.glMatrixMode(GL11.GL_TEXTURE); - GL11.glLoadIdentity(); + GL46.glMatrixMode(GL46.GL_TEXTURE); + GL46.glLoadIdentity(); float f = (float)entitylivingbaseIn.ticksExisted + partialTicks; - GL11.glTranslatef(f * 0.01F, f * 0.01F, 0.0F); - GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL46.glTranslatef(f * 0.01F, f * 0.01F, 0.0F); + GL46.glMatrixMode(GL46.GL_MODELVIEW); GlState.enableBlend(); float f1 = 0.5F; GlState.color(f1, f1, f1, 1.0F); GlState.disableLighting(); - GlState.blendFunc(GL11.GL_ONE, GL11.GL_ONE); + GlState.blendFunc(GL46.GL_ONE, GL46.GL_ONE); this.charge.setModelAttributes(this.main.getMainModel()); - GL11.glScalef(entitylivingbaseIn.height, entitylivingbaseIn.height, entitylivingbaseIn.height); - GL11.glTranslatef(0.0f, -0.25f, 0.0f); + GL46.glScalef(entitylivingbaseIn.height, entitylivingbaseIn.height, entitylivingbaseIn.height); + GL46.glTranslatef(0.0f, -0.25f, 0.0f); this.charge.render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale); - GL11.glMatrixMode(GL11.GL_TEXTURE); - GL11.glLoadIdentity(); - GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL46.glMatrixMode(GL46.GL_TEXTURE); + GL46.glLoadIdentity(); + GL46.glMatrixMode(GL46.GL_MODELVIEW); GlState.enableLighting(); GlState.disableBlend(); GlState.depthMask(false); diff --git a/client/src/main/java/client/renderer/layers/LayerEntityBreak.java b/client/src/main/java/client/renderer/layers/LayerEntityBreak.java index a705c6d7..b215b571 100755 --- a/client/src/main/java/client/renderer/layers/LayerEntityBreak.java +++ b/client/src/main/java/client/renderer/layers/LayerEntityBreak.java @@ -1,6 +1,6 @@ package client.renderer.layers; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.DefaultVertexFormats; import client.renderer.GlState; @@ -29,26 +29,26 @@ public class LayerEntityBreak implements LayerRenderer Random random = new Random(432L); GlState.disableTexture2D(); - GlState.shadeModel(GL11.GL_SMOOTH); + GlState.shadeModel(GL46.GL_SMOOTH); GlState.enableBlend(); - GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + GlState.blendFunc(GL46.GL_SRC_ALPHA, GL46.GL_ONE); GlState.disableAlpha(); GlState.enableCull(); GlState.depthMask(false); - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, -1.0F, -2.0F); + GL46.glPushMatrix(); + GL46.glTranslatef(0.0F, -1.0F, -2.0F); for (int i = 0; (float)i < (f + f * f) / 2.0F * 60.0F; ++i) { - GL11.glRotatef(random.floatv() * 360.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(random.floatv() * 360.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(random.floatv() * 360.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(random.floatv() * 360.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(random.floatv() * 360.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(random.floatv() * 360.0F + f * 90.0F, 0.0F, 0.0F, 1.0F); + GL46.glRotatef(random.floatv() * 360.0F, 1.0F, 0.0F, 0.0F); + GL46.glRotatef(random.floatv() * 360.0F, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(random.floatv() * 360.0F, 0.0F, 0.0F, 1.0F); + GL46.glRotatef(random.floatv() * 360.0F, 1.0F, 0.0F, 0.0F); + GL46.glRotatef(random.floatv() * 360.0F, 0.0F, 1.0F, 0.0F); + GL46.glRotatef(random.floatv() * 360.0F + f * 90.0F, 0.0F, 0.0F, 1.0F); float f2 = random.floatv() * 20.0F + 5.0F + f1 * 10.0F; float f3 = random.floatv() * 2.0F + 1.0F + f1 * 2.0F; - worldrenderer.begin(GL11.GL_TRIANGLE_FAN, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.begin(GL46.GL_TRIANGLE_FAN, DefaultVertexFormats.POSITION_COLOR); worldrenderer.pos(0.0D, 0.0D, 0.0D).color(255, 255, 255, (int)(255.0F * (1.0F - f1))).endVertex(); worldrenderer.pos(-0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex(); worldrenderer.pos(0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex(); @@ -57,11 +57,11 @@ public class LayerEntityBreak implements LayerRenderer Tessellator.draw(); } - GL11.glPopMatrix(); + GL46.glPopMatrix(); GlState.depthMask(true); GlState.disableCull(); GlState.disableBlend(); - GlState.shadeModel(GL11.GL_FLAT); + GlState.shadeModel(GL46.GL_FLAT); GlState.color(1.0F, 1.0F, 1.0F, 1.0F); GlState.enableTexture2D(); GlState.enableAlpha(); diff --git a/client/src/main/java/client/renderer/layers/LayerExtra.java b/client/src/main/java/client/renderer/layers/LayerExtra.java index 40bd8dac..bba0db0f 100755 --- a/client/src/main/java/client/renderer/layers/LayerExtra.java +++ b/client/src/main/java/client/renderer/layers/LayerExtra.java @@ -2,7 +2,7 @@ package client.renderer.layers; import java.util.List; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.Client; import client.renderer.GlState; @@ -62,11 +62,11 @@ public class LayerExtra implements LayerRenderer // { GlState.color(1.0F, 1.0F, 1.0F, 1.0F); Client.CLIENT.getTextureManager().bindTexture(EntityTexManager.getSkin(entity)); - GL11.glPushMatrix(); + GL46.glPushMatrix(); if (entity.isSneakingVisually()) { - GL11.glTranslatef(0.0F, 0.2F, 0.0F); + GL46.glTranslatef(0.0F, 0.2F, 0.0F); } // if (entity.isChild()) @@ -77,20 +77,20 @@ public class LayerExtra implements LayerRenderer // SKC.glTranslatef(0.0F, 24.0F * scale, 0.0F); // } - GL11.glPushMatrix(); + GL46.glPushMatrix(); this.model.bipedBody.postRender(0.0625F); for(ModelRenderer model : this.wing) { if(entity.hasDualWings()) { - GL11.glPushMatrix(); - GL11.glRotatef(model.rotateAngleY < 0.0f ? -10.0f : 10.0f, 0.0f, 1.0f, 0.0f); - GL11.glTranslatef(0.0f, 0.125f, -0.0625f); + GL46.glPushMatrix(); + GL46.glRotatef(model.rotateAngleY < 0.0f ? -10.0f : 10.0f, 0.0f, 1.0f, 0.0f); + GL46.glTranslatef(0.0f, 0.125f, -0.0625f); model.render(0.0625F); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glRotatef(model.rotateAngleY < 0.0f ? 10.0f : -10.0f, 0.0f, 1.0f, 0.0f); - GL11.glTranslatef(model.rotateAngleY < 0.0f ? 0.0625f : -0.0625f, -0.125f, 0.0f); + GL46.glPopMatrix(); + GL46.glPushMatrix(); + GL46.glRotatef(model.rotateAngleY < 0.0f ? 10.0f : -10.0f, 0.0f, 1.0f, 0.0f); + GL46.glTranslatef(model.rotateAngleY < 0.0f ? 0.0625f : -0.0625f, -0.125f, 0.0f); model.render(0.0625F); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } else { model.render(0.0625F); @@ -99,35 +99,35 @@ public class LayerExtra implements LayerRenderer for(ModelRenderer model : this.body) { model.render(0.0625F); } - GL11.glPopMatrix(); - GL11.glPushMatrix(); + GL46.glPopMatrix(); + GL46.glPushMatrix(); this.model.bipedLeftArm.postRender(0.0625F); this.model.slimLeftArm.postRender(0.0625F, -1.0f, 0.0f, 0.0f); for(ModelRenderer model : this.larm) { model.render(0.0625F); } - GL11.glPopMatrix(); - GL11.glPushMatrix(); + GL46.glPopMatrix(); + GL46.glPushMatrix(); this.model.bipedRightArm.postRender(0.0625F); this.model.slimRightArm.postRender(0.0625F, 1.0f, 0.0f, 0.0f); for(ModelRenderer model : this.rarm) { model.render(0.0625F); } - GL11.glPopMatrix(); - GL11.glPushMatrix(); + GL46.glPopMatrix(); + GL46.glPushMatrix(); this.model.bipedHead.postRender(0.0625F); for(ModelRenderer model : this.head) { model.render(0.0625F); } for(ModelRenderer model : this.halo) { - GL11.glPushMatrix(); - GL11.glRotatef((float)(entity.ticksExisted % (360 * 4)) * 0.25f, 0.0f, 1.0f, 0.0f); + GL46.glPushMatrix(); + GL46.glRotatef((float)(entity.ticksExisted % (360 * 4)) * 0.25f, 0.0f, 1.0f, 0.0f); model.render(0.0625F); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } - GL11.glPopMatrix(); + GL46.glPopMatrix(); - GL11.glPopMatrix(); + GL46.glPopMatrix(); // } } diff --git a/client/src/main/java/client/renderer/layers/LayerHeldItem.java b/client/src/main/java/client/renderer/layers/LayerHeldItem.java index 24e1b492..8f74a2f2 100755 --- a/client/src/main/java/client/renderer/layers/LayerHeldItem.java +++ b/client/src/main/java/client/renderer/layers/LayerHeldItem.java @@ -1,6 +1,6 @@ package client.renderer.layers; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.Client; import client.renderer.entity.RendererLivingEntity; @@ -29,7 +29,7 @@ public class LayerHeldItem implements LayerRenderer if (itemstack != null && itemstack.getItem().getWieldType() != null) { - GL11.glPushMatrix(); + GL46.glPushMatrix(); // if (this.livingEntityRenderer.getMainModel().isChild) // { @@ -42,7 +42,7 @@ public class LayerHeldItem implements LayerRenderer // } ((ModelBiped)this.livingEntityRenderer.getMainModel()).postRenderArm(0.0625F); - GL11.glTranslatef(this.xshift, this.yshift, 0.0625F); + GL46.glTranslatef(this.xshift, this.yshift, 0.0625F); if (entitylivingbaseIn.isPlayer() && ((EntityNPC)entitylivingbaseIn).fishEntity != null) { @@ -54,11 +54,11 @@ public class LayerHeldItem implements LayerRenderer if (entitylivingbaseIn.isSneakingVisually()) { - GL11.glTranslatef(0.0F, 0.203125F, 0.0F); + GL46.glTranslatef(0.0F, 0.203125F, 0.0F); } gm.getItemRenderer().renderItem(entitylivingbaseIn, itemstack, true); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } } diff --git a/client/src/main/java/client/renderer/layers/LayerSlimeGel.java b/client/src/main/java/client/renderer/layers/LayerSlimeGel.java index 7cf892a4..9eabf740 100755 --- a/client/src/main/java/client/renderer/layers/LayerSlimeGel.java +++ b/client/src/main/java/client/renderer/layers/LayerSlimeGel.java @@ -1,6 +1,6 @@ package client.renderer.layers; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.GlState; import client.renderer.entity.RenderSlime; @@ -25,7 +25,7 @@ public class LayerSlimeGel implements LayerRenderer GlState.color(1.0F, 1.0F, 1.0F, 1.0F); GlState.enableNormalize(); GlState.enableBlend(); - GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlState.blendFunc(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA); this.slimeModel.setModelAttributes(this.slimeRenderer.getMainModel()); this.slimeModel.render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale); GlState.disableBlend(); diff --git a/client/src/main/java/client/renderer/model/ModelArachnoid.java b/client/src/main/java/client/renderer/model/ModelArachnoid.java index e8285558..3df1e63a 100755 --- a/client/src/main/java/client/renderer/model/ModelArachnoid.java +++ b/client/src/main/java/client/renderer/model/ModelArachnoid.java @@ -1,6 +1,6 @@ package client.renderer.model; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import common.entity.Entity; import common.util.ExtMath; @@ -96,14 +96,14 @@ public class ModelArachnoid extends ModelHumanoid { this.isSneak = false; // this.setVisible(true); - GL11.glPushMatrix(); - GL11.glTranslatef(0.0f, 3.0f / 16.0f, 0.0f); + GL46.glPushMatrix(); + GL46.glTranslatef(0.0f, 3.0f / 16.0f, 0.0f); super.render(entityIn, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale); - GL11.glPopMatrix(); + GL46.glPopMatrix(); // this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); // this.spiderHead.render(scale); // this.spiderNeck.render(scale); - GL11.glPushMatrix(); + GL46.glPushMatrix(); // if (this.isChild) // { // float f = 2.0F; @@ -123,7 +123,7 @@ public class ModelArachnoid extends ModelHumanoid this.spiderLeg6.render(scale); this.spiderLeg7.render(scale); this.spiderLeg8.render(scale); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } /** diff --git a/client/src/main/java/client/renderer/model/ModelBiped.java b/client/src/main/java/client/renderer/model/ModelBiped.java index fee7e02e..3ec9e886 100755 --- a/client/src/main/java/client/renderer/model/ModelBiped.java +++ b/client/src/main/java/client/renderer/model/ModelBiped.java @@ -1,6 +1,6 @@ package client.renderer.model; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import common.entity.Entity; import common.entity.types.EntityLiving; @@ -61,7 +61,7 @@ public abstract class ModelBiped extends ModelBase public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) { this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); - GL11.glPushMatrix(); + GL46.glPushMatrix(); // if (this.isChild) // { @@ -89,7 +89,7 @@ public abstract class ModelBiped extends ModelBase // { if (this.isSneak) // entityIn.isSneaking()) { - GL11.glTranslatef(0.0F, 0.2F, 0.0F); + GL46.glTranslatef(0.0F, 0.2F, 0.0F); } this.bipedHead.render(scale); @@ -102,7 +102,7 @@ public abstract class ModelBiped extends ModelBase this.bipedHeadwear.render(scale); // } - GL11.glPopMatrix(); + GL46.glPopMatrix(); } /** diff --git a/client/src/main/java/client/renderer/model/ModelCat.java b/client/src/main/java/client/renderer/model/ModelCat.java index 55b5f6c1..68b558e1 100755 --- a/client/src/main/java/client/renderer/model/ModelCat.java +++ b/client/src/main/java/client/renderer/model/ModelCat.java @@ -1,6 +1,6 @@ package client.renderer.model; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import common.entity.Entity; import common.entity.animal.EntityCat; @@ -65,14 +65,14 @@ public class ModelCat extends ModelBase if (this.isChild) { float f = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.5F / f, 1.5F / f, 1.5F / f); - GL11.glTranslatef(0.0F, 10.0F * scale, 4.0F * scale); + GL46.glPushMatrix(); + GL46.glScalef(1.5F / f, 1.5F / f, 1.5F / f); + GL46.glTranslatef(0.0F, 10.0F * scale, 4.0F * scale); this.head.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / f, 1.0F / f, 1.0F / f); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); + GL46.glPopMatrix(); + GL46.glPushMatrix(); + GL46.glScalef(1.0F / f, 1.0F / f, 1.0F / f); + GL46.glTranslatef(0.0F, 24.0F * scale, 0.0F); this.body.render(scale); this.backLeftLeg.render(scale); this.backRightLeg.render(scale); @@ -80,7 +80,7 @@ public class ModelCat extends ModelBase this.frontRightLeg.render(scale); this.tail.render(scale); this.tail2.render(scale); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } else { diff --git a/client/src/main/java/client/renderer/model/ModelChicken.java b/client/src/main/java/client/renderer/model/ModelChicken.java index 57e7a9f6..6e491ee6 100755 --- a/client/src/main/java/client/renderer/model/ModelChicken.java +++ b/client/src/main/java/client/renderer/model/ModelChicken.java @@ -1,6 +1,6 @@ package client.renderer.model; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import common.entity.Entity; import common.util.ExtMath; @@ -55,21 +55,21 @@ public class ModelChicken extends ModelBase if (this.isChild) { float f = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, 5.0F * scale, 2.0F * scale); + GL46.glPushMatrix(); + GL46.glTranslatef(0.0F, 5.0F * scale, 2.0F * scale); this.head.render(scale); this.bill.render(scale); this.chin.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / f, 1.0F / f, 1.0F / f); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); + GL46.glPopMatrix(); + GL46.glPushMatrix(); + GL46.glScalef(1.0F / f, 1.0F / f, 1.0F / f); + GL46.glTranslatef(0.0F, 24.0F * scale, 0.0F); this.body.render(scale); this.rightLeg.render(scale); this.leftLeg.render(scale); this.rightWing.render(scale); this.leftWing.render(scale); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } else { diff --git a/client/src/main/java/client/renderer/model/ModelCrystal.java b/client/src/main/java/client/renderer/model/ModelCrystal.java index 90742112..a91532e1 100755 --- a/client/src/main/java/client/renderer/model/ModelCrystal.java +++ b/client/src/main/java/client/renderer/model/ModelCrystal.java @@ -1,6 +1,6 @@ package client.renderer.model; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import common.entity.Entity; @@ -33,28 +33,28 @@ public class ModelCrystal extends ModelBase */ public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) { - GL11.glPushMatrix(); - GL11.glScalef(2.0F, 2.0F, 2.0F); - GL11.glTranslatef(0.0F, -0.5F, 0.0F); + GL46.glPushMatrix(); + GL46.glScalef(2.0F, 2.0F, 2.0F); + GL46.glTranslatef(0.0F, -0.5F, 0.0F); if (this.base != null) { this.base.render(scale); } - GL11.glRotatef(p_78088_3_, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(0.0F, 0.8F + p_78088_4_, 0.0F); - GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); + GL46.glRotatef(p_78088_3_, 0.0F, 1.0F, 0.0F); + GL46.glTranslatef(0.0F, 0.8F + p_78088_4_, 0.0F); + GL46.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); this.glass.render(scale); float f = 0.875F; - GL11.glScalef(f, f, f); - GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); - GL11.glRotatef(p_78088_3_, 0.0F, 1.0F, 0.0F); + GL46.glScalef(f, f, f); + GL46.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); + GL46.glRotatef(p_78088_3_, 0.0F, 1.0F, 0.0F); this.glass.render(scale); - GL11.glScalef(f, f, f); - GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); - GL11.glRotatef(p_78088_3_, 0.0F, 1.0F, 0.0F); + GL46.glScalef(f, f, f); + GL46.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); + GL46.glRotatef(p_78088_3_, 0.0F, 1.0F, 0.0F); this.cube.render(scale); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } } diff --git a/client/src/main/java/client/renderer/model/ModelDragon.java b/client/src/main/java/client/renderer/model/ModelDragon.java index 990c1df7..f8db379c 100755 --- a/client/src/main/java/client/renderer/model/ModelDragon.java +++ b/client/src/main/java/client/renderer/model/ModelDragon.java @@ -1,6 +1,6 @@ package client.renderer.model; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.GlState; import common.entity.Entity; @@ -139,17 +139,17 @@ public class ModelDragon extends ModelBase */ public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) { - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, 0.5F, 0.0F); - GL11.glScalef(0.35f, 0.35f, 0.35f); - GL11.glPushMatrix(); + GL46.glPushMatrix(); + GL46.glTranslatef(0.0F, 0.5F, 0.0F); + GL46.glScalef(0.35f, 0.35f, 0.35f); + GL46.glPushMatrix(); EntityDragon entitydragon = (EntityDragon)entityIn; float f = entitydragon.prevAnimTime + (entitydragon.animTime - entitydragon.prevAnimTime) * this.partialTicks; this.jaw.rotateAngleX = (float)(Math.sin((double)(f * (float)Math.PI * 2.0F)) + 1.0D) * 0.2F; float f1 = (float)(Math.sin((double)(f * (float)Math.PI * 2.0F - 1.0F)) + 1.0D); f1 = (f1 * f1 * 1.0F + f1 * 2.0F) * 0.05F; - GL11.glTranslatef(0.0F, f1 - 2.0F, -3.0F); - GL11.glRotatef(f1 * 2.0F, 1.0F, 0.0F, 0.0F); + GL46.glTranslatef(0.0F, f1 - 2.0F, -3.0F); + GL46.glRotatef(f1 * 2.0F, 1.0F, 0.0F, 0.0F); float f2 = -30.0F; float f4 = 0.0F; float f5 = 1.5F; @@ -181,10 +181,10 @@ public class ModelDragon extends ModelBase this.head.rotateAngleY = 0.0f * (float)Math.PI / 180.0F * 1.0F; this.head.rotateAngleZ = -this.updateRotations(p_78088_5_ - (double)f7) * (float)Math.PI / 180.0F * 1.0F; this.head.render(scale); - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, 1.0F, 0.0F); - GL11.glRotatef(-f6 * f5 * 1.0F, 0.0F, 0.0F, 1.0F); - GL11.glTranslatef(0.0F, -1.0F, 0.0F); + GL46.glPushMatrix(); + GL46.glTranslatef(0.0F, 1.0F, 0.0F); + GL46.glRotatef(-f6 * f5 * 1.0F, 0.0F, 0.0F, 1.0F); + GL46.glTranslatef(0.0F, -1.0F, 0.0F); this.body.rotateAngleZ = 0.0F; this.body.render(scale); @@ -205,16 +205,16 @@ public class ModelDragon extends ModelBase this.wing.render(scale); this.frontLeg.render(scale); this.rearLeg.render(scale); - GL11.glScalef(-1.0F, 1.0F, 1.0F); + GL46.glScalef(-1.0F, 1.0F, 1.0F); if (j == 0) { - GlState.cullFace(GL11.GL_FRONT); + GlState.cullFace(GL46.GL_FRONT); } } - GL11.glPopMatrix(); - GlState.cullFace(GL11.GL_BACK); + GL46.glPopMatrix(); + GlState.cullFace(GL46.GL_BACK); GlState.disableCull(); float f10 = -((float)Math.sin((double)(f * (float)Math.PI * 2.0F))) * 0.0F; f8 = f * (float)Math.PI * 2.0F; @@ -237,8 +237,8 @@ public class ModelDragon extends ModelBase this.spine.render(scale); } - GL11.glPopMatrix(); - GL11.glPopMatrix(); + GL46.glPopMatrix(); + GL46.glPopMatrix(); } /** diff --git a/client/src/main/java/client/renderer/model/ModelFox.java b/client/src/main/java/client/renderer/model/ModelFox.java index cedf7209..e404cbf8 100644 --- a/client/src/main/java/client/renderer/model/ModelFox.java +++ b/client/src/main/java/client/renderer/model/ModelFox.java @@ -1,6 +1,6 @@ package client.renderer.model; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import common.entity.Entity; import common.util.ExtMath; @@ -54,20 +54,20 @@ public class ModelFox extends ModelBase if (this.isChild) { float f = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, 3.5F * scale, 2.0F * scale); + GL46.glPushMatrix(); + GL46.glTranslatef(0.0F, 3.5F * scale, 2.0F * scale); this.head.renderWithRotation(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / f, 1.0F / f, 1.0F / f); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); + GL46.glPopMatrix(); + GL46.glPushMatrix(); + GL46.glScalef(1.0F / f, 1.0F / f, 1.0F / f); + GL46.glTranslatef(0.0F, 24.0F * scale, 0.0F); this.body.render(scale); this.wolfLeg1.render(scale); this.wolfLeg2.render(scale); this.wolfLeg3.render(scale); this.wolfLeg4.render(scale); this.tail.renderWithRotation(scale); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } else { diff --git a/client/src/main/java/client/renderer/model/ModelHorse.java b/client/src/main/java/client/renderer/model/ModelHorse.java index bea368f0..6c3679f6 100755 --- a/client/src/main/java/client/renderer/model/ModelHorse.java +++ b/client/src/main/java/client/renderer/model/ModelHorse.java @@ -1,6 +1,6 @@ package client.renderer.model; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import common.entity.Entity; import common.entity.animal.EntityHorse; @@ -242,9 +242,9 @@ public class ModelHorse extends ModelBase if (!flag) { - GL11.glPushMatrix(); - GL11.glScalef(f1, 0.5F + f1 * 0.5F, f1); - GL11.glTranslatef(0.0F, 0.95F * (1.0F - f1), 0.0F); + GL46.glPushMatrix(); + GL46.glScalef(f1, 0.5F + f1 * 0.5F, f1); + GL46.glTranslatef(0.0F, 0.95F * (1.0F - f1), 0.0F); } this.backLeftLeg.render(scale); @@ -262,10 +262,10 @@ public class ModelHorse extends ModelBase if (!flag) { - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(f1, f1, f1); - GL11.glTranslatef(0.0F, 1.35F * (1.0F - f1), 0.0F); + GL46.glPopMatrix(); + GL46.glPushMatrix(); + GL46.glScalef(f1, f1, f1); + GL46.glTranslatef(0.0F, 1.35F * (1.0F - f1), 0.0F); } this.body.render(scale); @@ -277,18 +277,18 @@ public class ModelHorse extends ModelBase if (!flag) { - GL11.glPopMatrix(); - GL11.glPushMatrix(); + GL46.glPopMatrix(); + GL46.glPushMatrix(); float f2 = 0.5F + f1 * f1 * 0.5F; - GL11.glScalef(f2, f2, f2); + GL46.glScalef(f2, f2, f2); if (f <= 0.0F) { - GL11.glTranslatef(0.0F, 1.35F * (1.0F - f1), 0.0F); + GL46.glTranslatef(0.0F, 1.35F * (1.0F - f1), 0.0F); } else { - GL11.glTranslatef(0.0F, 0.9F * (1.0F - f1) * f + 1.35F * (1.0F - f1) * (1.0F - f), 0.15F * (1.0F - f1) * f); + GL46.glTranslatef(0.0F, 0.9F * (1.0F - f1) * f + 1.35F * (1.0F - f1) * (1.0F - f), 0.15F * (1.0F - f1) * f); } } @@ -307,7 +307,7 @@ public class ModelHorse extends ModelBase if (!flag) { - GL11.glPopMatrix(); + GL46.glPopMatrix(); } if (flag2) diff --git a/client/src/main/java/client/renderer/model/ModelHumanoid.java b/client/src/main/java/client/renderer/model/ModelHumanoid.java index df8f4fbc..d77a54ce 100755 --- a/client/src/main/java/client/renderer/model/ModelHumanoid.java +++ b/client/src/main/java/client/renderer/model/ModelHumanoid.java @@ -1,6 +1,6 @@ package client.renderer.model; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import common.entity.Entity; import common.util.ExtMath; @@ -150,7 +150,7 @@ public class ModelHumanoid extends ModelBiped public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) { super.render(entityIn, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale); - GL11.glPushMatrix(); + GL46.glPushMatrix(); // if (this.isChild) // { @@ -171,7 +171,7 @@ public class ModelHumanoid extends ModelBiped // { if (this.isSneak) // entityIn.isSneaking()) { - GL11.glTranslatef(0.0F, 0.2F, 0.0F); + GL46.glTranslatef(0.0F, 0.2F, 0.0F); // } } @@ -188,7 +188,7 @@ public class ModelHumanoid extends ModelBiped // if(this.sticks) { // } - GL11.glPopMatrix(); + GL46.glPopMatrix(); } // public void renderCape(float scale) diff --git a/client/src/main/java/client/renderer/model/ModelMouse.java b/client/src/main/java/client/renderer/model/ModelMouse.java index 5cc4e067..ec2d8637 100755 --- a/client/src/main/java/client/renderer/model/ModelMouse.java +++ b/client/src/main/java/client/renderer/model/ModelMouse.java @@ -1,6 +1,6 @@ package client.renderer.model; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import common.entity.Entity; import common.entity.types.EntityLiving; @@ -63,9 +63,9 @@ public class ModelMouse extends ModelBase this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); float s = this.isChild ? 0.125f : 0.25f; - GL11.glPushMatrix(); - GL11.glScalef(s, s, s); - GL11.glTranslatef(0.0f, (this.isChild ? 171.0f : 74.5f) * scale, 0.0f); + GL46.glPushMatrix(); + GL46.glScalef(s, s, s); + GL46.glTranslatef(0.0f, (this.isChild ? 171.0f : 74.5f) * scale, 0.0f); // if (this.isChild) // { // float f = 2.0F; @@ -97,7 +97,7 @@ public class ModelMouse extends ModelBase this.frontLeftLeg.render(scale); this.frontRightLeg.render(scale); // } - GL11.glPopMatrix(); + GL46.glPopMatrix(); } public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) diff --git a/client/src/main/java/client/renderer/model/ModelQuadruped.java b/client/src/main/java/client/renderer/model/ModelQuadruped.java index c608f36b..b2c0a620 100755 --- a/client/src/main/java/client/renderer/model/ModelQuadruped.java +++ b/client/src/main/java/client/renderer/model/ModelQuadruped.java @@ -1,6 +1,6 @@ package client.renderer.model; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import common.entity.Entity; import common.util.ExtMath; @@ -47,19 +47,19 @@ public class ModelQuadruped extends ModelBase if (this.isChild) { float f = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, this.childYOffset * scale, this.childZOffset * scale); + GL46.glPushMatrix(); + GL46.glTranslatef(0.0F, this.childYOffset * scale, this.childZOffset * scale); this.head.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / f, 1.0F / f, 1.0F / f); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); + GL46.glPopMatrix(); + GL46.glPushMatrix(); + GL46.glScalef(1.0F / f, 1.0F / f, 1.0F / f); + GL46.glTranslatef(0.0F, 24.0F * scale, 0.0F); this.body.render(scale); this.leg1.render(scale); this.leg2.render(scale); this.leg3.render(scale); this.leg4.render(scale); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } else { diff --git a/client/src/main/java/client/renderer/model/ModelRabbit.java b/client/src/main/java/client/renderer/model/ModelRabbit.java index 71e7fffe..5417b550 100755 --- a/client/src/main/java/client/renderer/model/ModelRabbit.java +++ b/client/src/main/java/client/renderer/model/ModelRabbit.java @@ -1,6 +1,6 @@ package client.renderer.model; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import common.entity.Entity; import common.entity.animal.EntityRabbit; @@ -101,16 +101,16 @@ public class ModelRabbit extends ModelBase { if(this.isChild) { float f = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, 5.0F * scale, 2.0F * scale); + GL46.glPushMatrix(); + GL46.glTranslatef(0.0F, 5.0F * scale, 2.0F * scale); this.rabbitHead.render(scale); this.rabbitLeftEar.render(scale); this.rabbitRightEar.render(scale); this.rabbitNose.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / f, 1.0F / f, 1.0F / f); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); + GL46.glPopMatrix(); + GL46.glPushMatrix(); + GL46.glScalef(1.0F / f, 1.0F / f, 1.0F / f); + GL46.glTranslatef(0.0F, 24.0F * scale, 0.0F); this.rabbitLeftFoot.render(scale); this.rabbitRightFoot.render(scale); this.rabbitLeftThigh.render(scale); @@ -119,7 +119,7 @@ public class ModelRabbit extends ModelBase { this.rabbitLeftArm.render(scale); this.rabbitRightArm.render(scale); this.rabbitTail.render(scale); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } else { this.rabbitLeftFoot.render(scale); diff --git a/client/src/main/java/client/renderer/model/ModelRenderer.java b/client/src/main/java/client/renderer/model/ModelRenderer.java index 330ff92e..5b759f69 100755 --- a/client/src/main/java/client/renderer/model/ModelRenderer.java +++ b/client/src/main/java/client/renderer/model/ModelRenderer.java @@ -2,7 +2,7 @@ package client.renderer.model; import java.util.List; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.RenderBuffer; import client.renderer.Tessellator; @@ -173,13 +173,13 @@ public class ModelRenderer this.compileDisplayList(p_78785_1_); } - GL11.glTranslatef(this.offsetX, this.offsetY, this.offsetZ); + GL46.glTranslatef(this.offsetX, this.offsetY, this.offsetZ); if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) { if (this.rotationPointX == 0.0F && this.rotationPointY == 0.0F && this.rotationPointZ == 0.0F) { - GL11.glCallList(this.displayList); + GL46.glCallList(this.displayList); if (this.childModels != null) { @@ -191,8 +191,8 @@ public class ModelRenderer } else { - GL11.glTranslatef(this.rotationPointX * p_78785_1_, this.rotationPointY * p_78785_1_, this.rotationPointZ * p_78785_1_); - GL11.glCallList(this.displayList); + GL46.glTranslatef(this.rotationPointX * p_78785_1_, this.rotationPointY * p_78785_1_, this.rotationPointZ * p_78785_1_); + GL46.glCallList(this.displayList); if (this.childModels != null) { @@ -202,30 +202,30 @@ public class ModelRenderer } } - GL11.glTranslatef(-this.rotationPointX * p_78785_1_, -this.rotationPointY * p_78785_1_, -this.rotationPointZ * p_78785_1_); + GL46.glTranslatef(-this.rotationPointX * p_78785_1_, -this.rotationPointY * p_78785_1_, -this.rotationPointZ * p_78785_1_); } } else { - GL11.glPushMatrix(); - GL11.glTranslatef(this.rotationPointX * p_78785_1_, this.rotationPointY * p_78785_1_, this.rotationPointZ * p_78785_1_); + GL46.glPushMatrix(); + GL46.glTranslatef(this.rotationPointX * p_78785_1_, this.rotationPointY * p_78785_1_, this.rotationPointZ * p_78785_1_); if (this.rotateAngleZ != 0.0F) { - GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); + GL46.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); } if (this.rotateAngleY != 0.0F) { - GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + GL46.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); } if (this.rotateAngleX != 0.0F) { - GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); + GL46.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); } - GL11.glCallList(this.displayList); + GL46.glCallList(this.displayList); if (this.childModels != null) { @@ -235,10 +235,10 @@ public class ModelRenderer } } - GL11.glPopMatrix(); + GL46.glPopMatrix(); } - GL11.glTranslatef(-this.offsetX, -this.offsetY, -this.offsetZ); + GL46.glTranslatef(-this.offsetX, -this.offsetY, -this.offsetZ); } } } @@ -254,26 +254,26 @@ public class ModelRenderer this.compileDisplayList(p_78791_1_); } - GL11.glPushMatrix(); - GL11.glTranslatef(this.rotationPointX * p_78791_1_, this.rotationPointY * p_78791_1_, this.rotationPointZ * p_78791_1_); + GL46.glPushMatrix(); + GL46.glTranslatef(this.rotationPointX * p_78791_1_, this.rotationPointY * p_78791_1_, this.rotationPointZ * p_78791_1_); if (this.rotateAngleY != 0.0F) { - GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + GL46.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); } if (this.rotateAngleX != 0.0F) { - GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); + GL46.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); } if (this.rotateAngleZ != 0.0F) { - GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); + GL46.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); } - GL11.glCallList(this.displayList); - GL11.glPopMatrix(); + GL46.glCallList(this.displayList); + GL46.glPopMatrix(); } } } @@ -296,26 +296,26 @@ public class ModelRenderer { if (this.rotationPointX != 0.0F || this.rotationPointY != 0.0F || this.rotationPointZ != 0.0F) { - GL11.glTranslatef(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale); + GL46.glTranslatef(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale); } } else { - GL11.glTranslatef(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale); + GL46.glTranslatef(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale); if (this.rotateAngleZ != 0.0F) { - GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); + GL46.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); } if (this.rotateAngleY != 0.0F) { - GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + GL46.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); } if (this.rotateAngleX != 0.0F) { - GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); + GL46.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); } } } @@ -337,26 +337,26 @@ public class ModelRenderer { if (this.rotationPointX + x != 0.0F || this.rotationPointY + y != 0.0F || this.rotationPointZ + z != 0.0F) { - GL11.glTranslatef((this.rotationPointX + x) * scale, (this.rotationPointY + y) * scale, (this.rotationPointZ + z) * scale); + GL46.glTranslatef((this.rotationPointX + x) * scale, (this.rotationPointY + y) * scale, (this.rotationPointZ + z) * scale); } } else { - GL11.glTranslatef((this.rotationPointX + x) * scale, (this.rotationPointY + y) * scale, (this.rotationPointZ + z) * scale); + GL46.glTranslatef((this.rotationPointX + x) * scale, (this.rotationPointY + y) * scale, (this.rotationPointZ + z) * scale); if (this.rotateAngleZ != 0.0F) { - GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); + GL46.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); } if (this.rotateAngleY != 0.0F) { - GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + GL46.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); } if (this.rotateAngleX != 0.0F) { - GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); + GL46.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); } } } @@ -365,8 +365,8 @@ public class ModelRenderer private void compileDisplayList(float scale) { - this.displayList = GL11.glGenLists(1); - GL11.glNewList(this.displayList, GL11.GL_COMPILE); + this.displayList = GL46.glGenLists(1); + GL46.glNewList(this.displayList, GL46.GL_COMPILE); // Tessellator.getInstance(); RenderBuffer worldrenderer = Tessellator.getBuffer(); @@ -375,13 +375,13 @@ public class ModelRenderer ((ModelBox)this.cubeList.get(i)).makeList(worldrenderer, scale); } - GL11.glEndList(); + GL46.glEndList(); this.compiled = true; } public void deleteDisplayList() { if(this.displayList != 0) - GL11.glDeleteLists(this.displayList, 1); + GL46.glDeleteLists(this.displayList, 1); this.displayList = 0; } diff --git a/client/src/main/java/client/renderer/model/ModelWolf.java b/client/src/main/java/client/renderer/model/ModelWolf.java index 97b05753..571f8c19 100755 --- a/client/src/main/java/client/renderer/model/ModelWolf.java +++ b/client/src/main/java/client/renderer/model/ModelWolf.java @@ -1,6 +1,6 @@ package client.renderer.model; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import common.entity.Entity; import common.entity.animal.EntityWolf; @@ -77,13 +77,13 @@ public class ModelWolf extends ModelBase if (this.isChild) { float f = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, 5.0F * scale, 2.0F * scale); + GL46.glPushMatrix(); + GL46.glTranslatef(0.0F, 5.0F * scale, 2.0F * scale); this.wolfHeadMain.renderWithRotation(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / f, 1.0F / f, 1.0F / f); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); + GL46.glPopMatrix(); + GL46.glPushMatrix(); + GL46.glScalef(1.0F / f, 1.0F / f, 1.0F / f); + GL46.glTranslatef(0.0F, 24.0F * scale, 0.0F); this.wolfBody.render(scale); this.wolfLeg1.render(scale); this.wolfLeg2.render(scale); @@ -91,7 +91,7 @@ public class ModelWolf extends ModelBase this.wolfLeg4.render(scale); this.wolfTail.renderWithRotation(scale); this.wolfMane.render(scale); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } else { diff --git a/client/src/main/java/client/renderer/model/TexturedQuad.java b/client/src/main/java/client/renderer/model/TexturedQuad.java index 12da9c36..1585e840 100755 --- a/client/src/main/java/client/renderer/model/TexturedQuad.java +++ b/client/src/main/java/client/renderer/model/TexturedQuad.java @@ -1,6 +1,6 @@ package client.renderer.model; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.DefaultVertexFormats; import client.renderer.RenderBuffer; @@ -59,7 +59,7 @@ public class TexturedQuad // ny = -ny; // nz = -nz; // } - renderer.begin(GL11.GL_QUADS, DefaultVertexFormats.OLDMODEL_POSITION_TEX_NORMAL); + renderer.begin(GL46.GL_QUADS, DefaultVertexFormats.OLDMODEL_POSITION_TEX_NORMAL); for (int i = 0; i < 4; ++i) { PositionTextureVertex vertex = this.vertices[i]; diff --git a/client/src/main/java/client/renderer/texture/Texture.java b/client/src/main/java/client/renderer/texture/Texture.java index 68ed5207..9496f77a 100755 --- a/client/src/main/java/client/renderer/texture/Texture.java +++ b/client/src/main/java/client/renderer/texture/Texture.java @@ -2,7 +2,7 @@ package client.renderer.texture; import java.io.IOException; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.GlState; @@ -11,7 +11,7 @@ public abstract class Texture { public final int getGlTextureId() { if(this.id == -1) - this.id = GL11.glGenTextures(); + this.id = GL46.glGenTextures(); return this.id; } diff --git a/client/src/main/java/client/renderer/texture/TextureUtil.java b/client/src/main/java/client/renderer/texture/TextureUtil.java index c50703e3..9cf8a60f 100755 --- a/client/src/main/java/client/renderer/texture/TextureUtil.java +++ b/client/src/main/java/client/renderer/texture/TextureUtil.java @@ -11,8 +11,7 @@ import java.nio.IntBuffer; import javax.imageio.ImageIO; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; +import org.lwjgl.opengl.GL46; import client.renderer.GlState; import client.util.FileUtils; @@ -26,10 +25,10 @@ public class TextureUtil public static void uploadTexture(int[] data, int w, int h, int x, int y) { int i = 4194304 / w; - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT); - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT); + GL46.glTexParameteri(GL46.GL_TEXTURE_2D, GL46.GL_TEXTURE_MIN_FILTER, GL46.GL_NEAREST); + GL46.glTexParameteri(GL46.GL_TEXTURE_2D, GL46.GL_TEXTURE_MAG_FILTER, GL46.GL_NEAREST); + GL46.glTexParameteri(GL46.GL_TEXTURE_2D, GL46.GL_TEXTURE_WRAP_S, GL46.GL_REPEAT); + GL46.glTexParameteri(GL46.GL_TEXTURE_2D, GL46.GL_TEXTURE_WRAP_T, GL46.GL_REPEAT); int l; for (int j = 0; j < w * h; j += w * l) @@ -40,7 +39,7 @@ public class TextureUtil BUFFER.clear(); BUFFER.put(data, j, i1); BUFFER.position(0).limit(i1); - GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, x, y + k, w, l, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, BUFFER); + GL46.glTexSubImage2D(GL46.GL_TEXTURE_2D, 0, x, y + k, w, l, GL46.GL_BGRA, GL46.GL_UNSIGNED_INT_8_8_8_8_REV, BUFFER); } } @@ -52,10 +51,10 @@ public class TextureUtil int h = img.getHeight(); int k = 4194304 / w; int[] data = new int[k * w]; - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT); - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT); + GL46.glTexParameteri(GL46.GL_TEXTURE_2D, GL46.GL_TEXTURE_MIN_FILTER, GL46.GL_NEAREST); + GL46.glTexParameteri(GL46.GL_TEXTURE_2D, GL46.GL_TEXTURE_MAG_FILTER, GL46.GL_NEAREST); + GL46.glTexParameteri(GL46.GL_TEXTURE_2D, GL46.GL_TEXTURE_WRAP_S, GL46.GL_REPEAT); + GL46.glTexParameteri(GL46.GL_TEXTURE_2D, GL46.GL_TEXTURE_WRAP_T, GL46.GL_REPEAT); for (int l = 0; l < w * h; l += w * k) { @@ -66,7 +65,7 @@ public class TextureUtil BUFFER.clear(); BUFFER.put(data, 0, k1); BUFFER.position(0).limit(k1); - GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, i1, w, j1, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, BUFFER); + GL46.glTexSubImage2D(GL46.GL_TEXTURE_2D, 0, 0, i1, w, j1, GL46.GL_BGRA, GL46.GL_UNSIGNED_INT_8_8_8_8_REV, BUFFER); } return id; } @@ -75,7 +74,7 @@ public class TextureUtil { // GlState.deleteTexture(id); //TODO: check needed GlState.bindTexture(id); - GL11.nglTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, width, height, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, NULL); + GL46.nglTexImage2D(GL46.GL_TEXTURE_2D, 0, GL46.GL_RGBA, width, height, 0, GL46.GL_BGRA, GL46.GL_UNSIGNED_INT_8_8_8_8_REV, NULL); } public static int[] readImageData(String loc) throws IOException diff --git a/client/src/main/java/client/renderer/tileentity/DisplayRenderer.java b/client/src/main/java/client/renderer/tileentity/DisplayRenderer.java index 0df29532..3e8a46ff 100644 --- a/client/src/main/java/client/renderer/tileentity/DisplayRenderer.java +++ b/client/src/main/java/client/renderer/tileentity/DisplayRenderer.java @@ -3,7 +3,7 @@ package client.renderer.tileentity; import java.util.Iterator; import java.util.Map; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.Client; import client.renderer.Drawing; @@ -92,18 +92,18 @@ public class DisplayRenderer extends ElementRenderer { else if(dir == Facing.EAST) rot = -90.0F; - GL11.glPushMatrix(); - GL11.glTranslatef((float)x + 0.5F, (float)y + 1.0f, (float)z + 0.5F); - GL11.glRotatef(-rot, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(-0.5F, 0.0f, -0.5f + 0.0625f + 0.005f); + GL46.glPushMatrix(); + GL46.glTranslatef((float)x + 0.5F, (float)y + 1.0f, (float)z + 0.5F); + GL46.glRotatef(-rot, 0.0F, 1.0F, 0.0F); + GL46.glTranslatef(-0.5F, 0.0f, -0.5f + 0.0625f + 0.005f); float density = 1.0f / (float)(te.density / 16); - GL11.glScalef(0.0625f * density, -0.0625f * density, 0.0625f * density); + GL46.glScalef(0.0625f * density, -0.0625f * density, 0.0625f * density); GlState.disableLighting(); Drawing.drawTexturedRect(Client.CLIENT, getTexture(te), te.density, te.density, 0, 0, 0, 0, te.density, te.density); GlState.enableLighting(); GlState.color(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } } diff --git a/client/src/main/java/client/renderer/tileentity/ItemPipeRenderer.java b/client/src/main/java/client/renderer/tileentity/ItemPipeRenderer.java index 324ab022..38b9e993 100644 --- a/client/src/main/java/client/renderer/tileentity/ItemPipeRenderer.java +++ b/client/src/main/java/client/renderer/tileentity/ItemPipeRenderer.java @@ -1,6 +1,6 @@ package client.renderer.tileentity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.Client; import client.renderer.GlState; @@ -17,17 +17,17 @@ public class ItemPipeRenderer extends ElementRenderer { return; Client.CLIENT.getTextureManager().bindTexture(TextureMap.BLOCKS); GlState.enableRescaleNormal(); - GlState.alphaFunc(GL11.GL_GREATER, 0.1F); + GlState.alphaFunc(GL46.GL_GREATER, 0.1F); GlState.enableBlend(); - GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); + GlState.tryBlendFuncSeparate(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA, GL46.GL_ONE, GL46.GL_ZERO); RenderItem itemRenderer = Client.CLIENT.getRenderItem(); IBakedModel ibakedmodel = itemRenderer.getItemModelMesher().getItemModel(itemstack); - GL11.glPushMatrix(); - GL11.glTranslatef((float)x + 0.5F, (float)y + 0.5f, (float)z + 0.5F); + GL46.glPushMatrix(); + GL46.glTranslatef((float)x + 0.5F, (float)y + 0.5f, (float)z + 0.5F); if(ibakedmodel.isGui3d()) - GL11.glScalef(0.5F, 0.5F, 0.5F); + GL46.glScalef(0.5F, 0.5F, 0.5F); itemRenderer.renderItem(itemstack, ibakedmodel); - GL11.glPopMatrix(); + GL46.glPopMatrix(); GlState.disableRescaleNormal(); GlState.disableBlend(); } diff --git a/client/src/main/java/client/renderer/tileentity/SignRenderer.java b/client/src/main/java/client/renderer/tileentity/SignRenderer.java index 3c1ffa3a..969183be 100755 --- a/client/src/main/java/client/renderer/tileentity/SignRenderer.java +++ b/client/src/main/java/client/renderer/tileentity/SignRenderer.java @@ -1,6 +1,6 @@ package client.renderer.tileentity; -import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL46; import client.renderer.Drawing; import client.renderer.GlState; @@ -14,13 +14,13 @@ public class SignRenderer extends ElementRenderer { public void renderElements(TileEntitySign te, double x, double y, double z, float partialTicks) { - GL11.glPushMatrix(); + GL46.glPushMatrix(); float f = 0.6666667F; State state = te.getState(); if (state.getBlock() instanceof BlockStandingSign) { - GL11.glTranslatef((float)x + 0.5F, (float)y + 0.75F * f, (float)z + 0.5F); + GL46.glTranslatef((float)x + 0.5F, (float)y + 0.75F * f, (float)z + 0.5F); int r = state.getValue(BlockStandingSign.FACING).getIndex(); float f1 = 0.0F; @@ -38,8 +38,8 @@ public class SignRenderer extends ElementRenderer { f1 = -90.0F; } - GL11.glRotatef(-f1, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(0.0F, f * -0.0625f * 2.0f, 0.0F); + GL46.glRotatef(-f1, 0.0F, 1.0F, 0.0F); + GL46.glTranslatef(0.0F, f * -0.0625f * 2.0f, 0.0F); } else { @@ -61,16 +61,16 @@ public class SignRenderer extends ElementRenderer f2 = -90.0F; } - GL11.glTranslatef((float)x + 0.5F, (float)y + 0.75F * f, (float)z + 0.5F); - GL11.glRotatef(-f2, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(0.0F, -0.3125F - f * 0.0625f * 0.5f, -0.4375F); + GL46.glTranslatef((float)x + 0.5F, (float)y + 0.75F * f, (float)z + 0.5F); + GL46.glRotatef(-f2, 0.0F, 1.0F, 0.0F); + GL46.glTranslatef(0.0F, -0.3125F - f * 0.0625f * 0.5f, -0.4375F); } GlState.enableRescaleNormal(); float f3 = 0.015625F * f; - GL11.glTranslatef(0.0F, 0.5F * f, 0.1F * f); - GL11.glScalef(f3, -f3, f3); - GL11.glNormal3f(0.0F, 0.0F, -1.0F * f3); + GL46.glTranslatef(0.0F, 0.5F * f, 0.1F * f); + GL46.glScalef(f3, -f3, f3); + GL46.glNormal3f(0.0F, 0.0F, -1.0F * f3); GlState.depthMask(false); for (int j = 0; j < te.text.length; ++j) @@ -78,15 +78,15 @@ public class SignRenderer extends ElementRenderer if (te.text[j] != null && !te.text[j].isEmpty()) { String s = te.text[j].length() > 50 ? te.text[j].substring(0, 50) : te.text[j]; - GL11.glPushMatrix(); - GL11.glScalef(0.75f, 0.75f, 0.75f); + GL46.glPushMatrix(); + GL46.glScalef(0.75f, 0.75f, 0.75f); Drawing.drawTextCenteredN(s, 0, j * (18 - 3) - 30, 0xff000000); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } } GlState.depthMask(true); GlState.color(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPopMatrix(); + GL46.glPopMatrix(); } } diff --git a/client/src/main/java/client/renderer/tileentity/SpecialRenderer.java b/client/src/main/java/client/renderer/tileentity/SpecialRenderer.java index d94c3fb2..9e0c3b13 100755 --- a/client/src/main/java/client/renderer/tileentity/SpecialRenderer.java +++ b/client/src/main/java/client/renderer/tileentity/SpecialRenderer.java @@ -2,7 +2,7 @@ package client.renderer.tileentity; import java.util.Map; -import org.lwjgl.opengl.GL13; +import org.lwjgl.opengl.GL46; import client.renderer.GlState; import common.collect.Maps; @@ -58,7 +58,7 @@ public class SpecialRenderer { int light = this.world.getCombinedLight(tile.getPos(), 0); int block = light % 65536; int sky = light / 65536; - GL13.glMultiTexCoord2f(GL13.GL_TEXTURE1, (float)block / 1.0F, (float)sky / 1.0F); + GL46.glMultiTexCoord2f(GL46.GL_TEXTURE1, (float)block / 1.0F, (float)sky / 1.0F); GlState.color(1.0F, 1.0F, 1.0F, 1.0F); BlockPos pos = tile.getPos(); this.render(tile, (double)pos.getX() - entityX, (double)pos.getY() - entityY, (double)pos.getZ() - entityZ, partial); diff --git a/client/src/main/java/client/util/FileUtils.java b/client/src/main/java/client/util/FileUtils.java index 129c5514..04ce0067 100644 --- a/client/src/main/java/client/util/FileUtils.java +++ b/client/src/main/java/client/util/FileUtils.java @@ -12,11 +12,9 @@ import java.nio.charset.Charset; public class FileUtils { public static final Charset UTF_8 = Charset.forName("UTF-8"); - public static String read(File file) throws IOException { - FileInputStream in = null; + private static String read(InputStream in) throws IOException { String s; try { - in = new FileInputStream(file); ByteArrayOutputStream output = new ByteArrayOutputStream(); byte[] buffer = new byte[4096]; long count = 0L; @@ -36,6 +34,14 @@ public class FileUtils { } return s; } + + public static String read(File file) throws IOException { + return read(new FileInputStream(file)); + } + + public static String read(String resource) throws IOException { + return read(getResource(resource)); + } public static void write(File file, String data) throws IOException { FileOutputStream out = null; diff --git a/client/src/main/java/client/window/Window.java b/client/src/main/java/client/window/Window.java index d4d6a692..8f68e100 100644 --- a/client/src/main/java/client/window/Window.java +++ b/client/src/main/java/client/window/Window.java @@ -20,7 +20,7 @@ import static org.lwjgl.glfw.GLFW.glfwGetClipboardString; import static org.lwjgl.glfw.GLFW.glfwGetKey; import static org.lwjgl.glfw.GLFW.glfwGetMonitorPos; import static org.lwjgl.glfw.GLFW.glfwGetPrimaryMonitor; -import static org.lwjgl.glfw.GLFW.glfwGetTimerFrequency; +import static org.lwjgl.glfw.GLFW.glfwGetVersionString; import static org.lwjgl.glfw.GLFW.glfwGetVideoMode; import static org.lwjgl.glfw.GLFW.glfwGetVideoModes; import static org.lwjgl.glfw.GLFW.glfwInit; @@ -41,7 +41,6 @@ import static org.lwjgl.glfw.GLFW.glfwSetWindowIcon; import static org.lwjgl.glfw.GLFW.glfwSetWindowMonitor; import static org.lwjgl.glfw.GLFW.glfwSetWindowPos; import static org.lwjgl.glfw.GLFW.glfwSetWindowPosCallback; -import static org.lwjgl.glfw.GLFW.glfwSetWindowRefreshCallback; import static org.lwjgl.glfw.GLFW.glfwSetWindowSize; import static org.lwjgl.glfw.GLFW.glfwSetWindowSizeLimits; import static org.lwjgl.glfw.GLFW.glfwSetWindowTitle; @@ -51,13 +50,15 @@ import static org.lwjgl.glfw.GLFW.glfwSwapInterval; import static org.lwjgl.glfw.GLFW.glfwTerminate; import static org.lwjgl.glfw.GLFW.glfwWindowHint; import static org.lwjgl.system.MemoryUtil.NULL; +import static org.lwjgl.BufferUtils.createByteBuffer; +import static org.lwjgl.Version.getVersion; +import static org.lwjgl.system.APIUtil.apiClassTokens; +import static common.log.Log.SYSTEM; import java.util.ArrayList; import java.util.List; import java.util.Map; -import org.lwjgl.BufferUtils; -import org.lwjgl.Version; import org.lwjgl.glfw.GLFW; import org.lwjgl.glfw.GLFWCharCallback; import org.lwjgl.glfw.GLFWCursorPosCallback; @@ -71,17 +72,17 @@ import org.lwjgl.glfw.GLFWVidMode; import org.lwjgl.glfw.GLFWWindowCloseCallback; import org.lwjgl.glfw.GLFWWindowFocusCallback; import org.lwjgl.glfw.GLFWWindowPosCallback; -import org.lwjgl.glfw.GLFWWindowRefreshCallback; -import org.lwjgl.opengl.GL; -import org.lwjgl.system.APIUtil; - -import common.log.Log; public abstract class Window { + private static final List EVENTS = new ArrayList(); + + private static long window; + public static void setWindowed(int xpos, int ypos, int xsize, int ysize) { if(window != NULL) glfwSetWindowMonitor(window, NULL, xpos, ypos, xsize, ysize, GLFW_DONT_CARE); } + public static void setFullscreen(int width, int height, int refresh) { if(window != NULL) { long monitor = glfwGetPrimaryMonitor(); @@ -89,47 +90,51 @@ public abstract class Window { glfwSetWindowMonitor(window, monitor, 0, 0, width, height, refresh); } } + public static boolean getKey(int code) { return window != NULL && glfwGetKey(window, code) == GLFW_PRESS; } + public static void setTitle(String title) { if(window != NULL) glfwSetWindowTitle(window, title); } + public static void setIcon(byte[] icon, int w, int h) { if(window != NULL) { GLFWImage img = GLFWImage.create(); img.width(w); img.height(h); - img.pixels(BufferUtils.createByteBuffer(icon.length).put(icon).rewind()); + img.pixels(createByteBuffer(icon.length).put(icon).rewind()); GLFWImage.Buffer buf = GLFWImage.create(1).put(img).rewind(); glfwSetWindowIcon(window, buf); } } + public static String getClipboard() { return window == NULL ? null : glfwGetClipboardString(window); } + public static void setClipboard(String text) { if(window != NULL) glfwSetClipboardString(window, text); } + public static void swapBuffers() { if(window != NULL) glfwSwapBuffers(window); } + public static void grabCursor(boolean grab) { if(window != NULL) glfwSetInputMode(window, GLFW_CURSOR, grab ? GLFW_CURSOR_DISABLED : GLFW_CURSOR_NORMAL); } + public static void setVSync(boolean sync) { if(window != NULL) glfwSwapInterval(sync ? 1 : 0); } - private static final List EVENTS = new ArrayList(); - - private static long window; - public static boolean createWindow(String id, boolean gldebug) { glfwDefaultWindowHints(); glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE); @@ -137,73 +142,62 @@ public abstract class Window { glfwWindowHint(GLFW_CONTEXT_DEBUG, gldebug ? GLFW_TRUE : GLFW_FALSE); window = glfwCreateWindow(100, 100, id, NULL, NULL); if(window == NULL) { - Log.SYSTEM.error("Konnte kein Fenster für das Programm erstellen"); + SYSTEM.error("Konnte kein Fenster für das Programm erstellen"); + return false; } - else { - glfwSetMouseButtonCallback(window, new GLFWMouseButtonCallback() { - public void invoke(long window, int button, int action, int mods) { - if(action != GLFW_REPEAT && button >= 0 && button < Button.values().length) - EVENTS.add(new WindowEvent(WindowAction.BUTTON, button, action == GLFW_PRESS ? 1 : 0)); - } - }); - glfwSetCharCallback(window, new GLFWCharCallback() { - public void invoke(long window, int codepoint) { - EVENTS.add(new WindowEvent(WindowAction.CHARACTER, codepoint, 0)); - } - }); - glfwSetCursorPosCallback(window, new GLFWCursorPosCallback() { - public void invoke(long window, double xpos, double ypos) { - EVENTS.add(new WindowEvent(WindowAction.CURSOR, (int)xpos, (int)ypos)); - } - }); - glfwSetFramebufferSizeCallback(window, new GLFWFramebufferSizeCallback() { - public void invoke(long window, int width, int height) { - EVENTS.add(new WindowEvent(WindowAction.RESIZE, width, height)); - } - }); - glfwSetKeyCallback(window, new GLFWKeyCallback() { - public void invoke(long window, int key, int scancode, int action, int mods) { - Keysym code = Keysym.getForCode(key); - if(code != null) - EVENTS.add(new WindowEvent(WindowAction.KEY, code.ordinal(), - (action == GLFW_PRESS ? KeyEvent.PRESS : (action == GLFW_RELEASE ? KeyEvent.RELEASE : KeyEvent.REPEAT)).ordinal())); - } - }); - glfwSetScrollCallback(window, new GLFWScrollCallback() { - public void invoke(long window, double xoffset, double yoffset) { - EVENTS.add(new WindowEvent(WindowAction.SCROLL, (int)xoffset, (int)yoffset)); - } - }); - glfwSetWindowCloseCallback(window, new GLFWWindowCloseCallback() { - public void invoke(long window) { - EVENTS.add(new WindowEvent(WindowAction.CLOSED, 0, 0)); - } - }); - glfwSetWindowFocusCallback(window, new GLFWWindowFocusCallback() { - public void invoke(long window, boolean focused) { - EVENTS.add(new WindowEvent(WindowAction.FOCUS, focused ? 1 : 0, 0)); - } - }); -// glfwSetWindowSizeCallback(window, new GLFWWindowSizeCallback() { -// public void invoke(long window, int width, int height) { -// EVENTS.add(new WindowEvent(WindowAction.RESIZE, width, height)); -// } -// }); - glfwSetWindowPosCallback(window, new GLFWWindowPosCallback() { - public void invoke(long window, int xpos, int ypos) { - EVENTS.add(new WindowEvent(WindowAction.POSITION, xpos, ypos)); - } - }); - glfwSetWindowRefreshCallback(window, new GLFWWindowRefreshCallback() { - public void invoke(long window) { - EVENTS.add(new WindowEvent(WindowAction.REDRAW, 0, 0)); - } - }); - glfwMakeContextCurrent(window); - GL.createCapabilities(); - } - return window != NULL; + glfwSetMouseButtonCallback(window, new GLFWMouseButtonCallback() { + public void invoke(long window, int button, int action, int mods) { + if(action != GLFW_REPEAT && button >= 0 && button < Button.values().length) + EVENTS.add(new WindowEvent(WindowAction.BUTTON, button, action == GLFW_PRESS ? 1 : 0)); + } + }); + glfwSetCharCallback(window, new GLFWCharCallback() { + public void invoke(long window, int codepoint) { + EVENTS.add(new WindowEvent(WindowAction.CHARACTER, codepoint, 0)); + } + }); + glfwSetCursorPosCallback(window, new GLFWCursorPosCallback() { + public void invoke(long window, double xpos, double ypos) { + EVENTS.add(new WindowEvent(WindowAction.CURSOR, (int)xpos, (int)ypos)); + } + }); + glfwSetFramebufferSizeCallback(window, new GLFWFramebufferSizeCallback() { + public void invoke(long window, int width, int height) { + EVENTS.add(new WindowEvent(WindowAction.RESIZE, width, height)); + } + }); + glfwSetKeyCallback(window, new GLFWKeyCallback() { + public void invoke(long window, int key, int scancode, int action, int mods) { + Keysym code = Keysym.getForCode(key); + if(code != null) + EVENTS.add(new WindowEvent(WindowAction.KEY, code.ordinal(), + (action == GLFW_PRESS ? KeyEvent.PRESS : (action == GLFW_RELEASE ? KeyEvent.RELEASE : KeyEvent.REPEAT)).ordinal())); + } + }); + glfwSetScrollCallback(window, new GLFWScrollCallback() { + public void invoke(long window, double xoffset, double yoffset) { + EVENTS.add(new WindowEvent(WindowAction.SCROLL, (int)xoffset, (int)yoffset)); + } + }); + glfwSetWindowCloseCallback(window, new GLFWWindowCloseCallback() { + public void invoke(long window) { + EVENTS.add(new WindowEvent(WindowAction.CLOSED, 0, 0)); + } + }); + glfwSetWindowFocusCallback(window, new GLFWWindowFocusCallback() { + public void invoke(long window, boolean focused) { + EVENTS.add(new WindowEvent(WindowAction.FOCUS, focused ? 1 : 0, 0)); + } + }); + glfwSetWindowPosCallback(window, new GLFWWindowPosCallback() { + public void invoke(long window, int xpos, int ypos) { + EVENTS.add(new WindowEvent(WindowAction.POSITION, xpos, ypos)); + } + }); + glfwMakeContextCurrent(window); + return true; } + public static void destroyWindow() { if(window != NULL) { glfwFreeCallbacks(window); @@ -211,6 +205,7 @@ public abstract class Window { window = NULL; } } + public static void initWindow(int sx, int sy, int wx, int wy, int mx, int my) { if(window == NULL) return; @@ -237,12 +232,7 @@ public abstract class Window { glfwSetWindowSize(window, xsize, ysize); glfwSetWindowSizeLimits(window, mx, my, GLFW_DONT_CARE, GLFW_DONT_CARE); glfwSetWindowPos(window, xpos, ypos); -// wcf_windowed(win, xpos, ypos, xsize, ysize); - // wcf_fullscreen does not move while hidden ... -// wcf_setpos(win, xpos, ypos); glfwShowWindow(window); -// wcf_show(win, 1); -// wcf_limits(win, 1, 1, -1, -1); glfwSetWindowMonitor(window, NULL, xpos, ypos, xsize, ysize, GLFW_DONT_CARE); // set position twice to work around bugs in some tiling window managers } @@ -252,6 +242,7 @@ public abstract class Window { EVENTS.clear(); return events; } + public static DisplayMode[] getDisplayModes() { long monitor = glfwGetPrimaryMonitor(); GLFWVidMode.Buffer data = monitor == NULL ? null : glfwGetVideoModes(monitor); @@ -264,6 +255,7 @@ public abstract class Window { } return modes; } + public static DisplayMode getDisplayMode() { long monitor = glfwGetPrimaryMonitor(); GLFWVidMode mode = monitor == NULL ? null : glfwGetVideoMode(monitor); @@ -271,20 +263,21 @@ public abstract class Window { return null; return new DisplayMode(mode.width(), mode.height(), mode.refreshRate()); } + public static void init() { GLFWErrorCallback.create(new GLFWErrorCallback() { - private Map codes = APIUtil.apiClassTokens((field, value) -> 0x10000 < value && value < 0x20000, null, GLFW.class); + private Map codes = apiClassTokens((field, value) -> 0x10000 < value && value < 0x20000, null, GLFW.class); public void invoke(int error, long description) { - Log.SYSTEM.error("LWJGL-Fehler %s: %s", this.codes.get(error), getDescription(description)); + SYSTEM.error("GLFW-Fehler %s: %s", this.codes.get(error), getDescription(description)); } }).set(); if(!glfwInit()) throw new IllegalStateException("Kann GLFW nicht initialisieren"); - if(glfwGetTimerFrequency() < 1000000L) - throw new IllegalStateException("Timer unterstützt keine Mikrosekunden-Präzision"); - Log.SYSTEM.info("LWJGL " + Version.getVersion()); + SYSTEM.info("LWJGL " + getVersion()); + SYSTEM.info("GLFW " + glfwGetVersionString()); } + public static void end() { glfwTerminate(); glfwSetErrorCallback(null).free(); diff --git a/client/src/main/java/client/window/WindowAction.java b/client/src/main/java/client/window/WindowAction.java index cdba867c..ea146aed 100644 --- a/client/src/main/java/client/window/WindowAction.java +++ b/client/src/main/java/client/window/WindowAction.java @@ -8,7 +8,6 @@ public enum WindowAction { BUTTON, KEY, CHARACTER, - REDRAW, CLOSED, FOCUS; } diff --git a/client/src/main/resources/shaders/blit.fsh b/client/src/main/resources/shaders/blit.fsh new file mode 100644 index 00000000..c52248e5 --- /dev/null +++ b/client/src/main/resources/shaders/blit.fsh @@ -0,0 +1,9 @@ +out vec4 FragColor; + +in vec2 tex_coord; + +uniform sampler2D tex; + +void main() { + FragColor = texture(tex, tex_coord); +} diff --git a/client/src/main/resources/shaders/blit.vsh b/client/src/main/resources/shaders/blit.vsh new file mode 100644 index 00000000..68849298 --- /dev/null +++ b/client/src/main/resources/shaders/blit.vsh @@ -0,0 +1,8 @@ +layout (location = 0) in vec2 coords; + +out vec2 tex_coord; + +void main() { + tex_coord = coords; + gl_Position = vec4(coords * 2.0 - 1.0, 0.0, 1.0); +} diff --git a/client/src/main/resources/shaders/grid.fsh b/client/src/main/resources/shaders/grid.fsh new file mode 100644 index 00000000..c86d557d --- /dev/null +++ b/client/src/main/resources/shaders/grid.fsh @@ -0,0 +1,38 @@ +out vec4 FragColor; + +in vec3 vertex; +in vec2 tex_coord; + +uniform float time; + +#define GLM_PI 3.14159265358979323846264338327950288 +#define GLM_SQRT2 1.41421356237309504880168872420969808 +#define vis_div 24.0 + +float v2rand(vec2 uv) { + return fract(sin(dot(uv, vec2(12.9898,78.233))) * 43758.5453123); +} + +float avg(vec4 v) { + return ((v.r + v.g + v.b) / 3.0) * v.a; +} + +float gauss(float v, float b, float c) { + return (1.0 / (c * sqrt(2.0 * GLM_PI))) * exp(-(pow(v - b, 2.0) / (2.0 * pow(c, 2.0)))); +} + +float dgauss(float v, float b, float c) { + return b + v * c; +} + +float inside(vec2 vec, vec2 offs, float a, float b, float scale, float x1, float x2, float y1, float y2) { + vec2 cscaled = (mod(vec + offs + 1.0, 1.0)) * scale; + return (x2 < x1 ? (cscaled.x >= x1 || cscaled.x <= x2) : (cscaled.x >= x1 && cscaled.x <= x2)) || (y2 < y1 ? (cscaled.y >= y1 || cscaled.y <= y2) : (cscaled.y >= y1 && cscaled.y <= y2)) || (abs(cscaled.y - (cscaled.x - (x2 < x1 ? (x1 - x2) : (x2 - x1)) * GLM_SQRT2 * (x2 < x1 ? 0.0 : (x1 < scale / 2.0 ? x1 : (x2 - scale))))) < GLM_SQRT2) ? b : a; +} + +void main() { + vec2 shift = vec2(v2rand(tex_coord + fract(time)) * 2.0 - 1.0, v2rand(tex_coord + 0.5 + fract(time)) * 2.0 - 1.0); + shift = vec2(dgauss(shift.x, 0.0, 1.0), dgauss(shift.y, 0.0, 1.0)) * 0.015; + vec3 cl = vec3(inside(tex_coord / vis_div, shift, 0.0, 1.0, 64.0, 1.0, 3.0, 1.0, 3.0), inside(tex_coord / vis_div, shift, 0.0, 1.0, 64.0, 63.0, 1.0, 63.0, 1.0), inside(tex_coord / vis_div, shift, 0.0, 1.0, 64.0, 61.0, 63.0, 61.0, 63.0)); + FragColor = vec4(mix(vec3(0.0, 0.0, clamp(0.1 + 0.2 * (vertex.y + 64.0) / 128.0, 0.0, 1.0)), cl, clamp(cl.x + cl.y + cl.z, 0.0, 1.0)), 1.0); +} diff --git a/client/src/main/resources/shaders/grid.vsh b/client/src/main/resources/shaders/grid.vsh new file mode 100644 index 00000000..78259dc8 --- /dev/null +++ b/client/src/main/resources/shaders/grid.vsh @@ -0,0 +1,16 @@ +layout (location = 0) in vec3 pos; +layout (location = 1) in vec3 norm; +layout (location = 2) in vec2 coord; + +out vec3 vertex; +out vec2 tex_coord; + +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +void main() { + vertex = vec3(model * vec4(pos, 1.0)); + tex_coord = coord; + gl_Position = projection * view * vec4(vertex, 1.0); +} diff --git a/client/src/main/resources/shaders/lightmap.fsh b/client/src/main/resources/shaders/lightmap.fsh new file mode 100644 index 00000000..37202e3b --- /dev/null +++ b/client/src/main/resources/shaders/lightmap.fsh @@ -0,0 +1,8 @@ +out vec4 FragColor; + +uniform float fog; +uniform vec3 color; + +void main() { + FragColor = vec4(color, fog); +} diff --git a/client/src/main/resources/shaders/lightmap.vsh b/client/src/main/resources/shaders/lightmap.vsh new file mode 100644 index 00000000..0e046107 --- /dev/null +++ b/client/src/main/resources/shaders/lightmap.vsh @@ -0,0 +1,7 @@ +layout (location = 0) in vec2 coords; + +uniform vec2 size; + +void main() { + gl_Position = vec4(coords * 2.0 / size, 0.0, 1.0); +} diff --git a/client/src/main/resources/shaders/vis.fsh b/client/src/main/resources/shaders/vis.fsh new file mode 100644 index 00000000..1d2fb5bb --- /dev/null +++ b/client/src/main/resources/shaders/vis.fsh @@ -0,0 +1,7 @@ +out vec4 FragColor; + +in float ypos; + +void main() { + FragColor = vec4(clamp(-0.3 + 1.8 * (ypos + 64.0) / 128.0, 0.0, 1.0), clamp(-0.7 + 2.2 * (ypos + 64.0) / 128.0, 0.0, 1.0), clamp(0.1 + 2.0 * (ypos + 64.0) / 128.0, 0.0, 1.0), 1.0); +} diff --git a/client/src/main/resources/shaders/vis.vsh b/client/src/main/resources/shaders/vis.vsh new file mode 100644 index 00000000..58ad5071 --- /dev/null +++ b/client/src/main/resources/shaders/vis.vsh @@ -0,0 +1,15 @@ +layout (location = 0) in vec3 pos; +layout (location = 1) in vec3 norm; +layout (location = 2) in vec2 coord; + +out float ypos; + +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +void main() { + vec3 vertex = vec3(model * vec4(pos, 1.0)); + ypos = vertex.y; + gl_Position = projection * view * vec4(vertex, 1.0); +} diff --git a/client/src/main/resources/shaders/world.fsh b/client/src/main/resources/shaders/world.fsh new file mode 100644 index 00000000..091fd704 --- /dev/null +++ b/client/src/main/resources/shaders/world.fsh @@ -0,0 +1,87 @@ +out vec4 FragColor; + +struct light_t { + vec4 position; + vec4 ambient; // constant + vec4 diffuse; // linear + vec4 specular; // quadratic + vec4 range; +}; + +in vec3 vertex; +in vec3 normal; +in vec2 tex_coord; + +uniform vec3 cam_pos; +uniform sampler2D tex; +uniform vec3 specular; +uniform float shine; +uniform float max_vert_dist; +uniform float max_cam_dist; +uniform float light_factor; +uniform vec3 dir_direction; +uniform vec3 dir_ambient; +uniform vec3 dir_diffuse; +uniform vec3 dir_specular; +uniform int n_lights; +uniform light_block { + light_t lights[MAX_LIGHTS]; +}; + +/* +vec4 pcf_sample(sampler2D stex, vec2 pos) { + vec4 avg = vec4(0.0); + vec2 texel = 1.0 / textureSize(stex, 0); + for(int x = -1; x <= 1; x++) { + for(int y = -1; y <= 1; y++) { + avg += texture(stex, pos + vec2(x, y) * texel); + } + } + return avg /= 9.0; +} +*/ + +vec3 calc_dir_light(vec3 norm, vec3 dir, vec3 rgb) { + vec3 ldir = normalize(-dir_direction); + float diff = max(dot(norm, ldir), 0.0); + vec3 rdir = reflect(-ldir, norm); + float spec = pow(max(dot(dir, rdir), 0.0), shine); + vec3 ambient = dir_ambient * rgb + clamp(vec3(0.0), 0.0, 1.0); + vec3 diffuse = dir_diffuse * diff * rgb; + vec3 specular = dir_specular * spec * specular * rgb; + return (ambient + diffuse + specular); +} + +vec3 calc_point_light(light_t light, vec3 norm, vec3 dir, vec3 rgb) { + rgb = clamp(rgb + light_factor, 0.0, 1.0); + vec3 ldir = normalize(light.position.xyz - vertex); + float diff = max(dot(norm, ldir), 0.0); + vec3 rdir = reflect(-ldir, norm); + float spec = pow(max(dot(dir, rdir), 0.0), shine); + float distance = length((light.position.xyz - vertex) / light.range.xyz); + float attenuation = 1.0 / (light.ambient.w + light.diffuse.w * distance + light.specular.w * (distance * distance)); + vec3 ambient = light.ambient.xyz * rgb; + vec3 diffuse = light.diffuse.xyz * diff * rgb; + vec3 specular = light.specular.xyz * spec * specular * rgb; + ambient *= attenuation; + diffuse *= attenuation; + specular *= attenuation; + return (ambient + diffuse + specular); +} + +void main() { + vec3 norm = normalize(normal); + vec3 dir = normalize(cam_pos - vertex); + vec4 texel = texture(tex, tex_coord); + vec3 rgb = texel.rgb * texel.a; + vec3 result = calc_dir_light(norm, dir, rgb); + // int l = 0; + for(int z = 0; z < n_lights; z++) { + // if(lights[z].enabled) { + if(distance(vertex, lights[z].position.xyz) <= max_vert_dist && distance(cam_pos, lights[z].position.xyz) <= max_cam_dist) + result += calc_point_light(lights[z], norm, dir, rgb); + // l++; + // } + } + FragColor = vec4(result, 1.0); +} diff --git a/client/src/main/resources/shaders/world.vsh b/client/src/main/resources/shaders/world.vsh new file mode 100644 index 00000000..ee7ec235 --- /dev/null +++ b/client/src/main/resources/shaders/world.vsh @@ -0,0 +1,20 @@ +layout (location = 0) in vec3 pos; +layout (location = 1) in vec3 norm; +layout (location = 2) in vec2 coord; + +out vec3 vertex; +out vec3 normal; +out vec2 tex_coord; + +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; +uniform sampler2D tex; +uniform float density; + +void main() { + vertex = vec3(model * vec4(pos, 1.0)); + normal = mat3(transpose(inverse(model))) * norm; + tex_coord = coord * density / textureSize(tex, 0); + gl_Position = projection * view * vec4(vertex, 1.0); +} diff --git a/common/src/main/java/common/block/Block.java b/common/src/main/java/common/block/Block.java index ec35299f..a2c681ef 100755 --- a/common/src/main/java/common/block/Block.java +++ b/common/src/main/java/common/block/Block.java @@ -1056,11 +1056,6 @@ public class Block { (double)pos.getX() + this.maxX, (double)pos.getY() + this.maxY, (double)pos.getZ() + this.maxZ); } - @Clientside - public boolean hasTransparency() { - return false; - } - @Clientside public boolean isXrayVisible() { return false; diff --git a/common/src/main/java/common/block/artificial/BlockBed.java b/common/src/main/java/common/block/artificial/BlockBed.java index 0d9c07cd..14a12c0c 100755 --- a/common/src/main/java/common/block/artificial/BlockBed.java +++ b/common/src/main/java/common/block/artificial/BlockBed.java @@ -166,11 +166,6 @@ public class BlockBed extends Block implements Rotatable { return 1; } - @Clientside - public boolean hasTransparency() { - return true; - } - // public void onBlockHarvested(World worldIn, BlockPos pos, State state, EntityNPC player) { // if(player.creative && state.getValue(PART) == BlockBed.EnumPartType.HEAD) { // BlockPos blockpos = pos.offset(((Facing)state.getValue(FACING)).getOpposite()); diff --git a/common/src/main/java/common/block/artificial/BlockCake.java b/common/src/main/java/common/block/artificial/BlockCake.java index b19f86c1..978fe63e 100755 --- a/common/src/main/java/common/block/artificial/BlockCake.java +++ b/common/src/main/java/common/block/artificial/BlockCake.java @@ -7,7 +7,6 @@ import common.init.SoundEvent; import common.model.Model; import common.model.Model.ModelProvider; import common.util.BlockPos; -import common.util.Clientside; import common.util.Facing; import common.world.AWorldServer; import common.world.State; @@ -69,11 +68,6 @@ public class BlockCake extends Block return worldIn.getState(pos.down()).getBlock().getMaterial().isSolid(); } - @Clientside - public boolean hasTransparency() { - return true; - } - public Model getModel(ModelProvider provider, String name, State state) { return provider.getModel("cake_side") .add(1, 0, 1, 15, 8, 15) diff --git a/common/src/main/java/common/block/artificial/BlockDoor.java b/common/src/main/java/common/block/artificial/BlockDoor.java index 43de686e..d35d5d25 100755 --- a/common/src/main/java/common/block/artificial/BlockDoor.java +++ b/common/src/main/java/common/block/artificial/BlockDoor.java @@ -250,11 +250,6 @@ public class BlockDoor extends Block implements Rotatable { return 1; } - @Clientside - public boolean hasTransparency() { - return true; - } - public static Facing getFacing(IBlockAccess world, BlockPos pos) { return world.getState(pos).getValue(FACING); } diff --git a/common/src/main/java/common/block/artificial/BlockFlowerPot.java b/common/src/main/java/common/block/artificial/BlockFlowerPot.java index 331f3828..094c6568 100755 --- a/common/src/main/java/common/block/artificial/BlockFlowerPot.java +++ b/common/src/main/java/common/block/artificial/BlockFlowerPot.java @@ -17,7 +17,6 @@ import common.model.Model.ModelProvider; import common.model.GuiPosition; import common.rng.Random; import common.util.BlockPos; -import common.util.Clientside; import common.util.Facing; import common.world.State; import common.world.World; @@ -125,11 +124,6 @@ public class BlockFlowerPot extends Block return Items.flowerpot; } - @Clientside - public boolean hasTransparency() { - return true; - } - public Model getModel(ModelProvider provider, String name, State state) { if(this.content == null) return provider.getModel("flower_pot") diff --git a/common/src/main/java/common/block/artificial/BlockGlass.java b/common/src/main/java/common/block/artificial/BlockGlass.java index 2cfd8532..6555c913 100755 --- a/common/src/main/java/common/block/artificial/BlockGlass.java +++ b/common/src/main/java/common/block/artificial/BlockGlass.java @@ -6,7 +6,6 @@ import common.entity.Entity; import common.item.CheatTab; import common.rng.Random; import common.util.BlockPos; -import common.util.Clientside; import common.util.Facing; import common.util.Serverside; import common.world.AWorldServer; @@ -23,11 +22,6 @@ public class BlockGlass extends Block { return 0; } - @Clientside - public boolean hasTransparency() { - return true; - } - public boolean isOpaqueCube() { return false; } diff --git a/common/src/main/java/common/block/artificial/BlockLadder.java b/common/src/main/java/common/block/artificial/BlockLadder.java index 25dfd9f9..10677572 100755 --- a/common/src/main/java/common/block/artificial/BlockLadder.java +++ b/common/src/main/java/common/block/artificial/BlockLadder.java @@ -12,7 +12,6 @@ import common.model.GuiPosition; import common.properties.Property; import common.util.BlockPos; import common.util.BoundingBox; -import common.util.Clientside; import common.util.Facing; import common.world.AWorldServer; import common.world.IWorldAccess; @@ -132,11 +131,6 @@ public class BlockLadder extends Block implements Rotatable return worldIn.getState(pos.offset(facing.getOpposite())).getBlock().isNormalCube(); } - @Clientside - public boolean hasTransparency() { - return true; - } - protected Property[] getProperties() { return new Property[] {FACING}; diff --git a/common/src/main/java/common/block/artificial/BlockPane.java b/common/src/main/java/common/block/artificial/BlockPane.java index 26aecdd0..61fefba2 100755 --- a/common/src/main/java/common/block/artificial/BlockPane.java +++ b/common/src/main/java/common/block/artificial/BlockPane.java @@ -17,7 +17,6 @@ import common.properties.PropertyBool; import common.rng.Random; import common.util.BlockPos; import common.util.BoundingBox; -import common.util.Clientside; import common.util.Facing; import common.util.Serverside; import common.world.AWorldServer; @@ -181,11 +180,6 @@ public class BlockPane extends Block return true; } - @Clientside - public boolean hasTransparency() { - return true; - } - protected Property[] getProperties() { return new Property[] {NORTH, EAST, WEST, SOUTH}; diff --git a/common/src/main/java/common/block/artificial/BlockSlab.java b/common/src/main/java/common/block/artificial/BlockSlab.java index c4c943fc..2dafad1a 100755 --- a/common/src/main/java/common/block/artificial/BlockSlab.java +++ b/common/src/main/java/common/block/artificial/BlockSlab.java @@ -17,7 +17,6 @@ import common.model.Model.ModelProvider; import common.properties.Property; import common.util.BlockPos; import common.util.BoundingBox; -import common.util.Clientside; import common.util.Facing; import common.util.Facing.Axis; import common.world.IWorldAccess; @@ -175,11 +174,6 @@ public class BlockSlab extends Block implements Directional { return model; } - @Clientside - public boolean hasTransparency() { - return this.textureOverlay != null; - } - public boolean getSumBrightness() { return true; } diff --git a/common/src/main/java/common/block/artificial/BlockTrapDoor.java b/common/src/main/java/common/block/artificial/BlockTrapDoor.java index 9a2f578c..8fd5bcc0 100755 --- a/common/src/main/java/common/block/artificial/BlockTrapDoor.java +++ b/common/src/main/java/common/block/artificial/BlockTrapDoor.java @@ -15,7 +15,6 @@ import common.properties.PropertyBool; import common.properties.PropertyEnum; import common.util.BlockPos; import common.util.BoundingBox; -import common.util.Clientside; import common.util.Facing; import common.util.HitPosition; import common.util.Identifyable; @@ -168,11 +167,6 @@ public class BlockTrapDoor extends Block implements Rotatable return iblockstate; } - @Clientside - public boolean hasTransparency() { - return true; - } - protected Property[] getProperties() { return new Property[] {FACING, OPEN, HALF}; diff --git a/common/src/main/java/common/block/foliage/BlockBush.java b/common/src/main/java/common/block/foliage/BlockBush.java index b2c309ef..58f1e3a5 100755 --- a/common/src/main/java/common/block/foliage/BlockBush.java +++ b/common/src/main/java/common/block/foliage/BlockBush.java @@ -8,7 +8,6 @@ import common.model.Model; import common.rng.Random; import common.util.BlockPos; import common.util.BoundingBox; -import common.util.Clientside; import common.util.Facing; import common.world.State; import common.world.World; @@ -88,11 +87,6 @@ public class BlockBush extends Block { return false; } - - @Clientside - public boolean hasTransparency() { - return true; - } public static Model makeCrossModel(Model model) { return model diff --git a/common/src/main/java/common/block/foliage/BlockCactus.java b/common/src/main/java/common/block/foliage/BlockCactus.java index 708ecf67..7b0ff364 100755 --- a/common/src/main/java/common/block/foliage/BlockCactus.java +++ b/common/src/main/java/common/block/foliage/BlockCactus.java @@ -13,7 +13,6 @@ import common.properties.PropertyInteger; import common.rng.Random; import common.util.BlockPos; import common.util.BoundingBox; -import common.util.Clientside; import common.util.Facing; import common.vars.Vars; import common.world.State; @@ -128,11 +127,6 @@ public class BlockCactus extends Block entityIn.attackEntityFrom(DamageSource.cactus, 1); } - @Clientside - public boolean hasTransparency() { - return true; - } - protected Property[] getProperties() { return new Property[] {AGE}; diff --git a/common/src/main/java/common/block/foliage/BlockGrass.java b/common/src/main/java/common/block/foliage/BlockGrass.java index 7d0293cf..a00f46c4 100755 --- a/common/src/main/java/common/block/foliage/BlockGrass.java +++ b/common/src/main/java/common/block/foliage/BlockGrass.java @@ -11,7 +11,6 @@ import common.properties.Property; import common.properties.PropertyBool; import common.rng.Random; import common.util.BlockPos; -import common.util.Clientside; import common.vars.Vars; import common.world.IWorldAccess; import common.world.State; @@ -92,11 +91,6 @@ public class BlockGrass extends Block implements IGrowable return new Property[] {SNOWY}; } - @Clientside - public boolean hasTransparency() { - return true; - } - public Model getModel(ModelProvider provider, String name, State state) { if(state.getValue(SNOWY)) return provider.getModel("dirt").add().d().u("snow").nswe().add().nswe("soil_snowed"); diff --git a/common/src/main/java/common/block/foliage/BlockLeavesBase.java b/common/src/main/java/common/block/foliage/BlockLeavesBase.java index 866892d3..28bd923e 100755 --- a/common/src/main/java/common/block/foliage/BlockLeavesBase.java +++ b/common/src/main/java/common/block/foliage/BlockLeavesBase.java @@ -2,7 +2,6 @@ package common.block.foliage; import common.block.Block; import common.block.Material; -import common.util.Clientside; public class BlockLeavesBase extends Block { @@ -26,11 +25,6 @@ public class BlockLeavesBase extends Block // this.transparent = transparent; // } - @Clientside - public boolean hasTransparency() { - return true; - } - public boolean isVisuallyOpaque() { return false; diff --git a/common/src/main/java/common/block/foliage/BlockMycelium.java b/common/src/main/java/common/block/foliage/BlockMycelium.java index 858ffada..ade921f1 100755 --- a/common/src/main/java/common/block/foliage/BlockMycelium.java +++ b/common/src/main/java/common/block/foliage/BlockMycelium.java @@ -11,7 +11,6 @@ import common.properties.Property; import common.properties.PropertyBool; import common.rng.Random; import common.util.BlockPos; -import common.util.Clientside; import common.util.ParticleType; import common.vars.Vars; import common.world.IWorldAccess; @@ -93,11 +92,6 @@ public class BlockMycelium extends Block return new Property[] {SNOWY}; } - @Clientside - public boolean hasTransparency() { - return true; - } - public Model getModel(ModelProvider provider, String name, State state) { if(state.getValue(SNOWY)) return provider.getModel("dirt").add().d().u("snow").nswe().add().nswe("soil_snowed"); diff --git a/common/src/main/java/common/block/foliage/BlockReed.java b/common/src/main/java/common/block/foliage/BlockReed.java index c766b694..abe1e285 100755 --- a/common/src/main/java/common/block/foliage/BlockReed.java +++ b/common/src/main/java/common/block/foliage/BlockReed.java @@ -12,7 +12,6 @@ import common.properties.PropertyInteger; import common.rng.Random; import common.util.BlockPos; import common.util.BoundingBox; -import common.util.Clientside; import common.util.Facing; import common.vars.Vars; import common.world.State; @@ -139,11 +138,6 @@ public class BlockReed extends Block return false; } - @Clientside - public boolean hasTransparency() { - return true; - } - protected Property[] getProperties() { return new Property[] {AGE}; diff --git a/common/src/main/java/common/block/foliage/BlockSwamp.java b/common/src/main/java/common/block/foliage/BlockSwamp.java index 593bcf4f..13b1f56d 100644 --- a/common/src/main/java/common/block/foliage/BlockSwamp.java +++ b/common/src/main/java/common/block/foliage/BlockSwamp.java @@ -13,7 +13,6 @@ import common.properties.PropertyBool; import common.rng.Random; import common.util.BlockPos; import common.util.BoundingBox; -import common.util.Clientside; import common.vars.Vars; import common.world.AWorldServer; import common.world.IWorldAccess; @@ -50,11 +49,6 @@ public class BlockSwamp extends Block entityIn.motionZ *= 0.6D; } - @Clientside - public boolean hasTransparency() { - return true; - } - public Model getModel(ModelProvider provider, String name, State state) { if(state.getValue(SNOWY)) return provider.getModel("dirt").add().d().u("snow").nswe().add().nswe("soil_snowed"); diff --git a/common/src/main/java/common/block/foliage/BlockTianSoil.java b/common/src/main/java/common/block/foliage/BlockTianSoil.java index 11e528fe..86624e80 100755 --- a/common/src/main/java/common/block/foliage/BlockTianSoil.java +++ b/common/src/main/java/common/block/foliage/BlockTianSoil.java @@ -11,7 +11,6 @@ import common.properties.Property; import common.properties.PropertyBool; import common.rng.Random; import common.util.BlockPos; -import common.util.Clientside; import common.world.IWorldAccess; import common.world.State; @@ -42,11 +41,6 @@ public class BlockTianSoil extends Block return new Property[] {SNOWY}; } - @Clientside - public boolean hasTransparency() { - return true; - } - public Model getModel(ModelProvider provider, String name, State state) { if(state.getValue(SNOWY)) return provider.getModel("tian").add().d().u("snow").nswe().add().nswe("tian_soil_snowed"); diff --git a/common/src/main/java/common/block/foliage/BlockVine.java b/common/src/main/java/common/block/foliage/BlockVine.java index f55a2087..82580218 100755 --- a/common/src/main/java/common/block/foliage/BlockVine.java +++ b/common/src/main/java/common/block/foliage/BlockVine.java @@ -19,7 +19,6 @@ import common.rng.Random; import common.tileentity.TileEntity; import common.util.BlockPos; import common.util.BoundingBox; -import common.util.Clientside; import common.util.Facing; import common.util.Equipment; import common.vars.Vars; @@ -415,11 +414,6 @@ public class BlockVine extends Block } } - @Clientside - public boolean hasTransparency() { - return true; - } - protected Property[] getProperties() { return new Property[] {UP, NORTH, EAST, SOUTH, WEST}; diff --git a/common/src/main/java/common/block/natural/BlockFire.java b/common/src/main/java/common/block/natural/BlockFire.java index be4fa03e..5094cd57 100755 --- a/common/src/main/java/common/block/natural/BlockFire.java +++ b/common/src/main/java/common/block/natural/BlockFire.java @@ -16,7 +16,6 @@ import common.properties.PropertyInteger; import common.rng.Random; import common.util.BlockPos; import common.util.BoundingBox; -import common.util.Clientside; import common.util.Facing; import common.util.ParticleType; import common.util.PortalType; @@ -427,11 +426,6 @@ public class BlockFire extends Block // return MapColor.tntColor; // } - @Clientside - public boolean hasTransparency() { - return true; - } - protected Property[] getProperties() { return new Property[] {AGE, NORTH, EAST, SOUTH, WEST, UPPER, FLIP, ALT}; diff --git a/common/src/main/java/common/block/natural/BlockPodzol.java b/common/src/main/java/common/block/natural/BlockPodzol.java index f569f8ae..168a0633 100644 --- a/common/src/main/java/common/block/natural/BlockPodzol.java +++ b/common/src/main/java/common/block/natural/BlockPodzol.java @@ -12,7 +12,6 @@ import common.properties.Property; import common.properties.PropertyBool; import common.rng.Random; import common.util.BlockPos; -import common.util.Clientside; import common.world.IWorldAccess; import common.world.State; @@ -38,11 +37,6 @@ public class BlockPodzol extends Block { return Items.dirt; } - @Clientside - public boolean hasTransparency() { - return true; - } - public Model getModel(ModelProvider provider, String name, State state) { if(state.getValue(SNOWY)) return provider.getModel("dirt").add().d().u("snow").nswe().add().nswe("soil_snowed"); diff --git a/common/src/main/java/common/block/natural/BlockWeb.java b/common/src/main/java/common/block/natural/BlockWeb.java index d483e16b..95d113c3 100755 --- a/common/src/main/java/common/block/natural/BlockWeb.java +++ b/common/src/main/java/common/block/natural/BlockWeb.java @@ -13,7 +13,6 @@ import common.model.GuiPosition; import common.rng.Random; import common.util.BlockPos; import common.util.BoundingBox; -import common.util.Clientside; import common.world.State; import common.world.World; @@ -64,11 +63,6 @@ public class BlockWeb extends Block return true; } - @Clientside - public boolean hasTransparency() { - return true; - } - public Model getModel(ModelProvider provider, String name, State state) { return BlockBush.makeCrossModel(provider.getModel("web")); } diff --git a/common/src/main/java/common/block/tech/BlockBrewingStand.java b/common/src/main/java/common/block/tech/BlockBrewingStand.java index ccda0272..094bef6f 100755 --- a/common/src/main/java/common/block/tech/BlockBrewingStand.java +++ b/common/src/main/java/common/block/tech/BlockBrewingStand.java @@ -44,11 +44,6 @@ public class BlockBrewingStand extends BlockMachine { worldIn.clientParticle(ParticleType.SMOKE, d0, d1, d2); } - @Clientside - public boolean hasTransparency() { - return true; - } - @Clientside public Model getModel(ModelProvider provider, String name, State state) { return provider.getModel("brewing_stand") diff --git a/common/src/main/java/common/block/tech/BlockEffectGenerator.java b/common/src/main/java/common/block/tech/BlockEffectGenerator.java index b7841134..cb854109 100755 --- a/common/src/main/java/common/block/tech/BlockEffectGenerator.java +++ b/common/src/main/java/common/block/tech/BlockEffectGenerator.java @@ -5,7 +5,6 @@ import common.item.CheatTab; import common.model.Model; import common.model.Model.ModelProvider; import common.tileentity.TileEntity; -import common.util.Clientside; import common.tileentity.DeviceEffectGenerator; import common.world.State; @@ -28,11 +27,6 @@ public class BlockEffectGenerator extends BlockMachine { return false; } - @Clientside - public boolean hasTransparency() { - return true; - } - public Model getModel(ModelProvider provider, String name, State state) { return provider.getModel("glass") .add(0, 0, 0, 16, 16, 16) diff --git a/common/src/main/java/common/block/tech/BlockHook.java b/common/src/main/java/common/block/tech/BlockHook.java index 302c12c8..88c2559b 100755 --- a/common/src/main/java/common/block/tech/BlockHook.java +++ b/common/src/main/java/common/block/tech/BlockHook.java @@ -15,7 +15,6 @@ import common.properties.PropertyBool; import common.rng.Random; import common.util.BlockPos; import common.util.BoundingBox; -import common.util.Clientside; import common.util.Facing; import common.util.Serverside; import common.world.IWorldAccess; @@ -308,11 +307,6 @@ public class BlockHook extends Block implements Rotatable return true; } - @Clientside - public boolean hasTransparency() { - return true; - } - protected Property[] getProperties() { return new Property[] {FACING, TRIGGERED, ATTACHED}; diff --git a/common/src/main/java/common/block/tech/BlockPipe.java b/common/src/main/java/common/block/tech/BlockPipe.java index bf6724ff..51c5d082 100755 --- a/common/src/main/java/common/block/tech/BlockPipe.java +++ b/common/src/main/java/common/block/tech/BlockPipe.java @@ -125,11 +125,6 @@ public abstract class BlockPipe extends Block implements ITileEntityProvider, Di return true; } - @Clientside - public final boolean hasTransparency() { - return true; - } - public final boolean isMagnetic() { return true; } diff --git a/common/src/main/java/common/block/tech/BlockRail.java b/common/src/main/java/common/block/tech/BlockRail.java index 7eabe037..0eb9a7b6 100755 --- a/common/src/main/java/common/block/tech/BlockRail.java +++ b/common/src/main/java/common/block/tech/BlockRail.java @@ -15,7 +15,6 @@ import common.properties.Property; import common.properties.PropertyEnum; import common.util.BlockPos; import common.util.BoundingBox; -import common.util.Clientside; import common.util.DirectionVec; import common.util.Facing; import common.util.HitPosition; @@ -158,11 +157,6 @@ public class BlockRail extends Block return 0; } - @Clientside - public boolean hasTransparency() { - return true; - } - public void onRemoved(AWorldServer worldIn, BlockPos pos, State state) { super.onRemoved(worldIn, pos, state); diff --git a/common/src/main/java/common/block/tech/BlockString.java b/common/src/main/java/common/block/tech/BlockString.java index 1573b502..40c286b3 100755 --- a/common/src/main/java/common/block/tech/BlockString.java +++ b/common/src/main/java/common/block/tech/BlockString.java @@ -15,7 +15,6 @@ import common.properties.PropertyBool; import common.rng.Random; import common.util.BlockPos; import common.util.BoundingBox; -import common.util.Clientside; import common.util.Facing; import common.world.IBlockAccess; import common.world.IWorldAccess; @@ -65,11 +64,6 @@ public class BlockString extends Block return false; } - @Clientside - public boolean hasTransparency() { - return true; - } - public void onAdded(AWorldServer worldIn, BlockPos pos, State state) { this.notifyHook(worldIn, pos, state); diff --git a/common/src/main/java/common/block/tech/BlockTorch.java b/common/src/main/java/common/block/tech/BlockTorch.java index 594c20eb..de50a857 100755 --- a/common/src/main/java/common/block/tech/BlockTorch.java +++ b/common/src/main/java/common/block/tech/BlockTorch.java @@ -16,7 +16,6 @@ import common.model.GuiPosition; import common.properties.Property; import common.util.BlockPos; import common.util.BoundingBox; -import common.util.Clientside; import common.util.Facing; import common.util.HitPosition; import common.util.Vec3; @@ -219,11 +218,6 @@ public abstract class BlockTorch extends Block implements Directional return super.rayTrace(worldIn, pos, start, end); } - @Clientside - public boolean hasTransparency() { - return true; - } - protected Property[] getProperties() { return new Property[] {FACING}; diff --git a/common/src/main/java/common/block/tech/BlockWire.java b/common/src/main/java/common/block/tech/BlockWire.java index 6e55b99a..490f0bed 100755 --- a/common/src/main/java/common/block/tech/BlockWire.java +++ b/common/src/main/java/common/block/tech/BlockWire.java @@ -17,7 +17,6 @@ import common.properties.PropertyBool; import common.rng.Random; import common.util.BlockPos; import common.util.BoundingBox; -import common.util.Clientside; import common.util.Facing; import common.util.Serverside; import common.world.IBlockAccess; @@ -117,11 +116,6 @@ public class BlockWire extends Block return state.getBlock() == this; } - @Clientside - public boolean hasTransparency() { - return true; - } - protected Property[] getProperties() { return new Property[] {DOWN, UP, NORTH, EAST, SOUTH, WEST};