Advertisement
GeradesoLukas

Tetra Registry Helper Class

Sep 24th, 2022
1,057
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1.  
  2. import net.minecraft.world.item.ItemStack;
  3. import se.mickelus.tetra.module.ItemUpgradeRegistry;
  4.  
  5. import java.util.Optional;
  6.  
  7. public class ItemUpgradeRegistryHelper {
  8.  
  9.     public static void init() {
  10.         if(TetraCompat.isLoaded) {
  11.             ItemUpgradeRegistry.instance.registerReplacementHook((ItemStack original, ItemStack replacement) -> {
  12.                 replacement.getOrCreateTag().putInt("level", original.getOrCreateTag().getInt("level"));
  13.                 replacement.getOrCreateTag().putInt("levelprogress", original.getOrCreateTag().getInt("levelprogress"));
  14.                 return replacement;
  15.             });
  16.         }
  17.     }
  18.  
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement