WorldEdit

WorldEdit

43M Downloads

//sel extend forgets it was set after arbitrary time

e-motiv opened this issue · 21 comments

commented

WorldEdit Version

7.2.12

Platform Version

Forge-1.19.2-43.1.25

Confirmations

  • I am using the most recent Minecraft release.
  • I am using a version of WorldEdit compatible with my Minecraft version.
  • I am using the latest or recommended version of my platform software.
  • I am NOT using a hybrid server, e.g. a server that combines Bukkit and Forge. Examples include Arclight, Mohist, and Cardboard.
  • I am NOT using a fork of WorldEdit, such as FastAsyncWorldEdit (FAWE) or AsyncWorldEdit (AWE)

Bug Description

  1. I type
    /tool farwand
    //sel extend
  2. Perfect! Selections extend after right clicking
  3. After a while, without dc'ing, right clicking doesn't extend anymore, but becomes a normal cuboid selection.

I tried to link this with other commands, but seems arbitrary for now.
This happens like 100 times per hour. Really frustrating, though I do appreciate your work, developers. Just saying.

commented

If you’ve disconnected from the server for >5 minutes this will happen. That’s so that worldedit isn’t storing data for potentially limitless players in memory over time

commented

or if this is single player, immediately after leaving the world. either way this likely isn't happening randomly. you can always set your default selector if you want it to persist after the session being dropped. all documented behavior.

commented

Thanks for the comments both of you, but...

@me4502: If you’ve disconnected from the server for >5 minutes this will happen. That’s so that worldedit isn’t storing data for potentially limitless players in memory over time

It happens without disconnecting or being AFK. Sometimes even after only 2 minutes actively editing the world.

@wizjany: or if this is single player, immediately after leaving the world.

It happens on single player indeed but also on multiplayer (though as an admin and only player online), but WITHOUT leaving the world or disconnecting or being afk. (forge client side mod)

@wizjany: either way this likely isn't happening randomly.

Being a developer myself, I understand this is probably not random, but so far it feels like it and I couldn't figure out when exactly this happens. One does a lot of things when editing the world, but I haven't notice any reproducibility yet.

@wizjany: you can always set your default selector if you want it to persist after the session being dropped. all documented behavior.

I will try this as a workaround for now. Which reminds me; I always use a farwand. Maybe that helps to pinpoint it, if this is a matter that concerns you.. I will edit it in my original report here above. Like so:

/tool farwand
//sel extend
commented

Forgive me, but I don't find how to set your default selector. I've searched to the docs for a half hour, but only find this:

  • Sessions>Persistent Data: "Your default selector" but how to set your default selector? Probably default selector item is meant here, is it not?
  • Configuration: A lot of defaults, including default selector item (axe), but nowhere says default selector mode (being extend for me, bc that is the only problem i experience).

To be clear, my selector item is not a problem...

commented

It happens without disconnecting or being AFK. Sometimes even after only 2 minutes actively editing the world.

This just... can't happen, unless your system timer is incredibly inaccurate. https://github.com/EngineHub/WorldEdit/blob/version/7.2.x/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java#L341-L347 is quite simple; it will only remove after 10 minutes has passed. Having your session removed earlier seems incredibly unlikely. Nothing ever calls SessionManager#remove, and SessionManager#clear is only called when WorldEdit shuts down. You should provide the content of your logs/latest.log after you experience the issue, though I really don't see how this could be possible.

Shall we delete our last comments to clean the clutter here?

I don't think that's necessary.

commented
commented

https://worldedit.enginehub.org/en/latest/commands/?highlight=default%20selector#selection-commands -- //sel takes -d. Not very well called out though.

O thank you very much.
Weird that that isn't found by a search of the word "default" in the doc's search engine.
https://worldedit.enginehub.org/en/latest/search/?q=default&check_keywords=yes&area=default

commented

It is, at the bottom.

commented

O sh*, you're right, how did I miss this.... Forgive me.... Shame on me...

commented

Maybe repeat it on the selection page itself? It's not mentioned there.
https://worldedit.enginehub.org/en/latest/usage/regions/selections/#selection-modes

commented

Shall we delete our last comments to clean the clutter here?

commented

I must have magical powers to induce impossible things. ;-) ;-) ;-)

(Maybe I am wrong about 2 minutes, but very soon. Time is kinda relative when playing mc. I should have written "a small amoutn of time" or so...)

I'll provide that log next time it happens..

commented

Are you on an ARM CPU? I suspect there may be a data-race issue that previously went unnoticed on x86 CPUs.

commented

Not sure what ARM is, but I have: Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz 2.40 GHz
(Not mining a lot lately..so no logs yet...)

commented

Never checked if the default ever broke, but now, even that doesn't work anymore. Nor on single player mod nor on bukkit plugin.
So, to be clear: farwand selection extend forgets sel extend, even when -d is set. Now on version 7.2.14

commented

@e-motiv are you using //paste -s or //paste -n?

//chunk has this code to account for the extending selector:
https://github.com/EngineHub/WorldEdit/blob/master/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java#L321-L326

//paste -s/n does not:
https://github.com/EngineHub/WorldEdit/blob/master/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java#L194

I created a PR to fix this:
#2289

I also reopened the issue since there is an actual identifiable problem here.

commented

@e-motiv are you using //paste -s or //paste -n?

All the time! Thanks for the effort.
(I even wish the -s would be default and -s would be to not select. Hihi)

commented

Based on the above discussion this might be fixed in the latest dev build. If you could please verify we can close this issue.

commented

Where are those dev builds? Can't find them, only find 7.2.14

commented

OK. Checked & seems fixed. Thank you.
(Only tested bukkit version, but it's probably common code.)