Remove item quirk entirely on 1.19+

This commit is contained in:
embeddedt 2023-08-03 13:13:09 -04:00
parent 72e3a115d6
commit f469d591b8
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -1,10 +1,6 @@
package org.embeddedt.modernfix.searchtree;
import net.minecraft.client.searchtree.RefreshableSearchTree;
import net.minecraft.core.NonNullList;
import net.minecraft.core.Registry;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import java.util.Collections;
@ -20,13 +16,7 @@ public class DummySearchTree<T> implements RefreshableSearchTree<T> {
@Override
public void refresh() {
// quirk: call fillItemCategory on all items in the registry in case they do classloading inside it
// see https://github.com/Shadows-of-Fire/GatewaysToEternity/issues/29 for an example of this
NonNullList<ItemStack> stacks = NonNullList.create();
for(Item item : Registry.ITEM) {
stacks.clear();
item.fillItemCategory(CreativeModeTab.TAB_SEARCH, stacks);
}
}
@Override