Jump to content

Mouse.isButtonDown() in multiplayer 1.12.2


poopoodice

Recommended Posts

 
 
 
 
1 minute ago, diesieben07 said:

Yes, you could send a packet when the player starts and stops holding the mouse button.

What are you trying to achieve? onUsingTick solves exactly this problem already. Why does it not work for you?

Well, the problem of onUsingTick is the item can't be damaged when holding right-click. Otherwise, it just returns a new itemstacks which interrupts the player's action (onUsingTick still being called when the player has already released the right mouse button).

Link to comment
Share on other sites

11 minutes ago, diesieben07 said:

You can override canContinueUsing to control the abort behavior.

I did find somebody says to use this method to avoid the problem on the internet but I remember that I couldn't find the method in Item class. And I've tried it again just then, still couldn't find it.

Link to comment
Share on other sites

26 minutes ago, diesieben07 said:

Update Forge. The method was added in #2805.

Alright, I'm updating now.

So if I Override it and always return true, it will be able to solve the problem, or I need to add some checkings?

And I had ran ./gradlew setupDecompWorkspace

do I still need to run ./gradlew eclipse?

Edited by poopoodice
Link to comment
Share on other sites

12 minutes ago, diesieben07 said:

You need to return true if it's okay to keep using the item. The definition of what that means is up to your use case. At minimum you should check if the new stack is a completely different Item.

Thanks ; )

Edited by poopoodice
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
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.