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) {
|
public void changeType(Player player, @Validator("isOwnerSchematicValidator") SchematicNode node) {
|
||||||
TextComponent base = new TextComponent();
|
TextComponent base = new TextComponent();
|
||||||
|
|
||||||
Clipboard clipboard = null;
|
Clipboard clipboard;
|
||||||
try {
|
try {
|
||||||
clipboard = new SchematicData(node).load();
|
clipboard = new SchematicData(node).load();
|
||||||
} catch (IOException ignored) { }
|
} catch (IOException ignored) {
|
||||||
|
SchematicSystem.MESSAGE.send("UTIL_LOAD_ERROR", player);
|
||||||
Clipboard finalClipboard = clipboard;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
String breadcrumb = node.generateBreadcrumbs(SteamwarUser.get(player.getUniqueId()));
|
String breadcrumb = node.generateBreadcrumbs(SteamwarUser.get(player.getUniqueId()));
|
||||||
|
|
||||||
SchematicType.values().parallelStream()
|
SchematicType.values().parallelStream()
|
||||||
.filter(SchematicType::isAssignable)
|
.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 -> {
|
.forEach(type -> {
|
||||||
TextComponent component = new TextComponent(type.name() + " ");
|
TextComponent component = new TextComponent(type.name() + " ");
|
||||||
component.setColor(ChatColor.GRAY);
|
component.setColor(ChatColor.GRAY);
|
||||||
|
|||||||
Reference in New Issue
Block a user