forked from SteamWar/SteamWar
Hotfix ModifyPart
This commit is contained in:
+6
-5
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user