Jump to content

Strange error


vtsman

Recommended Posts

I'm getting a strange error on my mod. It works in eclipse but when I reobfuscate it, it has this error:

 

2013-03-27 17:49:03 [iNFO] [sTDERR] Exception in thread "Minecraft main thread" java.lang.NoClassDefFoundError: mods/better_recipes_vtsman/shelfTE

2013-03-27 17:49:03 [iNFO] [sTDERR] at mods.better_recipes_vtsman.betterrecipes.<init>(betterrecipes.java:79)

2013-03-27 17:49:03 [iNFO] [sTDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

2013-03-27 17:49:03 [iNFO] [sTDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

2013-03-27 17:49:03 [iNFO] [sTDERR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

2013-03-27 17:49:03 [iNFO] [sTDERR] at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

2013-03-27 17:49:03 [iNFO] [sTDERR] at java.lang.Class.newInstance0(Class.java:357)

2013-03-27 17:49:03 [iNFO] [sTDERR] at java.lang.Class.newInstance(Class.java:310)

2013-03-27 17:49:03 [iNFO] [sTDERR] at cpw.mods.fml.common.FMLModContainer$JavaAdapter.getNewInstance(FMLModContainer.java:129)

2013-03-27 17:49:03 [iNFO] [sTDERR] at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:487)

2013-03-27 17:49:03 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

2013-03-27 17:49:03 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

2013-03-27 17:49:03 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

2013-03-27 17:49:03 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Method.java:597)

2013-03-27 17:49:03 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

2013-03-27 17:49:03 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

2013-03-27 17:49:03 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

2013-03-27 17:49:03 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

2013-03-27 17:49:03 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:267)

2013-03-27 17:49:03 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)

2013-03-27 17:49:03 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

2013-03-27 17:49:03 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

2013-03-27 17:49:03 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

2013-03-27 17:49:03 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Method.java:597)

2013-03-27 17:49:03 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

2013-03-27 17:49:03 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

2013-03-27 17:49:03 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

2013-03-27 17:49:03 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

2013-03-27 17:49:03 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:267)

2013-03-27 17:49:03 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)

2013-03-27 17:49:03 [iNFO] [sTDERR] at cpw.mods.fml.common.Loader.loadMods(Loader.java:502)

2013-03-27 17:49:03 [iNFO] [sTDERR] at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:160)

2013-03-27 17:49:03 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:407)

2013-03-27 17:49:03 [iNFO] [sTDERR] at net.minecraft.client.MinecraftAppletImpl.func_71384_a(SourceFile:56)

2013-03-27 17:49:03 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:729)

2013-03-27 17:49:03 [iNFO] [sTDERR] at java.lang.Thread.run(Thread.java:680)

2013-03-27 17:49:03 [iNFO] [sTDERR] Caused by: java.lang.ClassNotFoundException: mods.better_recipes_vtsman.shelfTE

2013-03-27 17:49:03 [iNFO] [sTDERR] at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:211)

2013-03-27 17:49:03 [iNFO] [sTDERR] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

2013-03-27 17:49:03 [iNFO] [sTDERR] at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

2013-03-27 17:49:03 [iNFO] [sTDERR] ... 35 more

2013-03-27 17:49:03 [iNFO] [sTDERR] Caused by: java.lang.ClassFormatError: Duplicate method name&signature in class file mods/better_recipes_vtsman/shelfTE

2013-03-27 17:49:03 [iNFO] [sTDERR] at java.lang.ClassLoader.defineClass1(Native Method)

2013-03-27 17:49:03 [iNFO] [sTDERR] at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)

2013-03-27 17:49:03 [iNFO] [sTDERR] at java.lang.ClassLoader.defineClass(ClassLoader.java:615)

2013-03-27 17:49:03 [iNFO] [sTDERR] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)

2013-03-27 17:49:03 [iNFO] [sTDERR] at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:200)

2013-03-27 17:49:03 [iNFO] [sTDERR] ... 37 more

 

Link to comment
Share on other sites

1.5.1 likely changed something that causes your mod, betterrecipes.java at line 79 to no longer work correctly.  Likely a function name changed.

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

line 79 - 81 is pretty standard code:

public final Block emptyShelf = new emptyShelf(500, 0, Material.wood)

    .setHardness(1.5F).setStepSound(Block.soundWoodFootstep)

    .setCreativeTab(CreativeTabs.tabDecorations);

And the bookshelf is pretty simple too:

//todo: add inventory

package mods.better_recipes_vtsman;

 

import java.util.Random;

 

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.src.*;

import cpw.mods.fml.common.Mod;

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

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

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

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

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.IFuelHandler;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import net.minecraft.item.ItemStack;

import net.minecraft.block.BlockContainer;

import net.minecraft.block.material.Material;

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

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.entity.item.EntityItem;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.inventory.IInventory;

import net.minecraft.item.ItemStack;

import net.minecraft.nbt.NBTTagCompound;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.world.World;

import net.minecraft.block.BlockContainer;

import net.minecraft.block.material.Material;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.entity.item.EntityItem;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.inventory.IInventory;

import net.minecraft.item.ItemStack;

import net.minecraft.nbt.NBTTagCompound;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.util.Icon;

import net.minecraft.world.World;

import net.minecraftforge.common.ForgeHooks;

import net.minecraftforge.common.MinecraftForge;

 

public class emptyShelf extends BlockContainer {

 

        public emptyShelf (int id, int texture, Material material) {

            super(id, material);

            setUnlocalizedName("Empty Shelf");

        }

        @Override

        public void registerIcons(IconRegister par1IconRegister)

        {

                this.blockIcon = par1IconRegister.registerIcon("better_recipes_vtsman:emptyShelf");

        }

        public Icon getBlockTextureFromSideAndMetadata(int par1, int par2)

        {

            return par1 != 1 && par1 != 0 ? super.getBlockTextureFromSideAndMetadata(par1, par2) : Block.planks.getBlockTextureFromSide(par1);

        }

       

    public int getBurnTime(ItemStack fuel) {

    return 300;

    }

 

 

        @Override

        public boolean onBlockActivated(World world, int x, int y, int z,

                        EntityPlayer player, int idk, float what, float these, float are) {

                TileEntity tileEntity = world.getBlockTileEntity(x, y, z);

                if (tileEntity == null || player.isSneaking()) {

                        return false;

                }

        //code to open gui explained later

        player.openGui(betterrecipes.instance, 0, world, x, y, z);

                return true;

        }

 

        @Override

        public void breakBlock(World world, int x, int y, int z, int par5, int par6) {

                dropItems(world, x, y, z);

                super.breakBlock(world, x, y, z, par5, par6);

        }

 

        private void dropItems(World world, int x, int y, int z){

                Random rand = new Random();

 

                TileEntity tileEntity = world.getBlockTileEntity(x, y, z);

                if (!(tileEntity instanceof IInventory)) {

                        return;

                }

                IInventory inventory = (IInventory) tileEntity;

 

                for (int i = 0; i < inventory.getSizeInventory(); i++) {

                        ItemStack item = inventory.getStackInSlot(i);

 

                        if (item != null && item.stackSize > 0) {

                                float rx = rand.nextFloat() * 0.8F + 0.1F;

                                float ry = rand.nextFloat() * 0.8F + 0.1F;

                                float rz = rand.nextFloat() * 0.8F + 0.1F;

 

                                EntityItem entityItem = new EntityItem(world,

                                                x + rx, y + ry, z + rz,

                                                new ItemStack(item.itemID, item.stackSize, item.getItemDamage()));

 

                                if (item.hasTagCompound()) {

                                        //entityItems.setTagCompound((NBTTagCompound) item.getTagCompound().copy());

                                }

 

                                float factor = 0.05F;

                                entityItem.motionX = rand.nextGaussian() * factor;

                                entityItem.motionY = rand.nextGaussian() * factor + 0.2F;

                                entityItem.motionZ = rand.nextGaussian() * factor;

                                world.spawnEntityInWorld(entityItem);

                                item.stackSize = 0;

                        }

                }

                }

       

 

        @Override

        public TileEntity createNewTileEntity(World world) {

                return new shelfTE();

        }

 

}

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

    • before I updated my pack I made for paintings++ mod, i noticed and saw that only modded paintings and vanilla ones move one block each time I re-enter my world! is there something wrong? what the hell is even going on? why is there a ghost living in my house?! the modded paintings even phase through blocks which is super weird!! help! here is my painting mod list: Paintings++ Dark paintings Macaw's paintings Joy of painting Immersive paintings My custom paintings++ resource pack
    • Error: java.lang.NullPointerException: Cannot invoke "me.codexadrian.tempad.TempadClientConfig.renderBlur()" because the return value of "me.codexadrian.tempad.TempadClient.getClientConfig()" is null I keep having this error while trying to launch a modpack through the forge modloader, any suggestions? https://docs.google.com/document/d/1CRKUoSiu2e_mDvDTVYpIA5wqD3w-BsCycxBu1_vQ4OA/edit?usp=sharing Crash Report ^^^^
    • I'm trying to start a server with the latest installer, but running the run.bat file doesn't generate new files. It shows the following in the cmd prompt.
    • One of my players is suddenly unable to join a locally hosted MC Eternal server. We have been playing on this server for about 2-3 weeks now. I have tried erasing his player files and his reputation file, and now it just coughs up this and kicks him out: [User Authenticator #5/INFO] [minecraft/NetHandlerLoginServer]: UUID of player EthosTheGod is 7692d8db-02c3-424f-a4ab-0e4e259b106b [20:25:36] [User Authenticator #4/INFO] [minecraft/NetHandlerLoginServer]: UUID of player EthosTheGod is 7692d8db-02c3-424f-a4ab-0e4e259b106b [20:29:35] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Did the system time change, or is the server overloaded? Running 575849ms behind, skipping 11516 tick(s) [20:29:35] [Server thread/INFO] [minecraft/NetHandlerLoginServer]: com.mojang.authlib.GameProfile@4a6c63f1[id=7692d8db-02c3-424f-a4ab-0e4e259b106b,name=EthosTheGod,properties={textures=[com.mojang.authlib.properties.Property@241ea89e]},legacy=false] (/IP.ADDRESS) lost connection: Disconnected [20:29:35] [Server thread/INFO] [minecraft/NetHandlerLoginServer]: com.mojang.authlib.GameProfile@6ab6c661[id=7692d8db-02c3-424f-a4ab-0e4e259b106b,name=EthosTheGod,properties={textures=[com.mojang.authlib.properties.Property@7f19aae3]},legacy=false] (/IP.ADDRESS) lost connection: Disconnected It just says "connection timed out" on his end. Any ideas?
    • I'm trying to migrate my mod from 1.20 to 1.21. Some packages in the forge api were changed so my mod did have some classes not working. I've changed everything i needed but still is getting me the following error error: cannot access Registry DeferredRegister.create(ForgeRegistries.BLOCKS, FarmMod.MOD_ID); ^ class file for net.minecraft.core.Registry not found The piece of code that is wrong is   public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, FarmMod.MOD_ID); And here are my imports   import com.lucas.farmmod.FarmMod; import com.lucas.farmmod.block.custom.BaseIrrigatorBlock; import com.lucas.farmmod.item.ModItems; import com.lucas.farmmod.item.custom.BaseIrrigatorBlockItem; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; The class DeferredRegister is throwing the error in the print below     I've tried running rebuilding my project in every way possible, tried refreshing my dependencies but nothing works. What can i do?
  • Topics

×
×
  • Create New...

Important Information

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