Jump to content

Need "{" after ";"?


DashAhead

Recommended Posts

If I do that it just creates more errors below

Such as?

 

@EventHandler

        public void preInit(FMLPreInitializationEvent event) {

               

        }

     

        @EventHandler

        public void load(FMLInitializationEvent event) {

                proxy.registerRenderers();

               

                // Ruby Tool Stacks

                ItemStack rubyStack = new ItemStack(rubyGem);

                ItemStack rubyStack2 = new ItemStack(rubyGem, 9);

                ItemStack stickStack = new ItemStack(Item.stick);

                ItemStack rubySwordStack = new ItemStack(rubySword);

                ItemStack rubyAxeStack = new ItemStack(rubyAxe);

                ItemStack rubyPickaxeStack = new ItemStack(rubyPickaxe);

                ItemStack rubySpadeStack = new ItemStack(rubySpade);

                ItemStack rubyHoeStack = new ItemStack(rubyHoe);

                ItemStack rubyBlockStack = new ItemStack(rubyBlock);

               

                // Ore Generation

                GameRegistry.registerWorldGenerator(oreManager);

               

                // Ruby Block

                GameRegistry.registerBlock(rubyBlock, "rubyBlock");

                LanguageRegistry.addName(rubyBlock, "Ruby Block");

                MinecraftForge.setBlockHarvestLevel(rubyBlock, "pickaxe", 1);   

               

                // Ruby Ore

                GameRegistry.registerBlock(rubyOre, "rubyOre");

                LanguageRegistry.addName(rubyOre, "Ruby Ore");

                MinecraftForge.setBlockHarvestLevel(rubyOre, "pickaxe", 2);

               

                // Ruby Gem

                GameRegistry.registerItem(rubyGem, "rubyGem");

                LanguageRegistry.addName(rubyGem, "Ruby");

               

                // Ruby Tools

                GameRegistry.registerItem(rubySword, "rubySword");

                LanguageRegistry.addName(rubySword, "Ruby Sword");

               

                GameRegistry.registerItem(rubyAxe, "rubyAxe");

                LanguageRegistry.addName(rubyAxe, "Ruby Axe");

               

                GameRegistry.registerItem(rubyPickaxe, "rubyPickaxe");

                LanguageRegistry.addName(rubyPickaxe, "Ruby Pickaxe");

               

                GameRegistry.registerItem(rubySpade, "rubySpade");

                LanguageRegistry.addName(rubySpade, "Ruby Spade");

               

                GameRegistry.registerItem(rubyHoe, "rubyHoe");

                LanguageRegistry.addName(rubyHoe, "Ruby Hoe");

               

                // Ruby Recipes

                GameRegistry.addRecipe(rubyBlockStack, "yyy", "yyy", "yyy", 'y', rubyStack);

                GameRegistry.addShapelessRecipe(rubyStack2, rubyBlockStack);

                GameRegistry.addRecipe(rubySwordStack, " y ", " y ", " x ", 'x', stickStack, 'y', rubyStack);

                GameRegistry.addRecipe(rubyAxeStack, "yy ", "yx ", " x ", 'x', stickStack, 'y', rubyStack);

                GameRegistry.addRecipe(rubyPickaxeStack, "yyy", " x ", " x ", 'x', stickStack, 'y', rubyStack);

                GameRegistry.addRecipe(rubySpadeStack, " y ", " x ", " x ", 'x', stickStack, 'y', rubyStack);

                GameRegistry.addRecipe(rubyHoeStack, "yy ", " x ", " x ", 'x', stickStack, 'y', rubyStack);

               

               

        }

     

        @EventHandler

        public void postInit(FMLPostInitializationEvent event) {

               

        }

     

@EventHandler

        public void preInit(FMLPreInitializationEvent event) <-----Multiple markers at this line

- Syntax error on token ")", ;

expected

- Syntax error on token "(", ;

expected {

               

        }

     

        @EventHandler

        public void load(FMLInitializationEvent event) <------Multiple markers at this line

- Syntax error on token ")", ;

expected

- Syntax error on token "(", ;

expected {

                proxy.registerRenderers();

               

                // Ruby Tool Stacks

                ItemStack rubyStack = new ItemStack(rubyGem);

                ItemStack rubyStack2 = new ItemStack(rubyGem, 9);

                ItemStack stickStack = new ItemStack(Item.stick);

                ItemStack rubySwordStack = new ItemStack(rubySword);

                ItemStack rubyAxeStack = new ItemStack(rubyAxe);

                ItemStack rubyPickaxeStack = new ItemStack(rubyPickaxe);

                ItemStack rubySpadeStack = new ItemStack(rubySpade);

                ItemStack rubyHoeStack = new ItemStack(rubyHoe);

                ItemStack rubyBlockStack = new ItemStack(rubyBlock);

               

                // Ore Generation

                GameRegistry.registerWorldGenerator(oreManager);

               

                // Ruby Block

                GameRegistry.registerBlock(rubyBlock, "rubyBlock");

                LanguageRegistry.addName(rubyBlock, "Ruby Block");

                MinecraftForge.setBlockHarvestLevel(rubyBlock, "pickaxe", 1);   

               

                // Ruby Ore

                GameRegistry.registerBlock(rubyOre, "rubyOre");

                LanguageRegistry.addName(rubyOre, "Ruby Ore");

                MinecraftForge.setBlockHarvestLevel(rubyOre, "pickaxe", 2);

               

                // Ruby Gem

                GameRegistry.registerItem(rubyGem, "rubyGem");

                LanguageRegistry.addName(rubyGem, "Ruby");

               

                // Ruby Tools

                GameRegistry.registerItem(rubySword, "rubySword");

                LanguageRegistry.addName(rubySword, "Ruby Sword");

               

                GameRegistry.registerItem(rubyAxe, "rubyAxe");

                LanguageRegistry.addName(rubyAxe, "Ruby Axe");

               

                GameRegistry.registerItem(rubyPickaxe, "rubyPickaxe");

                LanguageRegistry.addName(rubyPickaxe, "Ruby Pickaxe");

               

                GameRegistry.registerItem(rubySpade, "rubySpade");

                LanguageRegistry.addName(rubySpade, "Ruby Spade");

               

                GameRegistry.registerItem(rubyHoe, "rubyHoe");

                LanguageRegistry.addName(rubyHoe, "Ruby Hoe");

               

                // Ruby Recipes

                GameRegistry.addRecipe(rubyBlockStack, "yyy", "yyy", "yyy", 'y', rubyStack);

                GameRegistry.addShapelessRecipe(rubyStack2, rubyBlockStack);

                GameRegistry.addRecipe(rubySwordStack, " y ", " y ", " x ", 'x', stickStack, 'y', rubyStack);

                GameRegistry.addRecipe(rubyAxeStack, "yy ", "yx ", " x ", 'x', stickStack, 'y', rubyStack);

                GameRegistry.addRecipe(rubyPickaxeStack, "yyy", " x ", " x ", 'x', stickStack, 'y', rubyStack);

                GameRegistry.addRecipe(rubySpadeStack, " y ", " x ", " x ", 'x', stickStack, 'y', rubyStack);

                GameRegistry.addRecipe(rubyHoeStack, "yy ", " x ", " x ", 'x', stickStack, 'y', rubyStack);

               

               

        }

     

        @EventHandler

        public void postInit(FMLPostInitializationEvent event) <--- Multiple markers at this line

- Syntax error on token ")", ;

expected

- Syntax error on token "(", ;

expected {

               

        }

     

} <------ Syntax error, insert "}" to complete

ClassBody

Link to comment
Share on other sites

@EventHandler
        public void preInit(FMLPreInitializationEvent event) <-----Multiple markers at this line
   - Syntax error on token ")", ; 
    expected
   - Syntax error on token "(", ; 
    expected {
                
        }

needs to be this

@EventHandler
        public void preInit(FMLPreInitializationEvent event){

        }

------------------------------------------------------------------

@EventHandler
        public void load(FMLInitializationEvent event) <------Multiple markers at this line
   - Syntax error on token ")", ; 
    expected
   - Syntax error on token "(", ; 
    expected {
                proxy.registerRenderers();
                
                // Ruby Tool Stacks
                ItemStack rubyStack = new ItemStack(rubyGem);
                ItemStack rubyStack2 = new ItemStack(rubyGem, 9);
                ItemStack stickStack = new ItemStack(Item.stick);
                ItemStack rubySwordStack = new ItemStack(rubySword);
                ItemStack rubyAxeStack = new ItemStack(rubyAxe);
                ItemStack rubyPickaxeStack = new ItemStack(rubyPickaxe);
                ItemStack rubySpadeStack = new ItemStack(rubySpade);
                ItemStack rubyHoeStack = new ItemStack(rubyHoe);
                ItemStack rubyBlockStack = new ItemStack(rubyBlock);
                
                // Ore Generation
                GameRegistry.registerWorldGenerator(oreManager);
                
                // Ruby Block
                GameRegistry.registerBlock(rubyBlock, "rubyBlock");
                LanguageRegistry.addName(rubyBlock, "Ruby Block");
                MinecraftForge.setBlockHarvestLevel(rubyBlock, "pickaxe", 1);    
                
                // Ruby Ore
                GameRegistry.registerBlock(rubyOre, "rubyOre");
                LanguageRegistry.addName(rubyOre, "Ruby Ore");
                MinecraftForge.setBlockHarvestLevel(rubyOre, "pickaxe", 2);
                
                // Ruby Gem
                GameRegistry.registerItem(rubyGem, "rubyGem");
                LanguageRegistry.addName(rubyGem, "Ruby");
                
                // Ruby Tools
                GameRegistry.registerItem(rubySword, "rubySword");
                LanguageRegistry.addName(rubySword, "Ruby Sword");
                
                GameRegistry.registerItem(rubyAxe, "rubyAxe");
                LanguageRegistry.addName(rubyAxe, "Ruby Axe");
                
                GameRegistry.registerItem(rubyPickaxe, "rubyPickaxe");
                LanguageRegistry.addName(rubyPickaxe, "Ruby Pickaxe");
                
                GameRegistry.registerItem(rubySpade, "rubySpade");
                LanguageRegistry.addName(rubySpade, "Ruby Spade");
                
                GameRegistry.registerItem(rubyHoe, "rubyHoe");
                LanguageRegistry.addName(rubyHoe, "Ruby Hoe");
                
                // Ruby Recipes
                GameRegistry.addRecipe(rubyBlockStack, "yyy", "yyy", "yyy", 'y', rubyStack);
                GameRegistry.addShapelessRecipe(rubyStack2, rubyBlockStack);
                GameRegistry.addRecipe(rubySwordStack, " y ", " y ", " x ", 'x', stickStack, 'y', rubyStack);
                GameRegistry.addRecipe(rubyAxeStack, "yy ", "yx ", " x ", 'x', stickStack, 'y', rubyStack);
                GameRegistry.addRecipe(rubyPickaxeStack, "yyy", " x ", " x ", 'x', stickStack, 'y', rubyStack);
                GameRegistry.addRecipe(rubySpadeStack, " y ", " x ", " x ", 'x', stickStack, 'y', rubyStack);
                GameRegistry.addRecipe(rubyHoeStack, "yy ", " x ", " x ", 'x', stickStack, 'y', rubyStack);
                
                
        }

needs to be this

@EventHandler
        public void load(FMLInitializationEvent event){

                proxy.registerRenderers();
                
                // Ruby Tool Stacks
                ItemStack rubyStack = new ItemStack(rubyGem);
                ItemStack rubyStack2 = new ItemStack(rubyGem, 9);
                ItemStack stickStack = new ItemStack(Item.stick);
                ItemStack rubySwordStack = new ItemStack(rubySword);
                ItemStack rubyAxeStack = new ItemStack(rubyAxe);
                ItemStack rubyPickaxeStack = new ItemStack(rubyPickaxe);
                ItemStack rubySpadeStack = new ItemStack(rubySpade);
                ItemStack rubyHoeStack = new ItemStack(rubyHoe);
                ItemStack rubyBlockStack = new ItemStack(rubyBlock);
                
                // Ore Generation
                GameRegistry.registerWorldGenerator(oreManager);
                
                // Ruby Block
                GameRegistry.registerBlock(rubyBlock, "rubyBlock");
                LanguageRegistry.addName(rubyBlock, "Ruby Block");
                MinecraftForge.setBlockHarvestLevel(rubyBlock, "pickaxe", 1);    
                
                // Ruby Ore
                GameRegistry.registerBlock(rubyOre, "rubyOre");
                LanguageRegistry.addName(rubyOre, "Ruby Ore");
                MinecraftForge.setBlockHarvestLevel(rubyOre, "pickaxe", 2);
                
                // Ruby Gem
                GameRegistry.registerItem(rubyGem, "rubyGem");
                LanguageRegistry.addName(rubyGem, "Ruby");
                
                // Ruby Tools
                GameRegistry.registerItem(rubySword, "rubySword");
                LanguageRegistry.addName(rubySword, "Ruby Sword");
                
                GameRegistry.registerItem(rubyAxe, "rubyAxe");
                LanguageRegistry.addName(rubyAxe, "Ruby Axe");
                
                GameRegistry.registerItem(rubyPickaxe, "rubyPickaxe");
                LanguageRegistry.addName(rubyPickaxe, "Ruby Pickaxe");
                
                GameRegistry.registerItem(rubySpade, "rubySpade");
                LanguageRegistry.addName(rubySpade, "Ruby Spade");
                
                GameRegistry.registerItem(rubyHoe, "rubyHoe");
                LanguageRegistry.addName(rubyHoe, "Ruby Hoe");
                
                // Ruby Recipes
                GameRegistry.addRecipe(rubyBlockStack, "yyy", "yyy", "yyy", 'y', rubyStack);
                GameRegistry.addShapelessRecipe(rubyStack2, rubyBlockStack);
                GameRegistry.addRecipe(rubySwordStack, " y ", " y ", " x ", 'x', stickStack, 'y', rubyStack);
                GameRegistry.addRecipe(rubyAxeStack, "yy ", "yx ", " x ", 'x', stickStack, 'y', rubyStack);
                GameRegistry.addRecipe(rubyPickaxeStack, "yyy", " x ", " x ", 'x', stickStack, 'y', rubyStack);
                GameRegistry.addRecipe(rubySpadeStack, " y ", " x ", " x ", 'x', stickStack, 'y', rubyStack);
                GameRegistry.addRecipe(rubyHoeStack, "yy ", " x ", " x ", 'x', stickStack, 'y', rubyStack);
                
                
        }

 

Please learn some java because this is bad written java code and Minecraft forge is not a java tutorial place

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.