Merge pull request 'Remove System.out calls' (#128) from remove_system_out into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: #128 Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Commit
418b122f02
@ -123,37 +123,22 @@ public class FlatteningWrapper15 implements FlatteningWrapper {
|
||||
private static final BaseBlock CONCRETE_POWDER = Objects.requireNonNull(BlockTypes.PINK_CONCRETE_POWDER).getDefaultState().toBaseBlock();
|
||||
private static final BaseBlock CARPET = Objects.requireNonNull(BlockTypes.PINK_CARPET).getDefaultState().toBaseBlock();
|
||||
|
||||
private final Map<String, Long> timing = new HashMap<>();
|
||||
|
||||
private void start(String name) {
|
||||
timing.put(name, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
private long stop(String name) {
|
||||
return System.currentTimeMillis() - timing.getOrDefault(name, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
@Override
|
||||
public EditSession paste(File file, Point pastePoint, PasteOptions pasteOptions) {
|
||||
start("clipboardLoad");
|
||||
Clipboard clipboard;
|
||||
try (ClipboardReader reader = Objects.requireNonNull(ClipboardFormats.findByFile(file)).getReader(new FileInputStream(file))) {
|
||||
clipboard = reader.read();
|
||||
} catch (NullPointerException | IOException e) {
|
||||
throw new SecurityException("Bausystem schematic not found", e);
|
||||
}
|
||||
System.out.println("Clipboard Load: " + stop("clipboardLoad"));
|
||||
|
||||
start("paste");
|
||||
EditSession editSession = paste(clipboard, pastePoint, pasteOptions);
|
||||
System.out.println("Paste: " + stop("paste"));
|
||||
return editSession;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EditSession paste(Clipboard clipboard, Point pastePoint, PasteOptions pasteOptions) {
|
||||
try (EditSession e = WorldEdit.getInstance().getEditSessionFactory().getEditSession(new BukkitWorld(Bukkit.getWorlds().get(0)), -1)) {
|
||||
start("changeColor");
|
||||
if (pasteOptions.getColor() != Color.YELLOW) {
|
||||
changeColor(clipboard, pasteOptions.getColor());
|
||||
}
|
||||
@ -187,9 +172,7 @@ public class FlatteningWrapper15 implements FlatteningWrapper {
|
||||
}
|
||||
});
|
||||
}
|
||||
System.out.println("ChangeColor: " + stop("changeColor"));
|
||||
|
||||
start("transform");
|
||||
ClipboardHolder ch = new ClipboardHolder(clipboard);
|
||||
BlockVector3 dimensions = clipboard.getDimensions();
|
||||
BlockVector3 v = BlockVector3.at(pastePoint.getX(), pastePoint.getY(), pastePoint.getZ());
|
||||
@ -200,19 +183,14 @@ public class FlatteningWrapper15 implements FlatteningWrapper {
|
||||
} else {
|
||||
v = v.subtract(dimensions.getX() / 2, 0, dimensions.getZ() / 2).subtract(offset);
|
||||
}
|
||||
System.out.println("Transform: " + stop("transform"));
|
||||
|
||||
start("reset");
|
||||
if (pasteOptions.isReset()) {
|
||||
e.setBlocks((Region) new CuboidRegion(toBlockVector3(pasteOptions.getMinPoint()), toBlockVector3(pasteOptions.getMaxPoint())), Objects.requireNonNull(BlockTypes.AIR).getDefaultState().toBaseBlock());
|
||||
if (pasteOptions.getWaterLevel() != 0) {
|
||||
e.setBlocks((Region) new CuboidRegion(toBlockVector3(pasteOptions.getMinPoint()), toBlockVector3(pasteOptions.getMaxPoint()).withY(pasteOptions.getWaterLevel())), Objects.requireNonNull(BlockTypes.WATER).getDefaultState().toBaseBlock());
|
||||
}
|
||||
}
|
||||
System.out.println("Reset: " + stop("reset"));
|
||||
start("operation");
|
||||
Operations.completeBlindly(ch.createPaste(e).to(v).ignoreAirBlocks(pasteOptions.isIgnoreAir()).build());
|
||||
System.out.println("Operation: " + stop("operation"));
|
||||
return e;
|
||||
} catch (WorldEditException e) {
|
||||
throw new SecurityException(e.getMessage(), e);
|
||||
|
@ -56,7 +56,6 @@ public class BauGUI {
|
||||
if (ITEMS.containsKey(item.getId())) {
|
||||
throw new IllegalArgumentException("Duplicate Id Key: " + item.getId() + ". From Classes: " + ITEMS.get(item.getId()).getClass().getName() + " and " + item.getClass().getName());
|
||||
}
|
||||
System.out.println("Added Item: " + item.getId());
|
||||
ITEMS.put(item.getId(), item);
|
||||
}
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren