Jump to content

Recommended Posts

Posted

So, I'm trying to create a custom block that is effected by gravity and can be colored.  I've got the gravity part down, I just extended BlockFalling.  I looked at BlockColored and copied the body, renamed the variables that I knew what they were doing for easier reference, and created the appropriate textures for the block

 

 

package com.mmg.candymod.blocks;

import java.util.List;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.BlockFalling;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemDye;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;

public class BlockSugarCrystals extends BlockFalling {

    @SideOnly(Side.CLIENT)
    private IIcon[] iconArray;	

protected BlockSugarCrystals() {
	super(Material.sand);
	this.setHardness(0.5F);
	this.setHarvestLevel("shovel", 0);
	// TODO Auto-generated constructor stub
}

    /**
     * Gets the block's texture. Args: side, meta
     */
    @SideOnly(Side.CLIENT)
    public IIcon getIcon(int side, int meta)
    {
        return this.iconArray[meta % this.iconArray.length];
    }

    /**
     * Determines the damage on the item the block drops. Used in cloth and wood.
     */
    public int damageDropped(int meta)
    {
        return meta;
    }

    public static int func_150032_b(int p_150032_0_)
    {
        return func_150031_c(p_150032_0_);
    }

    public static int func_150031_c(int p_150031_0_)
    {
        return ~p_150031_0_ & 15;
    }

    /**
     * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
     */
    @SideOnly(Side.CLIENT)
    public void getSubBlocks(Item item, CreativeTabs creativeTab, List list)
    {
        for (int i = 0; i < 16; ++i)
        {
            list.add(new ItemStack(item, 1, i));
        }
    }

    @SideOnly(Side.CLIENT)
    public void registerBlockIcons(IIconRegister iconRegister)
    {
        this.iconArray = new IIcon[16];

        for (int i = 0; i < this.iconArray.length; ++i)
        {
            this.iconArray[i] = iconRegister.registerIcon(this.getTextureName() + "_" + ItemDye.field_150921_b[func_150031_c(i)]);
        }
    }

    public MapColor getMapColor(int p_149728_1_)
    {
        return MapColor.getMapColorForBlockColored(p_149728_1_);
    }	

}

 

 

Only things I didn't rename were func_150032_b and func_150031_c, as I have no idea what they are doing.

 

I haven't done anything special while registering the block (Which may be where the problem is).  I created a simple little dirt to custom block with metavalue 2 to see if it works.  The block looks fine in inventory, but when I place it, it renders the neutral texture.  I get the colored texture back when I break it.  I'm guessing that somehow I have to pass the meta value on to the block, but I have no idea how, or if I should register it in some way to recognize the meta value from inventory.

 

I'm sure this is an uber noobish question, but I'm stuck :-/

 

[edit]  Okay.  So I figured out I need another class extending ItemBlockWithMetaData. 

 

 

package com.mmg.candymod.items;

import net.minecraft.block.Block;
import net.minecraft.item.ItemBlockWithMetadata;
import net.minecraft.item.ItemStack;

import com.mmg.candymod.blocks.CustomBlock;

public class ItemBlockSugarCrystals extends ItemBlockWithMetadata {

private final static String[] subNames = {
	"white", "orange",  "magenta", "lightBlue", "yellow", "lightGreen",
	"pink", "darkGrey", "lightGrey", "cyan", "purple", "blue", "brown",
	"green", "red", "black"
};

public ItemBlockSugarCrystals() {
	super(CustomBlock.blockSugarCrystals, CustomBlock.blockSugarCrystals);
	// TODO Auto-generated constructor stub
}

@Override
public int getMetadata (int damageValue) {
	return damageValue;
}

@Override
public String getUnlocalizedName(ItemStack itemstack) {
	return getUnlocalizedName() + "." + subNames[itemstack.getItemDamage()];
}
}

 

 

I register in PreInit with: GameRegistry.registerBlock(blockSugarCrystals, ItemBlockSugarCrystals.class, blockSugarCrystals.getUnlocalizedName());

 

Now the game crashes, probably because I'm registering wrong :-/

 

Just in case, though

 

Crash Report

 

 

[11:10:09] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker

[11:10:09] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker

[11:10:09] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker

[11:10:09] [main/INFO] [FML]: Forge Mod Loader version 7.2.116.1024 for Minecraft 1.7.2 loading

[11:10:09] [main/INFO] [FML]: Java is Java HotSpot 64-Bit Server VM, version 1.7.0_25, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre7

[11:10:09] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

[11:10:09] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

[11:10:09] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker

[11:10:09] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

[11:10:09] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

[11:10:09] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper

[11:10:09] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!

[11:10:10] [main/ERROR] [FML]: The minecraft jar file:/C:/Users/Darkness/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.0.1024/forgeSrc-1.7.2-10.12.0.1024.jar!/net/minecraft/client/ClientBrandRetriever.class appears to be corrupt! There has been CRITICAL TAMPERING WITH MINECRAFT, it is highly unlikely minecraft will work! STOP NOW, get a clean copy and try again!

[11:10:10] [main/ERROR] [FML]: FML has been ordered to ignore the invalid or missing minecraft certificate. This is very likely to cause a problem!

[11:10:10] [main/ERROR] [FML]: Technical information: ClientBrandRetriever was at jar:file:/C:/Users/Darkness/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.0.1024/forgeSrc-1.7.2-10.12.0.1024.jar!/net/minecraft/client/ClientBrandRetriever.class, there were 0 certificates for it

[11:10:10] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing

[11:10:10] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper

[11:10:10] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker

[11:10:12] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}

[11:10:14] [main/INFO]: Setting user: Player903

[11:10:16] [Client thread/INFO]: LWJGL Version: 2.9.0

[11:10:17] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization

[11:10:17] [Client thread/INFO] [FML]: MinecraftForge v10.12.0.1024 Initialized

[11:10:17] [Client thread/INFO] [FML]: Replaced 128 ore recipies

[11:10:17] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization

[11:10:17] [Client thread/INFO] [FML]: Searching C:\Minecraft\Modding\Candy_1.7.2\eclipse\mods for mods

[11:10:17] [Client thread/INFO] [cm]: Mod cm is missing the required element 'name'. Substituting cm

[11:10:19] [Client thread/ERROR] [FML]: FML has detected a mod that is using a package name based on 'net.minecraft.src' : net.minecraft.src.FMLRenderAccessLibrary. This is generally a severe programming error.  There should be no mod code in the minecraft namespace. MOVE YOUR MOD! If you're in eclipse, select your source code and 'refactor' it into a new package. Go on. DO IT NOW!

[11:10:21] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load

[11:10:21] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:cm

[11:10:22] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0

[11:10:22] [Client thread/ERROR] [FML]: Caught an exception during block registration

java.lang.NoSuchMethodException: com.mmg.candymod.items.ItemBlockSugarCrystals.<init>(net.minecraft.block.Block)

at java.lang.Class.getConstructor0(Unknown Source) ~[?:1.7.0_25]

at java.lang.Class.getConstructor(Unknown Source) ~[?:1.7.0_25]

at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:187) [GameRegistry.class:?]

at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:160) [GameRegistry.class:?]

at com.mmg.candymod.blocks.CustomBlock.initializeBlock(CustomBlock.java:86) [CustomBlock.class:?]

at com.mmg.candymod.blocks.CustomBlock.mainRegistry(CustomBlock.java:35) [CustomBlock.class:?]

at com.mmg.candymod.main.CandyMod.preInit(CandyMod.java:25) [CandyMod.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_25]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_25]

at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:536) [FMLModContainer.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_25]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_25]

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) [guava-15.0.jar:?]

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) [guava-15.0.jar:?]

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) [guava-15.0.jar:?]

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) [guava-15.0.jar:?]

at com.google.common.eventbus.EventBus.post(EventBus.java:267) [guava-15.0.jar:?]

at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:209) [LoadController.class:?]

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:188) [LoadController.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_25]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_25]

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) [guava-15.0.jar:?]

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) [guava-15.0.jar:?]

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) [guava-15.0.jar:?]

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) [guava-15.0.jar:?]

at com.google.common.eventbus.EventBus.post(EventBus.java:267) [guava-15.0.jar:?]

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119) [LoadController.class:?]

at cpw.mods.fml.common.Loader.loadMods(Loader.java:498) [Loader.class:?]

at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:194) [FMLClientHandler.class:?]

at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:931) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_25]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_25]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]

[11:10:22] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from PREINITIALIZATION to INITIALIZATION. Loading cannot continue

[11:10:22] [Client thread/ERROR] [FML]:

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

FML{7.2.116.1024} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized

Forge{10.12.0.1024} [Minecraft Forge] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized

cm{0.1} [cm] (bin) Unloaded->Constructed->Errored

[11:10:22] [Client thread/ERROR] [FML]: The following problems were captured during this phase

[11:10:22] [Client thread/ERROR] [FML]: Caught exception from cm

cpw.mods.fml.common.LoaderException: java.lang.NoSuchMethodException: com.mmg.candymod.items.ItemBlockSugarCrystals.<init>(net.minecraft.block.Block)

at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:203) ~[GameRegistry.class:?]

at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:160) ~[GameRegistry.class:?]

at com.mmg.candymod.blocks.CustomBlock.initializeBlock(CustomBlock.java:86) ~[CustomBlock.class:?]

at com.mmg.candymod.blocks.CustomBlock.mainRegistry(CustomBlock.java:35) ~[CustomBlock.class:?]

at com.mmg.candymod.main.CandyMod.preInit(CandyMod.java:25) ~[CandyMod.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_25]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_25]

at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:536) ~[FMLModContainer.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_25]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_25]

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) ~[guava-15.0.jar:?]

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) ~[guava-15.0.jar:?]

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) ~[guava-15.0.jar:?]

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) ~[guava-15.0.jar:?]

at com.google.common.eventbus.EventBus.post(EventBus.java:267) ~[guava-15.0.jar:?]

at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:209) ~[LoadController.class:?]

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:188) ~[LoadController.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_25]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_25]

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) ~[guava-15.0.jar:?]

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) ~[guava-15.0.jar:?]

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) ~[guava-15.0.jar:?]

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) ~[guava-15.0.jar:?]

at com.google.common.eventbus.EventBus.post(EventBus.java:267) ~[guava-15.0.jar:?]

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119) [LoadController.class:?]

at cpw.mods.fml.common.Loader.loadMods(Loader.java:498) [Loader.class:?]

at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:194) [FMLClientHandler.class:?]

at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:931) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_25]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_25]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]

Caused by: java.lang.NoSuchMethodException: com.mmg.candymod.items.ItemBlockSugarCrystals.<init>(net.minecraft.block.Block)

at java.lang.Class.getConstructor0(Unknown Source) ~[?:1.7.0_25]

at java.lang.Class.getConstructor(Unknown Source) ~[?:1.7.0_25]

at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:187) ~[GameRegistry.class:?]

... 41 more

---- Minecraft Crash Report ----

// You should try our sister game, Minceraft!

 

Time: 3/28/14 11:10 AM

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

 

cpw.mods.fml.common.LoaderException: java.lang.NoSuchMethodException: com.mmg.candymod.items.ItemBlockSugarCrystals.<init>(net.minecraft.block.Block)

at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:203)

at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:160)

at com.mmg.candymod.blocks.CustomBlock.initializeBlock(CustomBlock.java:86)

at com.mmg.candymod.blocks.CustomBlock.mainRegistry(CustomBlock.java:35)

at com.mmg.candymod.main.CandyMod.preInit(CandyMod.java:25)

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:536)

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:47)

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

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:209)

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

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:47)

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

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:119)

at cpw.mods.fml.common.Loader.loadMods(Loader.java:498)

at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:194)

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

at net.minecraft.client.Minecraft.run(Minecraft.java:931)

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

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:134)

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

Caused by: java.lang.NoSuchMethodException: com.mmg.candymod.items.ItemBlockSugarCrystals.<init>(net.minecraft.block.Block)

at java.lang.Class.getConstructor0(Unknown Source)

at java.lang.Class.getConstructor(Unknown Source)

at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:187)

... 41 more

 

 

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

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

 

-- System Details --

Details:

Minecraft Version: 1.7.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: 885738376 bytes (844 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)

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

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

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

FML: MCP v9.01-pre FML v7.2.116.1024 Minecraft Forge 10.12.0.1024 4 mods loaded, 4 mods active

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

FML{7.2.116.1024} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized

Forge{10.12.0.1024} [Minecraft Forge] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized

cm{0.1} [cm] (bin) Unloaded->Constructed->Errored

#@!@# Game crashed! Crash report saved to: #@!@# C:\Minecraft\Modding\Candy_1.7.2\eclipse\.\crash-reports\crash-2014-03-28_11.10.22-client.txt

 

 

 

[edit again] Okay.  Digging around I found out that the problem was that the compiler was looking for a Block argument in the constructor.  I changed it to the following and it works like a dream:

 

 

public ItemBlockSugarCrystals(Block block1) {
	super(block1, block1);
	// TODO Auto-generated constructor stub
}

 

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

    • Hi,  I'm using Forge 47.3.0 for Minecraft 1.20.1 I apologise if this is obvious I am very new to modding for Minecraft. I sucessfully made a mod that launched without errors or crashes (without it doing anything) but in order to add the features I need, I need to add "Custom Portal API [Forge]" as a dependency. However no matter the way I've tried to acheive this, it crashes. I am pretty sure it's not the way I'm putting it in the repositories, the dependencies or the way I'm refrencing it, as I've a hundred diffrent combinations and multiple Maven methods. And on all those diffrent variations I still get this crash: pastebin.com/UhumzZCZ Any tips would be invaluable as I've been loosing my mind over this!
    • Hi, i'm really having problems trying to set the texture to my custom item. I thought i'm doing everything correctly, but all i see is the missing texture block for my item. I am trying this for over a week now and getting really frustrated. The only time i could make the texture work, was when i used an older Forge version (52.0.1) for Minecraft (1.21.4). Was there a fundamental change for textures and models somewhere between versions that i'm missing? I started with Forge 54.1.0 and had this problem, so in my frustration i tried many things: Upgrading to Forge 54.1.1, created multiple new projects, workspaces, redownloaded everything and setting things up multiple times, as it was suggested in an older thread. Therea are no errors in the console logs, but maybe i'm blind, so i pasted the console logs to pastebin anyway: https://pastebin.com/zAM8RiUN The only time i see an error is when i change the models JSON file to an incorrect JSON which makes sense and that suggests to me it is actually reading the JSON file.   I set the github repository to public, i would be so thankful if anyone could take a look and tell me what i did wrong: https://github.com/xLorkin/teleport_pug_forge   As a note: i'm pretty new to modding, this is my first mod ever. But i'm used to programming. I had some up and downs, but through reading the documentation, using google and experimenting, i could solve all other problems. I only started modding for Minecraft because my son is such a big fan and wanted this mod.
    • Please read the FAQ (link in orange bar at top of page), and post logs as described there.
    • Hello fellow Minecrafters! I recently returned to Minecraft and realized I needed a wiki that displays basic information easily and had great user navigation. That’s why I decided to build: MinecraftSearch — a site by a Minecraft fan, for Minecraft fans. Key Features So Far Straight-to-the-Point Info: No extra fluff; just the essentials on items, mobs, recipes, loot and more. Clean & Intuitive Layout: Easy navigation so you spend less time scrolling and more time playing. Optimized Search: Search for anything—items, mobs, blocks—and get results instantly. What I’m Thinking of Adding More data/information: Catch chances for fishing rod, traveling villager trades, biomes info and a lot more. The website is still under development and need a lot more data added. Community Contributions: Potential for user-uploaded tips for items/mobs/blocks in the future. Feature Requests Welcome: Your ideas could shape how the wiki evolves! You can see my roadmap at the About page https://minecraftsearch.com/about I’d love for you to check out MinecraftSearch and see if it helps you find the info you need faster. Feedback is crucial—I want to develop this further based on what the community needs most, so please let me know what you think. Thanks, and happy crafting!
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

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