diff options
| author | shedaniel <daniel@shedaniel.me> | 2020-08-27 19:36:00 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2020-08-27 19:36:50 +0800 |
| commit | 6104964f60bac00a4ac1359bd244d361e50786bd (patch) | |
| tree | 04bf0350e7305633436bb133e8647f0cecce0bf5 /RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java | |
| parent | 935417891d62500610fb05ce75dc8d63219c39d2 (diff) | |
| download | RoughlyEnoughItems-6104964f60bac00a4ac1359bd244d361e50786bd.tar.gz RoughlyEnoughItems-6104964f60bac00a4ac1359bd244d361e50786bd.tar.bz2 RoughlyEnoughItems-6104964f60bac00a4ac1359bd244d361e50786bd.zip | |
Migrate from yarn to mojmap
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java')
| -rw-r--r-- | RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java b/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java index ab67f9759..3bbc9d773 100644 --- a/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java +++ b/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java @@ -34,9 +34,9 @@ import me.shedaniel.rei.impl.filtering.FilteringRule; import me.shedaniel.rei.utils.CollectionUtils; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.collection.DefaultedList; +import net.minecraft.core.NonNullList; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -113,10 +113,10 @@ public class EntryRegistryImpl implements EntryRegistry { @NotNull @Override public List<ItemStack> appendStacksForItem(@NotNull Item item) { - DefaultedList<ItemStack> list = DefaultedList.of(); - item.appendStacks(item.getGroup(), list); + NonNullList<ItemStack> list = NonNullList.create(); + item.fillItemCategory(item.getItemCategory(), list); if (list.isEmpty()) - return Collections.singletonList(item.getStackForRender()); + return Collections.singletonList(item.getDefaultInstance()); return list; } @@ -125,7 +125,7 @@ public class EntryRegistryImpl implements EntryRegistry { public ItemStack[] getAllStacksFromItem(@NotNull Item item) { List<ItemStack> list = appendStacksForItem(item); ItemStack[] array = list.toArray(new ItemStack[0]); - Arrays.sort(array, (a, b) -> ItemStack.areEqualIgnoreDamage(a, b) ? 0 : 1); + Arrays.sort(array, (a, b) -> ItemStack.matches(a, b) ? 0 : 1); return array; } |
