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
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
// 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: Message_Screenshot_Display.java
package net.eahraeh.Screener;
import cpw.mods.fml.common.network.ByteBufUtils;
import cpw.mods.fml.common.network.simpleimpl.*;
import io.netty.buffer.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Date;
import javax.imageio.ImageIO;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.renderer.texture.DynamicTexture;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ResourceLocation;
// Referenced classes of package net.eahraeh.Screener:
// GuiScreenshotView
public class Message_Screenshot_Display
implements IMessage
{
public static class Handler
implements IMessageHandler
{
public IMessage onMessage(Message_Screenshot_Display msg, MessageContext ctx)
{
if(data == null)
data = new ByteBuf[msg.totalParts];
data[msg.partIndex] = msg.data;
ByteBuf abytebuf[] = data;
int i = abytebuf.length;
for(int j = 0; j < i; j++)
{
ByteBuf b = abytebuf[j];
if(b == null)
return null;
}
try
{
BufferedImage image = ImageIO.read(new ByteBufInputStream(Unpooled.wrappedBuffer(data)));
data = null;
if(msg.mode == 0)
Minecraft.func_71410_x().func_147108_a(new GuiScreenshotView(image, msg.name, msg.time));
else
if(msg.mode == 1 && (Minecraft.func_71410_x().field_71462_r instanceof GuiScreenshotView))
{
DynamicTexture texture = new DynamicTexture(image.getWidth(), image.getHeight());
Minecraft.func_71410_x().func_110434_K().func_110579_a(new ResourceLocation("deci", "screenshot"), texture);
image.getRGB(0, 0, image.getWidth(), image.getHeight(), texture.func_110565_c(), 0, image.getWidth());
texture.func_110564_a();
((GuiScreenshotView)Minecraft.func_71410_x().field_71462_r).date.setTime(msg.time);
}
}
catch(IOException var7)
{
Minecraft.func_71410_x().field_71439_g.func_145747_a(new ChatComponentText("\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0438 \u0441\u043A\u0440\u0438\u043D\u0448\u043E\u0442\u0430, \u0441\u043C\u043E\u0442\u0440\u0438\u0442\u0435 \u043B\u043E\u0433"));
System.out.println(var7.toString());
}
return null;
}
public volatile IMessage onMessage(IMessage imessage, MessageContext messagecontext)
{
return onMessage((Message_Screenshot_Display)imessage, messagecontext);
}
private ByteBuf data[];
public Handler()
{
}
}
public Message_Screenshot_Display()
{
}
public void toBytes(ByteBuf bytebuf)
{
}
public void fromBytes(ByteBuf buf)
{
name = ByteBufUtils.readUTF8String(buf);
mode = buf.readInt();
time = buf.readLong();
partIndex = buf.readUnsignedByte();
totalParts = buf.readUnsignedByte();
data = buf.readBytes(buf.readableBytes());
}
public static final int MAX_PAYLOAD_SIZE = 0x1fff97;
int partIndex;
int totalParts;
ByteBuf data;
String name;
int mode;
long time;
}