Skip to content

Commit 08bf458

Browse files
committed
Merge branch 'patch' into next
2 parents e2b2f4a + 2acaa5d commit 08bf458

33 files changed

Lines changed: 843 additions & 554 deletions

CONTRIBUTING.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ If you want to contribute Blockbench translations, you can visit [blockbench.net
1717

1818
## Source code contributions
1919

20-
Blockbench, the program itself, is mostly just coded by me. But sometimes, code contributions can be helpful!
20+
Blockbench, the program itself, is mostly just coded by me. But third party contributions are welcome!
2121

22-
If you want to contribute to the Blockbench code, please contact me (@Jannis) on [Discord](https://discord.gg/sGkj78W) (e.g. in #bb-feedback) *before* to discuss whether a change is necessary in the base program and how it can be approached.
23-
Some changes make sense in Blockbench itself, while others could work better as a plugin.
22+
Bug fixes can be submitted via pull request.
23+
24+
If you want to add a feature or change functionality, I recommend opening a discussion on Discord before to talk about if and where it fits in. You can do so in the channel [#bb-feedback](https://discord.gg/kZBmCwvBFw). Some features may be out of scope and work better as plugins, or I might have additional tips on how to approach it. The timing of features being integrated also depends on the release cycle, new features should go through beta testing before being shipped.
2425

2526
Minor fixes should be targeting the `patch` branch, new features and fixes that require additional testing should generally target the `next` branch.
2627

assets/player_skin.png

412 Bytes
Loading

css/general.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@
3131
background-color: var(--color-back);
3232
height: 18px;
3333
margin-top: 12px;
34+
border-radius: 10px;
3435
}
3536
.progress_bar_inner {
3637
background-color: var(--color-accent);
3738
height: 100%;
3839
width: calc(100% * var(--progress));
40+
border-radius: inherit;
3941
}
4042
.accent_color {
4143
color: var(--color-accent);
@@ -693,7 +695,10 @@
693695
}
694696
.tool.side_menu_tool i.icon.action_more_options {
695697
display: inline-block;
696-
width: 19px;
698+
width: 20px;
699+
height: 100%;
700+
margin-top: 0;
701+
padding-top: 4px;
697702
color: var(--color-text);
698703
margin-left: 0;
699704
}
@@ -708,6 +713,7 @@
708713
text-align: center;
709714
width: 100%;
710715
margin-top: 0px;
716+
padding-top: 0px;
711717
}
712718

713719
/*(Context-)Menu*/

css/panels.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,6 +1120,7 @@
11201120
}
11211121
.texture_layer > label {
11221122
flex-grow: 1;
1123+
overflow: hidden;
11231124
}
11241125
.texture_layer i.toggle_disabled {
11251126
color: var(--color-subtle_text);
@@ -1773,7 +1774,7 @@
17731774
}
17741775
#timeline_vue.graph_editor .channel_head {
17751776
flex-wrap: wrap;
1776-
justify-content: flex-end;
1777+
justify-content: flex-start;
17771778
}
17781779
.drag_hover[order]::before {
17791780
z-index: 7;

js/animations/animation_mode.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ export const Animator = {
8181
Timeline.pause()
8282
Animator.open = false;
8383

84-
scene.remove(WinterskyScene.space);
85-
scene.remove(Animator.motion_trail);
86-
scene.remove(Animator.onion_skin_object);
84+
Canvas.scene.remove(WinterskyScene.space);
85+
Canvas.scene.remove(Animator.motion_trail);
86+
Canvas.scene.remove(Animator.onion_skin_object);
8787
Animator.resetParticles(true);
8888

8989
three_grid.position.z = three_grid.position.x;
@@ -113,7 +113,7 @@ export const Animator = {
113113
}
114114
}
115115
Blockbench.dispatchEvent('display_default_pose', {reduced_updates});
116-
if (!reduced_updates) scene.updateMatrixWorld()
116+
if (!reduced_updates) Canvas.scene.updateMatrixWorld()
117117
},
118118
resetParticles(optimized) {
119119
for (var path in Animator.particle_effects) {

js/animations/molang.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@ new ValidatorCheck('molang_syntax', {
237237
if (clear_string.match(/^[+*/.,?=&<>|]/)) {
238238
issues.push('Expression starts with an invalid character')
239239
}
240+
if (clear_string.endsWith(';') && !clear_string.includes('return ')) {
241+
issues.push('Complex expression with no return value. Remove the semicolon or add a return statement')
242+
}
240243
if (
241244
(clear_string.match(/[\w.]\s+[\w.]/) &&
242245
!keywords.find((k) => clear_string.includes(k))) ||

js/auto_backup.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ export const AutoBackup = {
118118

119119
// Confirm selection
120120
if (confirm_selection && projects.length > 1) {
121-
let form: Record<string, FormElementOptions | '_'> = {};
121+
let form: Record<string, FormElementOptions | '_'> = {
122+
info: {
123+
text: '⚠ Recovering models is only a backup. Please remember to always save your work to your device.',
124+
type: 'info'
125+
}
126+
};
122127
let keys: UUID[] = [];
123128

124129
projects.sort((a, b) => (b.date??0) - (a.date??0));
@@ -154,7 +159,7 @@ export const AutoBackup = {
154159
}
155160

156161
projects = await new Promise<ProjectSave[]>((resolve, reject) => {
157-
new Dialog({
162+
let dialog = new Dialog({
158163
id: 'recover_backup',
159164
title: 'message.recover_backup.title',
160165
form,
@@ -170,6 +175,10 @@ export const AutoBackup = {
170175
resolve(to_open);
171176
}
172177
}).show();
178+
let content = dialog.object.querySelector('.dialog_content') as HTMLElement;
179+
if (content) {
180+
content.style.maxHeight = (window.innerHeight - 150) + 'px';
181+
}
173182
})
174183
}
175184

js/desktop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export function initializeDesktopApp() {
9292
//Load Model
9393
export function loadOpenWithBlockbenchFile() {
9494
function load(path: string) {
95-
if (!path || path.length < 7 || !path.match(/\w\.\w+$/)) return;
95+
if (!path || path.length < 7 || path.startsWith('--') || !path.match(/.\.\w+$/)) return;
9696
var extension = pathToExtension(path);
9797
if (extension == 'png') {
9898
Blockbench.read([path], {readtype: 'image'}, (files) => {

js/formats/bedrock/bedrock.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,6 +1301,11 @@ var codec = new Codec('bedrock', {
13011301
texture_width: Project.texture_width || 16,
13021302
texture_height: Project.texture_height || 16,
13031303
}
1304+
1305+
if (options.collection) {
1306+
1307+
}
1308+
13041309
var bones = []
13051310

13061311
var groups = getAllGroups();

js/formats/bedrock/bedrock_voxel_shape.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,32 @@ BARS.defineActions(function() {
189189
size: bb.size()
190190
}
191191
});
192-
if (type == 'selection_box') box_data.length = 1;
192+
if (type == 'selection_box') {
193+
let { origin, size } = box_data[0];
194+
let minX = origin[0];
195+
let minY = origin[1];
196+
let minZ = origin[2];
197+
let maxX = origin[0] + size[0];
198+
let maxY = origin[1] + size[1];
199+
let maxZ = origin[2] + size[2];
200+
for (let i = 1; i < box_data.length; i++) {
201+
const { origin, size } = box_data[i];
202+
minX = Math.min(minX, origin[0]);
203+
minY = Math.min(minY, origin[1]);
204+
minZ = Math.min(minZ, origin[2]);
205+
maxX = Math.max(maxX, origin[0] + size[0]);
206+
maxY = Math.max(maxY, origin[1] + size[1]);
207+
maxZ = Math.max(maxZ, origin[2] + size[2]);
208+
}
209+
box_data = [{
210+
origin: [minX, minY, minZ],
211+
size: [
212+
maxX - minX,
213+
maxY - minY,
214+
maxZ - minZ
215+
]
216+
}]
217+
};
193218
let data = box_data as any;
194219
if (box_data.length == 1 && box_data[0].origin.equals([-8, 0, -8]) && box_data[0].size.equals([16, 16, 16])) {
195220
data = true;

0 commit comments

Comments
 (0)