Cheatable

This commit is contained in:
nea
2022-07-26 12:42:11 +02:00
parent 37218614c6
commit 3aa6b486d8

View File

@@ -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<NEUItem>?, value: NEUItem?): ItemStack? {
return value?.asItemStack()
}
override fun getValueType(): Class<NEUItem> = NEUItem::class.java
override fun getType(): EntryType<NEUItem> =
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)
}))
}
}