Decompiled by Jad v1 8e Copyright 2001 Pavel Kouznetsov Jad home page

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3)
// Source File Name: Events.java
package net.eahraeh.Screener;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import io.netty.buffer.*;
import java.awt.image.*;
import java.io.IOException;
import java.io.PrintStream;
import java.nio.IntBuffer;
import javax.imageio.ImageIO;
import net.minecraft.client.Minecraft;
import net.minecraft.util.MathHelper;
import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL30;
// Referenced classes of package net.eahraeh.Screener:
// Message_Screenshot_Request, Screener, Message_Screenshot_Response
public class Events
{
public Events()
{
}
static BufferedImage getScreenshot()
{
Minecraft mc = Minecraft.func_71410_x();
int width = mc.field_71443_c;
int height = mc.field_71440_d;
GL11.glPixelStorei(3333, 1);
GL11.glPixelStorei(3317, 1);
int intCount = width * height;
if(intBuf == null || intBuf.capacity() < intCount)
intBuf = BufferUtils.createIntBuffer(intCount);
intBuf.clear();
GL11.glReadPixels(0, 0, width, height, 32993, 33639, intBuf);
GL30.glBindFramebuffer(36160, 0);
BufferedImage img = new BufferedImage(width, height, 1);
int imgData[] = ((DataBufferInt)img.getWritableTile(0, 0).getDataBuffer()).getData();
for(int row = height; row > 0;)
{
row--;
intBuf.get(imgData, row * width, width);
}
return img;
}
public void onRenderTickEvent(cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent event)
{
renderTickTime = event.renderTickTime;
if(event.phase != cpw.mods.fml.common.gameevent.TickEvent.Phase.END)
break MISSING_BLOCK_LABEL_174;
if(Message_Screenshot_Request.doingScreenshot == 2)
{
Message_Screenshot_Request.doingScreenshot = 1;
break MISSING_BLOCK_LABEL_174;
}
if(Message_Screenshot_Request.doingScreenshot != 1)
break MISSING_BLOCK_LABEL_174;
BufferedImage screenshot = getScreenshot();
ByteBuf buf = Unpooled.buffer();
ImageIO.write(screenshot, "PNG", new ByteBufOutputStream(buf));
int numParts = MathHelper.func_76123_f((float)buf.readableBytes() / 32763F);
for(int i = 0; i < numParts; i++)
{
int bufIdx = i * 32763;
int thisLen = Math.min(buf.readableBytes() - bufIdx, 32763);
ByteBuf sliced = buf.slice(bufIdx, thisLen);
Screener.mainNetworkChannel.sendToServer(new Message_Screenshot_Response(numParts, i, sliced));
}
Message_Screenshot_Request.doingScreenshot = 0;
break MISSING_BLOCK_LABEL_174;
IOException var12;
var12;
System.out.println("\u041E\u0448\u0438\u0431\u043A\u0430 \u0432 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0438 \u0441\u043A\u0440\u0438\u043D\u0448\u043E\u0442\u0430");
Message_Screenshot_Request.doingScreenshot = 0;
break MISSING_BLOCK_LABEL_174;
Exception exception;
exception;
Message_Screenshot_Request.doingScreenshot = 0;
throw exception;
}
private static IntBuffer intBuf;
public static float renderTickTime;
}