aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/tests/plugin/REITestPlugin.java
blob: da6b91ab89830578adb303b79403b217ed403d0e (plain)
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
package me.shedaniel.rei.tests.plugin;

import me.shedaniel.rei.api.EntryRegistry;
import me.shedaniel.rei.api.EntryStack;
import me.shedaniel.rei.api.plugins.REIPluginV0;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import org.apache.logging.log4j.LogManager;
import org.jetbrains.annotations.TestOnly;

@TestOnly
@Deprecated
public class REITestPlugin implements REIPluginV0 {
    
    @Override
    public void preRegister() {
        LogManager.getLogger().error("REI Test Plugin is enabled! If you see this unintentionally, please report this!");
    }
    
    @Override
    public Identifier getPluginIdentifier() {
        return new Identifier("roughlyenoughitems:test_dev_plugin");
    }
    
    @Override
    public void registerEntries(EntryRegistry entryRegistry) {
        for (Item item : Registry.ITEM) {
            entryRegistry.registerEntryAfter(null, EntryStack.create(item), false);
            entryRegistry.registerEntryAfter(null, EntryStack.create(item), false);
            entryRegistry.registerEntryAfter(null, EntryStack.create(item), false);
            try {
                for (ItemStack stack : entryRegistry.getAllStacksFromItem(item)) {
                    entryRegistry.registerEntryAfter(null, EntryStack.create(stack), false);
                    entryRegistry.registerEntryAfter(null, EntryStack.create(stack), false);
                    entryRegistry.registerEntryAfter(null, EntryStack.create(stack), false);
                }
            } catch (Exception e) {
            }
        }
    }
}