/
ItemRegistry.java
65 lines (55 loc) · 1.66 KB
/
ItemRegistry.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package mezz.jei;
import javax.annotation.Nullable;
import java.util.Locale;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableListMultimap;
import mezz.jei.api.IItemRegistry;
import mezz.jei.api.ingredients.IIngredientRegistry;
import mezz.jei.util.Log;
import mezz.jei.util.ModIdUtil;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@Deprecated
public class ItemRegistry implements IItemRegistry {
private final IIngredientRegistry ingredientRegistry;
private final ModIdUtil modIdUtil;
public ItemRegistry(
IIngredientRegistry ingredientRegistry,
ModIdUtil modIdUtil
) {
this.ingredientRegistry = ingredientRegistry;
this.modIdUtil = modIdUtil;
}
@Override
public ImmutableList<ItemStack> getItemList() {
return ingredientRegistry.getIngredients(ItemStack.class);
}
@Override
public ImmutableList<ItemStack> getFuels() {
return ingredientRegistry.getFuels();
}
@Override
public ImmutableList<ItemStack> getPotionIngredients() {
return ingredientRegistry.getPotionIngredients();
}
@Override
public String getModNameForItem(@Nullable Item item) {
if (item == null) {
Log.error("Null item", new NullPointerException());
return "";
}
return modIdUtil.getModNameForItem(item);
}
@Override
public String getModNameForModId(@Nullable String modId) {
if (modId == null) {
Log.error("Null modId", new NullPointerException());
return "";
}
return modIdUtil.getModNameForModId(modId);
}
@Override
public ImmutableList<ItemStack> getItemListForModId(@Nullable String modId) {
return ImmutableList.of();
}
}