#Reroll Player PRs

1 messages · Page 1 of 1 (latest)

torn briar
#

hiya! im looking for someone to make some PRs to the reroll player mod for 1.12.2.

Links:
Reroll Player: https://www.curseforge.com/minecraft/mc-mods/reroll-player
GitHub: https://github.com/SmashingMods/Reroll/tree/1.12.2
TREPIDATION: https://www.curseforge.com/minecraft/modpacks/trepidation

it's a mod made by the people at Akliz specifically for my modpack TREPIDATION. im still in frequent contact with the devs but unfortunately they dont have time to work on the mod anymore. ive even made some PRs myself and tried to work on these issues myself (many many hours derp) but its simply beyond my skill level atm.

im looking to have these issues fixed:

  • ~~https://github.com/SmashingMods/Reroll/issues/31~~
  • the other bugs on the GH, but they're not really needed
  • ive had a problem building the mod due to a weird dependency issue with baubles, but other devs can build just fine
  • maybe upgrade to forge gradle 5 and use fancy gradle, no idea where to start with this so id love to learn

For the first issue, i determined the issue lies with the WorldMixin class (https://github.com/SmashingMods/Reroll/blob/1.12.2/src/main/java/com/smashingmods/reroll/mixin/WorldMixin.java) where onEntityAdded is run every time the entity is added to the world (ie changing dim), when in reality it needs to be run just on first spawn in. can either use a different method or add some checks or something else that i dont know about.

i can pay for this commission, though im not sure how much it'd be due to just being laid off, but i can happily help out during the dev process as well. either way id love to be involved and learn.

thank you!

heady turret
#

So it should only set the player to the start block once per world? Lini_hmm_old

torn briar
#

That as well as whenever the reroll command/item is used

heady turret
#

Shouldn't be too hard, I can take a look tomorrow! 🤝

torn briar
#

thank you so much

heady turret
#

Alright, got the repo up and running and the compile issue settled. Fix tomorrow! kuruHi

torn briar
#

wdym settled?

heady turret
#

Fixed the Baubles build issue by providing the obfuscated method name. 😉

torn briar
#

i shouldve thought of that first thing before all the other stuff i did lol

heady turret
#

Thing is, this shouldn't be necessary normally as ForgeGradle is advised to deobfuscate the dependency. Oh well, the joys of Gradle frameworks. jinjaShrug2

heady turret
#

Enjoy! cool

#

Can also imagine fixing the other bugs over the next days.

torn briar
#

well, either way, thank you so much MenheraHappy1

heady turret
torn briar
#

oh lol i didnt see that

#

i did build it myself to ensure its working properly

#

which it does

heady turret
#

Even better! coolfingerguns

torn briar
heady turret
#

Definitely! And these are still issues with the latest changes?

torn briar
#

i havent given them thorough testing in the latest version

#

i can though

#

the 3rd is a new feature tho

heady turret
#

#27/#28 might be fixed by the latest changes, we'll see! 🙂

torn briar
#

trepidation has been blessed on this day

#

(and yesterday)

heady turret
#

For good reason! SeemsGood

heady turret
torn briar
#

sure thing

heady turret
#

Interesting, it definitely teleported me to different locations! Lini_hmm_old

torn briar
#

hmm, maybe its because it cant find a suitable block actually

#

it worked on the 3rd try for me

#

ill try increasing the search radius

#

is it possible that you can include something like "Failed to find suitable location for reroll. Cancelling... Please try again"

heady turret
#

Should be feasible!

#

commands.reroll.max_tries=Reroll failed to find a valid block position. Try again later.
This exists already though. MonkaHmm

torn briar
#

ohhhhh yeah i have seen that before

#

huh, wonder why it sometimes rerolls to the same position then

heady turret
#

Because it's a valid position, I guess?

torn briar
#
    I:"Reroll Minimum Distance"=1024```
#

its not respecting the minimum distance

#

im still doing some testing with other cfg options

#

so it still rerolled despite not finding a valid position

#

thats with max tries = 10 too lol

heady turret
#

Oh, that's funky. think_eyes

torn briar
#

it worked on the 2nd try mexShrug

heady turret
#

That's a weird one for sure!

torn briar
#

it seems to be working the majority of the time

heady turret
#

I could implement a cache for the old position but it's weird that it doesn't seem to respect the minimum distance.

torn briar
#

i dont think thats an issue actually. i think its just failing to find a suitable block

heady turret
#

Might be right, yeah.

torn briar
# torn briar

it was only that one time it didnt work. tried it on like 8 other worlds and it worked fine

#

honestly, just need a way to cancel the reroll if it doesnt find a valid position instead of rerolling to the same place

heady turret
heady turret
#

Do you think a cache per game session would suffice or should it be saved per world?

torn briar
#

Why do you need to check for block position?

#

Can't you just see when reroll.max_tries triggers and cancel the reroll there?

heady turret
#

The thing is, it works this way already. kuruKillMe

torn briar
#

ohh okay

#

i have noticed that it wont reroll to the same exact position though

#

like sometimes it might be a couple blocks over

#

so keep that in mind i suppose

#

and it should be saved per world

heady turret
#

I guess one can design it that it should avoid the vicinity of the initial spawn area? Like a 20 block radius or something.

#

Maybe the 'spiral' thing is involved here.

#

Working with foreign code is something. 🙃

torn briar
torn briar
#

might be worth noting that ive tested it probably 50 times now with not a single issue

heady turret
#

Yes, it very much seems that's exactly what this spiral thing is for. It saves the location to the world's NBT tags and does it's new position calculations from there.
In my opinion, this is a special corner case.

torn briar
#

aaaand just as we say that it happened again calama8Laugh same exact position, no error either

heady turret
torn briar
#

it seems to only happen the first time i reroll

#

maybe the first time after launching the game??

#

yeah i think thats whats happening

heady turret
#

That would be wild! Because loading the last saved data is the first thing it does.

torn briar
#

it only ever rerolls to the same position for the first time i run the command after opening the game

#

tried creating many worlds after it and it works fine, but the second i restart the game it happens again

heady turret
#

Odd! But at least, we're onto something. ChillBar_noted

torn briar
heady turret
#

Tried it myself, couldn't reproduce. In the overworld, that is. Maybe it's nether specific?
What I suspect is the pattern how new locations are calculated. Oddly close to either 0 or 512 for both X and Z.

torn briar
#

you have block spawn set right?

#

i can commit my changes to GH and you can see my cfg

heady turret
#

Using default values, yeah.

torn briar
heady turret
#

Testing with this now!

#

Alright, same thing but the calculation of new positions is oddly specific to the min distance value.

#

Like this, a bit of randomness could be useful.

torn briar
#

I have noticed that as well, but it's not a big deal

#

I think it doesnt want to spend anymore time searching for blocks than it has to

#

to increase performance i imagine, which i prefer

#

1k blocks is so incredibly far anyway

heady turret
#

But I think this is the cause of this behavior as I couldn't get it to teleport me to the last saved spot on a game reload like you could. Instead, there was this noticeable pattern when rerolling.

#

Which gets more noticeable with less valid reroll locations, I guess.

torn briar
#

I block i have set is a pretty uncommon block

heady turret
#

Which would make perfect sense in this case. As the algorithm seems to be rather fast but not random.

heady turret
#

Do you think we should leave it as that? Don't really want to undermine the current algorithm which seemingly involved a lot of effort to construct. jinjaShrug2

torn briar
#

hmmm, i think the first reroll of game launch does need to be fixed somehow

#

that's so bizarre that's its only the first reroll that doesnt respect minimum distance

heady turret
#

From my testing, it is rather per world than per game session. Lini_hmm_old

heady turret
torn briar
#

will test rn

#

first test, seems to work!

#

will test a couple more times just in case

#

does this include the elenai dodge reset too?

heady turret
#

I tested with about 8 different worlds with gravel as a rather specific spawn block. PauseChamp

heady turret
torn briar
#

testing on a server now

#

Got this error on a server

[16:27:35] [Server thread/WARN] [net.minecraft.command.CommandHandler]: Couldn't process command: reroll
java.lang.NoClassDefFoundError: net/minecraft/client/entity/EntityPlayerSP
    at com.elenai.elenaidodge2.util.Utils.showDodgeBar(Utils.java:207) ~[Utils.class:?]
    at com.elenai.elenaidodge2.api.FeathersHelper.increaseFeathers(FeathersHelper.java:62) ~[FeathersHelper.class:?]
    at com.smashingmods.reroll.handler.RerollHandler.resetModData(RerollHandler.java:159) ~[RerollHandler.class:1.12.2-1.5.6]
    at com.smashingmods.reroll.handler.RerollHandler.reroll(RerollHandler.java:57) ~[RerollHandler.class:1.12.2-1.5.6]
    at com.smashingmods.reroll.handler.RerollHandler.reroll(RerollHandler.java:46) ~[RerollHandler.class:1.12.2-1.5.6]
    at com.smashingmods.reroll.command.CommandReroll.rerollSelf(CommandReroll.java:149) ~[CommandReroll.class:1.12.2-1.5.6]
    at com.smashingmods.reroll.command.CommandReroll.execute(CommandReroll.java:56) ~[CommandReroll.class:1.12.2-1.5.6]
    at net.minecraft.command.CommandHandler.tryExecute(CommandHandler.java:119) [bj.class:?]
    at net.minecraft.command.CommandHandler.executeCommand(CommandHandler.java:91) [bj.class:?]
    at net.minecraft.network.NetHandlerPlayServer.handleSlashCommand(NetHandlerPlayServer.java:962) [pa.class:?]
    at net.minecraft.network.NetHandlerPlayServer.processChatMessage(NetHandlerPlayServer.java:941) [pa.class:?]
    at net.minecraft.network.play.client.CPacketChatMessage.processPacket(SourceFile:37) [la.class:?]
    at net.minecraft.network.play.client.CPacketChatMessage.processPacket(SourceFile:9) [la.class:?]
    at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13) [hv$1.class:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_361]
    at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_361]
    at net.minecraft.util.Util.runTask(SourceFile:529) [h.class:?]
    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:723) [MinecraftServer.class:?]
    at net.minecraft.server.dedicated.DedicatedServer.updateTimeLightAndEntities(DedicatedServer.java:397) [nz.class:?]
    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:668) [MinecraftServer.class:?]
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526) [MinecraftServer.class:?]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_361]
Caused by: java.lang.ClassNotFoundException: net.minecraft.client.entity.EntityPlayerSP
    at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:101) ~[launchwrapper-1.12.jar:?]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_361]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_361]
    ... 22 more```
#

The issue of TPing the player to the same location on first start occurs on servers as well, but not SP anymore

heady turret
#

The Elenai Dodge API is client-sided? kuruWTF

heady turret
torn briar
#

well at least its progress calama8Laugh

heady turret
#

We take everything we can, that's true! SeemsGood

torn briar
#

maybe fixing the elenai dodge issue will fix that as well

heady turret
#

Uncertain. MonkaHmm
But we'll see tomorrow. 🤝

torn briar
heady turret
#

Finally, I found a way around the problem to some extent. If the algorithm decides to pick the same or very similar location to the last one (it can even happen later on if the conditions are specific enough), it will search for a new location nearby. Since the boundaries for this new position need to be inside the Reroll Horizontal Radius because of reasons, the teleportation distance in these cases is still not ideal but definitely better.

Elenai Dodge integration is fixed as well.

https://github.com/ACGaming/Reroll/releases/tag/1.5.6

GitHub

Full Changelog: 1.5.5...1.5.6

torn briar
#

Will test this in a little bit

#

I really super appreciate you helping me out with this

#

This is going to be a massive improvement for trepidation

heady turret
#

I hope so! jinjaPray

torn briar
#

before reroll

#

after reroll

#

:(

#

singleplayer works just fine still

heady turret
#

Yes, it's the best I could do. Without that check, it would teleport directly back to the original spot or one block beside it. jinjaShrug2

#

It has to be within the reroll horizontal radius for whatever reason.

torn briar
#

thats strange

heady turret
#

If it's the same or higher, max tries are exceeded every time.

#

You could set the radius higher in the config to alleviate this somewhat.

#

Spent quite a few hours on debugging this but sadly couldn't quite wrap my head around it. Chances are the culprit lies somewhere deep within the first run of the iteration algorithm. 😪

torn briar
#

what if the first reroll is triggered twice 👀

heady turret
#

It is actually the second time now which didn't change much. kuruNah

#

It resets the location like a regular reroll at first spawn which I hoped it would solve the issue but of course not. kuruSmug

torn briar
#

i mean technically i can just use the command twice in the script

#

so clicking "reset run" does this
sendmessage: /reroll
sendmessage: /reroll

#

but then this happens lol

#

@heady turret how time consuming would it be to include a new command /reroll nomessage that functions the same as the reroll command but without a message to chat

#

oh one other thing, can you reset max health on reroll as well lol

heady turret
heady turret
torn briar
heady turret
torn briar
#

entityPlayer.getMaxHealth() is greater because i have a mod that increases their max health

#

that should be set to 20

#

or get the original max health of the player

heady turret
#

Then the health changing mod is not applying it the right way. Which one is used?

torn briar
#

scaling health

heady turret
#

Would be rather odd if that mod would require special attention. Max health could easily be changed since it's a modifiable attribute.

heady turret
torn briar
#

so, huh

#

it spawns me at 1k, x, x at first spawn in

#

then first reroll takes me to the default position which is near 0, 0, 0

torn briar
#

i dont think thats gonna work MenheraNervousEhehe

heady turret
#

By now, I don't think anything is going to work properly with the current implementation. Rerolling manually does these circle teleportations as well. jinjaShrug2

torn briar
#

it does? ive noticed it never goes back to the same place

#

it adds the minimum distance to each coord

#

so that it never loops back

torn briar
#

after that, that should be it

#

im sorry this turned out to be quite the complicated issue MenheraCry6

heady turret
#

This was literal ass! But that's how modding can be. jinjaShrug2

#

Working on an alternative right now.

torn briar
#

MenheraCry3 i feel so bad

#

this mod has been hell for Arcana to work on as well

heady turret
#

Premise seems so simple but what lurks underneath is uncanny

torn briar
heady turret
torn briar
#

lmao the description calama8Laugh

#

this seems to work just fine!

#

tested both servers and client

heady turret
#

Peace at last? OOOHNOO

#

Feel free to stress test, I hope I can get the health fix going tomorrow and the deal is sealed. Sweat

torn briar
heady turret
torn briar
#

will test in a bit im still in bed lol

heady turret
#

Sure! Time zones are fun. Laugh

torn briar
heady turret
#

It does for me though! kuruNah

#

You're sure it's nothing Trepidation-related? Lini_hmm_old

torn briar
#

derp i have no idea

#

maybe a config option to set what the max health is?

heady turret
#

Oh wow, I misread! roflmao
I thought you wanted it to have it heal the player on reroll because this is an issue with Scaling Health as well. LUL

torn briar
#

oh my gosh calama8Laugh

heady turret
#

Because when you spawn in with your starting health modified, it will first be at 10 hearts and then heals up costing hunger, so I thought you meant that. Derp

#

But I believe that's tied to vanilla bugs which I fixed in Universal Tweaks either way.

torn briar
torn briar
heady turret
torn briar
#

@heady turret everythings working MenheraCheer

#

i think you can go ahead and make the pr

heady turret
#

Was almost too easy, don't you think? roflmao

torn briar
torn briar
#

@heady turret just wanted to say thank you again for your incredible work. i know it was quite painful so i really appreciate it calama8Laugh

reroll is in trepidation now so if you havent given it a try, you totally should!

#

gonna go ahead and close this post ❤️

heady turret
heady turret
torn briar
#

Reroll Player PRs (Done)

#

fuk i didnt think it would post a message MenheraCry6

torn briar
#

@heady turret heya sorry for the ping, but i was wondering if you'd be down for revisiting this. someone found an exploit where it tps you back to the same area

#

@silent sleet i know you said its possible to regenerate dimensions, but do you have any input on how that could be done?

#

Reroll Player PRs

heady turret
#

Noticed that as well when developing the other changes! Dark-Arcana seems to have worked quite a bit on a persistant spiral system. As it was rather complex and I didn't want to void his work, I left it as is.
As much as I'd love to help again, my dev plate is full at the moment. Most energy goes into the upcoming Hexxit II update and other projects! jinjaPray

torn briar
#

no worries :)

#

if anyone else is available to take a look id greatly appreciate it!

torn briar
#

FileUtils.deleteDirectory(dimDir);

does it really just... delete the dimension directory in the world folder?

silent sleet
#

You need to account for some things beforehand but essentially yeah

torn briar
#

surely you cant be in the dimension at the same time. i wonder if you could just send the player to another dimension for a sec, delete it, then bring them back

silent sleet
#

You could probably just make the player stop loading chunks while regeneration is happening

#

and give protections against damage and stuff

#

Or figure out how to make a custom transition screen and just remove the player entirely

torn briar
#

man that'd be cool

silent sleet
#

Just peek into how vanilla does its transition screen when loading dimensions

#

or TF as Id imagine thats pretty similar