Jump to content

Recommended Posts

Posted

This isn't more of a problem, as it is plainly annoying. I am creating a block with a Gui, Container, and all that fancy work. When I right click my block, the container opens just fine. But, when I attempt to right click it with an item in my hand, it doesn't seem to work.

 

#onBlockActivated in my block class:

public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) {
	if(world.isRemote || player.isSneaking()) {
		return false;
	}else {
		FMLNetworkHandler.openGui(player, ModMain.instance, ModMain.GUI_UPGRADE_STATION, world, pos.getX(), pos.getY(), pos.getZ());

		return true;
	}
}

 

If you need any other classes, just ask!

I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.

Posted

I assume you debugged if this method gets called when you right-click with an item? Minecraft might be trying to do something else that pertains to the Item you are holding - something along the lines of the Item's function taking precedence over block activation (which wouldn't make sense since Buttons and Chests work alright). Maybe the error is outside the class?

I do pony stuff :3

Posted

I'm not sure. It seems when I hold anything in my hand, it won't activate. This has never happened before, so perhaps it is a 1.8 bug?

I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.

Posted

Seems like I can activate it with an item in my hand, but not a block. :/

I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.

Posted

Check out the ItemBlock class.. I think when you sneak you can't use ItemBlocks to interact with other blocks.

 

This. Shift-Click with blocks by vanilla bypasses block activation and places the block.

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.

Posted

Check out the ItemBlock class.. I think when you sneak you can't use ItemBlocks to interact with other blocks.

 

This. Shift-Click with blocks by vanilla bypasses block activation and places the block.

 

But... He's not talking about sneaking at all... It happens while he's standing?

I do pony stuff :3

Posted

It happens while standing. :/ Has this been happening to anyone else?

I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.

Posted

I've recently written some code that was dependent on detecting ItemBlocks being used trying to activate a block. This is not a problem on Forge 1.8-11.14. It's quite possible this is a genuine bug for 1.8.8. You should consider opening an issue on GitHub.

I still haven't published a mod because I can never get that in-dev version just right to warrant a public release. And yes, after two years of mod development I am still learning to speak Java.

 

Follow me on GitHub: https://github.com/yooksi

Contact me on Twitter: https://twitter.com/yooksi

Read my Minecraft blog: https://yooksidoesminecraft.blogspot.de/

Posted

I opened an issue, although I am still wondering if I am doing anything wrong. I never added a block with a gui in 1.8, only when I updated to 1.8.8. I might try to do the same in 1.8.9, and see if I get the same result.

I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.

  • 2 weeks later...
Posted

Can you link the issue on GitHub here?

Might be easier to find out what was the problem like this for the rest of us.

I still haven't published a mod because I can never get that in-dev version just right to warrant a public release. And yes, after two years of mod development I am still learning to speak Java.

 

Follow me on GitHub: https://github.com/yooksi

Contact me on Twitter: https://twitter.com/yooksi

Read my Minecraft blog: https://yooksidoesminecraft.blogspot.de/

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...

×   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.

Announcements



×
×
  • Create New...

Important Information

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