mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-30 18:46:40 +00:00
Added support for replacing a list of blocks with one block with //replace.
This commit is contained in:
@ -546,7 +546,7 @@ public class EditSession {
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException
|
||||
*/
|
||||
public int replaceBlocks(Region region, int fromBlockType, BaseBlock toBlock)
|
||||
public int replaceBlocks(Region region, Set<Integer> fromBlockTypes, BaseBlock toBlock)
|
||||
throws MaxChangedBlocksException {
|
||||
int affected = 0;
|
||||
|
||||
@ -561,8 +561,8 @@ public class EditSession {
|
||||
Vector pt = new Vector(x, y, z);
|
||||
int curBlockType = getBlock(pt).getID();
|
||||
|
||||
if (fromBlockType == -1 && curBlockType != 0 ||
|
||||
curBlockType == fromBlockType) {
|
||||
if (fromBlockTypes == null && curBlockType != 0 ||
|
||||
fromBlockTypes.contains(curBlockType)) {
|
||||
if (setBlock(pt, toBlock)) {
|
||||
affected++;
|
||||
}
|
||||
@ -574,8 +574,8 @@ public class EditSession {
|
||||
for (Vector pt : region) {
|
||||
int curBlockType = getBlock(pt).getID();
|
||||
|
||||
if (fromBlockType == -1 && curBlockType != 0 ||
|
||||
curBlockType == fromBlockType) {
|
||||
if (fromBlockTypes == null && curBlockType != 0 ||
|
||||
fromBlockTypes.contains(curBlockType)) {
|
||||
if (setBlock(pt, toBlock)) {
|
||||
affected++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user