Skip to content

Commit 802aa1b

Browse files
committed
Merge branch 'master' into gh-pages
2 parents f2c1777 + 752bfb3 commit 802aa1b

File tree

21 files changed

+2532
-72
lines changed

21 files changed

+2532
-72
lines changed

.github/ISSUE_TEMPLATE/issue.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,9 @@ body:
5858
- type: input
5959
id: plugins
6060
attributes:
61-
label: Installed Blockbench plugins
61+
label: Installed Blockbench plugins
62+
- type: textarea
63+
id: log
64+
attributes:
65+
label: Are there any console errors?
66+
description: This is particularly relevant if you expect something to happen and it does not happen, or if the UI becomes unresponsive. Click Help > Developer > Open Dev Tools and switch to the Console tab to see the log. Anything red is an error message.

.github/workflows/stale.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ jobs:
2222
This issue has been automatically marked as stale because it has not had
2323
recent activity. It will be closed if no further activity occurs. Thank you
2424
for your contributions.
25-
close-issue-message: false
2625
days-before-stale: 360
2726
days-before-close: 28
2827
# Issues with these labels will never be considered stale

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/dist/
2-
index.php
2+
.env
3+
.DS_store
34
electron-builder.env
45
node_modules/
56
bundle.js

js/animations/animation_mode.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ const Animator = {
491491
function processPlaceholderVariables(text) {
492492
if (typeof text !== 'string') return;
493493
text = text.replace(/v\./, 'variable.').replace(/q\./, 'query.').replace(/t\./, 'temp.').replace(/c\./, 'context.').toLowerCase();
494-
let matches = text.match(/(query|variable|context|temp)\.\w+/gi);
494+
let matches = text.match(/(query|variable|context|temp)\.\w+(\([^)]*\))?/gi);
495495
if (!matches) return;
496496
matches.forEach(match => {
497497
let panel_vue = Interface.Panels.variable_placeholders.inside_vue;
@@ -500,6 +500,7 @@ const Animator = {
500500

501501
let [space, name] = match.split(/\./);
502502
if (panel_vue.text != '' && panel_vue.text.substr(-1) !== '\n') panel_vue.text += '\n';
503+
name = name.replace(/[')]/g, '').replace('(', ':');
503504

504505
if (name == 'modified_distance_moved') {
505506
panel_vue.text += `${match} = time * 8`;
@@ -1499,21 +1500,18 @@ Interface.definePanels(function() {
14991500
})
15001501

15011502
function processVariablePlaceholderText(text) {
1502-
const res = text
1503-
.replaceAll(/(\s*)(v\.)/g, '$1variable.')
1504-
.replaceAll(/(\s*)(q\.)/g, '$1query.')
1505-
.replaceAll(/(\s*)(t\.)/g, '$1temp.')
1506-
.replaceAll(/(\s*)(c\.)/g, '$1context.')
1507-
15081503
Animator.global_variable_lines = {}
1509-
for (const line of res.split('\n')) {
1504+
for (const line of text.split('\n')) {
15101505
let [key, val] = line.split(/=\s*(.+)/)
15111506
if(val === undefined) {
15121507
continue
15131508
}
15141509
key = key.replace(/[\s;]/g, '')
1510+
key = key
1511+
.replace(/^v\./, 'variable.')
1512+
.replace(/^q\./, 'query.')
1513+
.replace(/^t\./, 'temp.')
1514+
.replace(/^c\./, 'context.');
15151515
Animator.global_variable_lines[key] = val.trim()
15161516
}
1517-
1518-
return res
15191517
}

js/animations/molang.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ Animator.MolangParser.global_variables = {
8989
return Timeline.time
9090
},
9191
}
92-
Animator.MolangParser.variableHandler = function (variable, variables) {
93-
const val = Animator.global_variable_lines[variable]
92+
Animator.MolangParser.variableHandler = function (variable, variables, args) {
93+
let variable_with_args = args?.length && `${variable}(${args.map(arg => "'"+arg+"'").join(',')})`;
94+
95+
const val = Animator.global_variable_lines[variable] ?? Animator.global_variable_lines[variable_with_args];
9496
if (val === undefined) {
9597
return
9698
}
@@ -237,10 +239,10 @@ new ValidatorCheck('molang_syntax', {
237239
.replace(/[^a-z0-9._]/g, '')
238240
)
239241
}
240-
if (clear_string.match(/[^\w\s+\-*/().,;:[\]!?=<>&|]/)) {
242+
if (clear_string.match(/[^\w\s+\-*/(){}.,;:[\]!?=<>&|]/)) {
241243
issues.push(
242244
'Invalid character: ' +
243-
clear_string.match(/[^\s\w+\-*/().,;:[\]!?=<>&|]+/g).join(', ')
245+
clear_string.match(/[^\s\w+\-*/(){}.,;:[\]!?=<>&|]+/g).join(', ')
244246
)
245247
}
246248
let left = string.match(/\(/g) || 0

js/io/formats/bedrock_old.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ var format = new ModelFormat({
418418
animation_controllers: true,
419419
animation_mode: true,
420420
locators: true,
421+
pbr: true,
421422
codec,
422423
onSetup(project) {
423424
if (isApp) {

js/io/formats/java_block.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ var format = new ModelFormat({
546546
texture_mcmeta: true,
547547
display_mode: true,
548548
texture_folder: true,
549+
pbr: true,
549550
cube_size_limiter: {
550551
coordinate_limits: [-16, 32],
551552
test(cube, values = 0) {

js/io/formats/modded_entity.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,7 @@ var format = new ModelFormat({
10801080
rotate_cubes: true,
10811081
integer_size: true,
10821082
animation_mode: true,
1083+
pbr: true,
10831084
})
10841085
Object.defineProperty(format, 'integer_size', {get: _ => Templates.get('integer_size') || settings.modded_entity_integer_size.value});
10851086
codec.format = format;

js/io/formats/optifine_jem.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ var format = new ModelFormat({
406406
bone_rig: true,
407407
centered_grid: true,
408408
texture_folder: true,
409+
pbr: true,
409410
codec
410411
})
411412
Object.defineProperty(format, 'integer_size', {get: _ => Project.box_uv})

js/io/formats/optifine_jpm.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ var part_format = new ModelFormat({
6666
bone_rig: true,
6767
centered_grid: true,
6868
texture_folder: true,
69+
pbr: true,
6970
codec: part_codec
7071
})
7172
Object.defineProperty(part_format, 'integer_size', {get: _ => Project.box_uv})

0 commit comments

Comments
 (0)