Hotfix ModifyPart

This commit is contained in:
2025-11-11 21:42:38 +01:00
parent 67223be80e
commit 3de4b3871d
@@ -51,18 +51,19 @@ public class ModifyPart extends SWCommand {
public void changeType(Player player, @Validator("isOwnerSchematicValidator") SchematicNode node) {
TextComponent base = new TextComponent();
Clipboard clipboard = null;
Clipboard clipboard;
try {
clipboard = new SchematicData(node).load();
} catch (IOException ignored) { }
Clipboard finalClipboard = clipboard;
} catch (IOException ignored) {
SchematicSystem.MESSAGE.send("UTIL_LOAD_ERROR", player);
return;
}
String breadcrumb = node.generateBreadcrumbs(SteamwarUser.get(player.getUniqueId()));
SchematicType.values().parallelStream()
.filter(SchematicType::isAssignable)
.filter(type -> finalClipboard != null && SchematicSystem.getGameModeConfig(type) != null && AutoChecker.sizeCheck(finalClipboard, SchematicSystem.getGameModeConfig(type)).fastOk())
.filter(type -> SchematicSystem.getGameModeConfig(type) == null || AutoChecker.sizeCheck(clipboard, SchematicSystem.getGameModeConfig(type)).fastOk())
.forEach(type -> {
TextComponent component = new TextComponent(type.name() + " ");
component.setColor(ChatColor.GRAY);