Jump to content

Recommended Posts

Posted

So, in 1.7.10, 1.8, and 1.8.9 my hacky code for breaking blocks next to the block the player broke worked (at least in SSP, never really tested it in MP...).

 

1.9 doesn't like my approach, so I need to clean it up. So, starting from scratch:

I have a sledgehammer tool and a mattock tool. One is a kind of pick, and the other is a kind of shovel. When you use them appropriately, not only do they break the block you were digging (as usual) but they also scan around for every adjacent block and break those - if they're breakable by the tool. These neighbour block candidates should drop XP, items, or blocks as appropriate (ie per Fortune, Silk Touch, etc).

 

I am scanning the neighboring blocks and making the list of candidates - I'm ideally looking for a method that takes an EntityPlayer or one of its descendants, the World, a BlockPos, and information about Fortune/Silk Touch, and breaks the block found at that BlockPos as if the EntityPlayer broke it.

 

I've found PlayerControllerMP.onPlayerDestroyBlock() and PlayerControllerMP.tryHarvestBlock() but they both seem to be for multiplayer only. Ideally I want something that works both in Singleplayer and Multiplayer. Also, not quite sure how to find them from inside the item.

 

halp?

Posted

SSP is SMP only running its own copy of the server and with only a single player connected.

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.

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.