Skip to content

Commit b693872

Browse files
authored
Remove warning of double handler (#4133)
1 parent f7cfae7 commit b693872

1 file changed

Lines changed: 0 additions & 16 deletions

File tree

src/main/java/com/gregtechceu/gtceu/api/capability/recipe/IRecipeCapabilityHolder.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.gregtechceu.gtceu.api.capability.recipe;
22

3-
import com.gregtechceu.gtceu.GTCEu;
43
import com.gregtechceu.gtceu.api.machine.trait.RecipeHandlerList;
54

65
import it.unimi.dsi.fastutil.objects.Reference2ObjectOpenHashMap;
@@ -10,7 +9,6 @@
109
import java.util.Collections;
1110
import java.util.List;
1211
import java.util.Map;
13-
import java.util.stream.Collectors;
1412

1513
public interface IRecipeCapabilityHolder {
1614

@@ -39,20 +37,6 @@ default List<IRecipeHandler<?>> getCapabilitiesFlat(IO io, RecipeCapability<?> c
3937
default void addHandlerList(RecipeHandlerList handlerList) {
4038
if (handlerList == RecipeHandlerList.NO_DATA) return;
4139
IO io = handlerList.getHandlerIO();
42-
43-
var existingHandlers = getCapabilitiesProxy().getOrDefault(io, Collections.emptyList()).stream()
44-
.flatMap(tempHandlerList -> tempHandlerList.getHandlersFlat().stream())
45-
.collect(Collectors.toSet());
46-
47-
for (var handler : handlerList.getHandlersFlat()) {
48-
if (existingHandlers.contains(handler)) {
49-
GTCEu.LOGGER.error("Do not add the same handler twice, as this could cause duplication bugs! " +
50-
"Handler {} in List {}",
51-
handler.getClass().getName(),
52-
handlerList.getClass().getName());
53-
}
54-
}
55-
5640
getCapabilitiesProxy().computeIfAbsent(io, i -> new ArrayList<>()).add(handlerList);
5741
var entrySet = handlerList.getHandlerMap().entrySet();
5842
var inner = getCapabilitiesFlat().computeIfAbsent(io, i -> new Reference2ObjectOpenHashMap<>(entrySet.size()));

0 commit comments

Comments
 (0)