Skip to content

Commit

Permalink
Fix enchantment patches on Purpur
Browse files Browse the repository at this point in the history
Fix #297
  • Loading branch information
NichtStudioCode committed Oct 23, 2023
1 parent 63b4cbd commit 63eec9f
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import net.minecraft.world.level.Level
import xyz.xenondevs.bytebase.jvm.VirtualClassPath
import xyz.xenondevs.nova.item.behavior.Enchantable
import xyz.xenondevs.nova.transformer.MultiTransformer
import xyz.xenondevs.nova.util.ServerSoftware
import xyz.xenondevs.nova.util.ServerUtils
import xyz.xenondevs.nova.util.reflection.ReflectionUtils
import xyz.xenondevs.nova.world.block.logic.tileentity.EnchantmentTableLogic
import xyz.xenondevs.nova.world.block.logic.tileentity.GrindstoneLogic
Expand All @@ -19,15 +21,17 @@ import xyz.xenondevs.nova.world.block.logic.tileentity.GrindstoneLogic
private val ENCHANTMENT_MENU_SLOTS_CHANGED_LAMBDA = ReflectionUtils.getMethod(
EnchantmentMenu::class,
true,
"lambda\$slotsChanged\$0", // not remapped
// not remapped
if (ServerUtils.SERVER_SOFTWARE == ServerSoftware.PAPER) "lambda\$slotsChanged\$0" else "lambda\$slotsChanged$1",
ItemStack::class, Level::class, BlockPos::class
)

// for future reference: https://i.imgur.com/PyYEYD5.png
private val ENCHANTMENT_MENU_CLICK_MENU_BUTTON_LAMBDA = ReflectionUtils.getMethod(
EnchantmentMenu::class,
true,
"lambda\$clickMenuButton\$1", // not remapped
// not remapped
if (ServerUtils.SERVER_SOFTWARE == ServerSoftware.PAPER) "lambda\$clickMenuButton\$1" else "lambda\$clickMenuButton$2",
ItemStack::class, Int::class, Player::class, Int::class, ItemStack::class, Level::class, BlockPos::class
)

Expand Down

0 comments on commit 63eec9f

Please sign in to comment.