diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesCopyCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesCopyCommand.java index fb32c023..5538b73a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesCopyCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesCopyCommand.java @@ -63,7 +63,7 @@ public class AttributesCopyCommand extends SWCommand { BlockData blockData = block.getBlockData(); List attributesToCopy = new ArrayList<>(); if (needsType(block)) { - attributesToCopy.add("§8-§7 type " + block.getType().name().toLowerCase()); + attributesToCopy.add("§8-§7 material " + block.getType().name().toLowerCase()); } for (BlockAttribute blockAttribute : blockAttributeList) { if (blockAttribute.type().isInstance(blockData)) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesPlaceListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesPlaceListener.java index 7976e5cd..0daed5af 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesPlaceListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesPlaceListener.java @@ -65,10 +65,16 @@ public class AttributesPlaceListener implements Listener { event.setCancelled(true); Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> { Material material = strings.stream() - .filter(s -> s.startsWith("§8-§7 type ")) - .map(s -> s.replace("§8-§7 type ", "")) + .filter(s -> s.startsWith("§8-§7 material ")) + .map(s -> s.replace("§8-§7 material ", "")) .map(String::toUpperCase) - .map(Material::valueOf) + .map(s -> { + try { + return Material.valueOf(s.toUpperCase()); + } catch (Exception e) { + return null; + } + }) .findFirst() .orElse(type); event.getBlock().setType(material, false);