Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Eclipse say an error when i create my Block class.
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
Dlooop

Eclipse say an error when i create my Block class.

By Dlooop, August 31, 2013 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

Dlooop    0

Dlooop

Dlooop    0

  • Tree Puncher
  • Dlooop
  • Members
  • 0
  • 2 posts
Posted August 31, 2013

Hi Guys,

 

I have a question: When i create a new Block class:

 

package dlooop.craftingchanges;

 

import javax.swing.text.ZoneView;

 

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

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

import net.minecraft.item.Item;

 

public class HuchasaOre extends Block{

 

public HuchasaOre(int id, Material mat) {

super(id, mat);

 

}

 

  @SideOnly(Side.CLIENT)

  public void registerIcons(IconRegister reg){

  this.blockIcon = reg.registerIcon("craftingchanges:ItemIngot");

 

  }

}

then come an error in the console:

crafting changes{2.1.1} [Crafting Changes Mod] (bin) Unloaded->Constructed->Pre-initialized->Errored

... (the directory of my pc)...  AL lib: (EE) alc_cleanup: 1 device not closed

 

In my Main class is the Huchasa Ore like this :

public static Block HuchasaOre;

public int HuchasaOreID = 13863;

 

 

HuchasaOre = new BlockHuchasaOre(HuchasaOreID, Material.iron).setUnlocalizedName("HuchasaOre").setCreativeTab(CreativeTabs.tabFood).setMaxStackSize(64);

 

 

  private void updateLanguage(){

  LanguageRegistry.addName(HuchasaOre, "Huchasa Ore");

                }

 

    private void registerBlocks(){

            GameRegistry.registerBlock(HuchasaOre, "Huchasa Ore");

    }

 

The complete error in the error.txt is :

 

 

---- Minecraft Crash Report ----

// Who set us up the TNT?

 

Time: 31.08.13 19:53

Description: There was a severe problem during mod loading that has caused the game to fail

 

cpw.mods.fml.common.LoaderException: java.lang.Error: Unresolved compilation problem:

BlockHuchasaOre cannot be resolved to a type

 

at cpw.mods.fml.common.LoadController.transition(LoadController.java:149)

at cpw.mods.fml.common.Loader.initializeMods(Loader.java:698)

at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:232)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:506)

at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796)

at net.minecraft.client.main.Main.main(Main.java:93)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)

at net.minecraft.launchwrapper.Launch.main(Launch.java:18)

Caused by: java.lang.Error: Unresolved compilation problem:

BlockHuchasaOre cannot be resolved to a type

 

at dlooop.craftingchanges.craftingchanges.init(craftingchanges.java:75)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:540)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:194)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:174)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:105)

at cpw.mods.fml.common.Loader.initializeMods(Loader.java:697)

... 10 more

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

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

 

-- System Details --

Details:

Minecraft Version: 1.6.2

Operating System: Windows 7 (amd64) version 6.1

Java Version: 1.7.0_25, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 908526336 bytes (866 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

Suspicious classes: FML and Forge are installed

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP v8.04 FML v6.2.35.804 Minecraft Forge 9.10.0.804 4 mods loaded, 4 mods active

mcp{8.04} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized

FML{6.2.35.804} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized

Forge{9.10.0.804} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized

crafting changes{2.1.1} [Crafting Changes Mod] (bin) Unloaded->Constructed->Pre-initialized->Errored

 

 

I dont know what to do when i make // befor every thing from the Block then the mod runs well but when not it crashes :(

 

Pls help me :)

 

  • Quote

Share this post


Link to post
Share on other sites

Jannis234    0

Jannis234

Jannis234    0

  • Tree Puncher
  • Jannis234
  • Members
  • 0
  • 4 posts
Posted September 1, 2013

1.) Wrong section. This is for players, there is a seperate section for modders who have porblems

2.) Your problem is that your class is named "HuchasaOre" while you are using "BlockHuchasaOre" in your main class

  • Quote

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Extrupt
      Forge won't fully download

      By Extrupt · Posted just now

      thanks for the help! it worked!
    • Luis_ST
      [1.16.5] Help with custom Backpack (slot background and mouse wheel move)

      By Luis_ST · Posted 1 minute ago

      I've already tried that and it's not how it's supposed to work. For example, if I put an item in the offand slot, the background texture is set to default. that's how it should work   I'll try the event   Another question which event should I use to open my BackpackContainer. I know that there is the KeyInputEvent when I use this I don't get a ServerPlayerEntity which I need to open the GUI with NetworkHooks#openGui. I currently use TickEvent#PlayerTickEvent which is not the best solution. Is there another / better way to do this?
    • ThisIsNotOriginal
      When I try to run my mod after I just added Deferred Registries it crashes

      By ThisIsNotOriginal · Posted 2 minutes ago

      https://github.com/hakerman74/ModPractice   This is my repo for the code I didnt add my assets file  
    • diesieben07
      Forge error Forge won't open

      By diesieben07 · Posted 3 minutes ago

      Really old Minecraft versions are no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • diesieben07
      Forge won't fully download

      By diesieben07 · Posted 4 minutes ago

      Disable it while installing.
  • Topics

    • Extrupt
      5
      Forge won't fully download

      By Extrupt
      Started 32 minutes ago

    • Luis_ST
      2
      [1.16.5] Help with custom Backpack (slot background and mouse wheel move)

      By Luis_ST
      Started Yesterday at 07:47 AM

    • ThisIsNotOriginal
      16
      When I try to run my mod after I just added Deferred Registries it crashes

      By ThisIsNotOriginal
      Started 15 hours ago

    • HDMI_Steckdose
      1
      Forge error Forge won't open

      By HDMI_Steckdose
      Started 7 minutes ago

    • Retsal
      7
      [1.16.x] Custom block as a shop

      By Retsal
      Started Yesterday at 01:04 PM

  • Who's Online (See full list)

    • Luis_ST
    • Tavi007
    • Extrupt
    • diesieben07
    • Draco18s
    • ThisIsNotOriginal
    • dresacraft
    • hugo.talento@gmail.com
    • HDMI_Steckdose
    • Katie328
    • Gorp5
    • GenElectrovise
    • troublemaker_47
    • RaySanketsu
    • J_F1Nl3Y_
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Eclipse say an error when i create my Block class.
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community