Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting script files if .sorting flag file is in script directory. #274

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

DerOliDE
Copy link

No description provided.

@DerOliDE DerOliDE changed the title Sorting script files if .sorting flag file is in script directory. Fixes https://github.com/stanhebben/MineTweaker3/issues/270 Sorting script files if .sorting flag file is in script directory. Oct 29, 2015
@DerOliDE
Copy link
Author

Fixes #270

@stanhebben
Copy link
Owner

The change looks acceptable, although, naming an empty file in windows to .sorting can be a bit of an annoyance to the average user (windows by default doesn't accept a filename starting with a .). Although the more experienced user known how do this from command line, this may be just a little too much for the target audience.

How stable is the default order returned by listFiles()? If nobody is relying on sorting order yet, we could simply have it always sorted.

@DerOliDE
Copy link
Author

DerOliDE commented Dec 1, 2015

The only reason for the .sorting-Flag is backward compatibility because
i don't know if someone is relying on the old "unordered" sorting.

Sorting by default is IMHO the better choice for example without sorting
we've got different order in Windows and Linux and with sorting we can
decide which script should be loaded first like OreDict changes or some
other common stuff.

Ask Krakel (#270) about
the stability of default order returned by listFiles. He has much more
java experience, i've only implemented his suggestion.

Am 30.11.2015 um 10:31 schrieb Stan Hebben:

The change looks acceptable, although, naming an empty file in windows
to .sorting can be a bit of an annoyance to the average user (windows
by default doesn't accept a filename starting with a .). Although the
more experienced user known how do this from command line, this may be
just a little too much for the target audience.

How stable is the default order returned by listFiles()? If nobody is
relying on sorting order yet, we could simply have it always sorted.


Reply to this email directly or view it on GitHub
#274 (comment).

@jaredlll08
Copy link
Collaborator

Well I don't think anyone would be relying on the old unsorting method, since you can't rely on something like that.

@DerOliDE
Copy link
Author

DerOliDE commented Dec 3, 2015

I've no problem with sorting by default but i don't know if other guys have some unsorted script order which get fucked up by sorting it. ;-)

@Blue64
Copy link

Blue64 commented Dec 8, 2015

I see it sorted by Alphabetical, I name the important stuff I want done first a - filename.zs then my OreDict is b - filename.zs, recipes, furnace, mod machines, etc. Perhaps it can be named true.sorting or false.sorting and if it's true, then you can set the load order of the scripts by their name (with extension, to prevent malicious code, and verify it's a .zs file). Just make sure it's reading the files from the Script directory. This would also be a good way to implement the allowance of reading Scripts from Sub-Folders, because in windows for example, it'd be located in %appdata%\.minecraft\scripts\ and then if the file reads line by line, it can say for example

AE2\Add On\OreDict.zs
AE2\Add On\Recipe.zs
AE2\Mod\OreDict.zs
AE2\Mod\Recipe.zs

Etc. And it'd just append the line to the end of %appdata%\.minecraft\scripts\, and voila!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants