Archived

This topic is now archived and is closed to further replies.

Nuclear696

Reversed World Anchor

Recommended Posts

Hello,

i search a modder (or a mod) for an reversed world anchor for smp.

these special world anchor must keep specific ID's, like machines, unloaded except its owner is near to it. it must also be possible to add or remove player as owner to this anchor and change the size of the unloaded area and the ID's there are unloaded.

Thanks and sorry for my bad english :D

Share this post


Link to post
Share on other sites

What...what? So you want it to unload chunks while nobody is near?

That's what Minecraft does, hence the need for World Anchors in the first place. There would be no need to keep chunks loaded with world anchors if the chunks didn't unload automatically.

Share this post


Link to post
Share on other sites

It sounds like a security device. Don't even send the given chunks to the another client if the owner hasn't loaded them. Does the server know when the client unloads a chunk?

Share this post


Link to post
Share on other sites

@ theprolo: sure minecraft unload chunks but it load it any time when a player is near. I search an mod that only load the chunk of a area like a factory when the owner is in the factory or near to it.

Share this post


Link to post
Share on other sites

It's impossible. You're asking for a method to prevent chunks from loading unless a specific player is near. You can't selectively load chunks. It's an all or nothing thing. Even if you could do it, you would have massive holes in the world extending into the void.

Share this post


Link to post
Share on other sites

Hrm.

I think the easiest way to do this would be to create a block that outputs a redstone signal based on the online status of a given player.

Block plus tile entity, have the tileentity record the player who placed it into an NBT tag, and randomtick it to check the online status of said player, changing redstone signal state as needed.

No need to mess with a gui or slash commands, just break and replace the block if you need to change who it's bound to. The block could be a simple one, no need for facing or sided textures.

For bonus points you could give it two skins and use the block's metadata to change the skin and light output based on the state.

Share this post


Link to post
Share on other sites

I do believe you mean "some to create this mod". Only need it made once.

This looks like a really good first mod for someone looking to start modding. It's pretty much grunt work that touches basic blocks, crafting recipes, tileentites, and a small assortment of useful tidbits.

Share this post


Link to post
Share on other sites

I recommend looking at onEnter events instead, less ticks per second. You know, "Soandso entered the world" messages, they have to be triggered somewhere.

Share this post


Link to post
Share on other sites

I recommend looking at onEnter events instead, less ticks per second. You know, "Soandso entered the world" messages, they have to be triggered somewhere.

True, it could work. But there's a couple things to consider.

1: Ticking it means a quick sanity check when the block is loaded into the world. Since it would be able to process join/leave events and change state only when the block is loaded.

2: There are a LOT of events: http://www.minecraftforge.net/wiki/Forge_Events If you set the tickrate long enough for the block it could be cheaper CPU wise to tick it than adding more subscribers to the event system.

3: I see an event for an entity joining the world (EntityJoinWorldEvent, which covers ALL entitys: projectiles, tileentitys, mobs, and players), but I don't see a leave event. Forge may not support that sort of tracking yet.

Share this post


Link to post
Share on other sites

hmmm maybe its that one way.: it loads off and the player can click it like a button or leaver to turn it on.when the chunk unloads it reset to off state or it scans every 10 minuets that the player is near.

Share this post


Link to post
Share on other sites