Multiverse-Portals icon indicating copy to clipboard operation
Multiverse-Portals copied to clipboard

Rename a Portal

Open benwoo1110 opened this issue 4 years ago • 4 comments

As the title states, add ability to rename an mv-portal.

benwoo1110 avatar Mar 04 '21 09:03 benwoo1110

This should actually not be very difficult to do at all. If someone forked the codebase, I think this could be done in about an hour.

You can actually probably do it with a text editor, too. For example, suppose you want to change portal TreetopRestStop to OakTreetopRestStop. Load portals.yml into vim, and do something like %s/TreetopRestStop/OakTreetopRestStop/g (basically, a string find and replace). You'll also want to make sure the world is correct too. So, you'd first want to change the portal itself, e.g.

TreetopRestStop: entryfee: amount: 0.0 safeteleport: true teleportnonplayers: false handlerscript: '' owner: CaffeineNYC location: -1110.0,71.0,52.0:-1107.0,73.0,52.0 world: SurvivalWorld destination: p:WaterfallRestStop

and then you'd want to change all references to that portal, e.g.

test: entryfee: amount: 0.0 safeteleport: true teleportnonplayers: false handlerscript: '' owner: CaffeineNYC location: -774.0,72.0,80.0:-772.0,74.0,80.0 world: SurvivalWorld destination: p:TreetopRestStop

Like I mentioned, forking the codebase and implementing it would be almost trivial, and I'd recommend it since your idea is a good one, and it appears nobody is willing to implement it.

However, doing it with a text editor seems so trivial, it seems a shame to waste time implementing. Maybe that's why nobody's picked it up?

caffeineLover avatar Jul 20 '21 18:07 caffeineLover

I will probably get around it eventually, but mv isn't the only project I have. Since you said it's quite easy, why not you open a PR 😛? Always happy to see good contributions.

benwoo1110 avatar Jul 21 '21 03:07 benwoo1110

I would, but I don't know if you want me touching your code. I'm a C++/python guy who moonlights as a Java dev. LOL.

Edit: Wow! Your code is super clean and a pleasure to learn from. I'm normally used to Bukkit plugins looking like spaghetti run through a blender and squished by a steamroller.

caffeineLover avatar Jul 21 '21 19:07 caffeineLover

Doesn't hurt to try.

And lol.

nicegamer7 avatar Jul 22 '21 00:07 nicegamer7