Jump to content

[1.10.2]TileEntity not Working properly (page 2)


Villfuk02

Recommended Posts

	public void finishRecipe(){
	ItemStack out = getOutput(itemHandler.getStackInSlot(0),itemHandler.getStackInSlot(1),itemHandler.getStackInSlot(2),itemHandler.getStackInSlot(3));
	itemHandler.insertItem(4, out, false);

	for(int i = 0; i < 4; i++){
		itemHandler.extractItem(i, 1, false); // first extract and then look it up that will trow a npe. so move this down

	essence_stored += getEssenceOutput(itemHandler.getStackInSlot(0),itemHandler.getStackInSlot(1),itemHandler.getStackInSlot(2),itemHandler.getStackInSlot(3)).getAmount();
	essence_type = getEssenceOutput(itemHandler.getStackInSlot(0),itemHandler.getStackInSlot(1),itemHandler.getStackInSlot(2),itemHandler.getStackInSlot(3)).getType();
	//---Something to write to NBT here---

	}
}

Link to comment
Share on other sites

You are greatly overusing super calls in your update methods ie getUpdateTag. I cant see anything that wont let it read and write, is writeToNBT and readFromNBT even getting called?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

 

I just don' have any idea what to do with this, i tried everything i could think of.

 

 

Have you set breakpoints and then stepped through and into code using the debugger? If not, then you have more to think of.

 

The debugger is such an essential tool that almost all non-crash runtime weirdness reported in this forum should include at least some observations made in the debugger before we can help most effectively.

 

Also, have you looked beyond the console output and scanned your log files? The log files contain warnings that do not show on the console (but are more likely to be helpful with rendering and crash issues).

 

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Link to comment
Share on other sites

Have you set breakpoints and then stepped through and into code using the debugger? If not, then you have more to think of.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

It look just lik the server is not syncing with the server, BUT WHY????????

 

If its not syncing with the server, you need to make it sync with the server.

Usually involves packets.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

I have debugged this so many times and nothing seems suspicious.

Everything does what it is supposed to and then it just resets like wtf

 

Something else to watch out for: The default behavior for tile entities is that updating the blockstate will cause the TE to be replaced. There's a "shouldRefresh" method somewhere (I think in the Block class) that needs to be overridden -- but it should not always return false. Instead, it needs to return true when the TE is really not needed anymore (like after its block type has been replaced with something else).

 

If you haven't dealt with "shouldRefresh" yet, then Google it. It has come up several times in this forum.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

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.