Jump to content

[1.6.4] World Gen Error Help please


daddysboy2001

Recommended Posts

hey i get this error when i try to call on .blockID of my block

Error: Cannot Make a static reference to a non-static field "CobaltBlock.blockID"

 

World Gen Class

 

package ca.WorldGen;

 

import java.util.Random;

 

import ca.CobaltOre;

import net.minecraft.world.World;

import net.minecraft.world.chunk.IChunkProvider;

import net.minecraft.world.gen.feature.WorldGenMinable;

import cpw.mods.fml.common.IWorldGenerator;

 

public class CobaltOreGen implements IWorldGenerator{

 

@Override

public void generate(Random random, int chunkX, int chunkZ, World world,

IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {

// TODO Auto-generated method stub

 

switch(world.provider.dimensionId) {

case -1:

generateNether();

break;

case 0:

generateSurface(world, random, chunkX*16, chunkZ*16);

break;

case 1:

generateEnd();

break;

}

}

 

public void generateNether() {

//we're not doing ore ore in the nether

}

 

public void generateSurface(World world, Random rand, int chunkX, int chunkZ) {

for (int i = 0; i < 30; i++) {

int randPosX = chunkX + rand.nextInt(16);

int randPosY = rand.nextInt(64);

int randPosZ = chunkZ + rand.nextInt(16);

 

(new WorldGenMinable(CobaltOre.blockID, 10)).generate(world, rand,

randPosX, randPosY, randPosZ);

}

}

 

public void generateEnd() {

//we're not going to generate in the end either

}

 

 

}

 

 

 

 

Main Class

 

package ca;

 

import java.util.Random;

 

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.item.Item;

import net.minecraft.world.World;

import net.minecraft.world.chunk.IChunkProvider;

import net.minecraft.world.gen.feature.WorldGenMinable;

import cpw.mods.fml.common.IWorldGenerator;

import cpw.mods.fml.common.Mod;

import cpw.mods.fml.common.Mod.EventHandler;

import cpw.mods.fml.common.Mod.Instance;

import cpw.mods.fml.common.SidedProxy;

import cpw.mods.fml.common.event.FMLInitializationEvent;

import cpw.mods.fml.common.event.FMLPostInitializationEvent;

import cpw.mods.fml.common.event.FMLPreInitializationEvent;

import cpw.mods.fml.common.network.NetworkMod;

import cpw.mods.fml.common.registry.GameRegistry;

import cpw.mods.fml.common.registry.LanguageRegistry;

import ca.proxys.CommonProxy;

 

@Mod(modid="ca", name="customarmor", version="0.0.2")

@NetworkMod(clientSideRequired = true, serverSideRequired = false)

public class ca {

 

public static final String modid ="Custom_Armor";

 

    // Says where the client and server 'proxy' code is loaded.

    @SidedProxy(clientSide="db.mods.ca.proxys.ClientProxy", serverSide="db.mods.ca.proxys.CommonProxy")

    public static CommonProxy proxy;

   

    @EventHandler // used in 1.6.2

    //@PreInit    // used in 1.5.2

    public void preInit(FMLPreInitializationEvent event) {

            // Stub Method

    }

   

    @EventHandler // used in 1.6.2

    //@Init      // used in 1.5.2

    public void load(FMLInitializationEvent event) {

            proxy.registerRenderers();

   

           

           

           

            //Items

           

            final Item CobaltIngot = new CobaltIngot(501)

            .setMaxStackSize(32)

            .setCreativeTab(CreativeTabs.tabMaterials)

            .setUnlocalizedName("CobaltIngot");

 

       

       

           

            //Block Details

           

            //Cobalt

            final Block CobaltBlock = new CobaltBlock(500, Material.iron)

            .setResistance(9999.0F)

            .setHardness(0.5F).setStepSound(Block.soundStoneFootstep)

            .setUnlocalizedName("CobaltBlock")

            .setCreativeTab(CreativeTabs.tabBlock);

           

            final Block CobaltOre = new CobaltOre(502, Material.iron)

            .setResistance(9999.0F)

            .setHardness(0.5F).setStepSound(Block.soundStoneFootstep)

            .setUnlocalizedName("CobaltOre")

            .setCreativeTab(CreativeTabs.tabBlock);

           

            //Define World Gen

            //CobaltOreGen CobaltOreGenb = new CobaltOreGen();

           

            //Register World Generation

            //GameRegistry.registerWorldGenerator(CobaltOreGenb);

   

   

           

    }

      @EventHandler // used in 1.6.2

    //@PostInit  // used in 1.5.2

    public void postInit(FMLPostInitializationEvent event) {

            // Stub Method

    }

 

//Items

 

public static final Item CobaltIngot = new CobaltIngot(501)

.setMaxStackSize(32)

.setCreativeTab(CreativeTabs.tabMaterials)

.setUnlocalizedName("CobaltIngot");

 

 

 

 

//Block Details

 

//Cobalt

public static final Block CobaltBlock = new CobaltBlock(500, Material.iron)

.setResistance(9999.0F)

.setHardness(0.5F).setStepSound(Block.soundStoneFootstep)

.setUnlocalizedName("CobaltBlock")

.setCreativeTab(CreativeTabs.tabBlock);

 

public static final Block CobaltOre = new CobaltOre(501, Material.iron)

.setResistance(9999.0F)

.setHardness(0.5F).setStepSound(Block.soundStoneFootstep)

.setUnlocalizedName("CobaltOre")

.setCreativeTab(CreativeTabs.tabBlock);

}

 

 

 

 

 

 

 

Cobalt Ore Class(My Block)

 

 

package ca;

 

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.client.renderer.texture.IconRegister;

 

public class CobaltOre extends Block{

 

public CobaltOre(int id, Material Material) {

super(id, Material);

}

 

 

 

public void registerIcons(IconRegister par1IconRegister)

    {

        this.blockIcon = par1IconRegister.registerIcon("customarmor:CobaltOre");

    }

}

 

 

Link to comment
Share on other sites

You've overloaded your naming scheme.  It can't tell the difference between CobaltBlock and CobaltBlock.

(One of those is a class, the other is an instance of that class, which is which?)

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Rename the instance variable.  That would fix it.

I don't need to tell you how to fix it, because doing so would make me look patronizing.

 

 

Select the variable, hit delete, type cobaltBlock with a lower case C, now rename allll the other ones to match....

 

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

new WorldGenMinable(CobaltOre.blockID, 10)

 

And what's that?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

That should be correct.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Then you haven't found all of them.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Modder Support topic subtitle: "(...) please keep in mind that this is not a Java school. You are expected to have basic knowledge of Java before posting here." Basic Java includes the understanding of OOP logic.

Author of PneumaticCraft, MineChess, Minesweeper Mod and Sokoban Mod. Visit www.minemaarten.com to take a look at them.

Link to comment
Share on other sites

Modder Support topic subtitle: "(...) please keep in mind that this is not a Java school. You are expected to have basic knowledge of Java before posting here." Basic Java includes the understanding of OOP logic.

Go To the tutorial for the basics it requires that. but it also says you could learn it along the way. so im learning it along the way
Link to comment
Share on other sites

Do you or do you not know what "a static reference" and a "a non-static field" are?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Thanks Draco. And the way you're doing it is great :). I just want to say, if you get any compile time errors, this is Java, and if you google it you'll most certainly find a solution. These solutions don't have to be Minecraft related in any way off course.

Author of PneumaticCraft, MineChess, Minesweeper Mod and Sokoban Mod. Visit www.minemaarten.com to take a look at them.

Link to comment
Share on other sites

Thanks you i fixed to thanks to none of you. fuck the forge community its full of people who try to murder people who help

 

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.

 

Did you finally name your variable something other than the same name as your class?  And start referencing that variable properly?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Dude thanks for the help and all but I removed the client side mods that were failing in the crashlog and now everything runs!
    • Hello, Hi and I am making a forge 1.12.2 mod and also trying to get a custom model helmet item (I made a joker mask) and exported it to .json format and put it in the ~/namespace/models/item folder. Though, I'm struggling to get the item to render what I want it to be rendered like as I've positioned it in the 'head' window view in blockbench. How did you render out your model? I checked your code and it looks like no references to the actual model are being made. I'm new to this forge modding stuff (was a fabric modder) and I desperately need some help. Is there a way to standardly render out armor models made using blockbench? any methods that one can use? My model in JSON: ```json { "credit": "Made with Blockbench", "texture_size": [160, 160], "textures": { "0": "ydyrn:items/joker_mask_texture", "particle": "ydyrn:items/joker_mask_texture" }, "elements": [ { "from": [0, 0, 0], "to": [16, 16, 1], "faces": { "north": {"uv": [0, 1.7, 16, 14.2], "texture": "#0"}, "east": {"uv": [0, 4, 0.9, 5.6], "texture": "#0"}, "south": {"uv": [0, 5.8, 1.6, 7.4], "texture": "#0"}, "west": {"uv": [0, 1.9, 1.3, 3.5], "texture": "#0"}, "up": {"uv": [0, 3.4, 1.6, 4.2], "texture": "#0"}, "down": {"uv": [0, 9, 1.6, 9.7], "texture": "#0"} } }, { "from": [15.8, 11, 0.5], "to": [16.2, 13, 15], "faces": { "north": {"uv": [7.9, 7.9, 7.94, 8.1], "texture": "#0"}, "east": {"uv": [7.9, 7.9, 9.35, 8.1], "texture": "#0"}, "south": {"uv": [7.9, 7.9, 7.94, 8.1], "texture": "#0"}, "west": {"uv": [7.9, 7.9, 9.35, 8.1], "texture": "#0"}, "up": {"uv": [7.9, 7.9, 7.94, 9.35], "texture": "#0"}, "down": {"uv": [7.9, 7.9, 7.94, 9.35], "texture": "#0"} } }, { "from": [0.2, 11, 14.6], "to": [15.8, 13, 15], "faces": { "north": {"uv": [7.9, 7.9, 9.46, 8.1], "texture": "#0"}, "east": {"uv": [7.9, 7.9, 7.94, 8.1], "texture": "#0"}, "south": {"uv": [7.9, 7.9, 9.46, 8.1], "texture": "#0"}, "west": {"uv": [7.9, 7.9, 7.94, 8.1], "texture": "#0"}, "up": {"uv": [7.9, 7.9, 9.46, 7.94], "texture": "#0"}, "down": {"uv": [7.9, 7.9, 9.46, 7.94], "texture": "#0"} } }, { "from": [-0.2, 11, 0.5], "to": [0.2, 13, 15], "faces": { "north": {"uv": [7.9, 7.9, 7.94, 8.1], "texture": "#0"}, "east": {"uv": [7.9, 7.9, 9.35, 8.1], "texture": "#0"}, "south": {"uv": [7.9, 7.9, 7.94, 8.1], "texture": "#0"}, "west": {"uv": [7.9, 7.9, 9.35, 8.1], "texture": "#0"}, "up": {"uv": [7.9, 7.9, 7.94, 9.35], "texture": "#0"}, "down": {"uv": [7.9, 7.9, 7.94, 9.35], "texture": "#0"} } } ], "display": { "thirdperson_righthand": { "translation": [-0.25, -2.75, 0], "scale": [0.3, 0.3, 0.3] }, "thirdperson_lefthand": { "translation": [-0.25, -2.75, 0], "scale": [0.3, 0.3, 0.3] }, "firstperson_righthand": { "rotation": [-9, 115, 15], "translation": [0, 1.25, -1.75], "scale": [0.5, 0.5, 0.5] }, "firstperson_lefthand": { "rotation": [-9, 115, 15], "translation": [0, 1.25, -1.75], "scale": [0.5, 0.5, 0.5] }, "ground": { "rotation": [40, 0, 0], "translation": [0, -2.5, 0], "scale": [0.5, 0.5, 0.5] }, "gui": { "rotation": [0, 180, 0] }, "head": { "translation": [0, 0, 0.25], "scale": [0.82773, 0.73594, 0.9] }, "fixed": { "translation": [0, 0, 8.75] } }, "groups": [ 0, { "name": "straps", "origin": [0, 0, 0], "color": 0, "children": [1, 2, 3] } ] } ```
    • Add the crash-report or latest.log (logs-folder) with sites like https://paste.ee/ and paste the link to it here  
    • In your config folder, delete the sophisticatedcore-common.toml file and test it again
  • Topics

×
×
  • Create New...

Important Information

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