Jump to content

Recommended Posts

Posted

So I am trying to update my mod to 1.8 and I am stuck on getting my crop to work. Every time I try to right click on farmland/any other block with my custom seeds, it crashes my game.

 

This is the crash report:

 

 

[16:21:16] [server thread/FATAL] [FML]: Exception caught executing FutureTask: java.util.concurrent.ExecutionException: java.lang.NullPointerException

java.util.concurrent.ExecutionException: java.lang.NullPointerException

  at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.7.0_72]

  at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.7.0_72]

  at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:715) [FMLCommonHandler.class:?]

  at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) [MinecraftServer.class:?]

  at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:669) [MinecraftServer.class:?]

  at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:171) [integratedServer.class:?]

  at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:540) [MinecraftServer.class:?]

  at java.lang.Thread.run(Unknown Source) [?:1.7.0_72]

Caused by: java.lang.NullPointerException

  at net.minecraft.item.ItemSeeds.getPlant(ItemSeeds.java:61) ~[itemSeeds.class:?]

  at net.minecraft.block.Block.canSustainPlant(Block.java:1905) ~[block.class:?]

  at net.minecraft.item.ItemSeeds.onItemUse(ItemSeeds.java:40) ~[itemSeeds.class:?]

  at net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(ForgeHooks.java:570) ~[ForgeHooks.class:?]

  at net.minecraft.item.ItemStack.onItemUse(ItemStack.java:146) ~[itemStack.class:?]

  at net.minecraft.server.management.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:488) ~[itemInWorldManager.class:?]

  at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:624) ~[NetHandlerPlayServer.class:?]

  at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:67) ~[C08PacketPlayerBlockPlacement.class:?]

  at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:114) ~[C08PacketPlayerBlockPlacement.class:?]

  at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:24) ~[PacketThreadUtil$1.class:?]

  at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.7.0_72]

  at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.7.0_72]

  at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:714) ~[FMLCommonHandler.class:?]

  ... 5 more

[16:21:17] [server thread/INFO]: Stopping server

[16:21:17] [server thread/INFO]: Saving players

[16:21:17] [server thread/INFO]: Saving worlds

[16:21:17] [server thread/INFO]: Saving chunks for level '1.8 Forge'/Overworld

[16:21:17] [server thread/INFO]: Saving chunks for level '1.8 Forge'/Nether

[16:21:17] [server thread/INFO]: Saving chunks for level '1.8 Forge'/The End

[16:21:18] [server thread/INFO] [FML]: Unloading dimension 0

[16:21:18] [server thread/INFO] [FML]: Unloading dimension -1

[16:21:18] [server thread/INFO] [FML]: Unloading dimension 1

[16:21:18] [server thread/INFO] [FML]: Applying holder lookups

[16:21:18] [server thread/INFO] [FML]: Holder lookups applied

[16:21:19] [Client thread/FATAL]: Unreported exception thrown!

java.lang.NullPointerException

  at net.minecraft.item.ItemSeeds.getPlant(ItemSeeds.java:61) ~[itemSeeds.class:?]

  at net.minecraft.block.Block.canSustainPlant(Block.java:1905) ~[block.class:?]

  at net.minecraft.item.ItemSeeds.onItemUse(ItemSeeds.java:40) ~[itemSeeds.class:?]

  at net.minecraft.item.ItemStack.onItemUse(ItemStack.java:147) ~[itemStack.class:?]

  at net.minecraft.client.multiplayer.PlayerControllerMP.func_178890_a(PlayerControllerMP.java:442) ~[PlayerControllerMP.class:?]

  at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1571) ~[Minecraft.class:?]

  at net.minecraft.client.Minecraft.runTick(Minecraft.java:2130) ~[Minecraft.class:?]

  at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1087) ~[Minecraft.class:?]

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

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

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

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

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

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

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

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

  at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]

  at GradleStart.main(Unknown Source) [start/:?]

[16:21:19] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:660]: ---- Minecraft Crash Report ----

// Uh... Did I do that?

 

Time: 11/06/15 4:21 PM

Description: Unexpected error

 

java.lang.NullPointerException: Unexpected error

  at net.minecraft.item.ItemSeeds.getPlant(ItemSeeds.java:61)

  at net.minecraft.block.Block.canSustainPlant(Block.java:1905)

  at net.minecraft.item.ItemSeeds.onItemUse(ItemSeeds.java:40)

  at net.minecraft.item.ItemStack.onItemUse(ItemStack.java:147)

  at net.minecraft.client.multiplayer.PlayerControllerMP.func_178890_a(PlayerControllerMP.java:442)

  at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1571)

  at net.minecraft.client.Minecraft.runTick(Minecraft.java:2130)

  at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1087)

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

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

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

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

  at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

  at GradleStart.main(Unknown Source)

 

 

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

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

 

-- Head --

Stacktrace:

  at net.minecraft.item.ItemSeeds.getPlant(ItemSeeds.java:61)

  at net.minecraft.block.Block.canSustainPlant(Block.java:1905)

  at net.minecraft.item.ItemSeeds.onItemUse(ItemSeeds.java:40)

  at net.minecraft.item.ItemStack.onItemUse(ItemStack.java:147)

  at net.minecraft.client.multiplayer.PlayerControllerMP.func_178890_a(PlayerControllerMP.java:442)

  at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1571)

 

-- Affected level --

Details:

  Level name: MpServer

  All players: 1 total; [EntityPlayerSP['jedispencer21'/142, l='MpServer', x=177.93, y=69.29, z=264.21]]

  Chunk stats: MultiplayerChunkCache: 289, 289

  Level seed: 0

  Level generator: ID 00 - default, ver 1. Features enabled: false

  Level generator options:

  Level spawn location: 186.00,64.00,266.00 - World: (186,64,266), Chunk: (at 10,4,10 in 11,16; contains blocks 176,0,256 to 191,255,271), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

  Level time: 254813 game time, 6000 day time

  Level dimension: 0

  Level storage version: 0x00000 - Unknown?

  Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)

  Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false

  Forced entities: 85 total; --- CUTOUT --- Retry entities: 0 total; []

  Server brand: fml,forge

  Server type: Integrated singleplayer server

Stacktrace:

  at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:392)

  at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2613)

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

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

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

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

  at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

  at GradleStart.main(Unknown Source)

 

 

 

This is my items:

 

 

public static void initItems()

{

tomato_seeds = RegistryHandler.registerItems(new ItemSeeds(tomato_plant, Blocks.farmland).setUnlocalizedName("tomato_seeds").setCreativeTab(tabGarmoraMaterials));

 

tomato = RegistryHandler.registerItems(new ItemFood(4, 0.1F, false).setUnlocalizedName("tomato").setCreativeTab(CreativeTabs.tabFood));

}

 

public static void initBlocks()

{

tomato_plant = RegistryHandler.registerBlocks(new BlockTomato().setUnlocalizedName("tomato_plant"));

}

 

public static void registerRenders()

{

RenderHelper.registerItemRender(tomato_seeds);

 

RenderHelper.registerItemRender(tomato);

 

RenderHelper.registerBlockRender(tomato_plant);

}

 

 

 

BlockTomato class:

 

 

public class BlockTomato extends BlockCrops

{

protected Item getSeed()

{

return Blocks_and_Items.tomato_seeds;

}

 

protected Item getCrop()

{

return Blocks_and_Items.tomato;

}

}

 

 

 

Render and Register class:

 

 

public class RenderHelper

{

/**

* Registers item model to JSON file.

*/

@SideOnly(Side.CLIENT)

public static void registerItemRender(Item item)

{

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Strings.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));

}

 

/**

* Registers block models to JSON file.

*/

@SideOnly(Side.CLIENT)

public static void registerBlockRender(Block block)

{

Item item = Item.getItemFromBlock(block);

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Strings.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));

}

 

/**

* Registers block models with metadata to JSON file.

*/

@SideOnly(Side.CLIENT)

public static void registerBlockMultiTextures(Block block, int meta, String location)

{

Item item = Item.getItemFromBlock(block);

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, meta, new ModelResourceLocation(Strings.MOD_ID + location, "inventory"));

}

}

 

public class RegistryHandler

{

private RegistryHandler() {}

 

/**

* A more convenient way of registering Items.

*/

public static Item registerItems(Item item)

{

GameRegistry.registerItem(item, item.getUnlocalizedName().substring(5));

return item;

}

 

/**

* A more convenient way of registering Blocks.

*/

public static Block registerBlocks(Block block)

{

GameRegistry.registerBlock(block, block.getUnlocalizedName().substring(5));

return block;

}

}

 

 

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



×
×
  • Create New...

Important Information

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