Skip to content

Conversation

@Absolutionism
Copy link
Contributor

Problem

The current property system does not yet have support for common effect syntaxes and no common property handler used for effects.

Solution

Adds PropertyBaseEffect, class for using common effects with only 1 input in the syntax.
Adds EffectHandler, common handler used in PropertyBaseEffect
Adds effects and properties for: load, unload, reload, enable, and disable.
ScriptClassInfo includes all of these properties
Moves classinfo for World into it's own class, WorldClassInfo, with an unload property.

Refactors EffScriptFile to enable/load/reload a script with errors to be printed, removes some patterns that are now in ExprScript, and moved into org.
Refactors EffWorldLoad with the only unload option to be without saving

Testing Completed

quickTest

Supporting Information

N/A

Note
PR currently fails due to pattern conflicts because of property syntaxes and their original classes.


Completes: none
Related: none

@Absolutionism
Copy link
Contributor Author

This will remain in draft until properties are officially fully released and ready to go.

"unload all worlds"
})
@Description("""
Load or unload a world.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mention the unload world property here since we don't have 'see also'

Comment on lines +45 to +47
"[the] [current] script [file]",
"[the] script[s] [file[s]] [named] %strings%",
"[the] skript file[s] %strings%",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skript file is a lot more than a script

Suggested change
"[the] [current] script [file]",
"[the] script[s] [file[s]] [named] %strings%",
"[the] skript file[s] %strings%",
"[the] [current] script [file]",
"[the] script[s] [file[s]] [named] %strings%",

Comment on lines +149 to +168
public void execute(Script script, OpenCloseable closeable) {
File file = script.getConfig().getFile();
if (file == null || !file.exists())
return;
if (ScriptLoader.getLoadedScripts().contains(ScriptLoader.getScript(file)))
return;
if (ScriptLoader.getDisabledScriptsFilter().accept(file)) {
try {
file = FileUtils.move(
file,
new File(file.getParentFile(), file.getName().substring(ScriptLoader.DISABLED_SCRIPT_PREFIX_LENGTH)),
false
);
} catch (IOException e) {
Skript.exception("Error while enabling script file: " + script.name());
return;
}
}
ScriptLoader.loadScripts(file, closeable);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems like somethign that should be on Script rather than here

Comment on lines +179 to +187
public void execute(Script script, OpenCloseable closeable) {
File file = script.getConfig().getFile();
if (file == null || !file.exists())
return;
if (ScriptLoader.getDisabledScriptsFilter().accept(file))
return;
unloadScripts(file);
ScriptLoader.loadScripts(file, closeable);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

likewise for rest of these

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.

2 participants