Change how resource type works, allow proper app and library installation (#956)

* Change how app store types work, allow proper app and library installation

* Add node for resources in dependencies and docs

* Fix NPE without `type`

* Fix docs trying to change location of app type resource

* Separate libraries and apps and add trash for them

* Update docs

* Create trash directory if it doesn't exist
This commit is contained in:
altrisi authored and GitHub committed 2021-06-30 12:42:24 -03:00
1 parent d92b412c0a
commit 97e69d347e
5 files changed
+153 -65

No files matched your search

@@ -70,7 +70,7 @@ import static net.minecraft.server.command.CommandManager.literal;
public class CarpetScriptHost extends ScriptHost
{
private final CarpetScriptServer scriptServer;
ServerCommandSource responsibleSource;
public ServerCommandSource responsibleSource;
private Tag globalState;
private int saveTimeout;
@@ -328,6 +328,15 @@ public class CarpetScriptHost extends ScriptHost
AppStoreManager.addResource(this, storeSource, resource);
}
}
Value libraries = config.get(new StringValue("libraries"));
if (libraries != null)
{
if (!(libraries instanceof ListValue)) throw new InternalExpressionException("App libraries not defined as a list");
for (Value library : ((ListValue) libraries).getItems())
{
AppStoreManager.addLibrary(this, storeSource, library);
}
}
}
appConfig = config;
}