Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.7.10] Spamming (Attempted to add a EntityItem) in console


jackmano
 Share

Recommended Posts

Ok, so I'm using a tile to spawn an EntityItem. Everything works except as soon as it drops the first item, the console spams with messages like this-

[12:19:29] [Client thread/WARN] [FML]: Attempted to add a EntityItem to the world with a invalid item at (-239.00,  3.00, 434.00), this is most likely a config issue between you and the server. Please double check your configs

It drops the item just like I told it to, so this is kind of a secondary error, but I need it fixed.

Tile Code -

 

 

package com.rabidfox.syntheticgems;

import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityChest;


public class TileMachineCeramicRodHolder extends TileEntity{
public Boolean rodInserted = false;
public ItemStack typeCrystal;
public int left = 120;
public TileMachineCeramicRodHolder(){  
}
@Override
public void writeToNBT(NBTTagCompound nbt){
	super.writeToNBT(nbt);
	nbt.setBoolean("ifyouknowwhatimean", rodInserted);
	if(typeCrystal != null){
	nbt.setInteger("crytype", (Item.getIdFromItem(typeCrystal.getItem())));
	nbt.setInteger("size", typeCrystal.stackSize);
	}
}
public void readFromNBT(NBTTagCompound nbt){
	super.readFromNBT(nbt);
	rodInserted = nbt.getBoolean("ifyouknowwhatimean");
	typeCrystal = new ItemStack(Item.getItemById(nbt.getInteger("crytype")), nbt.getInteger("size"));

}
public void setRod(Boolean rodIn){
	rodInserted = rodIn;
	worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); // Makes the server call getDescriptionPacket for a full data sync
}
    @Override
    public Packet getDescriptionPacket()
    {
        NBTTagCompound nbttagcompound = new NBTTagCompound();
        writeToNBT(nbttagcompound);
        return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound);
    }
    
    @Override
    public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet)
    {
        readFromNBT(packet.func_148857_g());
        worldObj.func_147479_m(xCoord, yCoord, zCoord);
    }
    @Override 
    public void updateEntity(){
    	if(worldObj.getTileEntity(xCoord, yCoord + 1, zCoord) == null){
    		return;
    	}
    	if(typeCrystal != null && ((TileHydroTorch) worldObj.getTileEntity(xCoord, yCoord + 1, zCoord)).isfire()){
    		left++;
    		TileHydroTorch trch = (TileHydroTorch) worldObj.getTileEntity(xCoord, yCoord + 1, zCoord);
    		if(left >= 120){
    			worldObj.spawnEntityInWorld(new EntityItem(worldObj, xCoord, yCoord, zCoord + 1, typeCrystal));
    			typeCrystal = null;
    			left = 0;
    			trch.killTorch();
    			trch.turnOff();
    		}
    	}
    }
}

 

 

The TypeCrystals are derived from these-

crystaltypes = new ArrayList();
	resultcrystals = new ArrayList();
	crystaltypes.add(0, Items.blaze_powder);
	resultcrystals.add(0, new ItemStack(Items.blaze_rod));
	crystaltypes.add(1, SyntheticGems.itemalumina);
	resultcrystals.add(1, new ItemStack(Blocks.redstone_block, 3));

I didnt have this problem when I only had the Blaze Rod and Blaze Powder, it just started. PLZ HEEELP

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
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.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.