Block: Invert default behaviour of silk touch (more logical)

Now, blocks do not respond to silk touch unless specifically opted into. Since this always involves custom drops in one way or another, it's easy enough to figure out which blocks need to be marked for silk touch - anything that overrides getDrops, getDropsForCompatibleTool or getSilkTouchDrops is a block which _might_ need to be flagged. Using these criteria to reduce the number of blocks needing to be checked, I was able to manually invert the behaviour as needed.

This fixes reoccurring bugs with blocks erroneously dropping themselves whenever new blocks are added and someone forgot to set that flag, granting players access to internal blocks with strange behaviour.
This commit is contained in:
Dylan K. Taylor
2020-05-21 13:02:36 +01:00
parent 72f59eca3c
commit 8e2b9b686b
38 changed files with 106 additions and 47 deletions

View File

@ -402,11 +402,10 @@ class Block{
}
/**
* Returns whether Silk Touch enchanted tools will cause this block to drop as itself. Since most blocks drop
* themselves anyway, this is implicitly true.
* Returns whether Silk Touch enchanted tools will cause this block to drop as itself.
*/
public function isAffectedBySilkTouch() : bool{
return true;
return false;
}
/**