Created
June 16, 2013 03:28
-
-
Save vgel/5790652 to your computer and use it in GitHub Desktop.
FUCK FUCK FUCK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WorldServer worldServer = DimensionManager.getWorld(dim); | |
if (worldServer == null) { | |
DimensionManager.initDimension(dim); | |
worldServer = DimensionManager.getWorld(dim); | |
} | |
if (dim != dimRendering) { | |
dimRendering = dim; | |
privRG.setWorldAndLoadRenderers(Minecraft.getMinecraft().theWorld); | |
} | |
System.out.println("render " + MinecraftForgeClient.getRenderPass()); | |
Minecraft mc = Minecraft.getMinecraft(); | |
GL11.glStencilMask(~0); | |
GL11.glDisable(GL11.GL_SCISSOR_TEST); | |
GL11.glClearStencil(0); | |
GL11.glClear(GL11.GL_STENCIL_BUFFER_BIT); | |
GL11.glColorMask(false, false, false, false); | |
GL11.glDepthMask(false); | |
GL11.glDisable(GL11.GL_DEPTH_TEST); | |
GL11.glEnable(GL11.GL_STENCIL_TEST); | |
GL11.glStencilFunc(GL11.GL_NEVER, 0, 0xFF); | |
GL11.glStencilOp(GL11.GL_INCR, GL11.GL_KEEP, GL11.GL_KEEP); | |
GL11.glStencilMask(0xFF); | |
this.drawPortal(portal); | |
GL11.glColorMask(true, true, true, true); | |
GL11.glDepthMask(true); | |
//GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); | |
GL11.glEnable(GL11.GL_DEPTH_TEST); | |
GL11.glEnable(GL11.GL_STENCIL_TEST); | |
GL11.glStencilMask(0); | |
GL11.glStencilFunc(GL11.GL_EQUAL, 1, 0xFF); | |
EntityLiving fakeEntity = new FakePlayer(mc.theWorld, "ModName-Camera"); | |
fakeEntity.setLocationAndAngles(x, y, z, (float) 180, (float) mc.thePlayer.rotationPitch); | |
fakeEntity.prevRotationYaw = 180; | |
fakeEntity.prevRotationPitch = mc.thePlayer.prevRotationPitch; | |
EntityLiving oldView = mc.renderViewEntity; | |
mc.renderViewEntity = fakeEntity; | |
RenderGlobal oldRG = mc.renderGlobal; | |
mc.renderGlobal = privRG; | |
mc.entityRenderer.renderWorld(partial, 0L); | |
mc.renderGlobal = oldRG; | |
mc.renderViewEntity = oldView; | |
GL11.glStencilFunc(GL11.GL_ALWAYS, 0, 0xFF); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment