mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-05 04:26:42 +00:00
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:
@ -90,8 +90,6 @@ public class BlockDataCyler implements DoubleActionBlockTool {
|
||||
BlockState newBlock = block.with(objProp, currentProperty.getValues().get(index));
|
||||
|
||||
try (EditSession editSession = session.createEditSession(player)) {
|
||||
editSession.disableBuffering();
|
||||
|
||||
try {
|
||||
editSession.setBlock(blockPoint, newBlock);
|
||||
player.print(Caption.of(
|
||||
|
@ -65,7 +65,6 @@ public class BlockReplacer implements DoubleActionBlockTool {
|
||||
|
||||
try (EditSession editSession = session.createEditSession(player)) {
|
||||
try {
|
||||
editSession.disableBuffering();
|
||||
BlockVector3 position = clicked.toVector().toBlockPoint();
|
||||
editSession.setBlock(position, pattern);
|
||||
} catch (MaxChangedBlocksException ignored) {
|
||||
|
@ -63,11 +63,14 @@ public class SinglePickaxe implements BlockTool {
|
||||
}
|
||||
|
||||
try (EditSession editSession = session.createEditSession(player)) {
|
||||
editSession.getSurvivalExtent().setToolUse(config.superPickaxeDrop);
|
||||
editSession.setBlock(blockPoint, BlockTypes.AIR.getDefaultState());
|
||||
session.remember(editSession);
|
||||
} catch (MaxChangedBlocksException e) {
|
||||
player.print(Caption.of("worldedit.tool.max-block-changes"));
|
||||
try {
|
||||
editSession.getSurvivalExtent().setToolUse(config.superPickaxeDrop);
|
||||
editSession.setBlock(blockPoint, BlockTypes.AIR.getDefaultState());
|
||||
} catch (MaxChangedBlocksException e) {
|
||||
player.print(Caption.of("worldedit.tool.max-block-changes"));
|
||||
} finally {
|
||||
session.remember(editSession);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -63,7 +63,6 @@ public class StackTool implements BlockTool {
|
||||
BlockStateHolder<?> block = editSession.getFullBlock(clicked.toVector().toBlockPoint());
|
||||
|
||||
try {
|
||||
editSession.disableBuffering();
|
||||
BlockVector3 position = clicked.toVector().toBlockPoint();
|
||||
for (int i = 0; i < range; i++) {
|
||||
position = position.add(face.toBlockVector());
|
||||
|
Reference in New Issue
Block a user