Pocketmine-mp: Explosions do not drop expected items

Created on 14 Mar 2018  路  5Comments  路  Source: pmmp/PocketMine-MP

Issue description


When using an explosion (TNT, explodeA(), etc.) it doesn鈥檛 drop every block it should.

  • Expected result: The explosion drops stone and other items that require tools to gather.
  • Actual result: Only blocks that didn鈥檛 require tools to drop spawned.

Steps to reproduce the issue

  1. Use any method of an explosion.
  2. Check the results on the explosion.
  3. Be amazed that only certain blocks dropped.

OS and versions

  • PocketMine-MP: fa644edef3db4abaa050cb9cb0aaa94170e132df
  • PHP: 7.2.1
  • Server OS: Windows 10
  • Game version: Both

Plugins

  • Test on a clean server without plugins: is the issue reproducible without any plugins loaded?

There are no plugins loaded.
If the issue is not reproducible without plugins:

  • Have you asked for help on our forums before creating an issue?
  • Can you provide sample, minimal reproducing code for the issue? If so, paste it in the bottom section
  • Paste your list of plugins here (use the 'plugins' command in PocketMine-MP)

Crashdump, backtrace or other files

  • Do not paste crashdumps into an issue - please use our Crash Archive at https://crash.pmmp.io for submitting crash reports to not spam the issue tracker. Add links to your reports in the Crash Archive here.
  • Please use gist or anything else to add other files and add links here
  • ...
Gameplay Debugged

Most helpful comment

I would prefer not adding more methods for this if it can be reasonably avoided.

All 5 comments

might be due to this https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/level/Explosion.php#L201

$air = ItemFactory::get(Item::AIR);
foreach($blocks as $block){
    foreach($block->getDrops($air) as $drop){...}
}

@Muqsit, a temporary fix is changing getDrops to getDropsForCompatibleTool() which doesn鈥檛 completely fix it.

The problem here is that getDrops() requires a compatible tool. However circumventing the tool check is not a correct fix (this will cause tallgrass and other things to drop).

@dktapps why not add a new function like getSilkTouchDrops,
$block->getExplosionDrops()?

I would prefer not adding more methods for this if it can be reasonably avoided.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

HipsterAF picture HipsterAF  路  3Comments

jasonwynn10 picture jasonwynn10  路  3Comments

nmo0ory picture nmo0ory  路  3Comments

JoshuaACasey picture JoshuaACasey  路  3Comments

dktapps picture dktapps  路  3Comments