Skip to content

Commit

Permalink
Merge branch 'master' into gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
JannisX11 committed Dec 21, 2023
2 parents 5fd4d33 + e2fa882 commit 433efda
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion js/animations/molang.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ new ValidatorCheck('molang_syntax', {
run() {
let check = this;
let keywords = ['return', 'continue', 'break'];
let two_expression_regex = (isApp || window.chrome) ? new RegExp('(?<!\\w)[0-9._]+\\(|\\)[a-z0-9._]+') : null;
function validateMolang(string, message, instance) {
if (!string || typeof string !== 'string') return;
let clear_string = string.replace(/'.*'/g, '0');
Expand All @@ -598,7 +599,7 @@ new ValidatorCheck('molang_syntax', {
if (clear_string.match(/^[+*/.,?=&<>|]/)) {
issues.push('Expression starts with an invalid character');
}
if ((clear_string.match(/[\w.]\s+[\w.]/) && !keywords.find(k => clear_string.includes(k))) || clear_string.match(/(?<!\w)[0-9._]+\(|\)[a-z0-9._]+/)) {
if ((clear_string.match(/[\w.]\s+[\w.]/) && !keywords.find(k => clear_string.includes(k))) || clear_string.match(/\)\(/) || (two_expression_regex && clear_string.match(two_expression_regex))) {
issues.push('Two expressions with no operator in between');
}
if (clear_string.match(/(^|[^a-z0-9_])[\d.]+[a-z_]+/i)) {
Expand Down
2 changes: 1 addition & 1 deletion js/io/formats/bedrock.js
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ var codec = new Codec('bedrock', {
return;
}
}
if (data) {
if (data && index !== undefined) {

if (Group.all.find(group => group.bedrock_binding)) {
data.format_version = '1.16.0';
Expand Down

0 comments on commit 433efda

Please sign in to comment.