mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-04-10 06:05:50 +02:00
Fixed some code smells
This commit is contained in:
parent
a240a6598d
commit
c5eb8ac7e7
@ -61,6 +61,8 @@ public class BlueprintPaster {
|
||||
CANCEL
|
||||
}
|
||||
|
||||
private static long chunkLoadTime = 0;
|
||||
|
||||
private static final String MINECRAFT = "minecraft:";
|
||||
|
||||
private static final Map<String, String> BLOCK_CONVERSION = ImmutableMap.of("sign", "oak_sign", "wall_sign", "oak_wall_sign");
|
||||
@ -164,7 +166,7 @@ public class BlueprintPaster {
|
||||
owner.ifPresent(user -> {
|
||||
// Estimated time:
|
||||
double total = (double) blocks.size() + attached.size() + entities.size();
|
||||
BigDecimal time = BigDecimal.valueOf(total / (pasteSpeed * 20.0D) + (BlueprintsManager.chunkLoadTime / 1000)).setScale(1, RoundingMode.UP);
|
||||
BigDecimal time = BigDecimal.valueOf(total / (pasteSpeed * 20.0D) + (chunkLoadTime / 1000.0D)).setScale(1, RoundingMode.UP);
|
||||
user.sendMessage("commands.island.create.pasting.estimated-time", TextVariables.NUMBER, String.valueOf(time.doubleValue()));
|
||||
// We're pasting blocks!
|
||||
user.sendMessage("commands.island.create.pasting.blocks", TextVariables.NUMBER, String.valueOf(blocks.size() + attached.size()));
|
||||
@ -179,8 +181,8 @@ public class BlueprintPaster {
|
||||
Util.getChunkAtAsync(location).thenRun(() -> {
|
||||
pasteState = PasteState.BLOCKS;
|
||||
long duration = System.currentTimeMillis() - timer;
|
||||
if (duration > BlueprintsManager.chunkLoadTime) {
|
||||
BlueprintsManager.chunkLoadTime = duration;
|
||||
if (duration > chunkLoadTime) {
|
||||
chunkLoadTime = duration;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -60,8 +60,6 @@ public class BlueprintsManager {
|
||||
|
||||
public static final @NonNull String FOLDER_NAME = "blueprints";
|
||||
private static final String FOR = "' for ";
|
||||
|
||||
public static long chunkLoadTime = 0;
|
||||
|
||||
/**
|
||||
* Map of blueprint bundles to game mode addon.
|
||||
|
Loading…
Reference in New Issue
Block a user