Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[SOLVED][1.15.2] Why does GUI button not display?


Slastic
 Share

Recommended Posts

    public TotemSelectorScreen(ITextComponent titleIn) {
        super(titleIn);
    }

    private static final ResourceLocation TOTEM_GUI_TEXTURE = new ResourceLocation(Main.MOD_ID, "textures/gui/totem_selector.png");
    int xSize = 176;
    int ySize = 125;

    @Override
    public void init() {
        super.init();
        this.buttons.clear();
        this.addButton(new Button (this.width / 2 - 100, this.height - (this.height / 4) + 10, 200, 20, "totembutton", (button) -> {
            System.out.println("button testing");
        }));
    }

    @Override
    public void render(int mouseX, int mouseY, float partialTicks) {
        RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
        this.renderBackground();
        this.minecraft.getTextureManager().bindTexture(TOTEM_GUI_TEXTURE);
        int x = (this.width - this.xSize) / 2;
        int y = (this.height - this.ySize) / 2;
        this.blit(x, y, 0, 0, this.xSize, this.ySize);
    }

    @Override
    public boolean isPauseScreen() {
        return false;
    }

 

Why does GUI button not display?

I'm sorry I started recently and I am not so good at this stuff, still learning

 

Edited by Slastic
Link to comment
Share on other sites

Pretty sure this is caused by not calling super.render().

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Problem with "structure gel", which is not using the forge config system correctly. Make sure the mod is up to date. If it already is, report this to the mod author (including my message above).
    • Time: 12/4/21, 11:45 AM Description: Initializing game java.lang.ExceptionInInitializerError: null     at net.minecraft.world.item.Item.handler$zch000$getDisplayName(Item.java:529) ~[client-1.17.1-20210706.113038-srg.jar%2379!:?] {re:mixin,re:classloading,pl:mixin:A}     at net.minecraft.world.item.Item.m_7626_(Item.java) ~[client-1.17.1-20210706.113038-srg.jar%2379!:?] {re:mixin,re:classloading,pl:mixin:A}     at net.minecraft.world.item.ItemStack.m_41786_(ItemStack.java:584) ~[client-1.17.1-20210706.113038-srg.jar%2379!:?] {re:mixin,xf:fml:forge:itemstack,re:classloading,xf:fml:forge:itemstack}     at net.minecraft.world.item.ItemStack.m_41651_(ItemStack.java:620) ~[client-1.17.1-20210706.113038-srg.jar%2379!:?] {re:mixin,xf:fml:forge:itemstack,re:classloading,xf:fml:forge:itemstack}     at net.minecraft.client.Minecraft.m_91316_(Minecraft.java:695) ~[client-1.17.1-20210706.113038-srg.jar%2379!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.searchtree.ReloadableSearchTree.m_8074_(SourceFile:36) ~[client-1.17.1-20210706.113038-srg.jar%2379!:?] {re:classloading}     at net.minecraft.client.searchtree.ReloadableIdSearchTree.m_8080_(SourceFile:48) ~[client-1.17.1-20210706.113038-srg.jar%2379!:?] {re:classloading}     at net.minecraft.client.Minecraft.lambda$createSearchTrees$10(Minecraft.java:713) ~[client-1.17.1-20210706.113038-srg.jar%2379!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?] {re:mixin}     at net.minecraft.client.Minecraft.m_91271_(Minecraft.java:712) ~[client-1.17.1-20210706.113038-srg.jar%2379!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.<init>(Minecraft.java:506) ~[client-1.17.1-20210706.113038-srg.jar%2379!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:151) ~[client-1.17.1-20210706.113038-srg.jar%2379!:?] {re:classloading,pl:runtimedistcleaner:A}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[?:?] {}     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}     at java.lang.reflect.Method.invoke(Method.java:567) ~[?:?] {}     at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:45) ~[fmlloader-1.17.1-37.0.112.jar%2322!:?] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:90) [bootstraplauncher-0.1.17.jar:?] {} Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext.getModEventBus()" because the return value of "net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext.get()" is null     at com.legacy.structure_gel.core.SGConfig$Common.<init>(SGConfig.java:49) ~[structure_gel-1.17.1-2.0.1.jar%2374!:2.0.1] {re:classloading}     at net.minecraftforge.common.ForgeConfigSpec$Builder.configure(ForgeConfigSpec.java:618) ~[forge-1.17.1-37.0.112-universal.jar%2383!:?] {re:classloading}     at com.legacy.structure_gel.core.SGConfig.<clinit>(SGConfig.java:25) ~[structure_gel-1.17.1-2.0.1.jar%2374!:2.0.1] {re:mixin,re:classloading}     ... 25 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Render thread Stacktrace:     at net.minecraft.world.item.Item.handler$zch000$getDisplayName(Item.java:529) ~[client-1.17.1-20210706.113038-srg.jar%2379!:?] {re:mixin,re:classloading,pl:mixin:A}     at net.minecraft.world.item.Item.m_7626_(Item.java) ~[client-1.17.1-20210706.113038-srg.jar%2379!:?] {re:mixin,re:classloading,pl:mixin:A}     at net.minecraft.world.item.ItemStack.m_41786_(ItemStack.java:584) ~[client-1.17.1-20210706.113038-srg.jar%2379!:?] {re:mixin,xf:fml:forge:itemstack,re:classloading,xf:fml:forge:itemstack}     at net.minecraft.world.item.ItemStack.m_41651_(ItemStack.java:620) ~[client-1.17.1-20210706.113038-srg.jar%2379!:?] {re:mixin,xf:fml:forge:itemstack,re:classloading,xf:fml:forge:itemstack}     at net.minecraft.client.Minecraft.m_91316_(Minecraft.java:695) ~[client-1.17.1-20210706.113038-srg.jar%2379!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.searchtree.ReloadableSearchTree.m_8074_(SourceFile:36) ~[client-1.17.1-20210706.113038-srg.jar%2379!:?] {re:classloading}     at net.minecraft.client.searchtree.ReloadableIdSearchTree.m_8080_(SourceFile:48) ~[client-1.17.1-20210706.113038-srg.jar%2379!:?] {re:classloading}     at net.minecraft.client.Minecraft.lambda$createSearchTrees$10(Minecraft.java:713) ~[client-1.17.1-20210706.113038-srg.jar%2379!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?] {re:mixin}     at net.minecraft.client.Minecraft.m_91271_(Minecraft.java:712) ~[client-1.17.1-20210706.113038-srg.jar%2379!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.<init>(Minecraft.java:506) ~[client-1.17.1-20210706.113038-srg.jar%2379!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A} -- Initialization -- Details: Stacktrace:     at net.minecraft.client.main.Main.main(Main.java:151) ~[client-1.17.1-20210706.113038-srg.jar%2379!:?] {re:classloading,pl:runtimedistcleaner:A}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[?:?] {}     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}     at java.lang.reflect.Method.invoke(Method.java:567) ~[?:?] {}     at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:45) ~[fmlloader-1.17.1-37.0.112.jar%2322!:?] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:90) [bootstraplauncher-0.1.17.jar:?] {}
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.