Merge remote-tracking branch 'origin/master' into develop-fix

# Conflicts:
#	pom.xml
This commit is contained in:
BONNe 2022-10-11 09:55:16 +03:00
commit b48a5a73b8
3 changed files with 9 additions and 9 deletions

View File

@ -138,8 +138,8 @@ public class BlueprintPaster {
// Tell the owner we're pasting blocks and how much time it might take
owner.ifPresent(user -> tellOwner(user, blocks.size(), attached.size(), entities.size(), plugin.getSettings().getPasteSpeed()));
Bits bits = new Bits(blocks, attached, entities,
blocks.entrySet().iterator(), attached.entrySet().iterator(), entities.entrySet().iterator(),
Bits bits = new Bits(blocks, attached, entities,
blocks.entrySet().iterator(), attached.entrySet().iterator(), entities.entrySet().iterator(),
plugin.getSettings().getPasteSpeed());
pastingTask = Bukkit.getScheduler().runTaskTimer(plugin, () -> pasterTask(result, owner, bits), 0L, 1L);
@ -237,7 +237,7 @@ public class BlueprintPaster {
if (island == null && clipboard != null) {
clipboard.setPos1(pos1);
clipboard.setPos2(pos2);
}
}
pasteState = PasteState.CANCEL;
result.complete(true);
} else if (pasteState.equals(PasteState.CANCEL)) {
@ -247,13 +247,13 @@ public class BlueprintPaster {
}
}
private void tellOwner(User user, int blocksSize, int attachedSize, int entitiesSize, int pasteSpeed) {
private void tellOwner(User user, int blocksSize, int attachedSize, int entitiesSize, int pasteSpeed) {
// Estimated time:
double total = (double) blocksSize + attachedSize + entitiesSize;
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(blocksSize + attachedSize));
user.sendMessage("commands.island.create.pasting.blocks", TextVariables.NUMBER, String.valueOf(blocksSize + attachedSize));
}
/**

View File

@ -945,7 +945,7 @@ public class Island implements DataObject, MetaDataAble {
public BoundingBox getProtectionBoundingBox(Environment environment)
{
BoundingBox boundingBox;
if (Environment.NORMAL.equals(environment))
{
// Return normal world bounding box.
@ -982,7 +982,7 @@ public class Island implements DataObject, MetaDataAble {
{
boundingBox = null;
}
return boundingBox;
}

View File

@ -16,7 +16,7 @@ import java.util.stream.Collectors;
public class PasteHandlerImpl implements PasteHandler {
@Override
public CompletableFuture<Void> pasteBlocks(Island island, World world, Map<Location, BlueprintBlock> blockMap) {
return blockMap.entrySet().parallelStream()
return blockMap.entrySet().stream()
.map(entry -> DefaultPasteUtil.setBlock(island, entry.getKey(), entry.getValue()))
.collect(
Collectors.collectingAndThen(
@ -28,7 +28,7 @@ public class PasteHandlerImpl implements PasteHandler {
@Override
public CompletableFuture<Void> pasteEntities(Island island, World world, Map<Location, List<BlueprintEntity>> entityMap) {
return entityMap.entrySet().parallelStream()
return entityMap.entrySet().stream()
.map(entry -> DefaultPasteUtil.setEntity(island, entry.getKey(), entry.getValue()))
.collect(
Collectors.collectingAndThen(