Update LinkageUtils
Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
89f63f3c77
Commit
5cb670d3f7
@ -31,6 +31,7 @@ import java.lang.reflect.Field;
|
|||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@UtilityClass
|
@UtilityClass
|
||||||
public class LinkageUtils {
|
public class LinkageUtils {
|
||||||
@ -90,18 +91,7 @@ public class LinkageUtils {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<LinkageType> linkageTypeList = new ArrayList<>();
|
List<LinkageType> linkageTypeList = Arrays.stream(linkages).filter(Objects::nonNull).map(Linked::value).filter(linkageType -> linkageType.getLinkagePredicate().test(clazz)).filter(linkageType -> linkageType.isUnlink() == unlink).collect(Collectors.toList());
|
||||||
for (Linked linked : linkages) {
|
|
||||||
if (linked == null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
LinkageType linkageType = linked.value();
|
|
||||||
if (linkageType.getLinkagePredicate().test(clazz)) {
|
|
||||||
linkageTypeList.add(linked.value());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
linkageTypeList.removeIf(linkageType -> linkageType.isUnlink() != unlink);
|
|
||||||
if (linkageTypeList.isEmpty()) {
|
if (linkageTypeList.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,6 @@ import lombok.experimental.UtilityClass;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import yapion.hierarchy.diff.DiffBase;
|
import yapion.hierarchy.diff.DiffBase;
|
||||||
import yapion.hierarchy.diff.YAPIONDiff;
|
import yapion.hierarchy.diff.YAPIONDiff;
|
||||||
import yapion.hierarchy.output.FileOutput;
|
|
||||||
import yapion.hierarchy.types.YAPIONObject;
|
import yapion.hierarchy.types.YAPIONObject;
|
||||||
import yapion.hierarchy.types.YAPIONType;
|
import yapion.hierarchy.types.YAPIONType;
|
||||||
import yapion.parser.YAPIONParser;
|
import yapion.parser.YAPIONParser;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren