Jump to content

[1.12.1]Load tileentity on command


GiantNuker

Recommended Posts

Hi, I'm making a Botania addon, my problem is that I have two portal TileEntities, to make them work, they need to be linked(obviously).

The system works just fine, until you try to link portals that aren't chunkloaded at the same time.

I thought I could just make them chunkload, but I don't want that abused.  Is there any way to load a TileEntity on command?

Link to comment
Share on other sites

8 minutes ago, GiantNuker said:

setPositionAndUpdate

But that's not it, I'm taking about linking portals in different chunks.

See.

Here's the thing.

It shouldn't bloody matter where the destination is. You send the player, bam, done, everything's golden.

We're trying to figure out why the hell you need to get any data from the destination at all.

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

35 minutes ago, Draco18s said:

See.

Here's the thing.

It shouldn't bloody matter where the destination is. You send the player, bam, done, everything's golden.

We're trying to figure out why the hell you need to get any data from the destination at all.

That's not what I'm talking about, my problem is that the TileEntities will not link properly if they are not both loaded at the time.  Also I am having problems because no connection can be started if it cannot reach the other TileEntity.

Link to comment
Share on other sites

25 minutes ago, MDW01 said:

I think you mean that the portal links correctly in the chunks that are loaded but not in the chunks that are unloaded so it only works in one direction?

More like this, the work fine when the player links them with both in render distance.  One does not know It's linked to the other if one is not in render distance. Same thing goes for activating them.  Teleportation works fine.  The only problems are those mentioned above.

And no to your Question, because if they are already connected, there should be no issue.

Edited by GiantNuker
Left something out.
Link to comment
Share on other sites

AH HA, NOW WE KNOW WHAT THE PROBLEM IS.

That is: your problem isn't teleporting, it's telling the two portals where to go.

 

Here's the solution: you need to store the destination coordinates somewhere else.  I don't me a reference to the TEs, I mean, the player says "this object needs to be a destination" and you store the location in an Item or a Capability, then when the player goes to the other portal, you read from that.

  • Like 1

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

4 minutes ago, Draco18s said:

AH HA, NOW WE KNOW WHAT THE PROBLEM IS.

That is: your problem isn't teleporting, it's telling the two portals where to go.

 

Here's the solution: you need to store the destination coordinates somewhere else.  I don't me a reference to the TEs, I mean, the player says "this object needs to be a destination" and you store the location in an Item or a Capability, then when the player goes to the other portal, you read from that.

So add an extra NBT tag to Botania's wand of the forest?

Also, what should I do to message the other TE, when bound, the first TE is supposed to send a message to the second.

Link to comment
Share on other sites

16 minutes ago, GiantNuker said:

So add an extra NBT tag to Botania's wand of the forest?

No, use a Capability if you can. You can even attach one to the player.

16 minutes ago, GiantNuker said:

Also, what should I do to message the other TE, when bound, the first TE is supposed to send a message to the second.

Your setup is fundamentally flawed. Areas that are unloaded cannot be accessed.

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

As mentioned by Draco, imagine using a capability on the player (or special item) that stores pairs of coordinates for linked TEs. As you place the TEs you'd record their location and then when you want to teleport you look it up. 

 

If the portals are meant to be used by multiple players then you might want to attach the data to the world instead, maybe as world save data or even just use your own Java file handling code to store it. 

 

The only trick is you also need to maintain the lists in the case where the TEs get destroyed or something.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.