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

Commit

Permalink
remove unneeded cast
Browse files Browse the repository at this point in the history
  • Loading branch information
Puyodead1 committed Jul 6, 2021
1 parent c740b05 commit 3f7eeec
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ public void onEnchantmentPerformed(Player player, int cost, InventoryView view)
Class<?> CraftInventoryView = ReflectionUtil.getOBCClass("inventory.CraftInventoryView");
Class<?> CraftPlayer = ReflectionUtil.getOBCClass("entity.CraftPlayer");
Class<?> ItemStack = Class.forName("net.minecraft.world.item.ItemStack");
Class<?> ContainerProperty = Class.forName("net.minecraft.world.inventory.ContainerProperty");


// get the entity player
Object craftPlayer = CraftPlayer.cast(player);
Expand All @@ -34,6 +32,6 @@ public void onEnchantmentPerformed(Player player, int cost, InventoryView view)
enchantmentSeedField.setAccessible(true);
Object dataSlot = enchantmentSeedField.get(enchantmentMenu);

ReflectionUtil.invokeMethod(ContainerProperty.cast(dataSlot), "set", new Class[]{int.class}, new Object[]{newEnchantmentSeed});
ReflectionUtil.invokeMethod(dataSlot, "set", new Class[]{int.class}, new Object[]{newEnchantmentSeed});
}
}

0 comments on commit 3f7eeec

Please sign in to comment.