Jump to content

Recommended Posts

Posted

Is this part still being developed? As I see the comment

 

//TODO: Hook interact event here...

 

in NetHandlerPlayServer#processPlayerBlockPlacement.

 

Was needing it, onItemUseFirst, for a mod I wanted to modify to be able to work with 1.9 when I came across the comment. So wasn't sure if there was a change of events or if it just hadn't been implemented yet.

Posted

 

 

may the forge version ?

 

i make some test coz also am updating items from 1.8 and has some trouble replacing the item

 

and test

[09:02:08] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.materiales.materialesHierroAlrojo:onItemUse:67]: 
onItemUse hand=OFF_HAND mundo=true
[09:02:08] [server thread/INFO] [sTDOUT]: [mercenarymod.items.materiales.materialesHierroAlrojo:onItemUse:67]:
onItemUse hand=OFF_HAND mundo=false
[09:02:12] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.materiales.materialesHierroAlrojo:onItemUse:67]:
onItemUse hand=MAIN_HAND mundo=true
[09:02:12] [server thread/INFO] [sTDOUT]: [mercenarymod.items.materiales.materialesHierroAlrojo:onItemUse:67]: 
onItemUse hand=MAIN_HAND mundo=false

 

 

   @Override
    public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
    {
	//chat.chatm(playerIn, "onItemUse hand="+hand+" mundo="+worldIn.isRemote);
	System.out.println("onItemUse hand="+hand+" mundo="+worldIn.isRemote);
        return EnumActionResult.PASS;
    }

 

 

or may you still use the method as declared in 1.8,

Posted

Using the latest forge: 12.16.0.1802.

 

While onItemUse is called on both sides, I need onItemUseFirst as it is called before the block being right clicked is activated, allowing me to prevent any action it might initiate.

Posted

mi error

 

now i second it

 

[11:37:35] [main/INFO] [FML]: Forge Mod Loader version 12.16.0.1802 for Minecraft 1.9 loading

[11:37:35] [main/INFO] [FML]: Java is Java HotSpot 64-Bit Server VM, version 1.8.0_65, running on Linux:amd64:3.16.0-4-amd64, installed at /opt/jdk1.8.0_65/jre

 

[11:40:20] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.materiales.materialesHierroAlrojo:onItemUseFirst:71]: onItemUseFirst hand=OFF_HAND mundo=true
[11:40:22] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.materiales.materialesHierroAlrojo:onItemUseFirst:71]: onItemUseFirst hand=OFF_HAND mundo=true
[11:40:25] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.materiales.materialesHierroAlrojo:onItemUseFirst:71]: onItemUseFirst hand=MAIN_HAND mundo=true
[11:40:26] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.materiales.materialesHierroAlrojo:onItemUseFirst:71]: onItemUseFirst hand=MAIN_HAND mundo=true

 

forge

 

it only works local side

Posted

We are actually debating on removing onFirstUse as the new mechanics in place make it redundant and the common practice being SHIFT click being the same effect as onFirstUse.

I'd like to see your argumetns for keeping it so that we can be better informed of how the community is using this hook and better decide if it's needed anymore of not.

 

On the other side of that, Interact events are being re-worked as the entire interaction system changed in 1.9.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

The only argument I can think of is that since onItemUseFirst is called before the block's onRightClick, or whatever the actual event name is, I can return EnumActionResult.SUCCESS and the block's event will not be triggered. Not sure if the new mechanics you mention can do this, if so could you point me in the direction of them?

 

The only reason for wanting to prevent the block's event is in the case of mods like StorageDrawers. The item will get stored on normal right click, and I was wanting to prevent storing of the item all together in those types of mod.

Posted

Then sneak click and have your item return true for 'doesSneakBypassBlock' or whatever the hook is named.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

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.