Skip to content

Releases: WingedSeal/jmc

v1.2.17

22 Mar 07:06
Compare
Choose a tag to compare

Changelog v1.2.17

✨Added:

  • Allow space between $ and vanilla macro
  • Allow function declaration inside function
    • Preserve class context in Hardcode
  • Add nbt operation
my_storage::my.path;
my_storage::my.path * 2;
my_storage::my.path = "Hello World";
my_storage::my.path = my_storage::other.path;
my_storage::my.path = my_storage::other.path[2:];
my_storage::my.path = my_storage::other.path[2:10];
my_storage::my.path >> "Hello World";
my_storage::my.path << "Hello World";
my_storage::my.path ^2 "Hello World";
my_storage::my.path ?= $my_var;
my_storage::my.path = $my_var;
my_storage::my.path = (float) $my_var;
my_storage::my.path = 2 * (float) $my_var;
my_storage::my.path += {key: "value"};
my_storage:: += {key: "value"};
my_storage::my.path.del();

my_namespace:my_storage::my.path;
my_storage::my.path;
my_storage::;
::my.path;
[0,0,0]::my.path;
@a::my.path;
@a[tag=test]::my.path;
  • Add @root decorator to ignore the current class the function is defined in
  • Add #bind EVAL
    • allow \ to be used for integer division in EVAL
#define CONST 5
#bind EVAL
$a = EVAL(CONST + 1);
  • Add #enum
#enum MyClass A B C D E
#enum Other 5 A B C D E

is equivalent to

#define MyClass.A 0
#define MyClass.B 1
#define MyClass.C 2
#define MyClass.D 3
#define MyClass.E 4

#define Other.A 5
#define Other.B 6
#define Other.C 7
#define Other.D 8
#define Other.E 9

🔧Fix:

  • Fix return run {...} with ... data ...
  • Fix .get() not working on scoreboard player
  • Fix .get() not working with macro
  • Fix return run execute getting "optimized"
  • Fix vanilla macro breaking semicolon check
  • Fix typo in Math.random algorithm
  • Fix static path crashing

🎉Change:

  • Make indexString work on source of NBT (@Nico314159)
  • Auto trim python code inside JMC.python
  • Overhaul if else algorithm, it should no longer create any unnecessary functions and skipping any number.

v1.2.17-alpha.1

02 Jan 10:45
Compare
Choose a tag to compare

Changelog v1.2.17-alpha.1

✨Added:

  • Add #bind __namehash16__ (@Nico314159)
  • Add lazy function related errors
  • Add a dedicated this keyword for classes
  • Add return run {...}
  • Add Hardcode.calc in lazy function
  • Allow using macro in Hardcode.calc
  • Add Team.prefix Team.suffix
  • Add Array.forEach(target: Keyword, path: String, function: ArrowFunction)
  • Allow using function ... with {} (A replacement for function ... {} because technical reasons)

🔧Fix:

  • Fix lazy function with 0 arguments not working
  • Fix using multiple lazy function causing a cached result
  • Fix misleading error message
  • Fix if ... execute run {...} with ...
  • Fix pack_format -1 not bypassing
  • Fix allowing the same name for lazy and normal function
  • Include quote in lazy function string arguments
  • Fix isEqual defaulting to namespace instead of minecraft

🎉Change:

  • Update a terminal message
  • Update JSON-related stuff for Minecraft 1.20.3 (@Nico314159)
  • Properly insert NBT source key on post 1.20.3 (@Nico314159)
  • Add error messages
  • Improve function duplicate error msg
  • Remove type parameter from Object.isEqual() and String.isEqual() (@amawdiin)
  • Imporve formattedtext
  • Allow variable operation macro

v1.2.16

21 Nov 20:09
90abe89
Compare
Choose a tag to compare

Changelog v1.2.16

✨Added:

  • Allow with ... after anonymous function for 1.20
  • Make anonym func with requires pack format 16+
  • Add 1.20.2 /random command to vanilla commands list (@Nico314159)
  • Error suggestion for misspelled built-in func name (@Nico314159)
  • Give hint if built-in func parameter ends with () (@Nico314159)
  • Add Tag.update() built-in function (@Nico314159)
  • Make custom namespaces work when calling functions (@Nico314159)
  • Prevent duplicate imports when using wildcard (@Nico314159)
  • Add @lazy decorator
    • Allow using lazy function for execute if there is only a single line
@lazy
function compile_time_func(a,b,c) {
    say "$a$b$c";
}
execute as @a run compile_time_func(x,y,c=z);

🔧Fix:

  • Fix recursion error from variable operation
  • Fix decorator breaking when using class
  • Fix quoted booleans in tellraw JSON
  • Fix missing backslash (@Nico314159)
  • Prevent UB caused by changing switch/case variables (@Nico314159)
  • Fix issue with objective:selector in Timer.set() (@Nico314159)
  • Fix bug #40 (@Nico314159)

🎉Change:

  • Allow objective:selector syntax in switch (@Nico314159)

v1.2.16-alpha.1

19 Sep 18:35
Compare
Choose a tag to compare

Changelog v1.2.16-alpha.1

✨Added:

@add(funcCallFrom)
function myFunc() {
}
  • Add print and printf
  • Support vanilla macro
myFunc(key="value");
myFunc({"key":"value"});
myFunc() with ...;
  • Added support for "separator":"" in Textprop.nbt (@amawdiin, @Nico314159)

🔧Fix:

  • Fix Hardcode.calc not working multiple time
  • Fix loot ... give
  • Fix function bugs
  • Fix FormattedText (&7-&r&7-)
  • Fix if (...) command ... {...} not requiring semicolon
  • Fix var func not working as intended with obj:selector

🎉Change:

  • Make Math.random works with variables
  • Improve Hardcode.calc
  • Improve JMC.python
  • Improve error message
  • Improve FormattedText optimization

v1.2.15

04 Sep 04:59
Compare
Choose a tag to compare

Changelog v1.2.15

✨Added:

  • Automatically fix typos for json file type (advancement -> advancements)
  • Add Player.join(function: Function) -> LoadOnce
  • Add $a = $b = $c = ...
  • Add $var = custom_func();
  • Throw error when $a = func() and func was not defined
  • Add #nometa
  • Add execute ... expand {...}
  • Add if (...) expand {...}
  • Add Item.clear (@Nico314159)

🔧Fix:

  • Fix logs printing out when using API (From Beet for example)
  • Fix PyJMC resource_locations
  • Fix ... = obj:selector not working
  • Fix an error position
  • Fix Math.random starting at negative creating invalid command
  • Fix checking for bool throwing unexpected error when selector has square param
  • Fix Math.random accepting non integers

🎉Change:

  • Improve error messages
  • Allow parens in macro factory
  • Change __certfile to _certfile in PyJMC
  • Make ??= compatible with true/false (@Nico314159)

v1.2.15-alpha

01 Aug 16:44
Compare
Choose a tag to compare

Changelog v1.2.15-alpha

✨Added:

JMC.python(pythonCode: string, env: string = "");
JMC.python(`
  emit("say hi")
`, "main");
  • Add Null Coalescing operator (??=) (If null, set to) (@Nico314159)
$a ??= 5;

🔧Fix:

  • Fix absolute path in config causing unhandled error
  • Fix =-1 not working the same way as = -1 in arguments
  • Fix Math.sqrt not working
  • Fix obj:selector in first value of comparasion in condition not working
  • Fix issue where dark_blue was not accepted as a color (@Nico314159)

🎉Change:

  • Update execute to latest mc version
  • Update commands to 23w16a
  • Remove #override_minecraft, use #override minecraft instead
  • Update Item.createSign for 1.19 & 1.20 (@Nico314159)

v1.2.14

27 May 15:44
Compare
Choose a tag to compare

Changelog v1.2.14

✨Added:

  • Add CLI for jmc
    • jmc run (default)
    • jmc init ...
    • jmc compile
    • jmc config ...
    • Run jmc -h for more information

🔧Fix:

  • Fix Timer.add
  • Fix backtick bug for multiline string
  • Fix variable operation not working for selector with
  • Fix : in obj:selector[]

🎉Change:

  • Raise error when there is no space between string and keyword
  • Change @import to import
  • Switch-case statements can now start at any number (by @Nico314159)
  • Allow obj:selector in condition
  • Fix negative sign in condition raising error

v1.2.14-alpha.2

08 Mar 04:43
Compare
Choose a tag to compare

Changelog v1.2.14-alpha.2

✨Added:

  • Add TextProps.clickCommand()
  • Add multiline string
Text.tellraw(@a, `
line1
line2
line3
  `);

🔧Fix:

  • Fix # comment not working with indent

🎉Change:

  • Cache TextProps
  • Improve TextProps and TextProp
  • Improve error message
  • Remove {} restriction for if else
if (entity @s) say "hi";

v1.2.14-alpha.1

02 Mar 11:02
Compare
Choose a tag to compare

Changelog v1.2.14-alpha.1

✨Added:

  • Automatically add execute excluded function to anonymous function
  • Throw error if function was never defined
  • Allow FormattedText to accept custom property
    • Add Add TextProp.clickCommand
TextProp.clickCommand(
    "prop_name",
    ()=>{kill @s;},
    local=false //local will delete the property after it's used once, defaults to false
);
Text.tellraw(@a, "&<prop_name>test");

🎉Change:

  • Add displayName default to Item.createSign and Item.createSpawnEgg
  • Allow multiple keys in #bind

v1.2.13

19 Feb 08:10
Compare
Choose a tag to compare

Changelog v1.2.13

✨Added:

  • Add #bind header
    • #bind __namespace__
    • #bind __UUID__

🔧Fix:

  • Fix onDeath running every tick in Player.die
  • Fix loot ... give ...
  • Fix particle ... item ...
  • Fix Object.isEqual not working
  • Fix tabs causing unaligned error position

🎉Change:

  • Improve error message suggestions
  • Allow default for displayName in Item.create
  • Remove restriction for using variable assignment as first statement in for loop