Jump to content

NPE on seeing if one int doesn't equal another?


KeeganDeathman

Recommended Posts

I wouldn't think so. This is only called if their are adjacent tubes, and then I have this

TileEntity posX = worldObj.getTileEntity(xCoord+1, yCoord, zCoord);
	TileEntity posZ = worldObj.getTileEntity(xCoord, yCoord, zCoord+1);
	TileEntity negX = worldObj.getTileEntity(xCoord-1, yCoord, zCoord);
	TileEntity negZ = worldObj.getTileEntity(xCoord, yCoord, zCoord-1);
	if(posX instanceof TileEntityAcceleratorTube && posX != null && !posX.equals(src))
		return (TileEntityAcceleratorTube)posX;
	if(posZ instanceof TileEntityAcceleratorTube && posZ != null && !posZ.equals(src))
		return (TileEntityAcceleratorTube)posZ;
	if(negX instanceof TileEntityAcceleratorTube && negX != null && !negX.equals(src))
		return (TileEntityAcceleratorTube)negX;
	if(negZ instanceof TileEntityAcceleratorTube && negZ != null && !negZ.equals(src))
		return (TileEntityAcceleratorTube)negZ;
	return null;

to find the next block in the sequence.But this is, again, only run if their are adjaecent blocks.

I pass in the parameters from my render, which figures out what kind of shape the tube is(straight on x,y, or z, corner, three way, four way, five way, all way, no way, one way), to my tile entity, it calculates what it is based on that(the render figures out whether there is a connection up, down, N,E,S,W), and updates the network accoridingly. If it's alone, it's invalid, and does nothing.

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

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