Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.minecraft.src;
- import java.awt.image.BufferedImage;
- import org.lwjgl.opengl.GL11;
- public class GuiWhatever extends GuiScreen
- {
- private BufferedImage img;
- private int imgID = 1000;
- public GuiWhatever()
- {
- }
- public void initGui()
- {
- try{
- img = ModLoader.loadImage(mc.renderEngine, "/mods/test1.png");
- mc.renderEngine.setupTexture(img, imgID);
- }catch(Exception e){
- e.printStackTrace();
- }
- controlList.clear();
- controlList.add(new GuiButton(1, width / 2 - 6, height / 2 + 20, 78, 20, "Make it Rain!"));
- controlList.add(new GuiButton(2, width / 2 - 90, height / 2 + 20, 78, 20, "Stop the Rain!"));
- }
- protected void actionPerformed(GuiButton guibutton)
- {
- if(guibutton.id == 1)
- {
- ModLoader.getMinecraftInstance().theWorld.setRainStrength(5F);
- ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Rain Started!");
- }
- if(guibutton.id == 2)
- {
- ModLoader.getMinecraftInstance().theWorld.setRainStrength(0F);
- ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Rain Stopped!");
- }
- }
- public boolean doesGuiPauseGame()
- {
- return false;
- }
- public void drawScreen(int i, int j, float f)
- {
- drawDefaultBackground();
- int x = width / 2 - 95;
- int y = height / 2 - 100;
- try{
- int wtf = mc.renderEngine.getTexture("/mods/test1.png");
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- mc.renderEngine.bindTexture(wtf);
- drawTexturedModalRect(x, y, 0, 0, 176, 166);
- }
- finally{
- }
- //drawGradientRect(20, 20, width - 20, height - 20, 0x60bb0000, 0xa0770055);
- //drawRect(60, 60, width - 60, height - 60, 0xFF11cc00);
- drawCenteredString(fontRenderer, "Weather Controller", width / 2, 45, 0x44ff11);
- drawString(fontRenderer, "Rain Controller", width / 2 - 100, height / 2 - 40, 0xCCCCCC);
- super.drawScreen(i, j, f);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement