Jump to content

Reversed World Anchor


Nuclear696

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

Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...