Jump to content

Crop Seeds Crash [Solved]


Tiffiter123

Recommended Posts

This has been solved.

A moderator may delete this post.

 

 

 

 

 

Ok. Simple.

For my mod I made a seed that would plant my crop.

When I run minecraft, the game would crash.

I know its not the crop because I comment out the seed, plant the crop (/give is how I got the crop) and all goes well.

I uncomment the seed and boom crash.

The crash reoport says something about when I do the "blahBlah = new BlahBlah" part.

 

 

Main File:

 

StrawberrySeeds = (new StrawberrySeeds(14533, MoFoodMod_Main.StrawberryCropBlock.blockID, Block.tilledField.blockID))

 

 

Seed File:

 

package TiffitMod.MoFoodsMod;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.ItemSeeds;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class StrawberrySeeds extends ItemSeeds{

public StrawberrySeeds(int par1, int par2, int par3) {
	super(par1, par2, par3);
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister) {
	this.itemIcon = par1IconRegister.registerIcon("tiffit#2:StrawberrySeeds");
}

}

 

 

 

Crash Report:

 

---- Minecraft Crash Report ----
// Everything's going to plan. No, really, that was supposed to happen.

Time: 8/2/13 4:40 PM
Description: Initializing game

java.lang.NullPointerException
at TiffitMod.MoFoodsMod.MoFoodMod_Main.load(MoFoodMod_Main.java:86) 
//Line 86 is the line Blah = new Blah part
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:540)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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:193)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:173)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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:104)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:697)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:222)
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(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)
at net.minecraft.launchwrapper.Launch.main(Launch.java:18)


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

-- Head --
Stacktrace:
at TiffitMod.MoFoodsMod.MoFoodMod_Main.load(MoFoodMod_Main.java:86)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:540)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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:193)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:173)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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:104)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:697)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:222)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:506)

-- Initialization --
Details:
Stacktrace:
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(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)
at net.minecraft.launchwrapper.Launch.main(Launch.java:18)

-- System Details --
Details:
Minecraft Version: 1.6.2
Operating System: Mac OS X (x86_64) version 10.6.8
Java Version: 1.6.0_43, Apple Inc.
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Apple Inc.
Memory: 1009457544 bytes (962 MB) / 1069416448 bytes (1019 MB) up to 1069416448 bytes (1019 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.19.789 Minecraft Forge 9.10.0.789 4 mods loaded, 4 mods active
mcp{8.04} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML{6.2.19.789} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
Forge{9.10.0.789} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
tiffit#2{(NOT REALEASED) v1.1.0} [Mo' Food's Mod] (bin) Unloaded->Constructed->Pre-initialized->Errored
Launched Version: 1.6
LWJGL: 2.9.0
OpenGL: NVIDIA GeForce 320M OpenGL Engine GL version 2.1 NVIDIA-1.6.36, NVIDIA Corporation
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Pack: Default
Current Language: English (US)
Profiler Position: N/A (disabled)
Vec3 Pool Size: ~~ERROR~~ NullPointerException: null

 

Link to comment
Share on other sites

Without seeing your whole main mod file I can only guess.

It seems to me that you don't initialize the StrawberryCropBlock field before you use it.

Please explain more.

 

And here is my whole main class:

 

package TiffitMod.MoFoodsMod;

import TiffitMod.MoFoodsMod.OreGeneration.CandyRockOreWorldGeneration;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFurnace;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemSeeds;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.potion.Potion;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid= "tiffit#2",name="Mo' Food's Mod",version="(NOT REALEASED) v1.1.0")
@NetworkMod(clientSideRequired=true,serverSideRequired=false)

public class MoFoodMod_Main { 

//itemz
public static Item Chocolate;
public static Item ChocolateBar;
public static Item RefinedSugar;
public static Item ChocolatePie;
public static Item CookedChocolatePie;
public static Item BrownStuff;
public static Item FakeChocolate;
public static Item WolfChocolate;
public static Item Blueberry;
public static Item BlueberryPie; 
public static Item CookedBlueberryPie;
public static Item Blender;
public static Item BlueberryJuice;
public static Item SugarBlueberryJuice;
public static Item Strawberry;
public static Item StrawberryPie;
public static Item CookedStrawberryPie;
public static Item StrawberryJuice;
public static Item SugarStrawberryJuice;
public static Item ChocolateStrawberry;
public static Item LargeStackRefinedSugar; 
public static Item Candy;
public static Item Sprinkles;
public static Item Flour;
public static Item RawDoughnut;
public static Item CookedDoughnut;
public static Item DoughnutSprinkles;
public static Item ChocolateDoughnut;
public static Item ChickenPotPie;
public static Item UnfilledPie;
public static Item CowPotPie;
public static Item RawCowPotPie;
public static Item RawChickenPotPie;
public static Item Picture;
public static Item HardCandy;


//cropz
public static Item StrawberrySeeds;
public static Block StrawberryCropBlock;


//blockz
public static Block CandyRockOre;





public static CandyRockOreWorldGeneration CRO_genWorld = new CandyRockOreWorldGeneration();



@Init
public void load(FMLInitializationEvent event){

	CreativeTabs MoFoodModTab = new TabMoFoodMod(CreativeTabs.getNextID(), "Mo' Foods Mod");

	StrawberrySeeds = new TiffitMod.MoFoodsMod.StrawberrySeeds(10000, MoFoodMod_Main.StrawberryCropBlock.blockID, Block.tilledField.blockID).setUnlocalizedName("tiffit#2:StrawberrySeeds");
	LanguageRegistry.addName(StrawberrySeeds, "Strawberry Seeds");
	GameRegistry.registerItem(StrawberrySeeds, "StrawberrySeeds");

	Picture = new Picture(20000).setMaxStackSize(1).setCreativeTab(MoFoodModTab).setUnlocalizedName("PictureFoodMod");
	LanguageRegistry.addName(Picture, "Tab picture (no use)");
	GameRegistry.registerItem(Picture, "Picture");



	UnfilledPie = new NonEdible(14000).setMaxStackSize(64).setCreativeTab(MoFoodModTab).setUnlocalizedName("UnfilledPieFoodMod");
	LanguageRegistry.addName(UnfilledPie, "Empty Pie Crust");
	GameRegistry.registerItem(UnfilledPie, "UnfilledPie");

	RefinedSugar = new NonEdible(14001).setCreativeTab(MoFoodModTab).setUnlocalizedName("RefinedSugarFoodMod");
	LanguageRegistry.addName(RefinedSugar, "Refined Sugar");
	GameRegistry.registerItem(RefinedSugar, "RefinedSugar");

	LargeStackRefinedSugar = new NonEdible(14002).setMaxStackSize(64).setCreativeTab(MoFoodModTab).setUnlocalizedName("SRefinedSugarFoodMod");
	LanguageRegistry.addName(LargeStackRefinedSugar, "Pile of Refined Sugar");
	GameRegistry.registerItem(LargeStackRefinedSugar, "LargeStackRefinedSugar");

	Flour = new NonEdible(14003).setMaxStackSize(64).setCreativeTab(MoFoodModTab).setUnlocalizedName("FlourFoodMod");
	LanguageRegistry.addName(Flour, "Flour");
	GameRegistry.registerItem(Flour, "Flour");

	Candy = new Edible(14004, 2, 3F, false).setMaxStackSize(64).setCreativeTab(MoFoodModTab).setUnlocalizedName("CandyFoodMod");
	LanguageRegistry.addName(Candy, "Candy");
	GameRegistry.registerItem(Candy, "Candy");

	Sprinkles = new Edible(14005, 1, 0.5F, false).setMaxStackSize(64).setCreativeTab(MoFoodModTab).setUnlocalizedName("SprinklesFoodMod");
	LanguageRegistry.addName(Sprinkles, "Sprinkles");
	GameRegistry.registerItem(Sprinkles, "Sprinkles");

	Chocolate = new NonEdible(14006).setCreativeTab(MoFoodModTab).setCreativeTab(MoFoodModTab).setUnlocalizedName("ChocolateFoodMod");
	LanguageRegistry.addName(Chocolate, "Raw Chocolate");
	GameRegistry.registerItem(Chocolate, "Chocolate");

	ChocolateBar = new Edible(14007, 3, 0.8F, false).setMaxStackSize(64).setCreativeTab(MoFoodModTab).setUnlocalizedName("ChocolateBarFoodMod");
	LanguageRegistry.addName(ChocolateBar, "Bar Of Chocolate");
	GameRegistry.registerItem(ChocolateBar, "ChocolateBar");

	ChocolatePie = new Edible(14008, 4, 2F, false).setMaxStackSize(64).setCreativeTab(MoFoodModTab).setUnlocalizedName("ChocolatePieFoodMod");
	LanguageRegistry.addName(ChocolatePie, "Chocolate Pie (Raw)");
	GameRegistry.registerItem(ChocolatePie, "ChocolatePie");

	CookedChocolatePie = new Edible(14009, 7, 2F, false).setMaxStackSize(64).setCreativeTab(MoFoodModTab).setUnlocalizedName("ChocolatePieCookedFoodMod");
	LanguageRegistry.addName(CookedChocolatePie, "Chocolate Pie (Cooked)");
	GameRegistry.registerItem(CookedChocolatePie, "CookedChocolatePie");

	Blueberry = new Edible(14010, 1, 0.2F, false).setMaxStackSize(64).setCreativeTab(MoFoodModTab).setUnlocalizedName("BlueberryFoodMod");
	LanguageRegistry.addName(Blueberry, "Blueberry");
	GameRegistry.registerItem(Blueberry, "Blueberry");
	MinecraftForge.addGrassSeed(new ItemStack(Blueberry), 10);

	BlueberryPie = new Edible(14011, 4, 0.8F, false).setMaxStackSize(64).setCreativeTab(MoFoodModTab).setUnlocalizedName("BlueberryPieFoodMod");
	LanguageRegistry.addName(BlueberryPie, "Blueberry Pie (Raw)");
	GameRegistry.registerItem(BlueberryPie, "BlueberryPie");

	CookedBlueberryPie = new Edible(14012, 9, 0.8F, false).setMaxStackSize(64).setCreativeTab(MoFoodModTab).setUnlocalizedName("CookedBlueberryPieFoodMod");
	LanguageRegistry.addName(CookedBlueberryPie, "Blueberry Pie (Cooked)");
	GameRegistry.registerItem(CookedBlueberryPie, "CookedBlueberryPie");

	BlueberryJuice = new Juice(14013, 4, 1F, false).setCreativeTab(MoFoodModTab).setUnlocalizedName("BlueberryJuiceFoodMod");
	LanguageRegistry.addName(BlueberryJuice, "Fresh Blueberry Juice");
	GameRegistry.registerItem(BlueberryJuice, "BlueberryJuice");

	SugarBlueberryJuice = new Juice(14014, 4, 9F, false).setCreativeTab(MoFoodModTab).setUnlocalizedName("SugarBlueberryJuiceFoodMod");
	LanguageRegistry.addName(SugarBlueberryJuice, "Sugar Added Blueberry Juice");
	GameRegistry.registerItem(SugarBlueberryJuice, "SugarBlueberryJuice");

	Strawberry = new Edible(14015, 1, 0.2F, false).setMaxStackSize(64).setCreativeTab(MoFoodModTab).setUnlocalizedName("StrawberryFoodMod");
	LanguageRegistry.addName(Strawberry, "Strawberry");
	GameRegistry.registerItem(Strawberry, "Strawberry");
	MinecraftForge.addGrassSeed(new ItemStack(Strawberry), 10);

	StrawberryPie = new Edible(14516, 4, 0.8F, false).setMaxStackSize(64).setCreativeTab(MoFoodModTab).setUnlocalizedName("StrawberryPieFoodMod");
	LanguageRegistry.addName(StrawberryPie, "Strawberry Pie (Raw)");
	GameRegistry.registerItem(StrawberryPie, "StrawberryPie");

	CookedStrawberryPie = new Edible(14517, 9, 0.8F, false).setMaxStackSize(64).setCreativeTab(MoFoodModTab).setUnlocalizedName("CookedStrawberryPieFoodMod");
	LanguageRegistry.addName(CookedStrawberryPie, "Strawberry Pie (Cooked)");
	GameRegistry.registerItem(CookedStrawberryPie, "CookedStrawberryPie");

	StrawberryJuice = new Juice(14518, 4, 1F, false).setMaxStackSize(64).setCreativeTab(MoFoodModTab).setUnlocalizedName("StrawberryJuiceFoodMod");
	LanguageRegistry.addName(StrawberryJuice, "Fresh Strawberry Juice");
	GameRegistry.registerItem(StrawberryJuice, "StrawberryJuice");

	SugarStrawberryJuice = new Juice(14519, 4, 9F, false).setMaxStackSize(64).setCreativeTab(MoFoodModTab).setUnlocalizedName("SugarStrawberryJuiceFoodMod");
	LanguageRegistry.addName(SugarStrawberryJuice, "Sugar Added Strawberry Juice");
	GameRegistry.registerItem(SugarStrawberryJuice, "SugarStrawberryJuice");

	ChocolateStrawberry = new Edible(14520, 4, 2F, false).setMaxStackSize(64).setCreativeTab(MoFoodModTab).setUnlocalizedName("ChocolateStrawberryFoodMod");
	LanguageRegistry.addName(ChocolateStrawberry, "Chocolate Covered Strawberry");
	GameRegistry.registerItem(ChocolateStrawberry, "ChocolateStrawberry");

	ChickenPotPie = new Edible(14521, 7, 2F, false).setMaxStackSize(64).setCreativeTab(MoFoodModTab).setUnlocalizedName("ChickenPotPieFoodMod");
	LanguageRegistry.addName(ChickenPotPie, "Chicken Pot Pie (Cooked)");
	GameRegistry.registerItem(ChickenPotPie, "ChickenPotPie");

	BrownStuff = new NonEdible(14522).setCreativeTab(MoFoodModTab).setUnlocalizedName("BrownStuffFoodMod");
	LanguageRegistry.addName(BrownStuff, "Stuff (brown look)");
	GameRegistry.registerItem(BrownStuff, "BrownStuff");

	FakeChocolate = new NonEdible(14523).setCreativeTab(MoFoodModTab).setUnlocalizedName("FakeChocolateFoodMod");
	LanguageRegistry.addName(FakeChocolate, "Fake Chocolate");
	GameRegistry.registerItem(FakeChocolate, "FakeChocolate");

	WolfChocolate = new wolfFood(14524, 0, 0F, true).setCreativeTab(MoFoodModTab).setUnlocalizedName("WolfChocolateFoodMod");
	LanguageRegistry.addName(WolfChocolate, "Wolf Chocolate");
	GameRegistry.registerItem(WolfChocolate, "WolfChocolate");

	Blender = new Blender(14525).setCreativeTab(MoFoodModTab).setUnlocalizedName("BlenderFoodMod");
	LanguageRegistry.addName(Blender, "Blender");
	GameRegistry.registerItem(Blender, "Blender");

	RawDoughnut = new Edible(14526, 2, 1F, false).setCreativeTab(MoFoodModTab).setMaxStackSize(64).setUnlocalizedName("RawDoughnutFoodMod");
	LanguageRegistry.addName(RawDoughnut, "Raw Doughnut");
	GameRegistry.registerItem(RawDoughnut, "RawDoughnut");

	CookedDoughnut = new Edible(14527, 3, 10F, false).setCreativeTab(MoFoodModTab).setMaxStackSize(64).setUnlocalizedName("CookedDoughnutFoodMod");
	LanguageRegistry.addName(CookedDoughnut, "Cooked Doughnut");
	GameRegistry.registerItem(CookedDoughnut, "CookedDoughnut");

	DoughnutSprinkles = new Edible(14528, 4, 10.5F, false).setCreativeTab(MoFoodModTab).setMaxStackSize(64).setUnlocalizedName("SprinklesCookedDoughnutFoodMod");
	LanguageRegistry.addName(DoughnutSprinkles, "Doughnut with Sprinkles");
	GameRegistry.registerItem(DoughnutSprinkles, "DoughnutSprinkles");

	ChocolateDoughnut = new Edible(14529, 4, 10.5F, false).setCreativeTab(MoFoodModTab).setMaxStackSize(64).setUnlocalizedName("ChocolateDoughnutFoodMod");
	LanguageRegistry.addName(ChocolateDoughnut, "Chocolate Doughnut");
	GameRegistry.registerItem(ChocolateDoughnut, "ChocolateDoughnut");

	CowPotPie = new Edible(14530, 7, 2F, false).setMaxStackSize(64).setCreativeTab(MoFoodModTab).setUnlocalizedName("CowgPotPieFoodMod");
	LanguageRegistry.addName(CowPotPie, "Cow Pot Pie (Cooked)");
	GameRegistry.registerItem(CowPotPie, "CowPotPie");

	RawChickenPotPie = new Edible(14531, 3, 1F, false).setMaxStackSize(64).setCreativeTab(MoFoodModTab).setUnlocalizedName("RawChickenPotPieFoodMod");
	LanguageRegistry.addName(RawChickenPotPie, "Chicken Pot Pie (Raw)");
	GameRegistry.registerItem(RawChickenPotPie, "RawChickenPotPie");

	RawCowPotPie = new Edible(14532, 3, 1F, false).setMaxStackSize(64).setCreativeTab(MoFoodModTab).setUnlocalizedName("RawCowPotPieFoodMod");
	LanguageRegistry.addName(RawCowPotPie, "Cow Pot Pie (Raw)");
	GameRegistry.registerItem(RawCowPotPie, "RawCowPotPie");

	HardCandy = new Edible(14533, 3, 20F, false).setMaxStackSize(64).setCreativeTab(MoFoodModTab).setUnlocalizedName("HardCandyFoodMod");
	LanguageRegistry.addName(HardCandy, "Hard Candy");
	GameRegistry.registerItem(HardCandy, "HardCandy");


	//
	//		
	//		
	//		
	//		
	//		
	//		
	//		

	CandyRockOre = new CandyRockOre(2750, "CandyRockOre").setCreativeTab(MoFoodModTab).setUnlocalizedName("CandyRockOre").setHardness(1.5F).setStepSound(Block.soundMetalFootstep).setResistance(1.0F);
	LanguageRegistry.addName(CandyRockOre, "Candy Rock");
	GameRegistry.registerBlock(CandyRockOre, "CandyRockOre");
	GameRegistry.registerWorldGenerator(CRO_genWorld);
	MinecraftForge.setBlockHarvestLevel(CandyRockOre, "pickaxe", 1);


	StrawberryCropBlock = new StrawberryCropBlock(2751).setUnlocalizedName("StrawberryCropBlockFoodMod");
	LanguageRegistry.addName(StrawberryCropBlock, "Strawberry Crop Block");
	GameRegistry.registerBlock(StrawberryCropBlock, "StrawberryCropBlock");

	//		
	//		
	//		
	//		
	//		
	//		
	//		
	//		
	//		
	//		
	//		
	//crafting
	ItemStack cocoaStack = new ItemStack(351, 1, 3);
	ItemStack rsugarStack = new ItemStack(RefinedSugar);
	ItemStack ChocolateStack = new ItemStack(Chocolate);
	ItemStack EggStack = new ItemStack(Item.egg);
	ItemStack BlueberryStack = new ItemStack(Blueberry);
	ItemStack dirtStack = new ItemStack(Block.dirt);
	ItemStack StuffBStack = new ItemStack(BrownStuff);
	ItemStack FakeChocolateStack = new ItemStack(FakeChocolate);
	ItemStack ChickenStack = new ItemStack(Item.chickenRaw);
	ItemStack IronStack = new ItemStack(Item.ingotIron);
	ItemStack RedstoneStack = new ItemStack(Item.redstone);
	ItemStack glassStack = new ItemStack(Block.glass);
	ItemStack BlenderStack = new ItemStack(Blender);
	ItemStack bJuiceStack = new ItemStack(BlueberryJuice);
	ItemStack StrawberryStack = new ItemStack(Strawberry);
	ItemStack sJuiceStack = new ItemStack(StrawberryJuice);
	ItemStack CandyStack = new ItemStack(Candy);
	ItemStack WheatStack = new ItemStack(Item.wheat);
	ItemStack FlourStack = new ItemStack(Flour);
	ItemStack SprinklesStack = new ItemStack(Sprinkles);
	ItemStack CookedDoughnutStack = new ItemStack(CookedDoughnut);
	ItemStack RawChickenStack = new ItemStack(Item.chickenRaw);
	ItemStack CookedChickenStack = new ItemStack(Item.chickenCooked);
	ItemStack UnfilledPieStack = new ItemStack(UnfilledPie);
	ItemStack RawCowStack = new ItemStack(Item.beefRaw);
	ItemStack CookedCowStack = new ItemStack(Item.beefCooked);





	GameRegistry.addShapelessRecipe(new ItemStack(Chocolate, 3), cocoaStack, rsugarStack);
	GameRegistry.addShapelessRecipe(new ItemStack(ChocolatePie, 1), ChocolateStack, ChocolateStack, UnfilledPieStack);
	GameRegistry.addShapelessRecipe(new ItemStack(BlueberryPie, 1), BlueberryStack, BlueberryStack, UnfilledPieStack);
	GameRegistry.addShapelessRecipe(new ItemStack(BrownStuff, 3), dirtStack, dirtStack, cocoaStack);
	GameRegistry.addShapelessRecipe(new ItemStack(WolfChocolate, 3), FakeChocolateStack, FakeChocolateStack, ChickenStack);
	GameRegistry.addShapelessRecipe(new ItemStack(BlueberryJuice, 1), BlueberryStack, BlueberryStack, BlueberryStack, BlenderStack);
	GameRegistry.addShapelessRecipe(new ItemStack(StrawberryPie, 1), StrawberryStack, StrawberryStack, UnfilledPieStack);
	GameRegistry.addShapelessRecipe(new ItemStack(StrawberryJuice, 1), StrawberryStack, StrawberryStack, StrawberryStack, BlenderStack);
	GameRegistry.addShapelessRecipe(new ItemStack(ChocolateStrawberry, 1), ChocolateStack, StrawberryStack);
	GameRegistry.addShapelessRecipe(new ItemStack(Sprinkles, 5), CandyStack);
	GameRegistry.addShapelessRecipe(new ItemStack(DoughnutSprinkles, 1), SprinklesStack, CookedDoughnutStack);
	GameRegistry.addShapelessRecipe(new ItemStack(ChocolateDoughnut, 1), CookedDoughnutStack, ChocolateStack);
	GameRegistry.addShapelessRecipe(new ItemStack(UnfilledPie, 1), EggStack, rsugarStack, FlourStack);



	GameRegistry.addRecipe(new ItemStack(FakeChocolate), "ucu",      'u', StuffBStack, 'c', cocoaStack);
	GameRegistry.addRecipe(new ItemStack(Blender, 10), "p p", "p p", "iri",     'i', IronStack, 'r', RedstoneStack, 'p', glassStack);		
	GameRegistry.addRecipe(new ItemStack(SugarBlueberryJuice), "rrr", "rjr", "rrr", 'j', bJuiceStack, 'r', rsugarStack);
	GameRegistry.addRecipe(new ItemStack(SugarStrawberryJuice), "rrr", "rjr", "rrr", 'j', sJuiceStack, 'r', rsugarStack);
	GameRegistry.addRecipe(new ItemStack(LargeStackRefinedSugar), "rrr", "rrr", "rrr", 'r', rsugarStack);
	GameRegistry.addRecipe(new ItemStack(LargeStackRefinedSugar), "rrr", 'r', rsugarStack);
	GameRegistry.addRecipe(new ItemStack(RawDoughnut), "rrr", "r r", "rrr", 'r', FlourStack);
	GameRegistry.addRecipe(new ItemStack(ChickenPotPie), "fue",      'f', FlourStack, 'u', UnfilledPieStack, 'e', CookedChickenStack);
	GameRegistry.addRecipe(new ItemStack(RawChickenPotPie), "fue",      'f', FlourStack, 'u', UnfilledPieStack, 'e', RawChickenStack);
	GameRegistry.addRecipe(new ItemStack(CowPotPie), "fue",      'f', FlourStack, 'u', UnfilledPieStack, 'e', CookedCowStack);
	GameRegistry.addRecipe(new ItemStack(RawCowPotPie), "fue",      'f', FlourStack, 'u', UnfilledPieStack, 'e', RawCowStack);



	//furnace
        FurnaceRecipes.smelting().addSmelting(Chocolate.itemID, 0, new ItemStack(ChocolateBar), 0.1F);
        FurnaceRecipes.smelting().addSmelting(Item.sugar.itemID, 0, new ItemStack(RefinedSugar), 0.1F);
        FurnaceRecipes.smelting().addSmelting(ChocolatePie.itemID, 0, new ItemStack(CookedChocolatePie), 0.1F);
        FurnaceRecipes.smelting().addSmelting(BlueberryPie.itemID, 0, new ItemStack(CookedBlueberryPie), 0.1F);
        FurnaceRecipes.smelting().addSmelting(StrawberryPie.itemID, 0, new ItemStack(CookedStrawberryPie), 0.1F);
        FurnaceRecipes.smelting().addSmelting(RawDoughnut.itemID, 0, new ItemStack(CookedDoughnut), 0.1F);
        FurnaceRecipes.smelting().addSmelting(RawChickenPotPie.itemID, 0, new ItemStack(ChickenPotPie), 0.1F);
        FurnaceRecipes.smelting().addSmelting(RawCowPotPie.itemID, 0, new ItemStack(CowPotPie), 0.1F);
        FurnaceRecipes.smelting().addSmelting(CandyRockOre.blockID, 0, new ItemStack(HardCandy), 0.1F);

        
}

}














 

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.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • https://mclo.gs/4UC49Ao
    • Way back in the Forge 1.17 days, work started for adding JPMS (Java Platform Module Support) to ModLauncher and ForgeModLoader. This has been used internally by Forge and some libraries for a while now, but mods (those with mods.toml specifically) have not been able to take advantage of it. As of Forge 1.21.1 and 1.21.3, this is now possible!   What is JPMS and what does it mean for modders? JPMS is the Java Platform Module System, introduced in Java 9. It allows you to define modules, which are collections of packages and resources that can be exported or hidden from other modules. This allows for much more fine-tuned control over visibility, cleaner syntax for service declarations and support for sealed types across packages. For example, you might have a mod with a module called `com.example.mod` that exports `com.example.mod.api` and `com.example.mod.impl` to other mods, but hides `com.example.mod.internal` from them. This would allow you to have a clean API for other mods to use, while keeping your internal implementation details hidden from IDE hints, helping prevent accidental usage of internals that might break without prior notice. This is particularly useful if you'd like to use public records with module-private constructors or partially module-private record components, as you can create a sealed interface that only your record implements, having the interface be exported and the record hidden. It's also nice for declaring and using services, as you'll get compile-time errors from the Java compiler for typos and the like, rather than deferring to runtime errors. In more advanced cases, you can also have public methods that are only accessible to specific other modules -- handy if you want internal interactions between multiple of your own mods.   How do I bypass it? We understand there may be drama in implementing a system that prevents mods from accessing each other's internals when necessary (like when a mod is abandoned or you need to fix a compat issue) -- after all, we are already modding a game that doesn't have explicit support for Java mods yet. We have already thought of this and are offering APIs from day one to selectively bypass module restrictions. Let me be clear: Forge mods are not required to use JPMS. If you don't want to use it, you don't have to. The default behaviour is to have fully open, fully exported automatic modules. In Java, you can use the `Add-Opens` and `Add-Exports` manifest attributes to selectively bypass module restrictions of other mods at launch time, and we've added explicit support for these when loading your Forge mods. At compile-time, you can use existing solutions such as the extra-java-module-info Gradle plugin to deal with non-modular dependencies and add extra opens and exports to other modules. Here's an example on how to make the internal package `com.example.examplemod.internal` open to your mod in your build.gradle: tasks.named('jar', Jar) { manifest { attributes([ 'Add-Opens' : 'com.example.examplemod/com.example.examplemod.internal' 'Specification-Title' : mod_id, 'Specification-Vendor' : mod_authors // (...) ]) } } With the above in your mod's jar manifest, you can now reflectively access the classes inside that internal package. Multiple entries are separated with a space, as per Java's official spec. You can also use Add-Exports to directly call without reflection, however you'd need to use the Gradle plugin mentioned earlier to be able to compile. The syntax for Add-Exports is the same as Add-Opens, and instructions for the compile-time step with the Gradle plugin are detailed later in this post. Remember to prefer the opens and exports keywords inside module-info.java for sources you control. The Add-Opens/Add-Exports attributes are only intended for forcing open other mods.   What else is new with module support? Previously, the runtime module name was always forced to the first mod ID in your `mods.toml` file and all packages were forced fully open and exported. Module names are now distinguished from mod IDs, meaning the module name in your module-info.java can be different from the mod ID in your `mods.toml`. This allows you to have a more descriptive module name that doesn't have to be the same as your mod ID, however we strongly recommend including your mod ID as part of your module name to aid troubleshooting. The `Automatic-Module-Name` manifest attribute is now also honoured, allowing you to specify a module name for your mod without needing to create a `module-info.java` file. This is particularly useful for mods that don't care about JPMS features but want to have a more descriptive module name and easier integration with other mods that do use JPMS.   How do I use it? The first step is to create a `module-info.java` file in your mod's source directory. This file should be in the same package as your main mod class, and should look something like this: open module com.example.examplemod { requires net.minecraftforge.eventbus; requires net.minecraftforge.fmlcore; requires net.minecraftforge.forge; requires net.minecraftforge.javafmlmod; requires net.minecraftforge.mergetool.api; requires org.slf4j; requires logging; } For now, we're leaving the whole module open to reflection, which is a good starting point. When we know we want to close something off, we can remove the open modifier from the module and open or export individual packages instead. Remember that you need to be open to Forge (module name net.minecraftforge.forge), otherwise it can't call your mod's constructor. Next is fixing modules in Gradle. While Forge and Java support modules properly, Gradle does not put automatic modules on the module path by default, meaning that the logging module (from com.mojang:logging) is not found. To fix this, add the Gradle plugin and add a compile-time module definition for that Mojang library: plugins { // (...) id 'org.gradlex.extra-java-module-info' version "1.9" } // (...) extraJavaModuleInfo { failOnMissingModuleInfo = false automaticModule("com.mojang:logging", "logging") } The automatic module override specified in your build.gradle should match the runtime one to avoid errors. You can do the same for any library or mod dependency that is missing either a module-info or explicit Automatic-Module-Name, however be aware that you may need to update your mod once said library adds one. That's all you need to get started with module support in your mods. You can learn more about modules and how to use them at dev.java.
    • Faire la mise à jour grâce à ce lien m'a aider personnellement, merci à @Paint_Ninja. https://www.amd.com/en/support 
    • When I came across the 'Exit Code: I got a 1 error in my Minecraft mods, so I decided to figure out what was wrong. First, I took a look at the logs. In the mods folder (usually where you'd find logs or crash reports), I found the latest.log file or the corresponding crash report. I read it through carefully, looking for any lines with errors or warnings. Then I checked the Minecraft Forge support site, where you can often find info on what causes errors and how to fix them. I then disabled half of my mods and tried running the game. If the error disappeared, it meant that the problem was with the disabled mod. I repeated this several times to find the problem mod.
    • I have no idea - switch to a pre-configured modpack and use it as working base    
  • Topics

×
×
  • Create New...

Important Information

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