feat: gui recipe

This commit is contained in:
Discreater committed 2021-04-30 15:57:44 +08:00
1 parent cce76168c0
commit 8ee76a5f8a
58 files changed
+925 -486

No files matched your search

@@ -3,6 +3,7 @@ package me.towdium.jecalculation.data.structure;
import me.towdium.jecalculation.data.label.ILabel;
import me.towdium.jecalculation.polyfill.NBTHelper;
import me.towdium.jecalculation.utils.Utilities;
import me.towdium.jecalculation.utils.wrappers.Pair;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
@@ -13,6 +14,7 @@ import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
/**
@@ -78,6 +80,14 @@ public class User {
}).set(index, recipe);
}
public int size() {
return records.size();
}
public Stream<Pair<String, List<Recipe>>> stream() {
return records.stream();
}
public void remove(String group, int index) {
records.get(group).orElseGet(() -> {
throw new RuntimeException("Group not found: " + group + ".");