blob: 300968a8001f68e7e4778916269525fcd9126017 (
plain)
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
|
package darkknight.jewelrycraft.events;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiChat;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
import org.lwjgl.input.Keyboard;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent;
import darkknight.jewelrycraft.JewelrycraftMod;
import darkknight.jewelrycraft.config.ConfigHandler;
import darkknight.jewelrycraft.network.PacketRequestPlayerInfo;
import darkknight.jewelrycraft.util.JewelrycraftUtil;
import darkknight.jewelrycraft.util.PlayerUtils;
public class ScreenHandler extends Gui
{
private Minecraft mc;
public static NBTTagCompound tagCache;
public static int cooldown;
public ScreenHandler(Minecraft mc)
{
super();
this.mc = mc;
}
@SubscribeEvent
public void onEntityJoinWorld(RenderGameOverlayEvent event)
{
if (cooldown == 0)
{
JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
cooldown = 500;
}
else cooldown--;
if (event.isCancelable() || event.type != ElementType.EXPERIENCE || tagCache == null) return;
mc.renderEngine.bindTexture(new ResourceLocation("jewelrycraft", "textures/gui/curses1.png"));
for (String l : JewelrycraftUtil.curses.keySet())
if (tagCache.getInteger(l) > -1){
int tag = JewelrycraftUtil.curses.get(l) + 1;
int size = 32;
this.drawTexturedModalRect(2 + size * tag, 2, tag % size * size, tag / size * size, size, size);
}
}
}
|