Fix major security bugs (3 brushes + superpickaxe)! (#1213)

* Fix major security bugs (3 brushes + superpickaxe)!
- Due to some recent changes, FAWE could edit everything in the world, no matter other plugin protections such as PS or WG.
- Fix superpickaxe allow to bypass protections => Fix SurvivalModeExtent not taking into account protections plugins due to breaking blocks naturally to get drops.

* Adress requests
- Revert some unsuitabe changes
- Add FAWE diff comments

* Clean imports

* Adress requests

Co-authored-by: NotMyFault <mc.cache@web.de>
This commit is contained in:
Aurélien
2021-08-07 11:09:33 +02:00
committed by GitHub
parent 14b3fd2085
commit abaa347ad4
8 changed files with 61 additions and 11 deletions

View File

@ -50,6 +50,8 @@ import com.sk89q.worldedit.world.weather.WeatherType;
import javax.annotation.Nullable;
import java.nio.file.Path;
import java.util.Collection;
import java.util.Collections;
import java.util.Locale;
import java.util.Set;
@ -218,6 +220,18 @@ public interface World extends Extent, Keyed, IChunkCache<IChunkGet> {
*/
void simulateBlockMine(BlockVector3 position);
//FAWE start
/**
* Return items that may drop by destroying this block.
*
* @param position the position
* @return Block drops
*/
default Collection<BaseItemStack> getBlockDrops(BlockVector3 position) {
return Collections.emptyList();
}
//FAWE end
/**
* Gets whether the given {@link BlockState} can be placed here.
*