Releases: 7UKECREAT0R/MCCompiled
MCCompiled 1.19
Stability update with a side of some much-needed TLC
Additions
• Added random()
built-in function which supports range bounds, compile-time bounds, and runtime bounds.
• Localized texts now have proper contextual names which gives you a hint as to where they're used.
Previously, they were just
mcc.rawtext.<HASH>
with the text's hash.
Now, you get something like:mcc.func_exampleFunction.value3.actionbar_s
• Localization keys are now sorted alphabetically.
• .lang files are truncated at the end so as to only include one empty line at most.
• Preprocessor variables now support being empty!
$var
now supports having no input to create an empty preprocessor variable.
Bugfixes
• Fixed hasitem
selector property not supporting namespaced items.
• Fixed broken preprocessor commands inside async contexts.
• Added preemptive error for async code which will omit invalid output.
• Added explicit errors for use of await
inside unsupported contexts, like loops.
• Some output names that involve indexes are now 1-indexed, and some exclude the 0.
Most prominent case might be:
name
->name1
->name2
-> etc...
• Macros now actually (actually) have documentation support.
• Async debug information now only shows if debugging is enabled.
• Fixed edge case in $strfriendly
with short words at the start of phrases.
the Place of Doom
-->The Place of Doom
• Gave item structure names contextual information, and they're now consistent between compilations.
• Gave scatter
structure names contextual information as well.
• Fixed an issue with partial functions included under folders.
• Fixed a crash when using execute
with a block inside async functions.
• Proud to announce: The official Web Editor now supports non-ASCII characters (accents, section symbol, etc.)
MCCompiled 1.18.1
Hotfix for a ton of important production issues, and some new bindings stuff.
Additions
• Added new binding type custom_bool
which accepts a string: condition
for determining the binding state.
• Added binding is_day
which checks query.time_of_day
inside a threshold (unable to sleep).
• Added binding is_night
which checks query.time_of_day
inside a threshold (able to sleep).
• Added compile option/editor property IGNORE_MANIFESTS
which makes MCCompiled not touch manifest files.
This is just here for edge cases; most users will not need this.
• Added automatic updates to manifest min_engine_version
when MCCompiled requires it.
Bugfixes
• Rewrote Manifest parser to support script modules and many more edge cases.
The new abstraction should also allow faster rollouts of fixes/additions for the parser.
• Value definition duplicates are now ignored if they're identical. This allows you to define
in macros.
• You are now able to create empty macros; pointless limitation.
• Fixed wording of errors relating to selectors that should only target players.
• No longer crashes when trying to fetch JSON files from the default pack.
• $log
no longer errors when linting (but not when compiling).
• Starting the mc
command's input with /
no longer causes it to compile incorrectly.
• Using \n
in format strings with localization enabled no longer fails.
MCCompiled 1.18
Additions
• Added while
command.
• Added repeat
command. Differs from the compile-time version as it is runtime-only.
• Added countEntities(selector)
function which counts the number of matching entities.
• Added support for checking for spectator mode in selectors.
• Added --trace
compiler option for tracing execution path in chat; used only for debugging.
• New bindings for bind
attribute:
• Added query.is_baby
• Added query.is_carrying_block
(endermen)
• Added query.is_sitting
(foxes, wolves/dogs, parrots)
• Added query.is_sneezing
(llamas)
• Added query.is_transforming
(zombies/husks)
• Added query.is_tamed
• Added query.is_elder
(guardians)
• Added summon
command; matches vanilla syntax.
Additions: Errors
Added loads of errors where previously the code was ignored. If some of your code is causing errors after these changes, it's most likely safe to remove the problematic parts because it wasn't valid; probably not even being processed in the first place.
• Added 7 new errors for conditions.
• Added 3 new errors for function definitions.
• Added 2 new errors for give
command.
• Added an error for attempting to apply duplicate attributes to functions.
• Added an error for when tokens at the end of statements go unused (not including comments).
Additions: Async
• Async functions can now be created, allowing you to use the new await
command inside of them.
async(global)
makes the scheduler in a global context, not running on a specific entity.
async(local)
makes the scheduler run on the calling entity only.
Does not support return values; returns an "awaitable"
• Added await
command. Can be used inside async functions.
• await <time>
waits for a specific amount of time.
• await until <condition>
waits until a condition evaluates to true.
• await while <condition>
waits while a condition remains true.
• await <awaitable>
await another async function.
You cannot await a
local
function from aglobal
function.
• Async isn't yet supported in repeat
and while
, but support is coming.
• Async is supported with if
and else
.
• halt
and throw
properly cancel execution of async functions.
Additions: Web Editor
I'm planning on focusing on LSP for 1.19 and integrating into VSCode, but since the web editor is already VSCode based, these fixes are an essential step regardless.
• Updated to Monaco 0.47.0
Sticky lines support.
• Enabled code mini-map only when hovered (right-side).
• Set default font to Jetbrains Mono
• Added button to switch to Minecraft Font (Monocraft)
Changes
• Changed exporter udl2.1
to notepadplusplus
for clarity.
• Overhauled raw
exporter to output JSON and much more information.
• Added raw-min
exporter, which is just the minimized version of raw
.
Bugfixes
• Made throw
show source code rather than compiled code (including location).
• MCCompiled now internally strips inline comments away to prevent unexpected errors.
Full-line comments still remain for uses like documentation; just inline comments are stripped.
• Decimals multiplied using time suffixes are once again interpreted as integers (e.g., 0.5s
)
• playsound
command no longer requires a selector, defaulting to @s
if unspecified.
• Fixed function re-definitions (e.g., partials or overloads) being interpreted as a call if there was parentheses.
• (Web Editor) Autocomplete no longer triggers inside comments or strings.
• (Web Editor) Unclosed strings are now highlighted.
• Made all generated file names use consistent camelCase formatting.
MCCompiled 1.17.1
• Fixed new manifests not being created. Thanks Minato
• Fixed GitHub "wiki" URL not directing to the new wiki. Thanks Minato
MCCompiled 1.17
Additions: Dialogue Support
• dialogue new <name> { ... }
dialogue new "tradingDialogue" {
name: "Trader"
text: "Care to trade? I'm looking for only the finest pelts.\n§oHe squints at you."
onClose: {
print "You leave with purpose. Something about him wasn't quite right."
}
button "Common Pelt" {
clear @s common_pelt 1
print "'This will absolutely do.'\n\n+10 Gold"
gold[@s] += 10
}
button "Rare Pelt" {
clear @s rare_pelt 1
print "'Exemplary quality.'\n\n+50 Gold"
gold[@s] += 50
}
}
• Supports code blocks and compiles right into the dialogue file.
• dialogue open
syntax and dialogue change
like vanilla.
• Includes compile-time selector validation.
• Support for localization natively.
• Support for using \n
in text, if localization is enabled.
The method used to support newlines requires the component{ translate: "...", with: ["\n"] }
Additions
• Added feature audiofiles
which allows the playsound
command to accept audio file inputs.
• Location of audio file in relation to project has effect on where it's copied to the RP!
• Audio file is placed in 'RP/sounds' root if no relative path is found.
• Added proper function overloading.
• Added partial
functions, which when re-defined, are appended to rather than overwritten.
• Added support for @r
• Added errors for defining a function with the same parameters.
• Added more compile-time checking to MANY commands/comparisons (especially regarding selectors).
• Localization now lets the BP/RP use pack.name
and pack.description
• Updated documentation
Changes
• Localization no longer applies to whitespace strings or strings without letters.
• Removed support for @i
selector, as it's not used in MCCompiled's dialogue implementation.
• Changed syntax of fill
to match vanilla, because wow, it was awful before.
• Missing/unexpected parameters have more informative messages.
Bugfixes
• Fixed a bug which prevented more than one function from being resolved in a single statement.
• Fixed a bug which prevented more than one dereference from being resolved in a single statement (sometimes).
• Builder fields on their own lines now have tokens properly processed.
• $include
d files now execute relative to their location, not the caller's location.
• Fixed an issue with dummy entities having incorrect tick_world
component.
• Updated the summon
command (exploders and dummy entities) to work with the Minecraft 1.20.51+.
• Declaring functions located in folders as auto
now works as intended.
• Removed actionbar times
syntax because it's not a thing.
• Code created by generative functions like round()
is now properly omitted if used in unused code.
• Code created by generative functions no longer generates more than once for the same configuration.
• You can now escape definitions.def entries (e.g., \[color: red]
)
MCCompiled 1.16
Testing, compiler functions, and some heavily updated data-driving stuff!
Additions: Compiler/Runtime Functions
• Added glyphE0(x, y = 0)
function for getting a character on the E0 glyph at compile time.
• Added glyphE1(x, y = 0)
function for getting a character on the E1 glyph at compile time.
• Added min(a, b)
- takes lower of two values
• Added max(a, b)
- takes higher of two values
• Added sqrt(n)
- square root (no runtime yet)
• Added sin(n)
- sine (no runtime yet)
• Added cos(n)
- cosine (no runtime yet)
• Added tan(n)
- tangent (no runtime yet)
• Added arctan(n)
- angle which has a tangent of n (no runtime yet)
• Added round(n)
- rounds to nearest int
• Added floor(n)
- rounds down to nearest int
• Added ceiling(n)
- rounds up to nearest int
• Added getValue(str)
- gets a value with the given name; acts the same as a regular value.
Additions: Tests
• Added tests
feature, which enables tests.
This is optional because it creates folders/files which would normally be unwanted.
• Added test
command which will create a test, similarly to how a function is defined.
• Tests cannot be called, nor do they show up in the editor's autocomplete.
• Tests are automatically ALL run sequentially in /function test
.
• Added assert
, which checks the input condition and halts execution if it fails.
• Added throw
, which is same as a guaranteed assertion fail with a custom message.
Additions
• Added $unique
to reduce an array to its unique values. (a != b)
• Added $assert
, which will throw a compile-time error with extra info if its condition evaluates to false.
• Added the ability to clarify variables using *
, to select all registered score-holders.
For example, setting the score of ALL players, including offline ones: score[*] = 0
• Added feature autoinit
which automatically calls init
every time the project is compiled. :)
• Added $append
which appends items to the end of a preprocessor variable.
• Added $prepend
which prepends items to the start of a preprocessor variable.
These new methods are fully optimized, as I've pulled away from the array-based implementation of preprocessor variables and fully implemented them as space-conscious lists instead. There's almost no memory overhead with the new implementation.
• Added dummy removeall
syntax for removing all dummies (or filtered per-tag).
• Documentation now resolves preprocessor variables.
• Specifying a JSON array now works in directives that allow array inputs (e.g., $add
, $sub
).
• Added compile-time function getValue(str)
which returns a value that can be read/written to.
• Added support to index preprocessor variables variableName[index]
.
The dereference is implicit. Reason being that these two snippets have different meanings:
• $variableName[...]
dereference variableName
and then index result.
• variableName[...]
index variableName
and then dereference it.
Changes: $iterate
Rework
Previously, the engine would iterate over any JSON arrays contained within the preprocessor variable. It was inconsistent and unexpected behavior. The new behavior has two types of input, and follows the same rules for both.
• If the identifier of a preprocessor variable is specified, it will now only iterate over its elements.
• Now iterates over JSON object property names if one is specified. Previously would error.
• To iterate over a JSON array/object, dereference an element of a preprocessor variable.
Changes
• You no longer have to specify decimal precision when using type inference with a decimal literal.
• define
now places its definition commands in the initialization file.
• Feature uninstall
now emits its function in the root directory instead of the ./compiler folder.
• Operations $add
$sub
$mul
$div
$mod
and $pow
:
• Operands (command inputs) now loop to fill the number of items in the given PPV.
• This means that doing $mul value 2
will multiply all values by 2, rather than just the first.
• Operations $strfriendly
$strlower
and $strupper
now ignore non-string values.
• $strfriendly
formatting improved.
• Changed init
file to not include project name, reserved "init" function name.
• Greatly improved $if
to produce better comparisons more consistently.
• Displaying decimal values now appends missing 0s to the start of the number.
Previously would show 0.1
instead of 0.001
, for example.
• Performing an int ? decimal
operation no longer rounds the decimal, flooring instead.
• Moved codebase over to use much more precise decimal type for more consistent use.
Bugfixes
• Fixed /setblock
invoking command(s) still using outdated block data format.
• Fixed parameter-less macros sometimes breaking the web editor.
• Fixed case where adding .0
to the end of a number didn't convert it to a decimal.
• Fixed an issue where the initialization file would be emitted even if no commands were needed.
• Fixed an error when using two or more features at once. (yeah, seriously)
• give
command no longer uses a structure when using properties which can be solved using JSON.
• give
command now consistently loads structures at the right place.
• give
command now generates stable structure names.
• Added guard to prevent auto
attribute from being added to functions with parameters.
• Changed dummies
feature to set dummy
preprocessor variable on enable.
MCCompiled 1.15 (hotfix 1)
- Fixed server support with Firefox.
MCCompiled 1.15
Much better control flow and API support, along with loads of important bugfixes. No huge features in this update in preparation for all the new types stuff coming in 1.16
. Types were completely reworked, so please report any bugs ASAP!
Additions
• Optimized output by only including functions that were used in the project
This allows users to use APIs created in MCCompiled in a more efficient way without bloating their project.
• Web IDE: Macros now show up in autocomplete and fully support templating.
• Added bind('query.is_sleeping')
to possible bindings.
• Returning inconsistent types in functions now uses conversion instead of throwing an error.
Reminder: the first instance of
return
always sets the function return type.
• Swapping ><
now converts types if they need to be converted.
• Conversion now only respects the left-hand side of the operation. (thanks SuperFluffyGame!)
• New export
attribute which exports a function regardless if it's used or not.
• New auto
attribute which makes a function run every tick/interval (if specified).
• Feature uninstall
now also removes all temps and return values.
Changes
• (last update) Value names are no longer hashed unless they are longer than 256 characters.
• Function parameters are now global by default, making them work good when used with tick.json.
• Return values are now global by default, making them work good when used with tick.json.
• Removed unnecessary quotation marks in output to make Blockception happy (and me).
• Swapped arguments of setblock
command to match vanilla.
• Much better handling of type-related errors.
• Re-evaluated and re-implemented where and how temps are used. More will be used now, but there is less chance of temps overwriting each other when they shouldn't.
Bugfixes
• Fixed --help
formatting errors.
• Daemon detects file changes and handles inputs faster.
• 256 character limit for values now actually works.
• Function parameters that exceed the character limit no longer have bugged names.
• Function-call setup subfunctions no longer have .
characters in their name.
• Global text commands now properly display values local to the player they are displaying to.
Consider the code
define int score
andglobalactionbar "Your score is {score}"
.
Previously, it would show all players the score of the player that executed the command. Now, it will show each individual player's score. This change only affects theglobalX
commands, not the regular ones in order to retain control with the programmer.
• Language server now provides information about macros. This field was accidentally left empty.
• Language server no longer crashes with big projects.
(And has better overall support for browsers.)
• Added missing enchantments mending
and swift_sneak
• Fixed grammatical issues with decoration of if-statements.
• OPEN COM.MOJANG
button in the IDE works again.
MCCompiled 1.14
Dialectization, dynamism, and decoration! Oh, and a dump-truck of bugfixes for max marketplace ready-ness.
Addition: Localization Support
• New lang <locale>
command for setting the active language.
• All strings specified in FString fields will automatically be placed in the active lang file.
• Translation components will automatically be used when an active language is set.
• Added preprocessor variable (boolean) _lang_merge
to determine whether to merge equal language keys.
Addition: Dynamic Calls
• Functions can be defined using a string as the name of the function.
• A function can be called dynamically by using the new $call
<name>
[parameters]
directive.
• Compiles to the exact same as calling a function regularly. i.e., name(parameters)
Additions
• tp
command now has full vanilla parity with facing support and checking for blocks.
• Preprocessor variables can now be used in selectors.
Note that the implementation used is identical to the way strings are, so the support is still shallow. No inline operations are run, only raw $dereferences
are.
• Massively better decoration (-dc
compile option) to help people with reading/debugging output.
• All subfunctions now contains detailed description of what it is doing and where it is invoked.
• Unfortunately hits performance (even without decoration enabled), but only by a bit.
• Makes following the code tree much easier.
• No longer causes bugged code with multiline comments.
• More consistent newlines added to better separate ideas.
• Value and function documentation now shows up at the top of their respective locations.
• Added DONT_DECORATE
attribute to language.json to indicate directives should not be displayed.
• Added DOCUMENTABLE
attribute to language.json to indicate directives that can be documented.
• Function folders can now be done by using dots. For example, math.abs
will create abs
under the math
folder.
This is a million times better than using a whole attribute just to set a folder. This also makes it so that your functions that are held behind a folder can be referenced using their fully qualified name rather than having many functions with the same name.
• Added the extern
attribute that can be added to functions that are already in the BP without changing their contents.
• Added new support for project "properties" that allow you to change debug/decorate from the web editor. (gear icon)
• Language server now closes existing files when a new client connects to it to prevent from accidentally overwriting it.
Changes
• Renamed minecraftversion
preprocessor variable to _minecraft
for consistency with the others.
• Renamed compilerversion
preprocessor variable to _compiler
for consistency with the others.
• The syntax of if
<selector>
now only accepts @s selectors to dial in its meaning.
• Removed the folder(...)
attribute in respect for the much nicer period support.
• The threshold for values to hash their names has been increased from 16 to 256 to fit the new 1.20 changes.
Bugfixes
• Fixed incorrect behavior/resource dependencies, in some cases.
• Prevented a crash if a manifest data module did not contain a description.
• Fixed if
not
<boolean>
pattern throwing an error.
• Fixed loaded (existing) manifest files not having a proper output location.
• Fixed an issue that prevented Decoration from being enabled on the server.
• Save/load dialog boxes now always open on top of the IDE window. (WOO!)
• Comments no longer trip up if/else statements.
This was meant to be fixed in 1.12, but it still failed when no brackets were used.
• Return statements now properly terminate single line if/else statements.
• Disabled buttons in the Web IDE no longer change the cursor.
MCCompiled 1.13
MoLang binding, bugfixes, and new IDE features!
Changes
• BREAKING: When using development folders, MCC now names folders like so: name_BP
and name_RP
.
• Removed size limit on scatter
command, replaced with a warning.
• Scatter command now runs "shallowly" when linting, so it doesn't impact performance.
• Variable definitions now allow attributes before and after the name.
• Function definitions now allow attributes before and after the name.
Additions
• New attribute bind(query)
that will bind a MoLang query to a value. Limited support.
See
bindings.json
for all of the current bindings in this release.
• Including a comment behind a function definition will now count as documentation.
• Including a comment behind a value definition will now count as documentation.
• Including a comment behind a macro definition will now count as documentation.
• Documentation for all objects now show up in the IDE.
• Introduced server spec 5.7 with symbol documentation and version information.
Bugfixes
• Fixed attribute functions sometimes being broken and causing weird behavior.
• Fixed slight issue with terminal coloring.
• Scatter command works again.
• Fixed the encoding issues with definitions.def.