AgriCraft

AgriCraft

30M Downloads

Agricraft gives empty NBT Strings

OddHero opened this issue ยท 9 comments

commented

The game starts up, but nei is NOT starting anymore
(its the FTB-Infinity Pack)

Crash report:

http://pastebin.com/Ud7Dyatv

commented

And another Error related to the same problem...:

http://pastebin.com/cXtFci0y

commented

What version?

commented

Also this is the first report I've had of this coming from the Infinity pack, did you add any mods, and so which ones?

commented

the version is:
infinity version is 1.2.0 (not reccomendet yet i know) i have not added any mods to the pack

AgriCraft-1.7.10-1.2.2.jar
The problem occures in this section of your code:
com.InfinityRaider.AgriCraft.utility.NBTHelper;

public static NBTTagCompound getMaterialTag(ItemStack stack) {
NBTTagCompound tag = new NBTTagCompound();
if(stack!=null && stack.getItem()!=null) {
tag.setString(Names.NBT.material, Block.blockRegistry.getNameForObject(((ItemBlock) stack.getItem()).field_150939_a));
tag.setInteger(Names.NBT.materialMeta, stack.getItemDamage());
}
return tag;
}

i made a quick fix which makes the stack variable always null so it skipps this portion of the code
now its not crashing anymore...

i edited the bytecode of the NBThelper class

new net/minecraft/nbt/NBTTagCompound
dup
invokespecial net/minecraft/nbt/NBTTagCompound/()V
astore_1

aload_0 -->changed to--> aconst_null

ifnull 24
aload_0
...

commented

change this code:
tag.setString(Names.NBT.material, Block.blockRegistry.getNameForObject(((ItemBlock)stack.getItem()).field_150939_a));

to this:
if (! Block.blockRegistry.getNameForObject(((ItemBlock) stack.getItem()).field_150939_a.isEmpty()){
tag.setString(Names.NBT.material, Block.blockRegistry.getNameForObject(((ItemBlock)stack.getItem()).field_150939_a));
}

should fix the problem i think

commented

I know how to fix it, I want to know whats causing it. Because people shouldn't add itemblocks without a block...

commented

it could be some problem with a cauldron plugin
it happens when playing on a server that runs cauldron

commented

if you want to check it for yourself i can give you the server-adress wher it occures!

commented

Thanks, but that won't be necessary, are you positive that this only happens when Cauldron is installed? I'm wondering if it is actually Cauldron or a mod that doesn't go nicely with Cauldron. I'll add in a check to prevent this exception. I'm still quite curious what is causing it though. Once the fix is out, can you compare the all the tanks with all the kinds of planks in your instance?