Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.