Hello I have copied this tutorial nearly word for word and I keep getting the following error everytime I try to open the Chest
-- System Details --
Details:
Minecraft Version: 1.4.6
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_11, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 894010464 bytes (852 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 11910 (666960 bytes; 0 MB) allocated, 3484 (195104 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 1, tallocated: 63
FML: MCP v7.25 FML v4.6.17.515 Minecraft Forge 6.5.0.489 4 mods loaded, 4 mods active
mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
jwolff52_Minetopia [Minetopia] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
LWJGL: 2.4.2
OpenGL: Intel(R) HD Graphics 3000 GL version 3.1.0 - Build 9.17.10.2867, Intel
Is Modded: Definitely; Client brand changed to 'forge,fml'
Type: Client (map_client.txt)
Texture Pack: Default
Profiler Position: N/A (disabled)
Vec3 Pool Size: 1828 (102368 bytes; 0 MB) allocated, 560 (31360 bytes; 0 MB) used
java.lang.NullPointerException
at jwolff52.minetopia.TileEntityAlchemyChest.getStackInSlot(TileEntityAlchemyChest.java:24)
at net.minecraft.inventory.Slot.getStack(Slot.java:87)
at net.minecraft.client.gui.inventory.GuiContainer.drawSlotInventory(GuiContainer.java:315)
at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:107)
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1004)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:882)
at net.minecraft.client.Minecraft.run(Minecraft.java:771)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT e8a4012c ----------
P.S. There is a lot more of an error report that is before this however it is just information about the world crash that the error causes, I can paste it if you like, but I dont think it is necessary.
Thanks for any help that can be given it would be much appreciated
Can you post the code for TileEntityAlchemyChest? Pastebin, or right here, but if it's here, please continue with the code and spoiler tags
Rollback Post to RevisionRollBack
Learn some Java before you mod, and skip over the chapter on ModLoader, straight to MinecraftForge. It's better. Trust me.
Everything is exactly the same and with the coding experience i have, as far as I can tell there should be no null pointer exception, as the array is declared before it is called I think.
sorry for interupting your talk guys about the problem, but 'ive got a gui problem :/
not one that has to do with this, but i know leah and drinfernoo are here most of the time, and they are really good
at gui's and tile entities. if you aren ot of them, plz ignore this message
I'm making a modified Quarry which has internal storage so I have the Block.class, Entity.class (which implements IInventory), GUI.class, Container.class and GUI Handler.class made (not the actual names, just what they do) and I am having a difficult time letting the TileEntity, which mines the blocks, add the mined blocks to its inventory. I can get it to work once the GUI is loaded (I'm guessing this is because the Container is created) but once the GUI is closed and reopened, the inventory is not there (figured out it just looked like it was skipping blocks). So basically my question is, is there an easy way to add items to a TIleEntity's own storage without needing to open the GUI first. Here is the snippet which I try to add the item in.
//myContain is a Container which I set in the QuarryContainer constructor
//inventoryfree is to make sure the inventory is not full (also for graphics stuff)
if(myContain != null && inventoryfree > 0)
{
inventoryfree -= item.stackSize;
myContain.mergeItemStack(item, 0, 27, false);
}
else
{
System.out.println("Container Null or Full");
}
anyone? Still can't figure out how to allow it to add items without opening the GUI first, it gives a null pointer exception for the container whenever I try
Can someone help me? Whenever I try to open the blocks GUI it Doesn't let me and on the console it says "a mod tried to open a GUI on the server without being a networkmod"
Well, that means EntityItem doesn't have a field called "item", or it isn't visible. It would probably help to know what versions of Minecraft, MCP, and Forge you're using, because I would guess that something has been changed in this regard since this tutorial was written. it may be getItem(), but I'm out of the loop, so that's a total shot in the dark.
Rollback Post to RevisionRollBack
Learn some Java before you mod, and skip over the chapter on ModLoader, straight to MinecraftForge. It's better. Trust me.
I want to change block id depending on empty slots quantity and I tried to use updateEntity() method, like furnace, but now my gui is just not opening.
Is this a right way to do that or I can somehow update the block from container file only when it's contents are changing?
Would be cool if you add Slot tutorial for specifying furnace fuel or making special chest for some types of items.
So-so. I made a thread for this, but I'll ask it here: can I use that packet handler to send fuel values from the server to the client so the client can render it properly (My model has this fuel container where it renders the amount of fuel. Unfortunately, the fuel value only updates on the client when I open the GUI. So when I walk up to my block it looks empty, even though there's fuel in it.)
You should be able to, if you can figure the coding out
I want to change block id depending on empty slots quantity and I tried to use updateEntity() method, like furnace, but now my gui is just not opening.
Is this a right way to do that or I can somehow update the block from container file only when it's contents are changing?
That probably won't work since the GUI is actually linked to the block ID that fires the notify. You are going to need to create separate blocks for that. Another implementation of this, though a little more in-depth with TileEntities, is cpw's IronChests mod, which does something like what I think you have in mind.
Would be cool if you add Slot tutorial for specifying furnace fuel or making special chest for some types of items.
What you do in order to accomplish that is simply extend the Slot, making something like MySlot or whatever you want to call it, and code in a check that makes sure you're only putting in the right item.
Here's a quick example:
//pseudocode for a slot that only accepts dirt, not sure if these are the right method names since it's been a while, but you'll get the point
public class DirtSlot extends Slot {
public boolean putItemInSlot(Item item) {
if (item = dirt) {
addToSlot();
} else {
dont
}
}
}
Rollback Post to RevisionRollBack
Learn some Java before you mod, and skip over the chapter on ModLoader, straight to MinecraftForge. It's better. Trust me.
"A Mod as tried to open a server side GUI without being a NetworkMod"
here is my Main with the NetworkMod anotation
package jordan30001.testMod.common;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.EnumHelper;
import cpw.mods.fml.common.FMLLog;
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.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler;
import cpw.mods.fml.common.SidedProxy;
import jordan30001.testMod.client.core.ClientProxy;
import jordan30001.testMod.client.core.handlers.ClientPacketHandler;
import jordan30001.testMod.client.core.items.ItemGems;
import jordan30001.testMod.common.blocks.BlockGemOres;
import jordan30001.testMod.common.blocks.BlockGems;
import jordan30001.testMod.common.core.CommonProxy;
import jordan30001.testMod.common.core.ConnectionHandler;
import jordan30001.testMod.common.core.handlers.FuelHandler;
import jordan30001.testMod.common.core.handlers.ServerPacketHandler;
import jordan30001.testMod.common.core.handlers.WorldGenHandler;
import jordan30001.testMod.common.item.tools.generic.tools.*;
import jordan30001.testMod.common.item.tools.generic.tools.entitys.EntityEnergySpell;
import jordan30001.testMod.common.item.tools.generic.tools.entitys.RenderEnergySpell;
import jordan30001.testMod.common.tabs.TabGems;
import jordan30001.testMod.utils.Utils;
import jordan30001.testMod.common.blocks.smith.BlockSmith;
import jordan30001.testMod.common.blocks.smith.TileEntitySmith;
@NetworkMod(clientSideRequired = true, serverSideRequired = false, // Whether client side and server side are needed
clientPacketHandlerSpec = @SidedPacketHandler(channels = { "jordan30001" }, packetHandler = ClientPacketHandler.class), // For clientside packet handling
serverPacketHandlerSpec = @SidedPacketHandler(channels = { "jordan30001"}, packetHandler = ServerPacketHandler.class), connectionHandler = ConnectionHandler.class)// For serverside packet handling
@Mod(modid = "jordan30001TestMod", name = "jordan30001TestMod", version = "1.0")// Gives Forge extra info about your mod
public class Main {
@Instance("jordan30001testMod")
public static Main instance = new Main();
@SidedProxy(clientSide = "jordan30001.testMod.client.core.ClientProxy", serverSide = "jordan30001.testMod.common.core.CommonProxy")
public static CommonProxy proxy;
@PreInit()
public void PreInitTutorial(FMLPreInitializationEvent e)
{
//load configs -snip-
}
@Init
public void InitMod(FMLInitializationEvent event)
{
NetworkRegistry.instance().registerGuiHandler(this, proxy);
proxy.registerBlocks();
proxy.registerTiles();
GameRegistry.registerWorldGenerator(new WorldGenHandler());
proxy.addNames();
proxy.addRecipes();
proxy.registerOre();
proxy.registerRenderInformation();
}
@PostInit
public void PostInit(FMLPostInitializationEvent event)
{
Utils.initOreDictionary();
ClientProxy.capesInit();
}
}
@Instance and @Mod are case-sensitive.
Also, just for your information, @Mod isn't what gives Forge "more information" about your mod. It's how Forge identifies your mod. Without that annotation, Forge wouldn't be able to find your mod, and thus it wouldn't even get loaded.
Rollback Post to RevisionRollBack
Learn some Java before you mod, and skip over the chapter on ModLoader, straight to MinecraftForge. It's better. Trust me.
Can you post the code for TileEntityAlchemyChest? Pastebin, or right here, but if it's here, please continue with the code and spoiler tags
Oh and I don't remember if it was in the error report or not but this is 1.4.6.....
Don't know if that changes anything
Do you have it set up just like this tutorial with a Container and everything? Because, as far as I can tell, this should all be working.
Looks like it got solved
http://www.minecraftforum.net/topic/1659819-furnace-progress-arrow-broken/
I mod things. Check me out on twitter or on Espernet IRC at #TheSteamTank
the inventory is not there(figured out it just looked like it was skipping blocks). So basically my question is, is there an easy way to add items to a TIleEntity's own storage without needing to open the GUI first. Here is the snippet which I try to add the item in.any help would be amazing thanks!
Here is an example:
EcoCityCraft Lead Developer
Contact: [email protected]
It is under the ".item" (highlighted) and it says "item cannot be resolved or is not a field."
Random rand = new Random();
TileEntity tile_entity = world.getBlockTileEntity(x, y, z);
if(!(tile_entity instanceof IInventory)) {
return;
}
IInventory inventory = (IInventory) tile_entity;
for(int i = 0; i < inventory.getSizeInventory(); i++) {
ItemStack item = inventory.getStackInSlot(i);
if(item != null && item.stackSize > 0) {
float rx = rand.nextFloat() * 0.6F + 0.1F;
float ry = rand.nextFloat() * 0.6F + 0.1F;
float rz = rand.nextFloat() * 0.6F + 0.1F;
EntityItem entity_item = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.itemID, item.stackSize, item.getItemDamage()));
if(item.hasTagCompound()) {
entity_item.item.setTagCompound((NBTTagCompound) item.getTagCompound().copy());
}
float factor = 0.5F;
entity_item.motionX = rand.nextGaussian() * factor;
entity_item.motionY = rand.nextGaussian() * factor + 0.2F;
entity_item.motionZ = rand.nextGaussian() * factor;
world.spawnEntityInWorld(entity_item);
item.stackSize = 0;
}
}
}
Any help would be appreciated. Thanks.
Well, that means EntityItem doesn't have a field called "item", or it isn't visible. It would probably help to know what versions of Minecraft, MCP, and Forge you're using, because I would guess that something has been changed in this regard since this tutorial was written. it may be getItem(), but I'm out of the loop, so that's a total shot in the dark.
Is this a right way to do that or I can somehow update the block from container file only when it's contents are changing?
Would be cool if you add Slot tutorial for specifying furnace fuel or making special chest for some types of items.
You should be able to, if you can figure the coding out
That probably won't work since the GUI is actually linked to the block ID that fires the notify. You are going to need to create separate blocks for that. Another implementation of this, though a little more in-depth with TileEntities, is cpw's IronChests mod, which does something like what I think you have in mind.
What you do in order to accomplish that is simply extend the Slot, making something like MySlot or whatever you want to call it, and code in a check that makes sure you're only putting in the right item.
Here's a quick example:
@Instance and @Mod are case-sensitive.
Also, just for your information, @Mod isn't what gives Forge "more information" about your mod. It's how Forge identifies your mod. Without that annotation, Forge wouldn't be able to find your mod, and thus it wouldn't even get loaded.