From 3e0fb9fde1974d12e2ab58fd80834b3e58b05de2 Mon Sep 17 00:00:00 2001 From: jojo Date: Wed, 30 Dec 2020 14:31:02 +0100 Subject: [PATCH] Simplify ArgumentMap --- .../src/de/steamwar/command/Argument.java | 2 -- .../src/de/steamwar/command/ArgumentMap.java | 12 ------------ 2 files changed, 14 deletions(-) diff --git a/SpigotCore_Main/src/de/steamwar/command/Argument.java b/SpigotCore_Main/src/de/steamwar/command/Argument.java index 6655357..aeffb72 100644 --- a/SpigotCore_Main/src/de/steamwar/command/Argument.java +++ b/SpigotCore_Main/src/de/steamwar/command/Argument.java @@ -49,7 +49,6 @@ public class Argument { public static final Argument STRING = new Argument<>(s -> s, string -> true); public static final Argument PLAYER = new Argument<>(Bukkit::getPlayer, Objects::nonNull, () -> Bukkit.getOnlinePlayers().stream().map(Player::getName).toArray(String[]::new)); - public static final Argument GAMEMODE = new Argument<>(s -> { switch (s.toLowerCase()) { case "creative": case "c": case "1": @@ -63,7 +62,6 @@ public class Argument { } return null; }, Objects::nonNull, GameMode.class); - public static final Argument MATERIAL = new Argument<>(Material::valueOf, Objects::nonNull, Material.class); public static final Argument PARTICLE = new Argument<>(Particle::valueOf, Objects::nonNull, Particle.class); public static final Argument ENTITY = new Argument<>(EntityType::valueOf, Objects::nonNull, EntityType.class); diff --git a/SpigotCore_Main/src/de/steamwar/command/ArgumentMap.java b/SpigotCore_Main/src/de/steamwar/command/ArgumentMap.java index 2a62c89..804ef2b 100644 --- a/SpigotCore_Main/src/de/steamwar/command/ArgumentMap.java +++ b/SpigotCore_Main/src/de/steamwar/command/ArgumentMap.java @@ -43,18 +43,6 @@ public class ArgumentMap { return (T)objects[index]; } - public T get(int index, T t) { - return get(index); - } - - public T get(int index, Class clazz) { - return get(index); - } - - public Class[] typeArray() { - return Arrays.stream(objects).map(Object::getClass).toArray(Class[]::new); - } - @Override public String toString() { return "ArgumentMap{" + Arrays.stream(objects).map(o -> o.getClass().getSimpleName() + "=" + o.toString()).collect(Collectors.joining(",")) + "}";