When a Slimefun item that doesn't have a BlockHandler is broken by a
tool that does have a BlockHandler and that tool's BlockHandler returns
true, Slimefun would stop handling the "onBlockBreak" event and would
not drop the Slimefun item that was broken but some vanilla block
instead.
This commit attempts to fix the way those events are handled, ensuring
that if a Slimefun item is broken one is dropped for the player.
The Explosive Pickaxe currently doesn't take any damage and therefore
doesn't lose durability, which isn't a desirable behavior for some of
us.
This commit adds a 'damage-on-use' item setting for EXPLOSIVE_PICKAXE,
which is disabled by default. When enabled, the Explosive Pickaxe will
get damaged for each block it breaks, in the same way a normal Diamond
Pickaxe would get damage if it were to break those blocks. This seems
to be similar to how Slimefun damages other tools.
Players can still enable Unbreaking (e.g. durability) on the pickaxe.
If we don't, opening the schematics for a Bio Reactor results in
"IllegalArgumentException: Size for custom inventory must be a multiple
of 9 between 9 and 54 slots"
And the player is simply handed the Bio Reactor, which they can place
and use. Once they do that, the Slimefun guide can't be used until they
reconnect.
For generators and reactors we show the fuels underneath the schematics
or build instructions. When there are more fuels than available space to
show them, we'll overflow, causing the custom inventory to not work and
Slimefun throwing exceptions.
Refactored the class for better readability.
* Added getPlayerByEventType method, instead of calling it directly from checkFor().
* Added pass method.
* Checking for false results first to reduce the amount of if-else.
* Renamed SlimefunItem talisman -> SlimefunItem item.
* Created new Talisman talisman = (Talisman) item, after instanceof check.
* Note: Casting the item every time to talisman clutters the code.