Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I`ve updated my mod and i have a furnace but the gui dont show no errors in console.

 

 

                                                                                Bryan

onBlockActivated code in the TileEntity please?

If you really want help, give that modder a thank you.

 

Modders LOVE thank yous.

  • Author

I used Microjunks code for this part becouse i could not fix the error for it here it is

 

 

 

    public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)

    {

        if (par1World.isRemote)

        {

            return true;

        }

        else if (!par5EntityPlayer.isSneaking())

        {

            TileEntityDarkIronFurnace var10 = (TileEntityDarkIronFurnace) par1World.getBlockTileEntity(par2, par3, par4);

            if (var10 != null)

            {

              par5EntityPlayer.openGui(Strings.instance, 0, par1World, par2, par3, par4);   

            }

            return true;

        }

        else

        {

            return false;

   

        }

    }

 

Can we see the Strings class too?

If you really want help, give that modder a thank you.

 

Modders LOVE thank yous.

  • Author

this is the strings class i worked before the update

 

public class Strings

{   

protected boolean enableStats = true;

 

 

 

 

    public static final String MOD_ID = "Darkcraft";

    public static final String Name = "Darkcraft-1.6.4 Beta-Dev";

    public static final String Version = "1.6.3 Beta-Dev";

 

    public static final String ServerProxylocation = "Darkcraft.main.ServerProxy";

    public static final String ClientProxylocation = "Darkcraft.main.ClientProxy";

public static String get(String string) {

// TODO Auto-generated method stub

return null;

}

    public boolean getEnableStats()

    {

        return this.enableStats;

    }

 

    /**

    *

    * Disable statistics for the block, the block will no count for mined or placed.

    *

    */

 

    protected Strings disableStats()

    {

        this.enableStats = false;

        return this;

    }

 

@Instance("Darkcraft")

  public static MainRegistry instance;

 

}

 

 

 

How about your gui handler?

If you really want help, give that modder a thank you.

 

Modders LOVE thank yous.

  • Author

public class GuiHandlerDIFurnace implements IGuiHandler

{

@Override

public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)

{

TileEntity tile_entity = world.getBlockTileEntity(x, y, z);

switch(id)

{

case 0: return new DarkIronFurnaceContainer(player.inventory, (TileEntityDarkIronFurnace) tile_entity);

}

return null;

}

@Override

public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)

{

TileEntity tile_entity = world.getBlockTileEntity(x, y, z);

switch(id)

{

case 0: return new GUIDarkIronFurnace(player.inventory, (TileEntityDarkIronFurnace) tile_entity);

}

return null;

}

}

did you register your gui handler and your tile entity?

If you really want help, give that modder a thank you.

 

Modders LOVE thank yous.

  • Author

heres the tile entity

            GameRegistry.registerTileEntity(TileEntityDarkIronFurnace.class, "TileEntityDarkIronFurnace");

 

and i think this is the guihandler

 

NetworkRegistry.instance().registerGuiHandler(this, GuiHandlerDIFurnace);

  • Author

I dont Know ive even changed the code to 1.6.4 furance code and no luck i have no clue?

Try using an instance of your mod file instead of using 'this'.

 

Example:

@Instance
public static YourMod instance = new YourMod();

NetworkRegistry.instance().registerGuiHandler(instance, new GuiHandler());

Does your block code override this:

    public TileEntity createNewTileEntity(World par1World)
    {
        return new TileEntityHere();
    }

Run in debug and double click in the left margin of that line of code. All the way to the left were that blue line is. You should see a circle appear. Double clicking again will remove it. Then, when that line executes, it pauses the execution, and you can mouse over the variables to see their values.

  • Author

im running in debug mode but what line of code i have outline in the middle right debug in the left top

sorry i just never debugged before

The line in block activated where you check if the tile entity is null. Or in your case, the very inconveniently named var10.

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.