mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-13 14:58:35 +00:00
reduce diff
This commit is contained in:
@ -127,12 +127,12 @@ public class BiomeCommands {
|
||||
return;
|
||||
}
|
||||
|
||||
BiomeType biome = player.getWorld().getBiome(blockPosition.toBlockPoint().toBlockVector2());
|
||||
BiomeType biome = player.getWorld().getBiome(blockPosition.toVector().toBlockPoint().toBlockVector2());
|
||||
biomes.add(biome);
|
||||
|
||||
qualifier = "at line of sight point";
|
||||
} else if (usePosition) {
|
||||
BiomeType biome = player.getWorld().getBiome(player.getLocation().toBlockPoint().toBlockVector2());
|
||||
BiomeType biome = player.getWorld().getBiome(player.getLocation().toVector().toBlockPoint().toBlockVector2());
|
||||
biomes.add(biome);
|
||||
|
||||
qualifier = "at your position";
|
||||
@ -145,11 +145,9 @@ public class BiomeCommands {
|
||||
biomes.add(world.getBiome(pt));
|
||||
}
|
||||
} else {
|
||||
RegionVisitor visitor = new RegionVisitor(region, pt -> {
|
||||
for (BlockVector3 pt : region) {
|
||||
biomes.add(world.getBiome(pt.toBlockVector2()));
|
||||
return true;
|
||||
});
|
||||
Operations.completeBlindly(visitor);
|
||||
}
|
||||
}
|
||||
|
||||
qualifier = "in your selection";
|
||||
|
@ -448,15 +448,17 @@ public class ClipboardCommands {
|
||||
BlockVector3 to = atOrigin ? clipboard.getOrigin() : session.getPlacementPosition(actor);
|
||||
checkPaste(actor, editSession, to, holder, clipboard);
|
||||
|
||||
Operation operation = holder
|
||||
.createPaste(editSession)
|
||||
.to(to)
|
||||
.ignoreAirBlocks(ignoreAirBlocks)
|
||||
.copyBiomes(pasteBiomes)
|
||||
.copyEntities(pasteEntities)
|
||||
.maskSource(sourceMask)
|
||||
.build();
|
||||
Operations.completeLegacy(operation);
|
||||
if (!onlySelect) {
|
||||
Operation operation = holder
|
||||
.createPaste(editSession)
|
||||
.to(to)
|
||||
.ignoreAirBlocks(ignoreAirBlocks)
|
||||
.copyBiomes(pasteBiomes)
|
||||
.copyEntities(pasteEntities)
|
||||
.maskSource(sourceMask)
|
||||
.build();
|
||||
Operations.completeLegacy(operation);
|
||||
}
|
||||
|
||||
if (selectPasted || onlySelect) {
|
||||
BlockVector3 clipboardOffset = clipboard.getRegion().getMinimumPoint().subtract(clipboard.getOrigin());
|
||||
|
@ -194,7 +194,7 @@ public class GeneralCommands {
|
||||
} else {
|
||||
session.setUseServerCUI(true);
|
||||
session.updateServerCUI(player);
|
||||
player.print("Server CUI enabled. This only supports cuboid regions, with a maximum size of 32×32×32.");
|
||||
player.print("Server CUI enabled. This only supports cuboid regions, with a maximum size of 32x32x32.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -231,35 +231,33 @@ public class HistoryCommands {
|
||||
@Arg(name = "player", desc = "Undo this player's operations", def = "")
|
||||
String playerName) throws WorldEditException {
|
||||
times = Math.max(1, times);
|
||||
LocalSession undoSession;
|
||||
LocalSession undoSession = session;
|
||||
if (session.hasFastMode()) {
|
||||
player.print(BBC.COMMAND_UNDO_DISABLED.s());
|
||||
return;
|
||||
}
|
||||
if (playerName != null && !playerName.isEmpty()) {
|
||||
if (playerName != null) {
|
||||
player.checkPermission("worldedit.history.undo.other");
|
||||
undoSession = worldEdit.getSessionManager().findByName(playerName);
|
||||
if (undoSession == null) {
|
||||
BBC.COMMAND_HISTORY_OTHER_ERROR.send(player, playerName);
|
||||
player.printError("Unable to find session for " + playerName);
|
||||
return;
|
||||
}
|
||||
}
|
||||
int timesUndone = 0;
|
||||
for (int i = 0; i < times; ++i) {
|
||||
EditSession undone = undoSession.undo(undoSession.getBlockBag(player), player);
|
||||
if (undone != null) {
|
||||
timesUndone++;
|
||||
worldEdit.flushBlockBag(player, undone);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (timesUndone > 0) {
|
||||
player.print("Undid " + timesUndone + " available edits.");
|
||||
} else {
|
||||
undoSession = session;
|
||||
}
|
||||
int finalTimes = times;
|
||||
EditSession undone = null;
|
||||
int i = 0;
|
||||
for (; i < finalTimes; ++i) {
|
||||
undone = undoSession.undo(undoSession.getBlockBag(player), player);
|
||||
if (undone == null) break;
|
||||
worldEdit.flushBlockBag(player, undone);
|
||||
}
|
||||
if (undone == null) i--;
|
||||
if (i > 0) {
|
||||
BBC.COMMAND_UNDO_SUCCESS.send(player, i == 1 ? "" : " x" + i);
|
||||
}
|
||||
if (undone == null) {
|
||||
player.printError(BBC.COMMAND_UNDO_ERROR.s());
|
||||
player.printError("Nothing left to undo.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,13 +59,11 @@ public class QueryTool implements BlockTool {
|
||||
builder.append(TextComponent.of(block.getBlockType().getName(), TextColor.YELLOW));
|
||||
builder.append(TextComponent.of(" (" + block + ") ", TextColor.GRAY)
|
||||
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Block state"))));
|
||||
/*
|
||||
final OptionalInt internalId = BlockStateIdAccess.getBlockStateId(block.toImmutableState());
|
||||
if (internalId.isPresent()) {
|
||||
builder.append(TextComponent.of(" (" + internalId.getAsInt() + ") ", TextColor.DARK_GRAY)
|
||||
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Internal ID"))));
|
||||
}
|
||||
*/
|
||||
builder.append(TextComponent.of(" (" + world.getBlockLightLevel(blockPoint) + "/"
|
||||
+ world.getBlockLightLevel(blockPoint.add(0, 1, 0)) + ")", TextColor.WHITE)
|
||||
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Block Light/Light Above"))));
|
||||
|
Reference in New Issue
Block a user