mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 17:27:38 +00:00
Add block break effect to area pickaxe (#1770)
* Add block break effect to area pickaxe * Create pos lower * Check before queueing block effect * comment
This commit is contained in:
parent
a16074cbe4
commit
af234b284b
@ -27,7 +27,9 @@ import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.extension.platform.Platform;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
@ -73,9 +75,14 @@ public class AreaPickaxe implements BlockTool {
|
||||
if (!initialType.equals(editSession.getBlock(x, y, z).getBlockType())) {
|
||||
continue;
|
||||
}
|
||||
// FAWE start - Only queue the block break effect if setting the block is successful
|
||||
if (editSession.setBlock(x, y, z, BlockTypes.AIR.getDefaultState())) {
|
||||
|
||||
editSession.setBlock(x, y, z, BlockTypes.AIR.getDefaultState());
|
||||
|
||||
BlockVector3 pos = BlockVector3.at(x, y, z);
|
||||
((World) clicked.getExtent()).queueBlockBreakEffect(server, pos, initialType,
|
||||
clicked.toVector().toBlockPoint().distanceSq(pos));
|
||||
}
|
||||
// FAWE end
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user