PocketMine-MP icon indicating copy to clipboard operation
PocketMine-MP copied to clipboard

Event when a block support is broken

Open roimee6 opened this issue 2 years ago • 13 comments

Introduction

Currently, when a block is broken because its support is broken, we can't modify the drops as in blockbreakevent, which can create duplication bugs in our plugins

I've searched all the uses of the "useBreakOn" function without a player is linked to a broken block because its support has been broken

roimee6 avatar Feb 18 '24 00:02 roimee6

The name of the event seems a bit off, but I can't think of anything else to say in English

roimee6 avatar Feb 18 '24 00:02 roimee6

What exactly do you mean by support?

pandaaaBE avatar Feb 18 '24 09:02 pandaaaBE

What exactly do you mean by support?

Support block, when the block holding the seeds, for example, is broken, this event is called for the seed block

roimee6 avatar Feb 18 '24 12:02 roimee6

This could be very useful, but the name needs to be revised. Alternatively, why not modify the blockbreak event so that it can be called here?

kaxyum avatar Feb 18 '24 20:02 kaxyum

Messing with existing events would break BC.

dktapps avatar Feb 18 '24 22:02 dktapps

I don't think this is the best name for this type of event. In any case, changing the BlockBreak event isn't the best solution either.

ShockedPlot7560 avatar Feb 19 '24 10:02 ShockedPlot7560

Really BlockBreakEvent itself is mis-named (it should be PlayerBlockBreakEvent).

Removal of support isn't the only case in which a block will get destroyed without a player present. For example, water flowing into a block will destroy it, triggering this event.

dktapps avatar Feb 19 '24 10:02 dktapps

So what name could be representative?

roimee6 avatar Feb 19 '24 16:02 roimee6

I don't have a problem with it personally. My only issue is that this will currently be called in cases where there wasn't any support to begin with.

dktapps avatar Feb 19 '24 16:02 dktapps

Really BlockBreakEvent itself is mis-named (it should be PlayerBlockBreakEvent).

Removal of support isn't the only case in which a block will get destroyed without a player present. For example, water flowing into a block will destroy it, triggering this event.

So why not create a PlayerBlockBreakEvent and a BlockBreakEvent ?

kaxyum avatar Feb 20 '24 10:02 kaxyum

Really BlockBreakEvent itself is mis-named (it should be PlayerBlockBreakEvent). Removal of support isn't the only case in which a block will get destroyed without a player present. For example, water flowing into a block will destroy it, triggering this event.

So why not create a PlayerBlockBreakEvent and a BlockBreakEvent ?

That's a big change that will break a lot of plugins

dktapps avatar Feb 20 '24 10:02 dktapps

Really BlockBreakEvent itself is mis-named (it should be PlayerBlockBreakEvent). Removal of support isn't the only case in which a block will get destroyed without a player present. For example, water flowing into a block will destroy it, triggering this event.

So why not create a PlayerBlockBreakEvent and a BlockBreakEvent ?

That's a big change that will break a lot of plugins

Yes, so why not do it for PM6?

kaxyum avatar Feb 20 '24 10:02 kaxyum

Really BlockBreakEvent itself is mis-named (it should be PlayerBlockBreakEvent). Removal of support isn't the only case in which a block will get destroyed without a player present. For example, water flowing into a block will destroy it, triggering this event.

So why not create a PlayerBlockBreakEvent and a BlockBreakEvent ?

That's a big change that will break a lot of plugins

Yes, so why not do it for PM6?

Just because we have a major version doesn't mean we should just break plugins. The benefits of making a BC break need to be weighed against the costs of changing it.

dktapps avatar Mar 04 '24 15:03 dktapps