package net.aeronica.mods.mxtune.init;

import net.aeronica.mods.mxtune.MXTuneMain;
import net.aeronica.mods.mxtune.blocks.BlockPiano;
import net.aeronica.mods.mxtune.blocks.TilePiano;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.util.CompoundDataFixer;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.registries.IForgeRegistry;

import java.util.HashSet;
import java.util.Set;

@SuppressWarnings("unused")
public class ModBlocks
{
   
    public static final BlockPiano SPINET_PIANO = registerBlock(new BlockPiano(), "spinet_piano");
    private ModBlocks() {}
    
    @Mod.EventBusSubscriber
    public static class RegistrationHandler {
        protected static final Set<Item> ITEM_BLOCKS = new HashSet<>();
        private RegistrationHandler() {}
        
        /**
         * Register this mod's {@link Block}s.
         *
         * @param event The event
         */
        @SubscribeEvent
        public static void registerBlocks(RegistryEvent.Register<Block> event) {
            final IForgeRegistry<Block> registry = event.getRegistry();

            final Block[] blocks = {
                    SPINET_PIANO,
            };

            registry.registerAll(blocks);
        }

        /**
         * Register this mod's {@link ItemBlock}s.
         *
         * @param event The event
         */
        @SubscribeEvent
        public static void registerItemBlocks(RegistryEvent.Register<Item> event) {
            final ItemBlock[] items = {
                    
            };

            final IForgeRegistry<Item> registry = event.getRegistry();

            for (final ItemBlock item : items) {
                registry.register(item.setRegistryName(item.getBlock().getRegistryName()));
                ITEM_BLOCKS.add(item);
            }
            
            registerTileEntities();
        }
    }
    
    private static void registerTileEntities() {
        GameRegistry.registerTileEntity(TilePiano.class, new ResourceLocation(MXTuneMain.MODID,"tile_piano"));
        CompoundDataFixer x;
    }

    private static <T extends Block> T registerBlock(T block, String name) {
        block.setRegistryName(name.toLowerCase());
        block.setTranslationKey(block.getRegistryName().toString());
        return block;
    }

    private static <T extends Block> T registerBlock(T block) {
        return registerBlock(block, block.getClass().getSimpleName());
    }

    private static void registerTileEntity(Class<? extends TileEntity> tileEntityClass, String name) {
        GameRegistry.registerTileEntity(tileEntityClass, MXTuneMain.prependModID(name));
    }

}

@@ -797,20 +797,16 @@
 locks%0A%7B%0A
-   %0A
     publ
@@ -2252,37 +2252,24 @@
 ) %7B%0A        
-GameRegistry.
 registerTile
@@ -2296,89 +2296,21 @@
 ss, 
-new ResourceLocation(MXTuneMain.MODID,%22tile_piano%22));%0A        CompoundDataFixer x
+%22tile_piano%22)
 ;%0A  
@@ -2846,32 +2846,47 @@
 ss, 
-MXTuneMain.prependModID(
+new ResourceLocation(MXTuneMain.MODID, 
 name
@@ -2895,11 +2895,10 @@
 ;%0A    %7D%0A
-%0A
 %7D%0A

Clean up