Petit problème de GUI et quelques question



  • Salut tout le monde ça fait quelque heure que je boss sur un GUI mais j'ai rencontré un petit problémme malgré quelque recherche je ne trouve rien  😞  donc je viens vers vous pour m'aidé 😄

    [22:36:46] [Client thread/FATAL]: Reported exception thrown!
    net.minecraft.util.ReportedException: Rendering screen
    at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1168) ~[EntityRenderer.class:?]
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1067) ~[Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:962) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]
    at GradleStart.main(Unknown Source) [start/:?]
    Caused by: java.lang.NullPointerException
    at ma.Yeyvo.MVC.client.GuiCheker.drawScreen(GuiCheker.java:86) ~[GuiCheker.class:?]
    at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1137) ~[EntityRenderer.class:?]
    … 11 more
    [22:36:46] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: –-- Minecraft Crash Report ----
    // Ooh. Shiny.
    
    Time: 14/06/16 22:36
    Description: Rendering screen
    
    java.lang.NullPointerException: Rendering screen
    at ma.Yeyvo.MVC.client.GuiCheker.drawScreen(GuiCheker.java:86)
    at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1137)
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1067)
    at net.minecraft.client.Minecraft.run(Minecraft.java:962)
    at net.minecraft.client.main.Main.main(Main.java:164)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
    at GradleStart.main(Unknown Source)
    
    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------
    
    -- Head --
    Stacktrace:
    at ma.Yeyvo.MVC.client.GuiCheker.drawScreen(GuiCheker.java:86)
    
    -- Screen render details --
    Details:
    Screen name: ma.Yeyvo.MVC.client.GuiCheker
    Mouse location: Scaled: (213, 119). Absolute: (427, 240)
    Screen size: Scaled: (427, 240). Absolute: (854, 480). Scale factor of 2
    
    -- Affected level --
    Details:
    Level name: MpServer
    All players: 1 total; [EntityClientPlayerMP['Player221'/256, l='MpServer', x=273,30, y=50,62, z=161,30]]
    Chunk stats: MultiplayerChunkCache: 81, 81
    Level seed: 0
    Level generator: ID 00 - default, ver 1\. Features enabled: false
    Level generator options: 
    Level spawn location: World: (261,64,162), Chunk: (at 5,4,2 in 16,10; contains blocks 256,0,160 to 271,255,175), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
    Level time: 35851 game time, 35851 day time
    Level dimension: 0
    Level storage version: 0x00000 - Unknown?
    Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
    Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
    Forced entities: 75 total; [EntityCreeper['Creeper'/128, l='MpServer', x=259,06, y=32,00, z=192,63], EntityClientPlayerMP['Player221'/256, l='MpServer', x=273,30, y=50,62, z=161,30], EntityItem['item.item.egg'/139, l='MpServer', x=286,13, y=65,13, z=110,28], EntitySheep['Sheep'/140, l='MpServer', x=282,56, y=67,00, z=115,44], EntityItem['item.item.egg'/141, l='MpServer', x=285,78, y=70,13, z=116,06], EntitySheep['Sheep'/142, l='MpServer', x=273,09, y=72,00, z=124,78], EntitySkeleton['Skeleton'/143, l='MpServer', x=285,63, y=38,00, z=158,56], EntitySkeleton['Skeleton'/144, l='MpServer', x=280,91, y=41,00, z=156,50], EntitySkeleton['Skeleton'/145, l='MpServer', x=285,06, y=38,00, z=157,53], EntityZombie['Zombie'/146, l='MpServer', x=286,47, y=37,00, z=159,50], EntityCreeper['Creeper'/147, l='MpServer', x=281,94, y=24,00, z=174,41], EntityZombie['Zombie'/148, l='MpServer', x=286,47, y=21,00, z=161,91], EntityZombie['Zombie'/149, l='MpServer', x=279,10, y=42,07, z=161,86], EntityCreeper['Creeper'/150, l='MpServer', x=286,91, y=37,00, z=161,69], EntitySkeleton['Skeleton'/151, l='MpServer', x=281,56, y=44,00, z=178,84], EntitySkeleton['Skeleton'/152, l='MpServer', x=275,47, y=43,00, z=184,31], EntitySkeleton['Skeleton'/153, l='MpServer', x=280,03, y=44,00, z=182,63], EntityZombie['Zombie'/154, l='MpServer', x=286,69, y=18,26, z=217,06], EntityZombie['Zombie'/155, l='MpServer', x=286,03, y=17,00, z=215,36], EntitySquid['Squid'/156, l='MpServer', x=284,50, y=55,00, z=219,92], EntitySquid['Squid'/157, l='MpServer', x=280,50, y=55,29, z=220,84], EntityChicken['Chicken'/163, l='MpServer', x=291,28, y=65,00, z=109,84], EntityZombie['Zombie'/164, l='MpServer', x=289,28, y=31,00, z=145,84], EntityZombie['Zombie'/165, l='MpServer', x=288,13, y=29,00, z=147,50], EntityCreeper['Creeper'/166, l='MpServer', x=301,41, y=26,00, z=169,31], EntityZombie['Zombie'/167, l='MpServer', x=294,13, y=44,00, z=163,69], EntitySkeleton['Skeleton'/168, l='MpServer', x=288,69, y=37,00, z=163,06], EntitySkeleton['Skeleton'/169, l='MpServer', x=288,09, y=37,00, z=162,06], EntitySquid['Squid'/170, l='MpServer', x=295,17, y=56,38, z=193,96], EntitySkeleton['Skeleton'/173, l='MpServer', x=314,94, y=33,00, z=98,53], EntityCreeper['Creeper'/174, l='MpServer', x=314,41, y=34,00, z=97,00], EntityZombie['Zombie'/175, l='MpServer', x=311,50, y=25,00, z=154,50], EntityCreeper['Creeper'/176, l='MpServer', x=310,50, y=18,00, z=155,95], EntityCreeper['Creeper'/177, l='MpServer', x=313,50, y=54,00, z=149,97], EntityCreeper['Creeper'/178, l='MpServer', x=319,28, y=54,00, z=144,44], EntityCreeper['Creeper'/179, l='MpServer', x=316,72, y=11,00, z=162,50], EntityItem['item.item.checker'/180, l='MpServer', x=305,03, y=26,13, z=170,13], EntityItem['item.tile.cactus'/181, l='MpServer', x=308,84, y=26,13, z=172,13], EntityItem['item.tile.dirt.default'/182, l='MpServer', x=304,84, y=26,13, z=170,13], EntityItem['item.tile.stoneSlab.sand'/183, l='MpServer', x=309,41, y=26,13, z=172,13], EntityItem['item.tile.stone'/184, l='MpServer', x=305,13, y=29,13, z=173,34], EntitySpider['Spider'/185, l='MpServer', x=304,38, y=15,00, z=170,72], EntityItem['item.tile.sand.default'/186, l='MpServer', x=306,47, y=32,13, z=174,88], EntityItem['item.item.sulphur'/187, l='MpServer', x=309,34, y=27,13, z=176,88], EntityZombie['Zombie'/188, l='MpServer', x=314,70, y=26,00, z=178,95], EntitySkeleton['Skeleton'/189, l='MpServer', x=307,84, y=17,00, z=176,56], EntitySkeleton['Skeleton'/202, l='MpServer', x=322,10, y=20,00, z=122,88], EntityCreeper['Creeper'/203, l='MpServer', x=335,77, y=16,00, z=109,27], EntityBat['Bat'/204, l='MpServer', x=333,02, y=55,31, z=157,01], EntitySkeleton['Skeleton'/205, l='MpServer', x=340,03, y=15,00, z=198,56], EntityZombie['Zombie'/80, l='MpServer', x=221,75, y=29,00, z=160,84], EntitySkeleton['Skeleton'/92, l='MpServer', x=232,06, y=23,00, z=158,72], EntitySkeleton['Skeleton'/93, l='MpServer', x=239,13, y=20,00, z=151,38], EntitySpider['Spider'/94, l='MpServer', x=229,16, y=23,00, z=163,78], EntitySkeleton['Skeleton'/95, l='MpServer', x=231,03, y=24,00, z=160,63], EntitySquid['Squid'/96, l='MpServer', x=226,84, y=56,39, z=202,85], EntitySquid['Squid'/97, l='MpServer', x=235,30, y=56,00, z=219,42], EntitySquid['Squid'/98, l='MpServer', x=236,53, y=56,00, z=210,90], EntitySquid['Squid'/99, l='MpServer', x=234,23, y=56,06, z=218,26], EntitySquid['Squid'/100, l='MpServer', x=232,24, y=56,00, z=206,31], EntitySpider['Spider'/108, l='MpServer', x=252,66, y=35,00, z=107,78], EntityChicken['Chicken'/109, l='MpServer', x=255,81, y=66,00, z=101,25], EntitySpider['Spider'/110, l='MpServer', x=252,28, y=29,00, z=195,22], EntityBat['Bat'/111, l='MpServer', x=246,63, y=30,10, z=206,25], EntityBat['Bat'/112, l='MpServer', x=248,78, y=28,69, z=199,56], EntityCreeper['Creeper'/117, l='MpServer', x=264,97, y=38,00, z=100,53], EntityChicken['Chicken'/119, l='MpServer', x=267,56, y=67,00, z=122,38], EntitySheep['Sheep'/120, l='MpServer', x=266,87, y=71,00, z=125,32], EntityChicken['Chicken'/121, l='MpServer', x=266,63, y=71,00, z=124,42], EntityBat['Bat'/122, l='MpServer', x=264,69, y=21,10, z=143,84], EntityCreeper['Creeper'/123, l='MpServer', x=263,03, y=24,00, z=143,38], EntityBat['Bat'/124, l='MpServer', x=263,25, y=19,10, z=134,31], EntityCreeper['Creeper'/125, l='MpServer', x=262,50, y=24,00, z=152,00], EntitySpider['Spider'/126, l='MpServer', x=262,89, y=21,77, z=158,25], EntitySheep['Sheep'/127, l='MpServer', x=258,45, y=71,00, z=147,02]]
    Retry entities: 0 total; []
    Server brand: fml,forge
    Server type: Integrated singleplayer server
    Stacktrace:
    at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:415)
    at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2566)
    at net.minecraft.client.Minecraft.run(Minecraft.java:984)
    at net.minecraft.client.main.Main.main(Main.java:164)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
    at GradleStart.main(Unknown Source)
    
    – System Details --
    Details:
    Minecraft Version: 1.7.10
    Operating System: Windows 7 (x86) version 6.1
    Java Version: 1.8.0_91, Oracle Corporation
    Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
    Memory: 781637912 bytes (745 MB) / 1046937600 bytes (998 MB) up to 1046937600 bytes (998 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94
    FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1614 4 mods loaded, 4 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
    UCHIJAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) 
    UCHIJAAAA FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar) 
    UCHIJAAAA Forge{10.13.4.1614} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar) 
    UCHIJAAAA mcv{1.0.0} [mcv] (bin) 
    GL info: ' Vendor: 'Intel' Version: '3.1.0 - Build 9.17.10.4229' Renderer: 'Intel(R) HD Graphics 3000'
    Launched Version: 1.7.10
    LWJGL: 2.9.1
    OpenGL: Intel(R) HD Graphics 3000 GL version 3.1.0 - Build 9.17.10.4229, Intel
    GL Caps: Using GL 1.3 multitexturing.
    Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
    Anisotropic filtering is supported and maximum anisotropy is 16.
    Shaders are available because OpenGL 2.1 is supported.
    
    Is Modded: Definitely; Client brand changed to 'fml,forge'
    Type: Client (map_client.txt)
    Resource Packs: []
    Current Language: English (US)
    Profiler Position: N/A (disabled)
    Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    Anisotropic Filtering: Off (1)
    [22:36:46] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:398]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\SUNABELKEK\Desktop\NewMod\eclipse\.\crash-reports\crash-2016-06-14_22.36.46-client.txt
    AL lib: (EE) alc_cleanup: 1 device not closed
    Java HotSpot(TM) Client VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
    
    

    Mon Code :

    import org.lwjgl.opengl.GL11;
    
    import com.sun.webkit.graphics.Ref;
    
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    import ma.Yeyvo.MVC.common.MvC;
    import net.minecraft.client.Minecraft;
    import net.minecraft.client.gui.FontRenderer;
    import net.minecraft.client.gui.GuiButton;
    import net.minecraft.client.gui.GuiScreen;
    import net.minecraft.client.gui.GuiTextField;
    import net.minecraft.client.resources.I18n;
    import net.minecraft.util.ResourceLocation;
    
    @SideOnly(Side.CLIENT)
    public class GuiCheker extends GuiScreen {  
    
    int guiWidth= 400; 
    
    int guiHeight= 200;
    
    private static final int width = 0;
    
    private static final int height = 0;
    
    private FontRenderer fontRendererObj;
        private GuiButton buttonSign;
    
    public void initGui()
    
       {
    
    this.textfield = new GuiTextField(this.fontRendererObj, this.width / 2 - 68, this.height / 2 -75, 100, 20);
    
    textfield.setMaxStringLength(10);
    
    textfield.setText("");
    
           this.textfield.setFocused(true);
    
       }
    protected void keyTyped(char par1, int par2)
    
       {
    
           super.keyTyped(par1, par2);
    
           this.textfield.textboxKeyTyped(par1, par2);
    
       }
    
    protected void mouseClicked(int x, int y, int btn) 
    
    {
    
           super.mouseClicked(x, y, btn);
    
           this.textfield.mouseClicked(x, y, btn);
    
       }
    
       @Override                                                               
    
    public void drawScreen(int x, int y, float ticks )
    
    {
    
        int guix =(width - guiWidth) /2 ;
                int guiy =(height - guiHeight) /2;
                GL11.glColor4f(1,1,1,1);
                this.drawDefaultBackground();
                mc.renderEngine.bindTexture(new ResourceLocation(MvC.MODID, "textures/gui/mvc.png"));
                drawTexturedModalRect(guix, guiy, 0, 0, guiWidth, guiHeight);
                this.fontRendererObj.drawString("Bienvenue ", guix +65, guiy +30, 0x404040 );
                this.buttonList.add(this.buttonSign = new GuiButton(0, guix +140, guiy +160, 100, 20, I18n.format("Vérifier !", new Object[0])));
                this.buttonList.add(this.buttonSign = new GuiButton(1, guix +380, guiy +0, 20, 20, I18n.format("X", new Object[0])));
        this.textfield.drawTextBox();
    
                super.drawScreen(x, y, ticks);
    
    }
    
       public void updateScreen()
    
       {
    
           super.updateScreen();
    
       }
    
       @Override
    
    public boolean doesGuiPauseGame()
    
    {
    
    return false;
    
    }
    
       private GuiTextField textfield;
    
    private GuiTextField text;
    
     @Override
     protected void actionPerformed(GuiButton par1)
     {
         switch (par1.id)
         {
             case 0:
                       System.out.println("Boutton 0");
                 break;
             case 1:
              this.mc.displayGuiScreen((GuiScreen) null); //retourne en jeu
              break;
         }
    
    }
    }
    


  • Le message d'erreur indique qu'à la ligne 86, tu accèdes à un objet non initialisé.

    D'après ton fichier, la ligne 86 est

    this.buttonList.add(this.buttonSign = new GuiButton(1, guix +380, guiy +0, 20, 20, I18n.format("X", new Object[0])));
    

    Mais cela n'a pas beaucoup de sens. Si celle-là plante, pourquoi est-ce que la précédente fonctionnerait ? Elles sont identiques (d'ailleurs, tu assignes deux fois de suite un GuiButton à ton this.buttonSign, à mon avis, ce n'est pas ce que tu veux).

    Donc peut-être que le fichier est décalé de 1 ligne par rapport à ce que tu as dans l'éditeur. Dans ce cas, c'est cette ligne :

    this.textfield.drawTextBox();
    

    Ce qui signifierait que this.textfield est null. Du coup, j'irai surtout vérifier que initGUI() a bien été appelée. Si la méthode n'a pas été appelée, alors textField n'a pas été initialisé.

    My guess…


  • Rédacteurs

    Comme tu l'as dis, le code envoyé est décalé d'une ligne (si c'est pas +) car il n'y a pas la déclaration de package



  • donc voila j'ai une erreur la mais je ne comprend pas vraiment pourquoi il y'a 2 minutes a peine sa marchait

    this.fontRendererObj.drawString("Bienvenue ", guix +65, guiy +30, 0x404040 );
    

    donc je la supprime et j'ai deux jolie erreur une la

                this.textfield.drawTextBox();
    

    et l'autre

    net.minecraft.client.gui.GuiTextField.drawTextBox
    

    de olus quand je fait un  Prinln dans mon initGUI je ne le retrouve pas dans les logs 😞



  • C'est quoi le problème ?


  • Administrateurs

    Le textfield semble en effet être nul, étrange.



  • Scarex j'ai un Npe ici :
     ```java
    this.textfield.drawTextBox();



  • Mets un System.out.println() dans initGui() pour être sur que c'est appelé.



  • fait dans le printlf j'ai mis test est je la trouve dans les logs donc le initGUI marche bien

    [12:22:37] [main/INFO] [GradleStart]: Extra: []
    [12:22:38] [main/INFO] [GradleStart]: Running with arguments: [–userProperties, {}, --assetsDir, C:/Users/SUNABELKEK/.gradle/caches/minecraft/assets, --assetIndex, 1.7.10, --accessToken, {REDACTED}, --version, 1.7.10, --tweakClass, cpw.mods.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
    [12:22:38] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker
    [12:22:41] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker
    [12:22:41] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
    [12:22:41] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker
    [12:22:41] [main/INFO] [FML]: Forge Mod Loader version 7.99.40.1614 for Minecraft 1.7.10 loading
    [12:22:41] [main/INFO] [FML]: Java is Java HotSpot(TM) Client VM, version 1.8.0_91, running on Windows 7:x86:6.1, installed at C:\Program Files\Java\jre1.8.0_91
    [12:22:41] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
    [12:22:42] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
    [12:22:42] [main/INFO] [GradleStart]: Injecting location in coremod cpw.mods.fml.relauncher.FMLCorePlugin
    [12:22:42] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
    [12:22:42] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
    [12:22:42] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker
    [12:22:42] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
    [12:22:42] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
    [12:22:42] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
    [12:22:42] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
    [12:22:43] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
    [12:22:47] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
    [12:22:47] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
    [12:22:47] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker
    [12:22:48] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
    [12:22:48] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.TerminalTweaker
    [12:22:48] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.TerminalTweaker
    [12:22:48] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
    [12:22:55] [main/INFO]: Setting user: Player46
    [12:23:18] [Client thread/INFO]: LWJGL Version: 2.9.1
    [12:23:40] [Client thread/INFO] [STDOUT]: [cpw.mods.fml.client.SplashProgress:start:188]: –-- Minecraft Crash Report ----
    // Surprise! Haha. Well, this is awkward.
    
    Time: 15/06/16 12:23
    Description: Loading screen debug info
    
    This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR
    
    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------
    
    -- System Details --
    Details:
    Minecraft Version: 1.7.10
    Operating System: Windows 7 (x86) version 6.1
    Java Version: 1.8.0_91, Oracle Corporation
    Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
    Memory: 968028648 bytes (923 MB) / 1046937600 bytes (998 MB) up to 1046937600 bytes (998 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: 
    GL info: ' Vendor: 'Intel' Version: '3.1.0 - Build 9.17.10.4229' Renderer: 'Intel(R) HD Graphics 3000'
    [12:23:40] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization
    [12:23:40] [Client thread/INFO] [FML]: MinecraftForge v10.13.4.1614 Initialized
    [12:23:40] [Client thread/INFO] [FML]: Replaced 183 ore recipies
    [12:23:42] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization
    [12:23:43] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer
    [12:23:43] [Client thread/INFO] [FML]: Searching C:\Users\SUNABELKEK\Desktop\NewMod\eclipse\mods for mods
    [12:24:32] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load
    [12:24:33] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, mcv] at CLIENT
    [12:24:33] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, mcv] at SERVER
    [12:24:35] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:mcv
    [12:24:35] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
    [12:24:35] [Client thread/INFO] [FML]: Found 341 ObjectHolder annotations
    [12:24:35] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations
    [12:24:35] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations
    [12:24:35] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
    [12:24:35] [Client thread/INFO] [FML]: Applying holder lookups
    [12:24:35] [Client thread/INFO] [FML]: Holder lookups applied
    [12:24:35] [Client thread/INFO] [FML]: Injecting itemstacks
    [12:24:35] [Client thread/INFO] [FML]: Itemstack injection complete
    [12:24:36] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [12:24:36] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem…
    [12:24:36] [Thread-8/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Initializing LWJGL OpenAL
    [12:24:36] [Thread-8/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:     (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
    [12:24:40] [Thread-8/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: OpenAL initialized.
    [12:24:40] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [12:24:40] [Sound Library Loader/INFO]: Sound engine started
    [12:24:48] [Client thread/INFO]: Created: 16x16 textures/blocks-atlas
    [12:24:48] [Client thread/INFO]: Created: 16x16 textures/items-atlas
    [12:24:48] [Client thread/INFO] [FML]: Injecting itemstacks
    [12:24:48] [Client thread/INFO] [FML]: Itemstack injection complete
    [12:24:49] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods
    [12:24:49] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:mcv
    [12:24:49] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas
    [12:24:50] [Client thread/INFO]: Created: 256x256 textures/items-atlas
    [12:24:50] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [12:24:50] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: SoundSystem shutting down…
    [12:24:50] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:importantMessage:90]:     Author: Paul Lamb, www.paulscode.com
    [12:24:50] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [12:24:50] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [12:24:50] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem…
    [12:24:51] [Thread-10/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Initializing LWJGL OpenAL
    [12:24:51] [Thread-10/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:     (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
    AL lib: (EE) DoReset: Failed to initialize audio client: 0x88890017
    Exception in thread "Thread-10" [12:24:51] [Thread-10/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: org.lwjgl.openal.OpenALException: Invalid Device
    [12:24:51] [Thread-10/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at org.lwjgl.openal.Util.checkALCError(Util.java:55)
    [12:24:51] [Thread-10/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at org.lwjgl.openal.ALC10.alcCreateContext(ALC10.java:251)
    [12:24:51] [Thread-10/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at org.lwjgl.openal.AL.init(AL.java:168)
    [12:24:51] [Thread-10/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at org.lwjgl.openal.AL.create(AL.java:138)
    [12:24:51] [Thread-10/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at org.lwjgl.openal.AL.create(AL.java:102)
    [12:24:51] [Thread-10/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at org.lwjgl.openal.AL.create(AL.java:201)
    [12:24:51] [Thread-10/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at paulscode.sound.libraries.LibraryLWJGLOpenAL.init(LibraryLWJGLOpenAL.java:164)
    [12:24:51] [Thread-10/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at paulscode.sound.SoundSystem.CommandNewLibrary(SoundSystem.java:1576)
    [12:24:51] [Thread-10/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at paulscode.sound.SoundSystem.CommandQueue(SoundSystem.java:2572)
    [12:24:51] [Thread-10/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at paulscode.sound.CommandThread.run(CommandThread.java:121)
    [12:24:54] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
    [12:24:54] [Client thread/ERROR] [TEXTURE ERRORS]: The following texture errors were found.
    [12:24:54] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================
    [12:24:54] [Client thread/ERROR] [TEXTURE ERRORS]:   DOMAIN mcv
    [12:24:54] [Client thread/ERROR] [TEXTURE ERRORS]: –------------------------------------------------
    [12:24:54] [Client thread/ERROR] [TEXTURE ERRORS]:   domain mcv is missing 1 texture
    [12:24:54] [Client thread/ERROR] [TEXTURE ERRORS]:     domain mcv has 1 location:
    [12:24:54] [Client thread/ERROR] [TEXTURE ERRORS]:       mod mcv resources at C:\Users\SUNABELKEK\Desktop\NewMod\bin
    [12:24:54] [Client thread/ERROR] [TEXTURE ERRORS]: –-----------------------
    [12:24:54] [Client thread/ERROR] [TEXTURE ERRORS]:     The missing resources for domain mcv are:
    [12:24:54] [Client thread/ERROR] [TEXTURE ERRORS]:       textures/items/checker.png
    [12:24:54] [Client thread/ERROR] [TEXTURE ERRORS]: –-----------------------
    [12:24:54] [Client thread/ERROR] [TEXTURE ERRORS]:     No other errors exist for domain mcv
    [12:24:54] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================
    [12:24:54] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
    [12:25:28] [Server thread/INFO]: Starting integrated minecraft server version 1.7.10
    [12:25:28] [Server thread/INFO]: Generating keypair
    [12:25:29] [Server thread/INFO] [FML]: Injecting existing block and item data into this server instance
    [12:25:30] [Server thread/INFO] [FML]: Applying holder lookups
    [12:25:30] [Server thread/INFO] [FML]: Holder lookups applied
    [12:25:30] [Server thread/INFO] [FML]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@9b4dd3)
    [12:25:30] [Server thread/INFO] [FML]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@9b4dd3)
    [12:25:30] [Server thread/INFO] [FML]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@9b4dd3)
    [12:25:30] [Server thread/INFO]: Preparing start region for level 0
    [12:25:31] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:importantMessage:90]:     ERROR MESSAGE:
    [12:25:31] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:         SoundSystem did not load after 30 seconds.
    [12:25:31] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [12:25:31] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem…
    [12:25:31] [Thread-13/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Switching to No Sound
    [12:25:31] [Thread-13/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:     (Silent Mode)
    [12:25:31] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [12:25:31] [Sound Library Loader/INFO]: Sound engine started
    [12:25:32] [Server thread/INFO]: Preparing spawn area: 0%
    [12:25:33] [Server thread/INFO]: Preparing spawn area: 32%
    [12:25:34] [Server thread/INFO]: Preparing spawn area: 63%
    [12:25:35] [Server thread/INFO]: Preparing spawn area: 85%
    [12:25:36] [Server thread/INFO]: Changing view distance to 4, from 10
    [12:25:38] [Netty Client IO #0/INFO] [FML]: Server protocol version 2
    [12:25:38] [Netty IO #1/INFO] [FML]: Client protocol version 2
    [12:25:38] [Netty IO #1/INFO] [FML]: Client attempting to join with 4 mods : mcv@1.0.0,FML@7.10.99.99,Forge@10.13.4.1614,mcp@9.05
    [12:25:38] [Netty IO #1/INFO] [FML]: Attempting connection with missing mods [] at CLIENT
    [12:25:38] [Netty Client IO #0/INFO] [FML]: Attempting connection with missing mods [] at SERVER
    [12:25:38] [Server thread/INFO] [FML]: [Server thread] Server side modded connection established
    [12:25:38] [Server thread/INFO]: Player46[local:E:1eebb7c2] logged in with entity id 274 at (268.0918215276778, 72.0, 154.53831180718174)
    [12:25:38] [Client thread/INFO] [FML]: [Client thread] Client side modded connection established
    [12:25:38] [Server thread/INFO]: Player46 joined the game
    [12:25:48] [Server thread/INFO] [STDOUT]: [ma.Yeyvo.MVC.client.GuiCheker:initGui:53]: test
    [12:25:49] [Server thread/INFO]: Stopping server
    [12:25:49] [Server thread/INFO]: Saving players
    [12:25:49] [Server thread/INFO]: Saving worlds
    [12:25:49] [Server thread/INFO]: Saving chunks for level 'New World'/Overworld
    [12:25:49] [Server thread/INFO]: Saving chunks for level 'New World'/Nether
    [12:25:49] [Server thread/INFO]: Saving chunks for level 'New World'/The End
    [12:25:51] [Server thread/INFO] [FML]: Unloading dimension 0
    [12:25:51] [Server thread/INFO] [FML]: Unloading dimension -1
    [12:25:51] [Server thread/INFO] [FML]: Unloading dimension 1
    [12:25:51] [Server thread/INFO] [FML]: Applying holder lookups
    [12:25:51] [Server thread/INFO] [FML]: Holder lookups applied
    [12:25:51] [Client thread/FATAL]: Reported exception thrown!
    net.minecraft.util.ReportedException: Rendering screen
    at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1168) ~[EntityRenderer.class:?]
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1067) ~[Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:962) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]
    at GradleStart.main(Unknown Source) [start/:?]
    Caused by: java.lang.NullPointerException
    at net.minecraft.client.gui.GuiTextField.drawTextBox(GuiTextField.java:485) ~[GuiTextField.class:?]
    at ma.Yeyvo.MVC.client.GuiCheker.drawScreen(GuiCheker.java:98) ~[GuiCheker.class:?]
    at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1137) ~[EntityRenderer.class:?]
    … 11 more
    [12:25:52] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: –-- Minecraft Crash Report ----
    // Why is it breaking :(
    
    Time: 15/06/16 12:25
    Description: Rendering screen
    
    java.lang.NullPointerException: Rendering screen
    at net.minecraft.client.gui.GuiTextField.drawTextBox(GuiTextField.java:485)
    at ma.Yeyvo.MVC.client.GuiCheker.drawScreen(GuiCheker.java:98)
    at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1137)
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1067)
    at net.minecraft.client.Minecraft.run(Minecraft.java:962)
    at net.minecraft.client.main.Main.main(Main.java:164)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
    at GradleStart.main(Unknown Source)
    
    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------
    
    -- Head --
    Stacktrace:
    at net.minecraft.client.gui.GuiTextField.drawTextBox(GuiTextField.java:485)
    at ma.Yeyvo.MVC.client.GuiCheker.drawScreen(GuiCheker.java:98)
    
    -- Screen render details --
    Details:
    Screen name: ma.Yeyvo.MVC.client.GuiCheker
    Mouse location: Scaled: (213, 119). Absolute: (427, 240)
    Screen size: Scaled: (427, 240). Absolute: (854, 480). Scale factor of 2
    
    -- Affected level --
    Details:
    Level name: MpServer
    All players: 1 total; [EntityClientPlayerMP['Player46'/274, l='MpServer', x=268,09, y=73,62, z=154,54]]
    Chunk stats: MultiplayerChunkCache: 81, 81
    Level seed: 0
    Level generator: ID 00 - default, ver 1\. Features enabled: false
    Level generator options: 
    Level spawn location: World: (261,64,162), Chunk: (at 5,4,2 in 16,10; contains blocks 256,0,160 to 271,255,175), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
    Level time: 37254 game time, 37254 day time
    Level dimension: 0
    Level storage version: 0x00000 - Unknown?
    Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
    Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
    Forced entities: 90 total; [EntityBat['Bat'/128, l='MpServer', x=265,88, y=38,51, z=98,03], EntityChicken['Chicken'/129, l='MpServer', x=260,69, y=68,00, z=107,53], EntityChicken['Chicken'/130, l='MpServer', x=263,97, y=64,00, z=121,59], EntitySheep['Sheep'/131, l='MpServer', x=271,06, y=72,00, z=124,91], EntityChicken['Chicken'/132, l='MpServer', x=266,74, y=69,00, z=123,48], EntitySheep['Sheep'/133, l='MpServer', x=258,34, y=68,00, z=122,50], EntityBat['Bat'/134, l='MpServer', x=264,69, y=21,10, z=143,84], EntityCreeper['Creeper'/135, l='MpServer', x=264,06, y=24,00, z=143,44], EntityBat['Bat'/136, l='MpServer', x=263,25, y=19,10, z=134,31], EntitySheep['Sheep'/137, l='MpServer', x=267,06, y=72,00, z=142,66], EntityCreeper['Creeper'/138, l='MpServer', x=262,31, y=24,00, z=152,06], EntitySpider['Spider'/139, l='MpServer', x=265,13, y=17,42, z=160,28], EntityCreeper['Creeper'/140, l='MpServer', x=260,28, y=32,00, z=190,63], EntityClientPlayerMP['Player46'/274, l='MpServer', x=268,09, y=73,62, z=154,54], EntityItem['item.item.egg'/150, l='MpServer', x=286,13, y=65,13, z=110,28], EntitySheep['Sheep'/151, l='MpServer', x=281,19, y=65,00, z=116,16], EntityItem['item.item.egg'/152, l='MpServer', x=285,78, y=70,13, z=116,06], EntitySkeleton['Skeleton'/153, l='MpServer', x=286,91, y=38,00, z=158,31], EntitySkeleton['Skeleton'/154, l='MpServer', x=283,69, y=40,00, z=156,31], EntitySkeleton['Skeleton'/155, l='MpServer', x=282,50, y=40,00, z=156,31], EntityZombie['Zombie'/156, l='MpServer', x=285,25, y=38,00, z=157,31], EntitySkeleton['Skeleton'/157, l='MpServer', x=287,69, y=38,00, z=158,31], EntityCreeper['Creeper'/158, l='MpServer', x=287,69, y=37,00, z=159,50], EntityZombie['Zombie'/159, l='MpServer', x=283,50, y=40,00, z=157,13], EntitySkeleton['Skeleton'/160, l='MpServer', x=285,97, y=38,00, z=158,66], EntityCreeper['Creeper'/161, l='MpServer', x=285,38, y=25,00, z=168,00], EntitySkeleton['Skeleton'/162, l='MpServer', x=284,94, y=38,00, z=172,44], EntitySkeleton['Skeleton'/163, l='MpServer', x=281,06, y=44,00, z=181,53], EntitySkeleton['Skeleton'/164, l='MpServer', x=281,31, y=44,00, z=179,91], EntityZombie['Zombie'/165, l='MpServer', x=286,16, y=17,00, z=215,53], EntityChicken['Chicken'/173, l='MpServer', x=298,38, y=64,00, z=113,56], EntityZombie['Zombie'/174, l='MpServer', x=290,59, y=31,00, z=148,03], EntityZombie['Zombie'/175, l='MpServer', x=288,13, y=29,00, z=147,50], EntityZombie['Zombie'/176, l='MpServer', x=302,41, y=47,00, z=158,94], EntityZombie['Zombie'/177, l='MpServer', x=289,31, y=23,00, z=162,06], EntityZombie['Zombie'/178, l='MpServer', x=295,00, y=45,00, z=166,50], EntitySquid['Squid'/179, l='MpServer', x=295,97, y=56,38, z=193,56], EntityZombie['Zombie'/180, l='MpServer', x=286,69, y=17,00, z=217,69], EntitySkeleton['Skeleton'/184, l='MpServer', x=313,50, y=35,00, z=96,91], EntityCreeper['Creeper'/185, l='MpServer', x=315,66, y=33,00, z=96,47], EntityCreeper['Creeper'/186, l='MpServer', x=317,38, y=54,00, z=145,00], EntityZombie['Zombie'/187, l='MpServer', x=311,50, y=25,00, z=154,50], EntityCreeper['Creeper'/188, l='MpServer', x=307,59, y=17,00, z=157,50], EntityCreeper['Creeper'/189, l='MpServer', x=313,50, y=54,00, z=149,97], EntityCreeper['Creeper'/190, l='MpServer', x=313,47, y=11,00, z=160,31], EntitySpider['Spider'/191, l='MpServer', x=302,53, y=15,00, z=173,09], EntityItem['item.item.checker'/192, l='MpServer', x=305,03, y=26,13, z=170,13], EntityItem['item.tile.cactus'/193, l='MpServer', x=308,84, y=26,13, z=172,13], EntityItem['item.tile.dirt.default'/194, l='MpServer', x=304,84, y=26,13, z=170,13], EntityItem['item.tile.stoneSlab.sand'/195, l='MpServer', x=309,41, y=26,13, z=172,13], EntityItem['item.tile.stone'/196, l='MpServer', x=305,13, y=29,13, z=173,34], EntityCreeper['Creeper'/197, l='MpServer', x=304,53, y=26,00, z=171,50], EntityItem['item.tile.sand.default'/198, l='MpServer', x=306,47, y=32,13, z=174,88], EntityItem['item.item.sulphur'/199, l='MpServer', x=309,34, y=27,13, z=176,88], EntityZombie['Zombie'/200, l='MpServer', x=314,59, y=26,00, z=179,50], EntitySkeleton['Skeleton'/201, l='MpServer', x=310,06, y=17,00, z=176,84], EntityCreeper['Creeper'/85, l='MpServer', x=214,69, y=53,00, z=185,69], EntityCreeper['Creeper'/213, l='MpServer', x=335,38, y=15,00, z=108,88], EntityCreeper['Creeper'/86, l='MpServer', x=213,31, y=53,00, z=185,69], EntitySkeleton['Skeleton'/214, l='MpServer', x=320,50, y=19,00, z=126,06], EntityZombie['Zombie'/87, l='MpServer', x=219,09, y=55,00, z=181,50], EntitySkeleton['Skeleton'/215, l='MpServer', x=335,50, y=37,00, z=124,50], EntityZombie['Zombie'/216, l='MpServer', x=331,50, y=37,00, z=127,50], EntitySkeleton['Skeleton'/217, l='MpServer', x=328,09, y=11,00, z=212,50], EntityCreeper['Creeper'/92, l='MpServer', x=231,59, y=12,00, z=88,00], EntityBat['Bat'/93, l='MpServer', x=238,28, y=15,45, z=84,47], EntityBat['Bat'/94, l='MpServer', x=234,47, y=16,10, z=86,75], EntityBat['Bat'/95, l='MpServer', x=226,75, y=19,16, z=102,31], EntityBat['Bat'/96, l='MpServer', x=231,00, y=22,10, z=95,53], EntitySkeleton['Skeleton'/97, l='MpServer', x=235,94, y=23,00, z=156,06], EntityZombie['Zombie'/98, l='MpServer', x=233,44, y=22,00, z=153,47], EntitySpider['Spider'/99, l='MpServer', x=234,00, y=23,00, z=158,94], EntitySkeleton['Skeleton'/100, l='MpServer', x=232,59, y=23,00, z=161,41], EntitySquid['Squid'/101, l='MpServer', x=230,50, y=55,00, z=204,50], EntitySquid['Squid'/102, l='MpServer', x=227,50, y=55,38, z=200,88], EntityBat['Bat'/103, l='MpServer', x=241,38, y=28,00, z=208,06], EntitySquid['Squid'/104, l='MpServer', x=236,50, y=56,00, z=220,19], EntitySquid['Squid'/105, l='MpServer', x=236,50, y=56,25, z=216,69], EntitySquid['Squid'/106, l='MpServer', x=234,69, y=56,34, z=215,16], EntityCreeper['Creeper'/113, l='MpServer', x=246,09, y=13,00, z=82,75], EntityCreeper['Creeper'/114, l='MpServer', x=243,75, y=13,00, z=91,13], EntityBat['Bat'/115, l='MpServer', x=243,06, y=16,29, z=79,69], EntitySpider['Spider'/116, l='MpServer', x=249,38, y=34,00, z=108,22], EntityZombie['Zombie'/117, l='MpServer', x=250,34, y=35,00, z=109,84], EntitySkeleton['Skeleton'/118, l='MpServer', x=241,50, y=21,00, z=142,91], EntitySpider['Spider'/119, l='MpServer', x=244,75, y=21,00, z=194,09], EntityBat['Bat'/120, l='MpServer', x=246,63, y=30,10, z=206,25], EntityCreeper['Creeper'/125, l='MpServer', x=265,75, y=38,00, z=94,06], EntityBat['Bat'/126, l='MpServer', x=266,56, y=37,47, z=78,66], EntitySpider['Spider'/127, l='MpServer', x=261,66, y=38,00, z=97,97]]
    Retry entities: 0 total; []
    Server brand: fml,forge
    Server type: Integrated singleplayer server
    Stacktrace:
    at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:415)
    at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2566)
    at net.minecraft.client.Minecraft.run(Minecraft.java:984)
    at net.minecraft.client.main.Main.main(Main.java:164)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
    at GradleStart.main(Unknown Source)
    
    – System Details --
    Details:
    Minecraft Version: 1.7.10
    Operating System: Windows 7 (x86) version 6.1
    Java Version: 1.8.0_91, Oracle Corporation
    Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
    Memory: 843519264 bytes (804 MB) / 1046937600 bytes (998 MB) up to 1046937600 bytes (998 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94
    FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1614 4 mods loaded, 4 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
    UCHIJAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) 
    UCHIJAAAA FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar) 
    UCHIJAAAA Forge{10.13.4.1614} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar) 
    UCHIJAAAA mcv{1.0.0} [mcv] (bin) 
    GL info: ' Vendor: 'Intel' Version: '3.1.0 - Build 9.17.10.4229' Renderer: 'Intel(R) HD Graphics 3000'
    Launched Version: 1.7.10
    LWJGL: 2.9.1
    OpenGL: Intel(R) HD Graphics 3000 GL version 3.1.0 - Build 9.17.10.4229, Intel
    GL Caps: Using GL 1.3 multitexturing.
    Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
    Anisotropic filtering is supported and maximum anisotropy is 16.
    Shaders are available because OpenGL 2.1 is supported.
    
    Is Modded: Definitely; Client brand changed to 'fml,forge'
    Type: Client (map_client.txt)
    Resource Packs: []
    Current Language: English (US)
    Profiler Position: N/A (disabled)
    Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    Anisotropic Filtering: Off (1)
    [12:25:52] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:398]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\SUNABELKEK\Desktop\NewMod\eclipse\.\crash-reports\crash-2016-06-15_12.25.52-client.txt
    Java HotSpot(TM) Client VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
    
    

  • Administrateurs

    Ajoutes un null check ?

    if(this.textfield != null)
    {
    this.textfield.drawTextBox();
    }
    


  • toujours le même problème

    #Mon code :(Mon code 🙂

    package ma.Yeyvo.MVC.client;
    
    import org.lwjgl.opengl.GL11;
    
    import com.sun.webkit.graphics.Ref;
    
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    import ma.Yeyvo.MVC.common.MvC;
    import net.minecraft.client.Minecraft;
    import net.minecraft.client.gui.FontRenderer;
    import net.minecraft.client.gui.GuiButton;
    import net.minecraft.client.gui.GuiScreen;
    import net.minecraft.client.gui.GuiTextField;
    import net.minecraft.client.resources.I18n;
    import net.minecraft.util.ResourceLocation;
    
    @SideOnly(Side.CLIENT)
    public class GuiCheker extends GuiScreen {  
    
    int guiWidth= 400; 
    
    int guiHeight= 200;
    
    private static final int width = 0;
    
    private static final int height = 0;
    
    private FontRenderer fontRendererObj;
        private GuiButton buttonSign;
    
    public void initGui()
    
       {
    
    this.textfield = new GuiTextField(this.fontRendererObj, this.width / 2 - 68, this.height / 2 -75, 100, 20);
    
    textfield.setMaxStringLength(10);
    
    textfield.setText("");
    
           this.textfield.setFocused(true);
           System.out.println("test");
    
       }
    protected void keyTyped(char par1, int par2)
    
       {
    
           super.keyTyped(par1, par2);
    
           this.textfield.textboxKeyTyped(par1, par2);
    
       }
    
    protected void mouseClicked(int x, int y, int btn) 
    
    {
    
           super.mouseClicked(x, y, btn);
    
           this.textfield.mouseClicked(x, y, btn);
    
       }
    
       @Override                                                               
    
    public void drawScreen(int x, int y, float ticks )
    
    {
    
        int guix =(width - guiWidth) /2 ;
                int guiy =(height - guiHeight) /2;
                GL11.glColor4f(1,1,1,1);
                this.drawDefaultBackground();
                mc.renderEngine.bindTexture(new ResourceLocation(MvC.MODID, "textures/gui/mvc.png"));
                drawTexturedModalRect(guix, guiy, 0, 0, guiWidth, guiHeight);
    
                this.buttonList.add(this.buttonSign = new GuiButton(0, guix +140, guiy +160, 100, 20, I18n.format("Vérifier !", new Object[0])));
                this.buttonList.add(this.buttonSign = new GuiButton(1, guix +380, guiy +0, 20, 20, I18n.format("X", new Object[0])));
    
                if(this.textfield != null)
                {
                   this.textfield.drawTextBox();
                }
    
                super.drawScreen(x, y, ticks);
    
    }
    
       public void updateScreen()
    
       {
    
           super.updateScreen();
    
       }
    
       @Override
    
    public boolean doesGuiPauseGame()
    
    {
    
    return false;
    
    }
    
       private GuiTextField textfield;
    
    private GuiTextField text;
    
     @Override
     protected void actionPerformed(GuiButton par1)
     {
         switch (par1.id)
         {
             case 0:
                       System.out.println("Boutton 0");
                 break;
             case 1:
              this.mc.displayGuiScreen((GuiScreen) null); //retourne en jeu
              break;
    
         }
    
    }
     }
    

    #Les logs(Les logs)



  • "at net.minecraft.client.gui.GuiTextField.drawTextBox(GuiTextField.java:485)" L'erreur est dans la classe GuiTextField, regarde ce qui peut causer un NullPointer à la ligne 485.



  • GuiTextField n'est pas une Class que j'ai créer c'est une classe de minecraft

    GuiTextField

    package net.minecraft.client.gui;
    
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    import net.minecraft.client.renderer.Tessellator;
    import net.minecraft.util.ChatAllowedCharacters;
    import org.lwjgl.opengl.GL11;
    
    @SideOnly(Side.CLIENT)
    public class GuiTextField extends Gui
    {
        private final FontRenderer field_146211_a;
        public int xPosition;
        public int yPosition;
        /** The width of this text field. */
        public int width;
        public int height;
        /** Has the current text being edited on the textbox. */
        private String text = "";
        private int maxStringLength = 32;
        private int cursorCounter;
        private boolean enableBackgroundDrawing = true;
        /** if true the textbox can lose focus by clicking elsewhere on the screen */
        private boolean canLoseFocus = true;
        /** If this value is true along with isEnabled, keyTyped will process the keys. */
        private boolean isFocused;
        /** If this value is true along with isFocused, keyTyped will process the keys. */
        private boolean isEnabled = true;
        /** The current character index that should be used as start of the rendered text. */
        private int lineScrollOffset;
        private int cursorPosition;
        /** other selection position, maybe the same as the cursor */
        private int selectionEnd;
        private int enabledColor = 14737632;
        private int disabledColor = 7368816;
        /** True if this textbox is visible */
        private boolean visible = true;
        private static final String __OBFID = "CL_00000670";
    
        public GuiTextField(FontRenderer p_i1032_1_, int p_i1032_2_, int p_i1032_3_, int p_i1032_4_, int p_i1032_5_)
        {
            this.field_146211_a = p_i1032_1_;
            this.xPosition = p_i1032_2_;
            this.yPosition = p_i1032_3_;
            this.width = p_i1032_4_;
            this.height = p_i1032_5_;
        }
    
        /**
         * Increments the cursor counter
         */
        public void updateCursorCounter()
        {
            ++this.cursorCounter;
        }
    
        /**
         * Sets the text of the textbox
         */
        public void setText(String p_146180_1_)
        {
            if (p_146180_1_.length() > this.maxStringLength)
            {
                this.text = p_146180_1_.substring(0, this.maxStringLength);
            }
            else
            {
                this.text = p_146180_1_;
            }
    
            this.setCursorPositionEnd();
        }
    
        /**
         * Returns the contents of the textbox
         */
        public String getText()
        {
            return this.text;
        }
    
        /**
         * returns the text between the cursor and selectionEnd
         */
        public String getSelectedText()
        {
            int i = this.cursorPosition < this.selectionEnd ? this.cursorPosition : this.selectionEnd;
            int j = this.cursorPosition < this.selectionEnd ? this.selectionEnd : this.cursorPosition;
            return this.text.substring(i, j);
        }
    
        /**
         * replaces selected text, or inserts text at the position on the cursor
         */
        public void writeText(String p_146191_1_)
        {
            String s1 = "";
            String s2 = ChatAllowedCharacters.filerAllowedCharacters(p_146191_1_);
            int i = this.cursorPosition < this.selectionEnd ? this.cursorPosition : this.selectionEnd;
            int j = this.cursorPosition < this.selectionEnd ? this.selectionEnd : this.cursorPosition;
            int k = this.maxStringLength - this.text.length() - (i - this.selectionEnd);
            boolean flag = false;
    
            if (this.text.length() > 0)
            {
                s1 = s1 + this.text.substring(0, i);
            }
    
            int l;
    
            if (k < s2.length())
            {
                s1 = s1 + s2.substring(0, k);
                l = k;
            }
            else
            {
                s1 = s1 + s2;
                l = s2.length();
            }
    
            if (this.text.length() > 0 && j < this.text.length())
            {
                s1 = s1 + this.text.substring(j);
            }
    
            this.text = s1;
            this.moveCursorBy(i - this.selectionEnd + l);
        }
    
        /**
         * Deletes the specified number of words starting at the cursor position. Negative numbers will delete words left of
         * the cursor.
         */
        public void deleteWords(int p_146177_1_)
        {
            if (this.text.length() != 0)
            {
                if (this.selectionEnd != this.cursorPosition)
                {
                    this.writeText("");
                }
                else
                {
                    this.deleteFromCursor(this.getNthWordFromCursor(p_146177_1_) - this.cursorPosition);
                }
            }
        }
    
        /**
         * delete the selected text, otherwsie deletes characters from either side of the cursor. params: delete num
         */
        public void deleteFromCursor(int p_146175_1_)
        {
            if (this.text.length() != 0)
            {
                if (this.selectionEnd != this.cursorPosition)
                {
                    this.writeText("");
                }
                else
                {
                    boolean flag = p_146175_1_ < 0;
                    int j = flag ? this.cursorPosition + p_146175_1_ : this.cursorPosition;
                    int k = flag ? this.cursorPosition : this.cursorPosition + p_146175_1_;
                    String s = "";
    
                    if (j >= 0)
                    {
                        s = this.text.substring(0, j);
                    }
    
                    if (k < this.text.length())
                    {
                        s = s + this.text.substring(k);
                    }
    
                    this.text = s;
    
                    if (flag)
                    {
                        this.moveCursorBy(p_146175_1_);
                    }
                }
            }
        }
    
        /**
         * see @getNthNextWordFromPos() params: N, position
         */
        public int getNthWordFromCursor(int p_146187_1_)
        {
            return this.getNthWordFromPos(p_146187_1_, this.getCursorPosition());
        }
    
        /**
         * gets the position of the nth word. N may be negative, then it looks backwards. params: N, position
         */
        public int getNthWordFromPos(int p_146183_1_, int p_146183_2_)
        {
            return this.func_146197_a(p_146183_1_, this.getCursorPosition(), true);
        }
    
        public int func_146197_a(int p_146197_1_, int p_146197_2_, boolean p_146197_3_)
        {
            int k = p_146197_2_;
            boolean flag1 = p_146197_1_ < 0;
            int l = Math.abs(p_146197_1_);
    
            for (int i1 = 0; i1 < l; ++i1)
            {
                if (flag1)
                {
                    while (p_146197_3_ && k > 0 && this.text.charAt(k - 1) == 32)
                    {
                        –k;
                    }
    
                    while (k > 0 && this.text.charAt(k - 1) != 32)
                    {
                        --k;
                    }
                }
                else
                {
                    int j1 = this.text.length();
                    k = this.text.indexOf(32, k);
    
                    if (k == -1)
                    {
                        k = j1;
                    }
                    else
                    {
                        while (p_146197_3_ && k < j1 && this.text.charAt(k) == 32)
                        {
                            ++k;
                        }
                    }
                }
            }
    
            return k;
        }
    
        /**
         * Moves the text cursor by a specified number of characters and clears the selection
         */
        public void moveCursorBy(int p_146182_1_)
        {
            this.setCursorPosition(this.selectionEnd + p_146182_1_);
        }
    
        /**
         * sets the position of the cursor to the provided index
         */
        public void setCursorPosition(int p_146190_1_)
        {
            this.cursorPosition = p_146190_1_;
            int j = this.text.length();
    
            if (this.cursorPosition < 0)
            {
                this.cursorPosition = 0;
            }
    
            if (this.cursorPosition > j)
            {
                this.cursorPosition = j;
            }
    
            this.setSelectionPos(this.cursorPosition);
        }
    
        /**
         * sets the cursors position to the beginning
         */
        public void setCursorPositionZero()
        {
            this.setCursorPosition(0);
        }
    
        /**
         * sets the cursors position to after the text
         */
        public void setCursorPositionEnd()
        {
            this.setCursorPosition(this.text.length());
        }
    
        /**
         * Call this method from your GuiScreen to process the keys into the textbox
         */
        public boolean textboxKeyTyped(char p_146201_1_, int p_146201_2_)
        {
            if (!this.isFocused)
            {
                return false;
            }
            else
            {
                switch (p_146201_1_)
                {
                    case 1:
                        this.setCursorPositionEnd();
                        this.setSelectionPos(0);
                        return true;
                    case 3:
                        GuiScreen.setClipboardString(this.getSelectedText());
                        return true;
                    case 22:
                        if (this.isEnabled)
                        {
                            this.writeText(GuiScreen.getClipboardString());
                        }
    
                        return true;
                    case 24:
                        GuiScreen.setClipboardString(this.getSelectedText());
    
                        if (this.isEnabled)
                        {
                            this.writeText("");
                        }
    
                        return true;
                    default:
                        switch (p_146201_2_)
                        {
                            case 14:
                                if (GuiScreen.isCtrlKeyDown())
                                {
                                    if (this.isEnabled)
                                    {
                                        this.deleteWords(-1);
                                    }
                                }
                                else if (this.isEnabled)
                                {
                                    this.deleteFromCursor(-1);
                                }
    
                                return true;
                            case 199:
                                if (GuiScreen.isShiftKeyDown())
                                {
                                    this.setSelectionPos(0);
                                }
                                else
                                {
                                    this.setCursorPositionZero();
                                }
    
                                return true;
                            case 203:
                                if (GuiScreen.isShiftKeyDown())
                                {
                                    if (GuiScreen.isCtrlKeyDown())
                                    {
                                        this.setSelectionPos(this.getNthWordFromPos(-1, this.getSelectionEnd()));
                                    }
                                    else
                                    {
                                        this.setSelectionPos(this.getSelectionEnd() - 1);
                                    }
                                }
                                else if (GuiScreen.isCtrlKeyDown())
                                {
                                    this.setCursorPosition(this.getNthWordFromCursor(-1));
                                }
                                else
                                {
                                    this.moveCursorBy(-1);
                                }
    
                                return true;
                            case 205:
                                if (GuiScreen.isShiftKeyDown())
                                {
                                    if (GuiScreen.isCtrlKeyDown())
                                    {
                                        this.setSelectionPos(this.getNthWordFromPos(1, this.getSelectionEnd()));
                                    }
                                    else
                                    {
                                        this.setSelectionPos(this.getSelectionEnd() + 1);
                                    }
                                }
                                else if (GuiScreen.isCtrlKeyDown())
                                {
                                    this.setCursorPosition(this.getNthWordFromCursor(1));
                                }
                                else
                                {
                                    this.moveCursorBy(1);
                                }
    
                                return true;
                            case 207:
                                if (GuiScreen.isShiftKeyDown())
                                {
                                    this.setSelectionPos(this.text.length());
                                }
                                else
                                {
                                    this.setCursorPositionEnd();
                                }
    
                                return true;
                            case 211:
                                if (GuiScreen.isCtrlKeyDown())
                                {
                                    if (this.isEnabled)
                                    {
                                        this.deleteWords(1);
                                    }
                                }
                                else if (this.isEnabled)
                                {
                                    this.deleteFromCursor(1);
                                }
    
                                return true;
                            default:
                                if (ChatAllowedCharacters.isAllowedCharacter(p_146201_1_))
                                {
                                    if (this.isEnabled)
                                    {
                                        this.writeText(Character.toString(p_146201_1_));
                                    }
    
                                    return true;
                                }
                                else
                                {
                                    return false;
                                }
                        }
                }
            }
        }
    
        /**
         * Args: x, y, buttonClicked
         */
        public void mouseClicked(int p_146192_1_, int p_146192_2_, int p_146192_3_)
        {
            boolean flag = p_146192_1_ >= this.xPosition && p_146192_1_ < this.xPosition + this.width && p_146192_2_ >= this.yPosition && p_146192_2_ < this.yPosition + this.height;
    
            if (this.canLoseFocus)
            {
                this.setFocused(flag);
            }
    
            if (this.isFocused && p_146192_3_ == 0)
            {
                int l = p_146192_1_ - this.xPosition;
    
                if (this.enableBackgroundDrawing)
                {
                    l -= 4;
                }
    
                String s = this.field_146211_a.trimStringToWidth(this.text.substring(this.lineScrollOffset), this.getWidth());
                this.setCursorPosition(this.field_146211_a.trimStringToWidth(s, l).length() + this.lineScrollOffset);
            }
        }
    
        /**
         * Draws the textbox
         */
        public void drawTextBox()
        {
            if (this.getVisible())
            {
                if (this.getEnableBackgroundDrawing())
                {
                    drawRect(this.xPosition - 1, this.yPosition - 1, this.xPosition + this.width + 1, this.yPosition + this.height + 1, -6250336);
                    drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, -16777216);
                }
    
                int i = this.isEnabled ? this.enabledColor : this.disabledColor;
                int j = this.cursorPosition - this.lineScrollOffset;
                int k = this.selectionEnd - this.lineScrollOffset;
                String s = this.field_146211_a.trimStringToWidth(this.text.substring(this.lineScrollOffset), this.getWidth());
                boolean flag = j >= 0 && j <= s.length();
                boolean flag1 = this.isFocused && this.cursorCounter / 6 % 2 == 0 && flag;
                int l = this.enableBackgroundDrawing ? this.xPosition + 4 : this.xPosition;
                int i1 = this.enableBackgroundDrawing ? this.yPosition + (this.height - 8) / 2 : this.yPosition;
                int j1 = l;
    
                if (k > s.length())
                {
                    k = s.length();
                }
    
                if (s.length() > 0)
                {
                    String s1 = flag ? s.substring(0, j) : s;
                    j1 = this.field_146211_a.drawStringWithShadow(s1, l, i1, i);
                }
    
                boolean flag2 = this.cursorPosition < this.text.length() || this.text.length() >= this.getMaxStringLength();
                int k1 = j1;
    
                if (!flag)
                {
                    k1 = j > 0 ? l + this.width : l;
                }
                else if (flag2)
                {
                    k1 = j1 - 1;
                    --j1;
                }
    
                if (s.length() > 0 && flag && j < s.length())
                {
                    this.field_146211_a.drawStringWithShadow(s.substring(j), j1, i1, i);
                }
    
                if (flag1)
                {
                    if (flag2)
                    {
                        Gui.drawRect(k1, i1 - 1, k1 + 1, i1 + 1 + this.field_146211_a.FONT_HEIGHT, -3092272);
                    }
                    else
                    {
                        this.field_146211_a.drawStringWithShadow("_", k1, i1, i);
                    }
                }
    
                if (k != j)
                {
                    int l1 = l + this.field_146211_a.getStringWidth(s.substring(0, k));
                    this.drawCursorVertical(k1, i1 - 1, l1 - 1, i1 + 1 + this.field_146211_a.FONT_HEIGHT);
                }
            }
        }
    
        /**
         * draws the vertical line cursor in the textbox
         */
        private void drawCursorVertical(int p_146188_1_, int p_146188_2_, int p_146188_3_, int p_146188_4_)
        {
            int i1;
    
            if (p_146188_1_ < p_146188_3_)
            {
                i1 = p_146188_1_;
                p_146188_1_ = p_146188_3_;
                p_146188_3_ = i1;
            }
    
            if (p_146188_2_ < p_146188_4_)
            {
                i1 = p_146188_2_;
                p_146188_2_ = p_146188_4_;
                p_146188_4_ = i1;
            }
    
            if (p_146188_3_ > this.xPosition + this.width)
            {
                p_146188_3_ = this.xPosition + this.width;
            }
    
            if (p_146188_1_ > this.xPosition + this.width)
            {
                p_146188_1_ = this.xPosition + this.width;
            }
    
            Tessellator tessellator = Tessellator.instance;
            GL11.glColor4f(0.0F, 0.0F, 255.0F, 255.0F);
            GL11.glDisable(GL11.GL_TEXTURE_2D);
            GL11.glEnable(GL11.GL_COLOR_LOGIC_OP);
            GL11.glLogicOp(GL11.GL_OR_REVERSE);
            tessellator.startDrawingQuads();
            tessellator.addVertex((double)p_146188_1_, (double)p_146188_4_, 0.0D);
            tessellator.addVertex((double)p_146188_3_, (double)p_146188_4_, 0.0D);
            tessellator.addVertex((double)p_146188_3_, (double)p_146188_2_, 0.0D);
            tessellator.addVertex((double)p_146188_1_, (double)p_146188_2_, 0.0D);
            tessellator.draw();
            GL11.glDisable(GL11.GL_COLOR_LOGIC_OP);
            GL11.glEnable(GL11.GL_TEXTURE_2D);
        }
    
        public void setMaxStringLength(int p_146203_1_)
        {
            this.maxStringLength = p_146203_1_;
    
            if (this.text.length() > p_146203_1_)
            {
                this.text = this.text.substring(0, p_146203_1_);
            }
        }
    
        /**
         * returns the maximum number of character that can be contained in this textbox
         */
        public int getMaxStringLength()
        {
            return this.maxStringLength;
        }
    
        /**
         * returns the current position of the cursor
         */
        public int getCursorPosition()
        {
            return this.cursorPosition;
        }
    
        /**
         * get enable drawing background and outline
         */
        public boolean getEnableBackgroundDrawing()
        {
            return this.enableBackgroundDrawing;
        }
    
        /**
         * enable drawing background and outline
         */
        public void setEnableBackgroundDrawing(boolean p_146185_1_)
        {
            this.enableBackgroundDrawing = p_146185_1_;
        }
    
        /**
         * Sets the text colour for this textbox (disabled text will not use this colour)
         */
        public void setTextColor(int p_146193_1_)
        {
            this.enabledColor = p_146193_1_;
        }
    
        public void setDisabledTextColour(int p_146204_1_)
        {
            this.disabledColor = p_146204_1_;
        }
    
        /**
         * Sets focus to this gui element
         */
        public void setFocused(boolean p_146195_1_)
        {
            if (p_146195_1_ && !this.isFocused)
            {
                this.cursorCounter = 0;
            }
    
            this.isFocused = p_146195_1_;
        }
    
        /**
         * Getter for the focused field
         */
        public boolean isFocused()
        {
            return this.isFocused;
        }
    
        public void setEnabled(boolean p_146184_1_)
        {
            this.isEnabled = p_146184_1_;
        }
    
        /**
         * the side of the selection that is not the cursor, may be the same as the cursor
         */
        public int getSelectionEnd()
        {
            return this.selectionEnd;
        }
    
        /**
         * returns the width of the textbox depending on if background drawing is enabled
         */
        public int getWidth()
        {
            return this.getEnableBackgroundDrawing() ? this.width - 8 : this.width;
        }
    
        /**
         * Sets the position of the selection anchor (i.e. position the selection was started at)
         */
        public void setSelectionPos(int p_146199_1_)
        {
            int j = this.text.length();
    
            if (p_146199_1_ > j)
            {
                p_146199_1_ = j;
            }
    
            if (p_146199_1_ < 0)
            {
                p_146199_1_ = 0;
            }
    
            this.selectionEnd = p_146199_1_;
    
            if (this.field_146211_a != null)
            {
                if (this.lineScrollOffset > j)
                {
                    this.lineScrollOffset = j;
                }
    
                int k = this.getWidth();
                String s = this.field_146211_a.trimStringToWidth(this.text.substring(this.lineScrollOffset), k);
                int l = s.length() + this.lineScrollOffset;
    
                if (p_146199_1_ == this.lineScrollOffset)
                {
                    this.lineScrollOffset -= this.field_146211_a.trimStringToWidth(this.text, k, true).length();
                }
    
                if (p_146199_1_ > l)
                {
                    this.lineScrollOffset += p_146199_1_ - l;
                }
                else if (p_146199_1_ <= this.lineScrollOffset)
                {
                    this.lineScrollOffset -= this.lineScrollOffset - p_146199_1_;
                }
    
                if (this.lineScrollOffset < 0)
                {
                    this.lineScrollOffset = 0;
                }
    
                if (this.lineScrollOffset > j)
                {
                    this.lineScrollOffset = j;
                }
            }
        }
    
        /**
         * if true the textbox can lose focus by clicking elsewhere on the screen
         */
        public void setCanLoseFocus(boolean p_146205_1_)
        {
            this.canLoseFocus = p_146205_1_;
        }
    
        /**
         * returns true if this textbox is visible
         */
        public boolean getVisible()
        {
            return this.visible;
        }
    
        /**
         * Sets whether or not this textbox is visible
         */
        public void setVisible(boolean p_146189_1_)
        {
            this.visible = p_146189_1_;
        }
    }
    

  • Modérateurs

    Dans ton GuiChecker, tu crées un field de type FontRenderer appelé 'fontRendererObj', que tu n'initialises pas.
    Le problème est qu'ainsi tu "caches" le fontRendererObj de GuiScreen, qui lui a une valeur et donc ne ferra pas planter GuiTextBox.

    Donc la solution est de simplement supprimer cette ligne dans GuiChecker.java:

    private FontRenderer fontRendererObj;
    


  • Merci 😄
    mais du coup l'image n'est plus centré



  • Il n'était pas centré avant non plus puisque ça plantait 🙂

    A priori, le TextGui a besoin d'un FontRenderer. Il faut donc bien lui en passer un, mais il faut le créer (ou l'obtenir). Dans ton code qui plante, tu déclares le font renderer,c'est tout.

    D'après le message précédent, j'imagine (je n'ai pas le code sous les yeux) qu'il te faut obtenir l'instance d'un font renderer depuis GuiScreen



  • @'Mokona78':

    Il n'était pas centré avant non plus puisque ça plantait 🙂

    A priori, le TextGui a besoin d'un FontRenderer. Il faut donc bien lui en passer un, mais il faut le créer (ou l'obtenir). Dans ton code qui plante, tu déclares le font renderer,c'est tout.

    D'après le message précédent, j'imagine (je n'ai pas le code sous les yeux) qu'il te faut obtenir l'instance d'un font renderer depuis GuiScreen

    [font=Ubuntu, sans-serifquoi va ou ? xD              (si il était centré avant que j'ajoute la text box)]

    PS :C'est l'u de mes premier GUI .


  • Administrateurs

    @'Mokona78':

    Il n'était pas centré avant non plus puisque ça plantait 🙂

    A priori, le TextGui a besoin d'un FontRenderer. Il faut donc bien lui en passer un, mais il faut le créer (ou l'obtenir). Dans ton code qui plante, tu déclares le font renderer,c'est tout.

    D'après le message précédent, j'imagine (je n'ai pas le code sous les yeux) qu'il te faut obtenir l'instance d'un font renderer depuis GuiScreen

    Il y a déjà une instance de FontRenderer dans GuiScreen.java, donc toutes classe extends GuiScreen en a aussi une.
    Ce n'est pas ça le problème.



  • Si je lis le code ci-dessus:

    • Je vois que GuiTextField extends Gui, et non GuiScreen.
    • Et que GuiTextField a son propre FontRenderer.
    • Un peu plus loin, je lis qu'il n'existe qu'un seul constructeur, qui prend comme premier paramètre une instance de FontRenderer.

    D'où ma réponse.



  • Ah… je viens de voir que c'est la classe créée qui hérite de GuiScreen. Du coup, ok, je comprends la réponse.