diff --git a/build.gradle.kts b/build.gradle.kts index 8977c306..cb7b079e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,7 +9,7 @@ plugins { } group = "de.eldoria" -version = "2.6.0" +version = "2.6.1" var publishModules = setOf("schematicbrushreborn-api", "schematicbrushreborn-core", diff --git a/schematicbrushreborn-core/src/main/java/de/eldoria/schematicbrush/rendering/PacketWorker.java b/schematicbrushreborn-core/src/main/java/de/eldoria/schematicbrush/rendering/PacketWorker.java index 302c0a11..149a2f8a 100644 --- a/schematicbrushreborn-core/src/main/java/de/eldoria/schematicbrush/rendering/PacketWorker.java +++ b/schematicbrushreborn-core/src/main/java/de/eldoria/schematicbrush/rendering/PacketWorker.java @@ -81,17 +81,7 @@ public void queue(RenderSink renderSink) { public void remove(Player player) { - queue.removeIf(e -> e.sinkOwner().equals(player.getUniqueId())); - } - - public void process(Player player) { - queue.removeIf(e -> { - if (e.sinkOwner().equals(player.getUniqueId())) { - e.sendChanges(); - return true; - } - return false; - }); + queue.removeIf(e -> e == null || e.sinkOwner().equals(player.getUniqueId())); } public int packetQueueCount() { diff --git a/schematicbrushreborn-core/src/main/java/de/eldoria/schematicbrush/rendering/RenderService.java b/schematicbrushreborn-core/src/main/java/de/eldoria/schematicbrush/rendering/RenderService.java index 77ced588..b54f76f2 100644 --- a/schematicbrushreborn-core/src/main/java/de/eldoria/schematicbrush/rendering/RenderService.java +++ b/schematicbrushreborn-core/src/main/java/de/eldoria/schematicbrush/rendering/RenderService.java @@ -105,8 +105,8 @@ public void onPrePaste(PrePasteEvent event) { * @param player player to resolve */ private void resolveBlocked(Player player) { - worker.process(player); RenderSink playerSink = getSink(player); + worker.remove(player); // We push and send empty changes playerSink.pushAndSend(null); //getChanges(player).ifPresent(change -> new PaketWorker.ChangeEntry(player, change, null).sendChanges());