From d336a7b91b85d4691ef2bf6190a10da77753bb09 Mon Sep 17 00:00:00 2001 From: gnembon Date: Sun, 20 Oct 2019 01:07:49 -0300 Subject: [PATCH 1/2] docs to 1.5 --- .../java/carpet/script/CarpetExpression.java | 22 ++++++++++--------- src/main/java/carpet/script/Expression.java | 8 +++---- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/main/java/carpet/script/CarpetExpression.java b/src/main/java/carpet/script/CarpetExpression.java index deb9d57e..f3abbba6 100644 --- a/src/main/java/carpet/script/CarpetExpression.java +++ b/src/main/java/carpet/script/CarpetExpression.java @@ -2958,7 +2958,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) @@ -3165,7 +3165,7 @@ public class CarpetExpression } /** - *

/script load / unload <module> (shared?), /script in <module> commands

+ *

/script load / unload <app> (global?), /script in <app> commands

*
*

load / unload 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 @@ -3181,13 +3181,15 @@ public class CarpetExpression * // baz = foo() * *

- *

/script load/unload <module> (?shared)

+ *

/script load/unload <app> (?global)

*

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 /script load again. * Reloading removes all the current global state (globals and functions) that were added later by the module.

*

Loading a module, if it contains a __command() 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).

+ *

Loaded apps have the ability to store and load external files, especially their persistent tag state. + * For that check load_app_data and store_app_data functions.

*

If an app defines __config method, and that method returns a map, it will be used to apply custom * settings for this app. Currently the following options are supported:

* - *

Unloading a module removes all of its state from the game, disables commands, and removes bounded events

- *

Scripts can be loaded in shared and player mode. Default is player, so all globals and stored functions are + *

Unloading an app removes all of its state from the game, disables commands, and removes bounded events

+ *

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 /execute as (player) run script in (module) run ... + * 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 /execute as (player) run script in (app) run ... * To access global/server state, you need to disown the command from any player, so use a commandblock, or any arbitrary * entity: /execute as @e[type=bat,limit=1] run script in (module) globals for instance. *

- *

/script in <module> ...

- *

Allows to run normal /script commands in a specific module, like run, invoke,..., globals etc...

+ *

/script in <app> ...

+ *

Allows to run normal /script commands in a specific app, like run, invoke,..., globals etc...

*
*/ public void loadScriptsFromFilesCommand() diff --git a/src/main/java/carpet/script/Expression.java b/src/main/java/carpet/script/Expression.java index 0cab3df3..89994ce3 100644 --- a/src/main/java/carpet/script/Expression.java +++ b/src/main/java/carpet/script/Expression.java @@ -51,7 +51,7 @@ import static java.lang.Math.min; /** - *

Fundamental components of scarpet programming language (towards upcoming version 1.5).

+ *

Fundamental components of scarpet programming language (version 1.5).

* *

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; * *

Code delivery, line indicators

*

Note that this should only apply to pasting your code to execute with commandblock. Scarpet recommends placing your - * code in packages (files with .sc extension that can be placed inside "/scripts" folder in the world files - * and loaded as a module with command /script load [package_name]. Scarpet modules loaded from disk should only + * code in apps (files with .sc extension that can be placed inside "/scripts" folder in the world files + * and loaded as a scarpet app with command /script load [app_name]. Scarpet apps loaded from disk should only * contain code, no need to start with "/script run" prefix

- *

The following is the code that could be provided in a foo.sc file located in world /scripts folder

+ *

The following is the code that could be provided in a foo.sc app file located in world /scripts folder

* *
  * run_program() -> (

From fd59b826c30169245d536f94889b29ccdf48be53 Mon Sep 17 00:00:00 2001
From: gnembon 
Date: Sun, 20 Oct 2019 01:52:48 -0300
Subject: [PATCH 2/2] 1.2

---
 gradle.properties                              |   2 +-
 .../java/carpet/settings/CarpetSettings.java   |   2 +-
 src/main/resources/assets/carpet/icon.png      | Bin 453 -> 6328 bytes
 src/main/resources/fabric.mod.json             |   2 +-
 4 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gradle.properties b/gradle.properties
index 0e6d0046..ec5c973c 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -9,7 +9,7 @@ org.gradle.jvmargs=-Xmx1G
 	loader_version=0.4.8+build.158
 
 # Mod Properties
-	mod_version = 1.1.3+v191016
+	mod_version = 1.2.0+v191020
 	maven_group = carpet
 	archives_base_name = fabric-carpet
 
diff --git a/src/main/java/carpet/settings/CarpetSettings.java b/src/main/java/carpet/settings/CarpetSettings.java
index ad1c5222..abb48eb8 100644
--- a/src/main/java/carpet/settings/CarpetSettings.java
+++ b/src/main/java/carpet/settings/CarpetSettings.java
@@ -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;
diff --git a/src/main/resources/assets/carpet/icon.png b/src/main/resources/assets/carpet/icon.png
index 047b91f2347de5cf95f23284476fddbe21ba23fe..9178b9612e5f6ca97a2f001c4d957cd8d6895332 100644
GIT binary patch
literal 6328
zcmZ9QWmMHcx5oc;r=)Ob0qO3L?ruSvLwDEVAd({8NU3x;NFBNxBo5Muv~RIBToQe`1_wi
z_-KVf2>_TH_A)Y>ns%;UuAX+TZZt|VGBj=;u3&p78vyWI&e5^e)!8Evzh1qNR*8b9
zsJLnqqtj?he})nzGP2NO;44Sb7Az5KbrZNWcQoBI_MTkAEgPPbeSW
z`uP|DpWxl;=aJ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--- a/src/main/resources/fabric.mod.json
+++ b/src/main/resources/fabric.mod.json
@@ -1,7 +1,7 @@
 {
   "schemaVersion": 1,
   "id": "carpet",
-  "version": "1.1.3",
+  "version": "1.2.0",
 
   "name": "Carpet Mod in Fabric",
   "description": "Carpet made out of fabric",