Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/24/18 in all areas

  1. Yes. If I recall correctly, there is a method in the Item class called shouldShowEquipAnimation or showReequip or something like that, override that and return false when all that has changed is your NBT data.
    1 point
  2. I'm wondering if the logic for things like isHandActive() are getting a bit screwed up for your implementation. If you trace the call hierarchy you find that the Minecraft#proccessKeyBinds() method will only stop the use if the isHandActive() returns true. For example, you should double check your onItemRightClick() and compare with the ItemBow implementation for example to make sure you're properly setting the hand active in the first place. Part of the problem is that an item like yours is sort of a mix between vanilla item behaviors. For example, food consumes the actual item stack and checks the maximum use duration so there is code that checks to see if the item stack becomes empty, but you have a separate concept of ammo. And a bow has a concept of use but only fires once at the end of use. So I suspect that you're not quite handling some piece of the vanilla logic correctly. Maybe it is the active hand stuff. Or maybe the max use duration stuff. The other issue is that NBT isn't automatically synced between sides. It will get synced, but maybe not as quickly as you might need for your logic. So you might want to force the sync by explicitly sending an item update packet. Regarding "synchronization" though I'm not sure what you are concerned about in your console trace you posted. It looks like the client side (MAIN) detects the firing and sends that to the server which then starts firing. There is of course the problem that you should also see the client detect the stopped using, but otherwise it looks normal to me. What did you expect to see?
    1 point
  3. Well... 1) Use BlockPos.allInBox(...) instead of new BlockPos(...); and iterate over the list it returns instead 2) The more blocks you change all in one go, the longer the hitch will be 3) Look at the flag parameter to setBlockState() and see if you can avoid doing lighting recalculations until you're done
    1 point
  4. It is important in modding to learn how to help yourself. So in this case, it seems like you just have question about making particles generally. So have you looked at all the vanilla and open source mods that generate particles? Have you looked for any recent tutorials on particles? Then for the dragon specifically generating the particles, have you looked at the vanilla dragon code to understand how it attacks and how the head position is tracked? Based on that can you use a forge hook like an attack event and your understanding of the dragon code to generate the particles? When experienced modders answer questions on forums, even they often look things up. So best thing is to learn to look it up yourself? To do that, look at all the similar things you can think of and then put it together.
    1 point
×
×
  • Create New...

Important Information

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