Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-05 11:00:05 +01:00
Added particle effects to area and recursive pickaxe.
Dieser Commit ist enthalten in:
Ursprung
6be514cdf9
Commit
36e4b99ade
@ -63,13 +63,16 @@ public class AreaPickaxe implements BlockTool {
|
||||
for (int y = oy - range; y <= oy + range; ++y) {
|
||||
for (int z = oz - range; z <= oz + range; ++z) {
|
||||
Vector pos = new Vector(x, y, z);
|
||||
if (world.getBlockType(pos) == initialType) {
|
||||
if (config.superPickaxeManyDrop) {
|
||||
world.simulateBlockMine(pos);
|
||||
}
|
||||
|
||||
editSession.setBlock(pos, air);
|
||||
if (world.getBlockType(pos) != initialType) {
|
||||
continue;
|
||||
}
|
||||
if (config.superPickaxeManyDrop) {
|
||||
world.simulateBlockMine(pos);
|
||||
}
|
||||
|
||||
world.queueBlockBreakEffect(server, pos, initialType, clicked.distanceSq(pos));
|
||||
|
||||
editSession.setBlock(pos, air);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ package com.sk89q.worldedit.tools;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.sk89q.worldedit.*;
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
import com.sk89q.worldedit.blocks.BlockID;
|
||||
@ -90,21 +91,25 @@ public class RecursivePickaxe implements BlockTool {
|
||||
Set<BlockVector> visited, boolean drop)
|
||||
throws MaxChangedBlocksException {
|
||||
|
||||
if (origin.distance(pos) > size || visited.contains(pos)) {
|
||||
final double distanceSq = origin.distanceSq(pos);
|
||||
if (distanceSq > size*size || visited.contains(pos)) {
|
||||
return;
|
||||
}
|
||||
|
||||
visited.add(pos);
|
||||
|
||||
if (editSession.getBlock(pos).getType() == initialType) {
|
||||
if (drop) {
|
||||
world.simulateBlockMine(pos);
|
||||
}
|
||||
editSession.setBlock(pos, air);
|
||||
} else {
|
||||
if (editSession.getBlock(pos).getType() != initialType) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (drop) {
|
||||
world.simulateBlockMine(pos);
|
||||
}
|
||||
|
||||
world.queueBlockBreakEffect(server, pos, initialType, distanceSq);
|
||||
|
||||
editSession.setBlock(pos, air);
|
||||
|
||||
recurse(server, editSession, world, pos.add(1, 0, 0).toBlockVector(),
|
||||
origin, size, initialType, visited, drop);
|
||||
recurse(server, editSession, world, pos.add(-1, 0, 0).toBlockVector(),
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren