GTNewHorizons / ServerUtilities

GNU Lesser General Public License v3.0
29 stars 14 forks source link

Backwards Compatible backport and rewrite. #7

Closed Lyfts closed 12 months ago

Lyfts commented 1 year ago

Backport of FTBU, FTBL and Aurora, with lots of new features useful for server admins. (and players)

I can't push to the other branch since org purge and it doesn't look like Ethryan is still working on it. So I thought I would open a new pr in order to adress potential reviews. Don't know how anyone is supposed to review this tho :)

Of course big credit to Ethryan and koi330 for much of the early work.

What's new

World logging (Block break, player right click, block place, player attack, chat log) Drag claiming on chunk map (Hold Shift to chunkload, CTRL to claim in a large square) Lots of new commands Teams (replaces the old friend system) Permission system Improved GUI Lots of new useful config options NBTEdit - edit item, entity, block and even player nbt data ingame +more probably :) and it of course still has the backup, auto restart etc. that we are used to.

It's also fully backwards compatible for homes, chunks, warps and most of the config which will all be loaded on first startup. This has been tested with a couple of my own worlds as well as the ballers world download, all of Sampsa's 2400 claimed and loaded chunks converted correctly.

A bit of time has been spent cleaning up the mods as well as combine the 3 into 1 single mod, which will hopefully improve maintainability a bit. There's still a lot of cleanup that could be done, all the events are only being used for internal mod communication so they could all be removed and there's a number of unused classes and methods spread throughout.

All the critical bugs that I have encountered has been fixed and it feels just about ready for release now. It's become a bit of passion project at this point, so I'll be ready for any additional bugs that pop up.

Closes: https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/14410 all this just to close a ticket 💯

bombcar commented 1 year ago

So this jar replaces the three mods listed? There are too many changes to review but I can certainly test a jar.

Lyfts commented 1 year ago

Yup, remember to remove ftbu & lib if installed.

bombcar commented 1 year ago

[✔️] FTBLib-1.0.19-GTNH.jar [✔️] FTBUtilities-1.1.1-GTNH.jar [✔️] ServerUtilities-1.0.1-backport.166+a6299e49f4.jar

Should it error out if it sees FTBLib/Utils? Because it seems to not care and I get double things:

image

(Yes I intentionally didn't remove the old jars ...)

bombcar commented 1 year ago

image

Claimed chunks are now mauve or something, and hard to distinguished from claimed/chunkloaded (with the default FTB from GTNH it was bright green for claimed, red for claimed + loaded, the colors in the overlay text). I don't see a config option to change that.

EDIT: This is apparently the "team color" feature, and my old "team" was green. I was able to change it in Team colors, though the chunkloaded before were highlighted, now they're just a box.

The click to drag claiming/chunkloading works, though it's shift now instead of control so we may have to update some documentation on the Wiki.

Ethryan commented 1 year ago

My irl stuff got in the way, and I got stuck on the last few errors.

Lyfts commented 1 year ago

Alright @bombcar no more launching with the old mods.

As for the loaded chunks it needs to be somewhat consistent with the team color as other players will see it as well. I can make the loaded chunks darker/lighter or if you have any other good ideas let me know.

Lyfts commented 1 year ago

Had some extra time, so backwards compatibility has been added for the majority of the config as well.

Edit: I'm aware that it doesn't build atm. Internet is down so can't push the fix.

Dream-Master commented 1 year ago

@bombcar since you not answering on Discord. Are you still using it?

bombcar commented 1 year ago

As for the loaded chunks it needs to be somewhat consistent with the team color as other players will see it as well. I can make the loaded chunks darker/lighter or if you have any other good ideas let me know.

Maybe a hatch pattern? Slightly darker would probably be fine, or even just lines of slightly darker. Whatever's easiest to code. It's not like people use that minimap for navigation but if you're in the center of a 2400 chunk base it might not be easy to see if a chunk is not chunk loaded without hovering over it.

@Dream-Master yah is me back from the dead, started a new run because Minecraft vanilla sucks too hard - freaking glowsquid

bombcar commented 1 year ago

The build and test crash is missing something required, because a local build and run in a full pack works fine.

Strangely enough RunClient on my machine works fine.

Maybe it's a config init issue?

Caused by: java.lang.IllegalStateException: Not a JSON Object: null at com.google.gson.JsonElement.getAsJsonObject(JsonElement.java:90) ~[JsonElement.class:?] at serverutils.data.BackwardsCompat.(BackwardsCompat.java:38) ~[BackwardsCompat.class:?] at serverutils.ranks.Ranks.reload(Ranks.java:138) ~[Ranks.class:?]

Lyfts commented 1 year ago

Yeah it's missing a check in the config compat. I'll push a fix whenever my internet comes back.

Ethryan commented 1 year ago

Hmm, i think it needs a nullcheck, since the file don't exist on a completely new install. It would probably crash if you deleted the config files in an existing setup too since it then can't find the specified file.

Rika-TH commented 1 year ago

DRAG CLAIMING LETSFUCKINGGOOOOO

Caedis commented 1 year ago

That should fix that issue

Lyfts commented 1 year ago

@Ethryan it was never actually saving your last position and would just send you to 0, 0, 0. That should be all good now.

Ethryan commented 1 year ago

This can probably be merged, but be aware that I haven’t tested everything changed yet.

bombcar commented 1 year ago

I don't see how to remotely unclaim a chunk? I have a claimed miner chunk but I forgot to unclaim after recovering the miner.

I wonder if it would be possible to make chunk claiming a journeymap overlay.

Ethryan commented 1 year ago

There is the button to unclaim all chunks in the dimension.

Lyfts commented 1 year ago

@bombcar I already have Journeymap overlay close to ready. Interacting with chunks would however require some more mixin magic on Visual prospectings side. For now you can do /chunks unclaim_all [dimension name] (or use the button). Their names might not be registered correctly, but you should be able to tab complete to see them.

WIP ![sneak](https://github.com/GTNewHorizons/ServerUtilities/assets/127234178/51ef71a8-c4bd-49b0-8f7f-6db8ea82535b)
raylras commented 12 months ago

It generates a nether portal when I teleporting between dim -1 and dim 0.

The usage of net.minecraft.entity.Entity#travelToDimension method seems incorrect here: https://github.com/GTNewHorizons/ServerUtilities/blob/89d0d3d0c1aaff82daec6b7525be8a96bcdead7b/src/main/java/serverutils/lib/math/TeleporterDimPos.java#L73-L78

mitchej123 commented 12 months ago

@bombcar I already have Journeymap overlay close to ready. Interacting with chunks would however require some more mixin magic on Visual prospectings side. For now you can do /chunks unclaim_all [dimension name] (or use the button). Their names might not be registered correctly, but you should be able to tab complete to see them.

WIP

Are you sending this as a separate PR? Should I go ahead and merge this?