mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-27 05:00:08 +08:00
Made a few commands obey //toggleplace
This commit is contained in:
parent
0830eecd48
commit
1aa08104b5
@ -532,7 +532,8 @@ public static boolean isRedstoneBlock(int id) {
|
||||
* @return
|
||||
*/
|
||||
public static boolean canTransferRedstone(int id) {
|
||||
return id == 75 // Redstone torch (off)
|
||||
return id == 27 // Powered rail
|
||||
|| id == 75 // Redstone torch (off)
|
||||
|| id == 76 // Redstone torch (on)
|
||||
|| id == 55 // Redstone wire
|
||||
|| id == 93 // Diode (off)
|
||||
|
@ -236,8 +236,9 @@ public static void replaceNear(CommandContext args, WorldEdit we,
|
||||
to = we.getBlock(player, args.getString(2));
|
||||
}
|
||||
|
||||
Vector min = player.getBlockIn().subtract(size, size, size);
|
||||
Vector max = player.getBlockIn().add(size, size, size);
|
||||
Vector base = session.getPlacementPosition(player);
|
||||
Vector min = base.subtract(size, size, size);
|
||||
Vector max = base.add(size, size, size);
|
||||
Region region = new CuboidRegion(min, max);
|
||||
|
||||
int affected = editSession.replaceBlocks(region, from, to);
|
||||
@ -258,7 +259,7 @@ public static void snow(CommandContext args, WorldEdit we,
|
||||
|
||||
int size = args.argsLength() > 0 ? Math.max(1, args.getInteger(0)) : 10;
|
||||
|
||||
int affected = editSession.simulateSnow(player.getBlockIn(), size);
|
||||
int affected = editSession.simulateSnow(session.getPlacementPosition(player), size);
|
||||
player.print(affected + " surfaces covered. Let it snow~");
|
||||
}
|
||||
|
||||
@ -276,7 +277,7 @@ public static void thaw(CommandContext args, WorldEdit we,
|
||||
|
||||
int size = args.argsLength() > 0 ? Math.max(1, args.getInteger(0)) : 10;
|
||||
|
||||
int affected = editSession.thaw(player.getBlockIn(), size);
|
||||
int affected = editSession.thaw(session.getPlacementPosition(player), size);
|
||||
player.print(affected + " surfaces thawed.");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user