diff --git a/BauSystem_Main/src/de/steamwar/bausystem/utils/ProtocolAPI.java b/BauSystem_Main/src/de/steamwar/bausystem/utils/ProtocolAPI.java index e88e7c94..e3ba3aea 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/utils/ProtocolAPI.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/utils/ProtocolAPI.java @@ -80,34 +80,4 @@ public class ProtocolAPI { public static void broadcastPacket(Object packet) { Bukkit.getOnlinePlayers().stream().map(tinyProtocol::getChannel).filter(tinyProtocol::hasInjected).forEach(channel -> tinyProtocol.sendPacket(channel, packet)); } - - private static BiConsumer shallowFill(Class clazz) { - if (clazz == null) - return (source, clone) -> { - }; - - BiConsumer superFiller = shallowFill(clazz.getSuperclass()); - - Field[] fds = clazz.getDeclaredFields(); - List fields = new ArrayList<>(); - for (Field field : fds) { - if (Modifier.isStatic(field.getModifiers())) - continue; - - field.setAccessible(true); - fields.add(field); - } - - return (source, clone) -> { - superFiller.accept(source, clone); - try { - for (Field field : fields) { - field.set(clone, field.get(source)); - } - } catch (IllegalAccessException e) { - throw new IllegalStateException("Could not set field", e); - } - - }; - } }