aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt
diff options
context:
space:
mode:
authornea <romangraef@gmail.com>2022-07-29 20:51:53 +0200
committernea <romangraef@gmail.com>2022-07-29 20:51:53 +0200
commitf4bf70032a45b4daa7805ca38f2d820645dc9a6b (patch)
treedc91fa8e13b78ac9a7fcda24a26894e430f7fc84 /src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt
parent386ee78026801bf50d9cba24de541ed087f145d6 (diff)
downloadfirmament-f4bf70032a45b4daa7805ca38f2d820645dc9a6b.tar.gz
firmament-f4bf70032a45b4daa7805ca38f2d820645dc9a6b.tar.bz2
firmament-f4bf70032a45b4daa7805ca38f2d820645dc9a6b.zip
no arch
Diffstat (limited to 'src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt')
-rw-r--r--src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt b/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt
new file mode 100644
index 0000000..cc4b0f1
--- /dev/null
+++ b/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt
@@ -0,0 +1,38 @@
+package moe.nea.notenoughupdates.rei
+
+import io.github.moulberry.repo.data.NEUItem
+import me.shedaniel.rei.api.client.plugins.REIClientPlugin
+import me.shedaniel.rei.api.client.registry.entry.EntryRegistry
+import me.shedaniel.rei.api.common.entry.EntryStack
+import me.shedaniel.rei.api.common.entry.type.EntryTypeRegistry
+import me.shedaniel.rei.api.common.entry.type.VanillaEntryTypes
+import moe.nea.notenoughupdates.NotEnoughUpdates.neuRepo
+import moe.nea.notenoughupdates.repo.ItemCache.asItemStack
+import net.minecraft.resources.ResourceLocation
+import net.minecraft.world.item.ItemStack
+
+
+class NEUReiPlugin : REIClientPlugin {
+
+ companion object {
+
+ fun EntryStack<NEUItem>.asItemEntry(): EntryStack<ItemStack> {
+ return EntryStack.of(VanillaEntryTypes.ITEM, value.asItemStack())
+ }
+
+
+ val SKYBLOCK_ITEM_TYPE_ID = ResourceLocation("notenoughupdates", "skyblockitems")
+ }
+
+ override fun registerEntryTypes(registry: EntryTypeRegistry) {
+ registry.register(SKYBLOCK_ITEM_TYPE_ID, SBItemEntryDefinition)
+ }
+
+
+ override fun registerEntries(registry: EntryRegistry) {
+ neuRepo.items.items.values.forEach {
+ if (!it.isVanilla)
+ registry.addEntry(EntryStack.of(SBItemEntryDefinition, it))
+ }
+ }
+}