From 3aa6b486d80654f4c3ca284f665d1293555adb72 Mon Sep 17 00:00:00 2001 From: nea Date: Tue, 26 Jul 2022 12:42:11 +0200 Subject: Cheatable --- .../kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/common/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt b/common/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt index 0fb3621..ccb9b0b 100644 --- a/common/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt +++ b/common/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt @@ -16,7 +16,6 @@ import me.shedaniel.rei.api.common.entry.type.EntryDefinition import me.shedaniel.rei.api.common.entry.type.EntryType import me.shedaniel.rei.api.common.entry.type.EntryTypeRegistry import me.shedaniel.rei.api.common.entry.type.VanillaEntryTypes -import me.shedaniel.rei.api.common.util.EntryStacks import moe.nea.notenoughupdates.LegacyTagParser import moe.nea.notenoughupdates.NotEnoughUpdates.neuRepo import net.minecraft.ChatFormatting @@ -31,7 +30,6 @@ import net.minecraft.util.datafix.DataFixers.getDataFixer import net.minecraft.util.datafix.fixes.References import net.minecraft.world.item.ItemStack import net.minecraft.world.item.Items -import net.minecraft.world.item.enchantment.Enchantments import java.util.concurrent.ConcurrentHashMap import java.util.stream.Stream @@ -77,7 +75,7 @@ class NEUReiPlugin : REIClientPlugin { } val itemInstance = ItemStack.of(itemTag_modern) return itemInstance.also { - if(false)it.appendLore( + if (false) it.appendLore( listOf( TextComponent("Old: $minecraftItemId").withStyle { it.withItalic(false).withColor(ChatFormatting.RED) @@ -87,7 +85,6 @@ class NEUReiPlugin : REIClientPlugin { }, ) ) - it.hoverName = TextComponent(this.skyblockItemId) } } @@ -109,6 +106,10 @@ class NEUReiPlugin : REIClientPlugin { return o1 == o2 } + override fun cheatsAs(entry: EntryStack?, value: NEUItem?): ItemStack? { + return value?.asItemStack() + } + override fun getValueType(): Class = NEUItem::class.java override fun getType(): EntryType = EntryType.deferred(hehe) @@ -181,10 +182,8 @@ class NEUReiPlugin : REIClientPlugin { override fun registerEntries(registry: EntryRegistry) { neuRepo.items.items.values.forEach { - registry.addEntry(EntryStack.of(SBItemEntryDefinition, it)) + if (!it.isVanilla) + registry.addEntry(EntryStack.of(SBItemEntryDefinition, it)) } - registry.addEntry(EntryStacks.of(ItemStack(Items.DIAMOND).also { - it.enchant(Enchantments.ALL_DAMAGE_PROTECTION, 10) - })) } } -- cgit