Jump to content

[1.8.8]Tile Entity saving... Kind of?[solved]


Atijaf

Recommended Posts

After a long while, I have gotten my tile entity to work just the way I want it to...

I just want to add a couple lines of text that display information about what the Tile Entity contains, such as it's current amount of "Energy" and "Energy Rate"

 

Pictures and explanations

 

 

 

Adding the power source

https://gyazo.com/aca0d76b0da029cde249ea9bfb6530f0

 

outcome - Current Energy is moving down at 200 per tick and placed into block on right

https://gyazo.com/b507219e38d945e31c87e633e5c6991c

 

When Block is removed from right, Current Energy is no longer being removed

https://gyazo.com/295bcd0fbb7a112fb36e9a87206da346

 

After saving and quiting - (The problem occurs)

https://gyazo.com/763bfcc8b670eb25c9113b47fca69663

 

The TileEntity still has the data inside.  I've debugged and saw that, but one of the tile Entities, (The one displaying the screen) is the incorrect one... I think, but am unsure as to how to obtain the correct one.

 

Shows it still works, but doesn't update "Current Energy" or "Energy Rate"

https://gyazo.com/1ae5981a764581560e31845a156f439e

 

 

 

 

I Believe the problem begins with the creation of a new TileEntity

When I start up the game, I notice that the method "createNewTileEntity" is called

 

BlockKineticRelocator: -- (When activated, passes TileEntity it obtains from a location.  Somehow, it isn't correct?)

http://pastebin.com/JzpxCrZu

 

GuiKineticRelocator -- (Information here is correct until restart)

http://pastebin.com/XA6AgdrY

 

KineticRelocatorTileEntity

http://pastebin.com/DTdX0yKy

 

As in the last gif, it's obvious a Tile Entity has the data I'm looking for, but I'm unsure how to find it.  Everytime I use the method, "World.getTileEntity(pos)" , it returns a tileEntity but it doesn't have the correct information.  (The data I'm looking for are all 0)

 

While T300kCapsule is being charged, if I debug and set breakpoints in the tile entity that takes care of that, it shows the data correctly.

 

I know this is a lot to take in, but hopefully it's just something silly that's happening...

Thanks a bunch for anyone that helps

Link to comment
Share on other sites

I had this same problem. Simply call the super for #writeToNBT, and #readFromNBT in your TileEntity class.

 

Unfortunately, I've already done that.

 

I probably should have included that code.  I've edited my previous post and have added it.

Link to comment
Share on other sites

I believe, from looking at the furnace, you need to use the #getFields() and #setFields() for easy client to server sync. I haven't tried it, but it seems the furnace TileEntity uses it.

I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.

Link to comment
Share on other sites

- You will need to sync the data that is visible in your GUI in your Container. You can look at e.g. ContainerFurnace for a vanilla example.

- Why on earth are you storing all your data in the Items list? :o You can have more than one top-level entry in your NBT data (like you already do with the custom name).

 

Would it be the method "detectAndSendChanges()"?

I'll try it when I get back home.

Thanks

Link to comment
Share on other sites

@Override
public void detectAndSendChanges() {
	// TODO Auto-generated method stub
	super.detectAndSendChanges();

	//I Understand I need to loop through all of these for each player, just not yet
	ICrafting icrafting = (ICrafting)this.crafters.get(0);

	if(this.tileentitycharge != this.te.getField(0)){
		/**								this, id, the TileEntity variable */
		icrafting.sendProgressBarUpdate(this, 0, this.te.getField(0));
	}

	this.tileentitycharge = this.te.getField(0);
}

 

@Override
public int getField(int id) {
	switch(id){
		case(0): return this.TileEntityCharge;
	}
    return 0;
}

@Override
public void setField(int id, int value) {
	switch(id){
	case(0): this.TileEntityCharge = value; break;
	}
}

@Override
public int getFieldCount() {
    return 1;
}

 

did this, but it's still not updating the gui screen variables after restarting the game.  Have I missed something?

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I was just trying to play my modded world when i randomly got this crash for no reason. I sorted through like every mod and eventually I realized it was LLibrary but I can't seem to find a solution to fix the crashing. I can't lose the world that I have that uses this mod please help me. Here's the report: https://pastebin.com/0D00B79i If anyone has a solution please let me know.  
    • 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑   Daftar Slot Ligawin88 adalah bocoran slot rekomendasi gacor dari Ligawin88 yang bisa anda temukan di SLOT Ligawin88. Situs SLOT Ligawin88 hari ini yang kami bagikan di sini adalah yang terbaik dan bersiaplah untuk mengalami sensasi tak terlupakan dalam permainan slot online. Temukan game SLOT Ligawin88 terbaik dengan 100 pilihan provider ternama yang dipercaya akan memberikan kepuasan dan kemenangan hari ini untuk meraih x500. RTP SLOT Ligawin88 merupakan SLOT Ligawin88 hari ini yang telah menjadi pilihan utama bagi pemain judi online di seluruh Indonesia. Setiap harinya jutaan pemain memasuki dunia maya untuk memperoleh hiburan seru dan kemenangan besar dalam bermain slot dengan adanya bocoran RTP SLOT Ligawin88. Tidak ada yang lebih menyenangkan daripada mengungguli mesin slot dan meraih jackpot x500 yang menggiurkan di situs SLOT Ligawin88 hari ini yang telah disediakan SLOT Ligawin88. Menangkan jackpot besar x500 rajanya maxwin dari segala slot dan raih kemenangan spektakuler di situs Ligawin88 terbaik 2024 adalah tempat yang menyediakan mesin slot dengan peluang kemenangan lebih tinggi daripada situs slot lainnya. Bagi anda yang mencari pengalaman judi slot paling seru dan mendebarkan, situs bo SLOT Ligawin88 terbaik 2024 adalah pilihan yang tepat. Jelajahi dunia slot online melalui situs SLOT Ligawin88 di link SLOT Ligawin88.
    • 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑   Daftar Slot Asusslot adalah bocoran slot rekomendasi gacor dari Asusslot yang bisa anda temukan di SLOT Asusslot. Situs SLOT Asusslot hari ini yang kami bagikan di sini adalah yang terbaik dan bersiaplah untuk mengalami sensasi tak terlupakan dalam permainan slot online. Temukan game SLOT Asusslot terbaik dengan 100 pilihan provider ternama yang dipercaya akan memberikan kepuasan dan kemenangan hari ini untuk meraih x500. RTP SLOT Asusslot merupakan SLOT Asusslot hari ini yang telah menjadi pilihan utama bagi pemain judi online di seluruh Indonesia. Setiap harinya jutaan pemain memasuki dunia maya untuk memperoleh hiburan seru dan kemenangan besar dalam bermain slot dengan adanya bocoran RTP SLOT Asusslot. Tidak ada yang lebih menyenangkan daripada mengungguli mesin slot dan meraih jackpot x500 yang menggiurkan di situs SLOT Asusslot hari ini yang telah disediakan SLOT Asusslot. Menangkan jackpot besar x500 rajanya maxwin dari segala slot dan raih kemenangan spektakuler di situs Asusslot terbaik 2024 adalah tempat yang menyediakan mesin slot dengan peluang kemenangan lebih tinggi daripada situs slot lainnya. Bagi anda yang mencari pengalaman judi slot paling seru dan mendebarkan, situs bo SLOT Asusslot terbaik 2024 adalah pilihan yang tepat. Jelajahi dunia slot online melalui situs SLOT Asusslot di link SLOT Asusslot.
    • 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑 Daftar Slot Galeri555 adalah bocoran slot rekomendasi gacor dari Galeri555 yang bisa anda temukan di SLOT Galeri555. Situs SLOT Galeri555 hari ini yang kami bagikan di sini adalah yang terbaik dan bersiaplah untuk mengalami sensasi tak terlupakan dalam permainan slot online. Temukan game SLOT Galeri555 terbaik dengan 100 pilihan provider ternama yang dipercaya akan memberikan kepuasan dan kemenangan hari ini untuk meraih x500. RTP SLOT Galeri555 merupakan SLOT Galeri555 hari ini yang telah menjadi pilihan utama bagi pemain judi online di seluruh Indonesia. Setiap harinya jutaan pemain memasuki dunia maya untuk memperoleh hiburan seru dan kemenangan besar dalam bermain slot dengan adanya bocoran RTP SLOT Galeri555. Tidak ada yang lebih menyenangkan daripada mengungguli mesin slot dan meraih jackpot x500 yang menggiurkan di situs SLOT Galeri555 hari ini yang telah disediakan SLOT Galeri555. Menangkan jackpot besar x500 rajanya maxwin dari segala slot dan raih kemenangan spektakuler di situs Galeri555 terbaik 2024 adalah tempat yang menyediakan mesin slot dengan peluang kemenangan lebih tinggi daripada situs slot lainnya. Bagi anda yang mencari pengalaman judi slot paling seru dan mendebarkan, situs bo SLOT Galeri555 terbaik 2024 adalah pilihan yang tepat. Jelajahi dunia slot online melalui situs SLOT Galeri555 di link SLOT Galeri555.
    • 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑 Daftar Slot Kocok303 adalah bocoran slot rekomendasi gacor dari Kocok303 yang bisa anda temukan di SLOT Kocok303. Situs SLOT Kocok303 hari ini yang kami bagikan di sini adalah yang terbaik dan bersiaplah untuk mengalami sensasi tak terlupakan dalam permainan slot online. Temukan game SLOT Kocok303 terbaik dengan 100 pilihan provider ternama yang dipercaya akan memberikan kepuasan dan kemenangan hari ini untuk meraih x500. RTP SLOT Kocok303 merupakan SLOT Kocok303 hari ini yang telah menjadi pilihan utama bagi pemain judi online di seluruh Indonesia. Setiap harinya jutaan pemain memasuki dunia maya untuk memperoleh hiburan seru dan kemenangan besar dalam bermain slot dengan adanya bocoran RTP SLOT Kocok303. Tidak ada yang lebih menyenangkan daripada mengungguli mesin slot dan meraih jackpot x500 yang menggiurkan di situs SLOT Kocok303 hari ini yang telah disediakan SLOT Kocok303. Menangkan jackpot besar x500 rajanya maxwin dari segala slot dan raih kemenangan spektakuler di situs Kocok303 terbaik 2024 adalah tempat yang menyediakan mesin slot dengan peluang kemenangan lebih tinggi daripada situs slot lainnya. Bagi anda yang mencari pengalaman judi slot paling seru dan mendebarkan, situs bo SLOT Kocok303 terbaik 2024 adalah pilihan yang tepat. Jelajahi dunia slot online melalui situs SLOT Kocok303 di link SLOT Kocok303.
  • Topics

×
×
  • Create New...

Important Information

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