PlotSquared icon indicating copy to clipboard operation
PlotSquared copied to clipboard

fix-silk-touch-with-instabreak

Open ch4ika opened this issue 1 year ago • 7 comments

Fixes #4358

ch4ika avatar Feb 23 '24 15:02 ch4ika

I tested your changes and your changes do not work the way you wanted. There is still no stone but cobblestone in a claimed plot with instabreak and with a silk touch pickaxe. I guess if you only give the method breakNaturally an itemstack without considering enchants it might won't work.

OneLiteFeather avatar Feb 23 '24 16:02 OneLiteFeather

I tested your changes and your changes do not work the way you wanted. There is still no stone but cobblestone in a claimed plot with instabreak and with a silk touch pickaxe. I guess if you only give the method breakNaturally an itemstack without considering enchants it might won't work.

These changes do work. See this Video please also consider reading the Paper Docs. It clearly says "Breaks the block and spawns items as if a player had digged it with a specific tool". Therefore the enchants are also considered into the method.

Tamikaschu avatar Feb 23 '24 16:02 Tamikaschu

I tested your changes and your changes do not work the way you wanted. There is still no stone but cobblestone in a claimed plot with instabreak and with a silk touch pickaxe. I guess if you only give the method breakNaturally an itemstack without considering enchants it might won't work.

These changes do work. See this Video please also consider reading the Paper Docs. It clearly says "Breaks the block and spawns items as if a player had digged it with a specific tool". Therefore the enchants are also considered into the method.

yes I already seen the docs but I tested your version in game and it is not working with the silk touch enchantment, it still drops only cobblestone. You will likely need to change the drops or check if there is a wrong method / check.

OneLiteFeather avatar Feb 23 '24 17:02 OneLiteFeather

yes I already seen the docs but I tested your version in game and it is not working with the silk touch enchantment, it still drops only cobblestone. You will likely need to change the drops or check if there is a wrong method / check.

The changes work perfectly fine as shown in the Video

Tamikaschu avatar Feb 23 '24 17:02 Tamikaschu

Looks like I took the wrong branch, but what needs to be considered is that the drops will only happen if you have a tool in your hand, which changes the way instabreak works. Instabreaks actual behaviour is to break blocks with your bare hand too which is dropping cobblestone. But at the changes cobblestone won't drop with bare hands.

OneLiteFeather avatar Feb 23 '24 18:02 OneLiteFeather

Looks like I took the wrong branch, but what needs to be considered is that the drops will only happen if you have a tool in your hand, which changes the way instabreak works. Instabreaks actual behaviour is to break blocks with your bare hand too which is dropping cobblestone. But at the changes cobblestone won't drop with bare hands.

"Set to true to allow blocks to be instantaneously broken in survival mode" The flags description doesn't say anything about the intention of the flag being instantaneously breaking blocks with your bare hand. Therefore adapting the survival mechanic where u have to use the specific tool is the only logic conclusion.

Tamikaschu avatar Feb 23 '24 18:02 Tamikaschu

As this changes existing behavior, I'd like @IntellectualSites/plotsquared-team to weigh in too. I'm generally fine with it, as it makes sense this way. But it might make sense to put it behind a configurable option (in settings.yml) so we don't break any existing setups. (I guess we could need a new section for flags there then)

SirYwell avatar Feb 24 '24 16:02 SirYwell

@ch4ika Pls add an Option so that it can be merged

nicolube avatar Feb 27 '24 15:02 nicolube

As this changes existing behavior, I'd like @IntellectualSites/plotsquared-team to weigh in too. I'm generally fine with it, as it makes sense this way. But it might make sense to put it behind a configurable option (in settings.yml) so we don't break any existing setups. (I guess we could need a new section for flags there then)

This is a reasonable explanation. I'll approve once a config option has been added.

NotMyFault avatar Feb 27 '24 17:02 NotMyFault