Merge branch 'master' into 1.15
This commit is contained in:
commit
631545767b
6 files changed
+19
-17
No files matched your search
@@ -2969,7 +2969,7 @@ public class CarpetExpression
|
||||
this.expr.addLazyFunction("store_app_data", -1, (c, t, lv) ->
|
||||
{
|
||||
if (lv.size() == 0)
|
||||
throw new InternalExpressionException("'store_app_data' needs nbt tag and optional file");
|
||||
throw new InternalExpressionException("'store_app_data' needs NBT tag and an optional file");
|
||||
Value val = lv.get(0).evalValue(c);
|
||||
String file = null;
|
||||
if (lv.size()>1)
|
||||
@@ -3176,7 +3176,7 @@ public class CarpetExpression
|
||||
}
|
||||
|
||||
/**
|
||||
* <h1><code>/script load / unload <module> (shared?)</code>, <code>/script in <module></code> commands</h1>
|
||||
* <h1><code>/script load / unload <app> (global?)</code>, <code>/script in <app></code> commands</h1>
|
||||
* <div style="padding-left: 20px; border-radius: 5px 45px; border:1px solid grey;">
|
||||
* <p><code>load / unload</code> commands allow for very conventient way of writing your code, providing it to the game
|
||||
* and distribute with your worlds without the need of use of commandblocks. Just place your scarpet code in the /scripts
|
||||
@@ -3192,13 +3192,15 @@ public class CarpetExpression
|
||||
* // baz = foo()
|
||||
* </pre>
|
||||
* <h2></h2>
|
||||
* <h3><code>/script load/unload <module> (?shared) </code></h3>
|
||||
* <h3><code>/script load/unload <app> (?global) </code></h3>
|
||||
* <p>Loading operation will load that script code from disk and execute it right away. You would probably use it to
|
||||
* load some stored procedures to be used for later. To reload the module, just type <code>/script load</code> again.
|
||||
* Reloading removes all the current global state (globals and functions) that were added later by the module. </p>
|
||||
* <p>Loading a module, if it contains a <code>__command()</code> method, will attempt to registed a command with that
|
||||
* module name, and register all public (no underscore) functions available in the module as subcommands. It will also
|
||||
* app name, and register all public (no underscore) functions available in the module as subcommands. It will also
|
||||
* bind specific events to the event system (check Events section for details).</p>
|
||||
* <p>Loaded apps have the ability to store and load external files, especially their persistent tag state.
|
||||
* For that check <code>load_app_data</code> and <code>store_app_data</code> functions.</p>
|
||||
* <p>If an app defines <code>__config</code> method, and that method returns a map, it will be used to apply custom
|
||||
* settings for this app. Currently the following options are supported:</p>
|
||||
* <ul>
|
||||
@@ -3212,16 +3214,16 @@ public class CarpetExpression
|
||||
* should be running at startup. WARNING: all apps will run once at startup anyways, so be aware that their actions
|
||||
* that are called statically, will be performed once anyways.</li>
|
||||
* </ul>
|
||||
* <p>Unloading a module removes all of its state from the game, disables commands, and removes bounded events</p>
|
||||
* <p>Scripts can be loaded in shared and player mode. Default is player, so all globals and stored functions are
|
||||
* <p>Unloading an app removes all of its state from the game, disables commands, and removes bounded events</p>
|
||||
* <p>Scripts can be loaded in shared(global) and player mode. Default is player, so all globals and stored functions are
|
||||
* individual for each player, meaning scripts don't need to worry about making sure they store some intermittent data
|
||||
* for each player independently. In shared mode - all global values and stored functions are shared among all players.
|
||||
* To access specific player data with commandblocks, use <code>/execute as (player) run script in (module) run ... </code>
|
||||
* for each player independently. In global mode - all global values and stored functions are shared among all players.
|
||||
* To access specific player data with commandblocks, use <code>/execute as (player) run script in (app) run ... </code>
|
||||
* To access global/server state, you need to disown the command from any player, so use a commandblock, or any arbitrary
|
||||
* entity: <code>/execute as @e[type=bat,limit=1] run script in (module) globals</code> for instance.
|
||||
* </p>
|
||||
* <h3><code>/script in <module> ... </code></h3>
|
||||
* <p>Allows to run normal /script commands in a specific module, like <code>run, invoke,..., globals</code> etc...</p>
|
||||
* <h3><code>/script in <app> ... </code></h3>
|
||||
* <p>Allows to run normal /script commands in a specific app, like <code>run, invoke,..., globals</code> etc...</p>
|
||||
* </div>
|
||||
*/
|
||||
public void loadScriptsFromFilesCommand()
|
||||
|
||||
@@ -51,7 +51,7 @@ import static java.lang.Math.min;
|
||||
|
||||
|
||||
/**
|
||||
* <h1>Fundamental components of <code>scarpet</code> programming language (towards upcoming version 1.5).</h1>
|
||||
* <h1>Fundamental components of <code>scarpet</code> programming language (version 1.5).</h1>
|
||||
*
|
||||
* <p>Scarpet (a.k.a. Carpet Script, or Script for Carpet) is a programming language designed to provide
|
||||
* the ability to write custom programs to run within Minecraft and
|
||||
@@ -205,10 +205,10 @@ import static java.lang.Math.min;
|
||||
*
|
||||
* <h2>Code delivery, line indicators</h2>
|
||||
* <p>Note that this should only apply to pasting your code to execute with commandblock. Scarpet recommends placing your
|
||||
* code in packages (files with <code>.sc</code> extension that can be placed inside "/scripts" folder in the world files
|
||||
* and loaded as a module with command <code>/script load [package_name]</code>. Scarpet modules loaded from disk should only
|
||||
* code in apps (files with <code>.sc</code> extension that can be placed inside "/scripts" folder in the world files
|
||||
* and loaded as a scarpet app with command <code>/script load [app_name]</code>. Scarpet apps loaded from disk should only
|
||||
* contain code, no need to start with "/script run" prefix</p>
|
||||
* <p>The following is the code that could be provided in a <code>foo.sc</code> file located in world <code>/scripts</code> folder</p>
|
||||
* <p>The following is the code that could be provided in a <code>foo.sc</code> app file located in world <code>/scripts</code> folder</p>
|
||||
*
|
||||
* <pre>
|
||||
* run_program() -> (
|
||||
|
||||
@@ -27,7 +27,7 @@ import static carpet.settings.RuleCategory.SURVIVAL;
|
||||
|
||||
public class CarpetSettings
|
||||
{
|
||||
public static final String carpetVersion = "1.1.3+v191016";
|
||||
public static final String carpetVersion = "1.2.0+v191020";
|
||||
public static final Logger LOG = LogManager.getLogger();
|
||||
public static boolean skipGenerationChecks = false;
|
||||
public static boolean impendingFillSkipUpdates = false;
|
||||
|
||||
Reference in new issue
Block a user