Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
Remove debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Puyodead1 committed May 12, 2022
1 parent f636343 commit e061768
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.puyodead1</groupId>
<artifactId>EnchantCrystals</artifactId>
<version>2.1.3</version>
<version>2.1.4</version>
<packaging>jar</packaging>

<name>EnchantCrystals</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,11 @@ public void onEnchantmentPerformed(Player player, int cost, InventoryView view)

// get the entity player
Object craftPlayer = CraftPlayer.cast(player);
System.out.println(craftPlayer);
Object entityPlayer = ReflectionUtil.getHandle(craftPlayer);
System.out.println(entityPlayer);

// get container as EnchantMenu
Object container = CraftInventoryView.cast(view);
System.out.println(container);
Object enchantmentMenu = ReflectionUtil.getHandle(container);
System.out.println(enchantmentMenu);

// change the enchantment seed
// onEnchantmentPerformed on Player in net.minecraft.world.entity.player
Expand All @@ -37,11 +33,10 @@ public void onEnchantmentPerformed(Player player, int cost, InventoryView view)
// change enchantment seed on enchant menu data slot
// enchantmentSeed on net.minecraft.world.inventory.ContainerEnchantTable
Field enchantmentSeedField = enchantmentMenu.getClass().getDeclaredField("q");
System.out.println(enchantmentSeedField);
enchantmentSeedField.setAccessible(true);

// DataSlot aka ContainerProperty
Object dataSlot = enchantmentSeedField.get(enchantmentMenu);
System.out.println(dataSlot);

// Calls the set method on net.minecraft.world.inventory.ContainerProperty
ReflectionUtil.invokeMethod(dataSlot, "a", new Class[]{int.class}, new Object[]{newEnchantmentSeed});
Expand Down

0 comments on commit e061768

Please sign in to comment.