mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-11-28 21:56:33 +01:00
Per player schematic listing
This commit is contained in:
parent
0e33b1f06d
commit
7926b5a3f6
@ -48,12 +48,17 @@ public class HeightMapMCAGenerator implements Extent {
|
||||
private boolean modifiedMain = false;
|
||||
|
||||
public HeightMapMCAGenerator(BufferedImage img, File regionFolder) {
|
||||
this(img.getWidth(), img.getHeight(), regionFolder);
|
||||
setHeight(img);
|
||||
}
|
||||
|
||||
public HeightMapMCAGenerator(int width, int length, File regionFolder) {
|
||||
if (!regionFolder.exists()) {
|
||||
regionFolder.mkdirs();
|
||||
}
|
||||
this.folder = regionFolder;
|
||||
this.width = img.getWidth();
|
||||
this.length = img.getHeight();
|
||||
this.width = width;
|
||||
this.length = length;
|
||||
this.area = width * length;
|
||||
heights = new byte[area];
|
||||
biomes = new byte[area];
|
||||
@ -63,6 +68,9 @@ public class HeightMapMCAGenerator implements Extent {
|
||||
char grass = (char) FaweCache.getCombined(2, 0);
|
||||
Arrays.fill(main, stone);
|
||||
Arrays.fill(floor, grass);
|
||||
}
|
||||
|
||||
public void setHeight(BufferedImage img) {
|
||||
int index = 0;
|
||||
for (int z = 0; z < length; z++) {
|
||||
for (int x = 0; x < width; x++, index++){
|
||||
|
@ -308,14 +308,18 @@ public class SchematicCommands {
|
||||
)
|
||||
@CommandPermissions("worldedit.schematic.list")
|
||||
public void list(Actor actor, CommandContext args, @Switch('p') @Optional("1") int page) throws WorldEditException {
|
||||
if (Settings.IMP.PATHS.PER_PLAYER_SCHEMATICS) {
|
||||
|
||||
}
|
||||
|
||||
File dir = worldEdit.getWorkingDirectoryFile(worldEdit.getConfiguration().saveDir);
|
||||
List<File> fileList = allFiles(dir, true);
|
||||
|
||||
if (fileList == null || fileList.isEmpty()) {
|
||||
List<File> fileList = new ArrayList<>();
|
||||
if (Settings.IMP.PATHS.PER_PLAYER_SCHEMATICS) {
|
||||
File playerDir = new File(dir, actor.getUniqueId().toString());
|
||||
if (playerDir.exists()) {
|
||||
fileList.addAll(allFiles(playerDir, true));
|
||||
}
|
||||
fileList.addAll(allFiles(dir, false));
|
||||
} else {
|
||||
fileList.addAll(allFiles(dir, true));
|
||||
}
|
||||
if (fileList.isEmpty()) {
|
||||
BBC.SCHEMATIC_NONE.send(actor);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user