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

Hey Guys,

 

Sorry to have to post, I'm not usually one to do so, but I'm really stuck.

 

After setting up my furnace, right clicking on it in-game does nothing, if someone would be kind enough to take a look at my code to see if anything is amiss that would we great.

 

Here's a .zip to download if you want it

https://dl.dropbox.com/u/31947512/sourcecode.zip

Virus Total - https://www.virustotal.com/en/file/69a28fd31a38d8bf029b4973766208e74a8a5c6753b753a5420718fcf10e0f52/analysis/1361628225/

 

And here's a folder in my SkyDrive account if you would rather use it.

http://sdrv.ms/ZpLD6y

 

This line in BlockMyFurnace DOES print to the console on right click

System.out.println("Trying to open GUI...");

 

Please note that I have renamed my mod and furnace to protect it's identity.

 

Thanks a lot for any responses,

 

JPiiONEFOURONE

 

EDIT: This mod is NOT a server mod. I have added Network annotations purely to try fixing this problem.

try doing this for your onActivated method in the block class

@Override
        public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
        {
        	TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
        	if (tileEntity == null || player.isSneaking())
        	{
        		return false;
        	}
	player.openGui(MyMod.instance, 0, world, x, y, z);
	return true;
        	}
        }

and make sure the two methods in the GUI handler have the EXACT same code in each of them, or the inventory will be buggy when it's opened

  • Author

try doing this for your onActivated method in the block class

@Override
        public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
        {
        	TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
        	if (tileEntity == null || player.isSneaking())
        	{
        		return false;
        	}
	player.openGui(MyMod.instance, 0, world, x, y, z);
	return true;
        	}
        }

and make sure the two methods in the GUI handler have the EXACT same code in each of them, or the inventory will be buggy when it's opened

 

One more problem you might be able to help me with.

 

If I make the code in the server element the same as in the client element like you said, it crashes the game when I open the gui, and if I don't put it the same, the gui is buggy also like you said.

 

Any pointers? I can post the errors if you want.

 

Thanks,

 

JPiiONEFOURONE

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.