Jump to content

Recommended Posts

Posted

Hello, when I try to recompile a mod it shows me an error message. (Cannot find symbol)

 

This is the mod file:

 

package net.minecraft.src;

import cpw.*;
import cpw.mods.*;
import cpw.mods.fml.*;
import cpw.mods.fml.client.*;
import cpw.mods.fml.client.modloader.*;
import cpw.mods.fml.client.registry.*;
import cpw.mods.fml.common.*;
import cpw.mods.fml.common.asm.*;
import cpw.mods.fml.common.asm.transformers.*;
import cpw.mods.fml.common.discovery.*;
import cpw.mods.fml.common.discovery.asm.*;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.functions.*;
import cpw.mods.fml.common.modloader.*;
import cpw.mods.fml.common.network.*;
import cpw.mods.fml.common.registry.*;
import cpw.mods.fml.common.toposort.*;
import cpw.mods.fml.common.versioning.*;
import cpw.mods.fml.relauncher.*;
import cpw.mods.fml.server.*;
import ibxm.*;
import net.*;
import net.minecraft.*;
import net.minecraft.block.*;
import net.minecraft.block.material.*;
import net.minecraft.client.*;
import net.minecraft.client.audio.*;
import net.minecraft.client.entity.*;
import net.minecraft.client.gui.*;
import net.minecraft.client.gui.achievement.*;
import net.minecraft.client.gui.inventory.*;
import net.minecraft.client.model.*;
import net.minecraft.client.multiplayer.*;
import net.minecraft.client.particle.*;
import net.minecraft.client.renderer.*;
import net.minecraft.client.renderer.culling.*;
import net.minecraft.client.renderer.entity.*;
import net.minecraft.client.renderer.texturefx.*;
import net.minecraft.client.renderer.tileentity.*;
import net.minecraft.client.settings.*;
import net.minecraft.client.texturepacks.*;
import net.minecraft.command.*;
import net.minecraft.crash.*;
import net.minecraft.creativetab.*;
import net.minecraft.dispenser.*;
import net.minecraft.enchantment.*;
import net.minecraft.entity.*;
import net.minecraft.entity.ai.*;
import net.minecraft.entity.boss.*;
import net.minecraft.entity.effect.*;
import net.minecraft.entity.item.*;
import net.minecraft.entity.monster.*;
import net.minecraft.entity.passive.*;
import net.minecraft.entity.player.*;
import net.minecraft.entity.projectile.*;
import net.minecraft.inventory.*;
import net.minecraft.item.*;
import net.minecraft.item.crafting.*;
import net.minecraft.nbt.*;
import net.minecraft.network.*;
import net.minecraft.network.packet.*;
import net.minecraft.network.rcon.*;
import net.minecraft.pathfinding.*;
import net.minecraft.potion.*;
import net.minecraft.profiler.*;
import net.minecraft.server.*;
import net.minecraft.server.dedicated.*;
import net.minecraft.server.gui.*;
import net.minecraft.server.integrated.*;
import net.minecraft.server.management.*;
import net.minecraft.src.*;
import net.minecraft.stats.*;
import net.minecraft.tileentity.*;
import net.minecraft.util.*;
import net.minecraft.village.*;
import net.minecraft.world.*;
import net.minecraft.world.biome.*;
import net.minecraft.world.chunk.*;
import net.minecraft.world.chunk.storage.*;
import net.minecraft.world.demo.*;
import net.minecraft.world.gen.*;
import net.minecraft.world.gen.feature.*;
import net.minecraft.world.gen.layer.*;
import net.minecraft.world.gen.structure.*;
import net.minecraft.world.storage.*;
import net.minecraftforge.*;
import net.minecraftforge.classloading.*;
import net.minecraftforge.client.*;
import net.minecraftforge.client.event.*;
import net.minecraftforge.client.event.sound.*;
import net.minecraftforge.common.*;
import net.minecraftforge.event.*;
import net.minecraftforge.event.entity.*;
import net.minecraftforge.event.entity.item.*;
import net.minecraftforge.event.entity.living.*;
import net.minecraftforge.event.entity.minecart.*;
import net.minecraftforge.event.entity.player.*;
import net.minecraftforge.event.terraingen.*;
import net.minecraftforge.event.world.*;
import net.minecraftforge.liquids.*;
import net.minecraftforge.oredict.*;
import net.minecraftforge.transformers.*;
import paulscode.*;
import paulscode.sound.*;
import paulscode.sound.codecs.*;

import java.util.Random;

public class mod_rubyoreblock extends BaseMod{

public mod_rubyoreblock(){}

public static BlockRubyoreblock block;

public void load(){

ModLoader.registerBlock(block);
ModLoader.addName(block, "Ruby Ore");

}
public String getVersion(){
return "1.0";
}


static{

block = (BlockRubyoreblock)(new BlockRubyoreblock(148, 1).setHardness(7.0F)
.setResistance(10.0F)
.setLightValue(0.0F)
.setBlockName("Ruby Ore")
.setLightOpacity(0)
.setStepSound(Block.soundStoneFootstep)
.setCreativeTab(CreativeTabs.tabBlock)
.setRequiresSelfNotify()
);block.blockIndexInTexture=block.a1;
block.setBlockBounds(0.0F,0.0F,0.0F,1.0F,1.0F,1.0F);
MinecraftForge.setBlockHarvestLevel(block, "pickaxe", 0);
}


public void generateSurface(World world, java.util.Random rand, int chunkX, int chunkZ){
for(int i = 0; i < 25; i++){
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(256)+0;
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_rubyoreblock.block.blockID, 31)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}

static class BlockRubyoreblock extends Block
{

int a1 = 0,a2 = 0,a3 = 0,a4 = 0,a5 = 0,a6 = 0;

boolean red = false;





protected BlockRubyoreblock(int i, int j)
{
        super(i, j, Material.iron);
a1 = 0;
a2 = 0;
a3 = 0;
a4 = 0;
a5 = 0;
a6 = 0;

}
public boolean isPoweringTo(IBlockAccess blockAccess, int i, int j, int k, int l){
return red;
}
public int getBlockTextureFromSide(int i){

if (i == 0)
return a1;

else if (i == 1)
return a2;

else if (i == 2)
return a3;

else if (i == 3)
return a4;

else if (i == 4)
return a5;

else if (i == 5)
return a6;

else
return a1;

}

public String getTextureFile(){return "/Ores.png";}
public int getRenderType(){
return 0;
}
public int tickRate()
{
    return 10;
}

public int quantityDropped(Random par1Random){
return 1;
}

public int idDropped(int par1, Random par2Random, int par3){
return mod_rubygem.block.shiftedIndex;
}
}
}

 

And this is the error message:

 

== MCP 7.26 (data: 7.26, client: 1.4.7, server: 1.4.7) ==
# found ff, ff patches, srgs, name csvs, doc csvs, param csvs, renumber csv, astyle, astyle config
== Recompiling client ==
> Cleaning bin
> Recompiling
'"E:\Program Files\Java\jdk1.7.0_17\bin\javac" -encoding UTF-8 -Xlint:-options -deprecation -g -sourc...' failed : 1

== ERRORS FOUND ==

src\minecraft\cpw\mods\fml\common\modloader\ModLoaderDispenseHelper.java:8: warning: [deprecation] IDispenseHandler in cpw.mods.fml.common has been deprecated
import cpw.mods.fml.common.IDispenseHandler;
                          ^

src\minecraft\cpw\mods\fml\common\modloader\ModLoaderDispenseHelper.java:9: warning: [deprecation] IDispenserHandler in cpw.mods.fml.common has been deprecated
import cpw.mods.fml.common.IDispenserHandler;
                          ^

src\minecraft\cpw\mods\fml\common\modloader\ModLoaderDispenseHelper.java:11: warning: [deprecation] IDispenserHandler in cpw.mods.fml.common has been deprecated
public class ModLoaderDispenseHelper implements IDispenserHandler
                                                ^

src\minecraft\cpw\mods\fml\common\modloader\ModLoaderHelper.java:39: warning: [deprecation] IDispenseHandler in cpw.mods.fml.common has been deprecated
import cpw.mods.fml.common.IDispenseHandler;
                          ^

src\minecraft\cpw\mods\fml\common\modloader\ModLoaderHelper.java:40: warning: [deprecation] IDispenserHandler in cpw.mods.fml.common has been deprecated
import cpw.mods.fml.common.IDispenserHandler;
                          ^

src\minecraft\cpw\mods\fml\common\registry\GameRegistry.java:39: warning: [deprecation] IDispenseHandler in cpw.mods.fml.common has been deprecated
import cpw.mods.fml.common.IDispenseHandler;
                          ^

src\minecraft\cpw\mods\fml\common\registry\GameRegistry.java:40: warning: [deprecation] IDispenserHandler in cpw.mods.fml.common has been deprecated
import cpw.mods.fml.common.IDispenserHandler;
                          ^

src\minecraft\cpw\mods\fml\common\modloader\ModLoaderModContainer.java:528: warning: [deprecation] registerDispenserHandler(IDispenserHandler) in GameRegistry has been deprecated
            GameRegistry.registerDispenserHandler(ModLoaderHelper.buildDispenseHelper(mod));
                        ^

src\minecraft\net\minecraft\src\ModLoader.java:638: warning: [deprecation] registerBlock(Block) in GameRegistry has been deprecated
        GameRegistry.registerBlock(block);
                    ^

src\minecraft\net\minecraft\src\ModLoader.java:649: warning: [deprecation] registerBlock(Block,Class<? extends ItemBlock>) in GameRegistry has been deprecated
        GameRegistry.registerBlock(block, itemclass);
                    ^

src\minecraft\net\minecraft\src\mod_rubyoreblock.java:217: error: cannot find symbol
return mod_rubygem.block.shiftedIndex;
                        ^

  symbol:   variable shiftedIndex
  location: variable block of type Item
1 error
10 warnings
==================

!! Can not find server sources, try decompiling !!

 

I hope that someone will help me as soon as possible, thanks..

 

Edit:

 

When I remove this piece of code:

public int idDropped(int par1, Random par2Random, int par3){
return mod_rubygem.block.shiftedIndex;
}

it works fine..

 

 

Posted
package net.minecraft.src;

import cpw.*;
import cpw.mods.*;
import cpw.mods.fml.*;
import cpw.mods.fml.client.*;
import cpw.mods.fml.client.modloader.*;
import cpw.mods.fml.client.registry.*;
import cpw.mods.fml.common.*;
import cpw.mods.fml.common.asm.*;
import cpw.mods.fml.common.asm.transformers.*;
import cpw.mods.fml.common.discovery.*;
import cpw.mods.fml.common.discovery.asm.*;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.functions.*;
import cpw.mods.fml.common.modloader.*;
import cpw.mods.fml.common.network.*;
import cpw.mods.fml.common.registry.*;
import cpw.mods.fml.common.toposort.*;
import cpw.mods.fml.common.versioning.*;
import cpw.mods.fml.relauncher.*;
import cpw.mods.fml.server.*;
import ibxm.*;
import net.*;
import net.minecraft.*;
import net.minecraft.block.*;
import net.minecraft.block.material.*;
import net.minecraft.client.*;
import net.minecraft.client.audio.*;
import net.minecraft.client.entity.*;
import net.minecraft.client.gui.*;
import net.minecraft.client.gui.achievement.*;
import net.minecraft.client.gui.inventory.*;
import net.minecraft.client.model.*;
import net.minecraft.client.multiplayer.*;
import net.minecraft.client.particle.*;
import net.minecraft.client.renderer.*;
import net.minecraft.client.renderer.culling.*;
import net.minecraft.client.renderer.entity.*;
import net.minecraft.client.renderer.texturefx.*;
import net.minecraft.client.renderer.tileentity.*;
import net.minecraft.client.settings.*;
import net.minecraft.client.texturepacks.*;
import net.minecraft.command.*;
import net.minecraft.crash.*;
import net.minecraft.creativetab.*;
import net.minecraft.dispenser.*;
import net.minecraft.enchantment.*;
import net.minecraft.entity.*;
import net.minecraft.entity.ai.*;
import net.minecraft.entity.boss.*;
import net.minecraft.entity.effect.*;
import net.minecraft.entity.item.*;
import net.minecraft.entity.monster.*;
import net.minecraft.entity.passive.*;
import net.minecraft.entity.player.*;
import net.minecraft.entity.projectile.*;
import net.minecraft.inventory.*;
import net.minecraft.item.*;
import net.minecraft.item.crafting.*;
import net.minecraft.nbt.*;
import net.minecraft.network.*;
import net.minecraft.network.packet.*;
import net.minecraft.network.rcon.*;
import net.minecraft.pathfinding.*;
import net.minecraft.potion.*;
import net.minecraft.profiler.*;
import net.minecraft.server.*;
import net.minecraft.server.dedicated.*;
import net.minecraft.server.gui.*;
import net.minecraft.server.integrated.*;
import net.minecraft.server.management.*;
import net.minecraft.src.*;
import net.minecraft.stats.*;
import net.minecraft.tileentity.*;
import net.minecraft.util.*;
import net.minecraft.village.*;
import net.minecraft.world.*;
import net.minecraft.world.biome.*;
import net.minecraft.world.chunk.*;
import net.minecraft.world.chunk.storage.*;
import net.minecraft.world.demo.*;
import net.minecraft.world.gen.*;
import net.minecraft.world.gen.feature.*;
import net.minecraft.world.gen.layer.*;
import net.minecraft.world.gen.structure.*;
import net.minecraft.world.storage.*;
import net.minecraftforge.*;
import net.minecraftforge.classloading.*;
import net.minecraftforge.client.*;
import net.minecraftforge.client.event.*;
import net.minecraftforge.client.event.sound.*;
import net.minecraftforge.common.*;
import net.minecraftforge.event.*;
import net.minecraftforge.event.entity.*;
import net.minecraftforge.event.entity.item.*;
import net.minecraftforge.event.entity.living.*;
import net.minecraftforge.event.entity.minecart.*;
import net.minecraftforge.event.entity.player.*;
import net.minecraftforge.event.terraingen.*;
import net.minecraftforge.event.world.*;
import net.minecraftforge.liquids.*;
import net.minecraftforge.oredict.*;
import net.minecraftforge.transformers.*;
import paulscode.*;
import paulscode.sound.*;
import paulscode.sound.codecs.*;

What... The... fuck?

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Please see https://forums.minecraftforge.net/topic/125488-rules-and-frequently-asked-questions-faq/ for information on how to post your log correctly.
    • Hello!  The detailed description of how you got to where you are is certainly valuable.  But, at the end of the day (well, any time of the day actually), it is going to be the actual logs that going to provide the necessary details to hopefully solve your startup issue. Part of me wonders if you have installed a client-only mod on a dedicated server.  But I may very well be wrong, and it will be the logs that will tell that story.
    • Hello there! I didn't quite know where to go regarding this, but ended up deciding to post it here. I have been running a forge server with around 200 mods for me and some friends to play on casually, but have recently started to get an issue when booting the server. This all started after I decided to add some new mods to the server. Like usual, I add a mod, test run the server for any issues, and if all is well, I'll add a next one and so on until I have added all that I wanted to. After doing so, in all test runs, it all seemed to work just fine. However, the next day, after trying to boot the server, I kept getting an error regarding java.lang.NullPointerException, towards one of the mods I had recently added. So far so good, I removed the mod that was causing the issue, started up the server again, and here in when things took a turn for the worse. I received another java.lang.NullPointerException null error that wouldn't allow me to boot the server, but this time with a mod that wasn't part of the new ones I had recently added. I found this weird, but nonetheless, I removed it thinking it might be causing some conflicts with some of the new ones. Afterwards, booting the server again proved to be impossible, as it gave me another java.lang.NullPointerException null error with the 3rd mod I had ever installed on the server! This mod was there since the start, it added some biomes and had been just fine so far. This turn of events made me remove all the newer mods I had recently added in hopes to fix this whole ordeal, but alas, to no avail. Same error, with that same biome mod that had been there since day one. Reluctantly, I removed the biome mod, booted the server, and voila! The server was running, although without a major mod that had always been there to begin with. As I do not wish to part ways with this mod, specially since it had been working so far without any issues, I tried to bring everything back to how it was before I added those new mods, but kept on getting the same java.lang.NullPointerException null error for the biome mod. Even adding the newer mods won't cause me this error, with exception of the one that started it all, which I find quite odd since the mods I had been using without any issues are now giving me the same error the newer one that started it all gave me. Now, I have checked that everything is up to date regarding the mods, forge (forge-1.20.1-47.3.12) and java. The modpack runs perfectly fine when I start Minecraft itself, and play singleplayer, or even when I open a LAN world, everything works. Everything aside from the server. From what I could gather, this java.lang.NullPointerException null error would point to a missing value of sorts, for an item perhaps, within the mod that is causing the error, but aside from removing the whole mod, I lack the knowledge on how to fix this. With this in mind, if anyone would be so kind as to shine some light into this situation, with a way to fix all this blunder, I would be most grateful!
    • If you want a mana GUI, call Minecraft.getInstance().setScreen(new ManaScreen()); somewhere display your GUI. I would recommend creating a keybind and listening to key events, and if your key bind is pressed down, running that code.
    • You are creating an entire new screen, or GUI. What you probably want is an Overlay.
  • Topics

×
×
  • Create New...

Important Information

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