mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-20 23:30:29 +00:00
implement Event API
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
package com.dfsek.terra.registry;
|
||||
|
||||
import com.dfsek.terra.api.structures.parser.lang.functions.FunctionBuilder;
|
||||
|
||||
public class FunctionRegistry extends TerraRegistry<FunctionBuilder<?>> {
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public abstract class TerraRegistry<T> implements TypeLoader<T> {
|
||||
@@ -59,6 +60,10 @@ public abstract class TerraRegistry<T> implements TypeLoader<T> {
|
||||
objects.forEach((id, obj) -> consumer.accept(obj));
|
||||
}
|
||||
|
||||
public void forEach(BiConsumer<String, T> consumer) {
|
||||
objects.forEach(consumer);
|
||||
}
|
||||
|
||||
public Set<T> entries() {
|
||||
return new HashSet<>(objects.values());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user