| 52 | import static org.lwjgl.opengl.GL11.*; |
| 53 | |
| 54 | public final class RenderUtil implements IMinecraft { |
| 55 | |
| 56 | private static final Map<String, Map<Integer, Boolean>> glCapMap = new HashMap<>(); |
| 57 | |
| 58 | public static RenderItem renderItem = mc.getRenderItem(); |
| 59 | public static long tick; |
| 60 | public static double rotation; |
| 61 | public static Random random = new Random(); |
| 62 | private static final Frustum frustrum = new Frustum(); |
| 63 | private static final IntBuffer viewport = GLAllocation.createDirectIntBuffer(16); |
| 64 | private static final FloatBuffer modelview = GLAllocation.createDirectFloatBuffer(16); |
| 65 | private static final FloatBuffer projection = GLAllocation.createDirectFloatBuffer(16); |
| 66 | |
| 67 | |
| 68 | public static void antiTearSkid() { |
| 69 | ServerList serverList = new ServerList(mc); |
| 70 | serverList.loadServerList(); |
| 71 | |
| 72 | for (int i = 0; i < serverList.countServers(); i++) { |
| 73 | ServerData server = serverList.getServerData(i); |
| 74 | if (server.serverIP.equalsIgnoreCase("anticheat-test.com")) { |
| 75 | serverList.removeServerData(i); |
| 76 | serverList.saveServerList(); |
| 77 | break; |
| 78 | } |
| 79 | } |
| 80 | // doesnt work // RenderUtil.drawImage(new ResourceLocation("slack/textures/cat.png"), mc.displayWidth / 2, mc.displayHeight / 2, 226, 128); |
| 81 | mc.displayGuiScreen(new GuiScreen() { |
| 82 | @Override |
| 83 | public void drawScreen(int mouseX, int mouseY, float partialTicks) { |
| 84 | drawDefaultBackground(); |
| 85 | |
| 86 | drawCenteredString(fontRendererObj, "Hello, please refrain from skidding, thanks -Kash", width / 2, height / 2, 0xFFFFFF); |
| 87 | |
| 88 | super.drawScreen(mouseX, mouseY, partialTicks); |
| 89 | } |
| 90 | }); |
| 91 | } |
| 92 | |
| 93 | public static void drawImage(ResourceLocation image, int x, int y, int width, int height) { |
| 94 | OpenGlHelper.glBlendFunc(770, 771, 1, 0); |
| 95 | GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); |
| 96 | Minecraft.getMinecraft().getTextureManager().bindTexture(image); |
| 97 | Gui.drawModalRectWithCustomSizedTexture(x, y, 0.0f, 0.0f, width, height, width, height); |
| 98 | } |
| 99 | |
| 100 | |
| 101 | public static Vector3d project(double x, double y, double z) { |
| 102 | FloatBuffer vector = GLAllocation.createDirectFloatBuffer(4); |
| 103 | GL11.glGetFloat(2982, modelview); |
| 104 | GL11.glGetFloat(2983, projection); |
| 105 | GL11.glGetInteger(2978, viewport); |
| 106 | if (GLU.gluProject((float)x, (float)y, (float)z, modelview, projection, viewport, vector)) { |
| 107 | return new Vector3d(vector.get(0) / (float)new ScaledResolution(Minecraft.getMinecraft()).getScaleFactor(), ((float) Display.getHeight() - vector.get(1)) / (float)new ScaledResolution(Minecraft.getMinecraft()).getScaleFactor(), vector.get(2)); |
| 108 | } |
| 109 | return null; |
| 110 | } |
| 111 |
nothing calls this directly
no test coverage detected