Skip to content

Commit 7aac7a2

Browse files
committed
Merge branch 'blockbench-4.12.0' into next
2 parents a921620 + 26a5af7 commit 7aac7a2

File tree

13 files changed

+24
-88
lines changed

13 files changed

+24
-88
lines changed

src/blockbenchTypeMods.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ declare global {
9898
isDataPackPath: typeof isDataPackPath
9999
blueprintSettingErrors: typeof blueprintSettingErrors
100100
openUnexpectedErrorDialog: typeof openUnexpectedErrorDialog
101-
TRANSPARENT_TEXTURE: Texture
102101
BLUEPRINT_FORMAT: typeof BLUEPRINT_FORMAT
103102
BLUEPRINT_CODEC: typeof BLUEPRINT_CODEC
104103
TextDisplay: typeof TextDisplay

src/blueprintFormat.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { injectSvelteCompomponent } from './util/injectSvelteComponent'
77
import { toSafeFuntionName } from './util/minecraftUtil'
88
import { addProjectToRecentProjects } from './util/misc'
99
import { Valuable } from './util/stores'
10-
import { TRANSPARENT_TEXTURE, TRANSPARENT_TEXTURE_MATERIAL, Variant } from './variants'
10+
import { Variant } from './variants'
1111
import FormatPageSvelte from './components/formatPage.svelte'
1212
import { translate } from './util/translation'
1313
import { process } from './systems/modelDataFixerUpper'
@@ -572,9 +572,6 @@ export const BLUEPRINT_FORMAT = new Blockbench.ModelFormat({
572572
events.UNLOAD.subscribe(() => clearInterval(updateBoundingBoxIntervalId), true)
573573
events.UNINSTALL.subscribe(() => clearInterval(updateBoundingBoxIntervalId), true)
574574

575-
thisProject.materials[TRANSPARENT_TEXTURE.uuid] = TRANSPARENT_TEXTURE_MATERIAL
576-
TRANSPARENT_TEXTURE.updateMaterial()
577-
578575
Project.loadingPromises ??= []
579576
Project.loadingPromises.push(
580577
new Promise<void>(resolve => {
@@ -664,7 +661,7 @@ export function saveBlueprint() {
664661
export function updateRotationLock() {
665662
if (!isCurrentFormat()) return
666663
BLUEPRINT_FORMAT.rotation_limit = !(
667-
!!Group.selected ||
664+
!!Group.first_selected ||
668665
!!AnimatedJava.API.TextDisplay.selected.length ||
669666
!!AnimatedJava.API.VanillaItemDisplay.selected.length ||
670667
!!AnimatedJava.API.VanillaBlockDisplay.selected.length ||

src/components/variantConfigDialog.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts" context="module">
22
import { type Valuable } from '../util/stores'
33
import { translate } from '../util/translation'
4-
import { TRANSPARENT_TEXTURE, TextureMap, Variant } from '../variants'
4+
import { TextureMap, Variant } from '../variants'
55
import Checkbox from './dialogItems/checkbox.svelte'
66
import LineInput from './dialogItems/lineInput.svelte'
77
import MissingTexture from '../assets/missing_texture.png'
@@ -19,7 +19,7 @@
1919
export let generateNameFromDisplayName: Valuable<boolean>
2020
export let excludedNodes: Valuable<Array<CollectionItem>>
2121
22-
const availableTextures = [...Texture.all, TRANSPARENT_TEXTURE]
22+
const availableTextures = [...Texture.all]
2323
const primaryTextures = [...Texture.all]
2424
const secondaryTextures = availableTextures
2525

src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import './systems/minecraft/blockstateManager'
2020
import './systems/minecraft/assetManager'
2121
import './systems/minecraft/fontManager'
2222
// Misc imports
23-
import { TRANSPARENT_TEXTURE, Variant } from './variants'
23+
import { Variant } from './variants'
2424
import './systems/minecraft/registryManager'
2525
import { MINECRAFT_REGISTRY } from './systems/minecraft/registryManager'
2626
import resourcepackCompiler from './systems/resourcepackCompiler'
@@ -59,7 +59,6 @@ globalThis.AnimatedJava = {
5959
isDataPackPath,
6060
blueprintSettingErrors,
6161
openUnexpectedErrorDialog,
62-
TRANSPARENT_TEXTURE,
6362
BLUEPRINT_FORMAT,
6463
BLUEPRINT_CODEC,
6564
TextDisplay,

src/interface/dialog/boneConfig.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ export const BONE_CONFIG_ACTION = createAction(`${PACKAGE.name}:bone_config`, {
174174
name: translate('action.open_bone_config.name'),
175175
condition: () => Format === BLUEPRINT_FORMAT,
176176
click: () => {
177-
openBoneConfigDialog(Group.selected)
177+
if (!Group.first_selected) return
178+
openBoneConfigDialog(Group.first_selected)
178179
},
179180
})

src/outliner/textDisplay.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ export class TextDisplay extends ResizableOutlinerElement {
212212
}
213213

214214
select() {
215-
if (Group.selected) {
216-
Group.selected.unselect()
215+
if (Group.first_selected) {
216+
Group.first_selected.unselect()
217217
}
218218

219219
if (!Pressing.ctrl && !Pressing.shift) {
@@ -548,7 +548,7 @@ export const CREATE_ACTION = createAction(`${PACKAGE.name}:create_text_display`,
548548
}
549549

550550
selected.forEachReverse(el => el.unselect())
551-
Group.selected && Group.selected.unselect()
551+
Group.first_selected && Group.first_selected.unselect()
552552
textDisplay.select()
553553

554554
Undo.finishEdit('Create Text Display', {

src/outliner/vanillaBlockDisplay.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ export class VanillaBlockDisplay extends ResizableOutlinerElement {
143143
}
144144

145145
select() {
146-
if (Group.selected) {
147-
Group.selected.unselect()
146+
if (Group.first_selected) {
147+
Group.first_selected.unselect()
148148
}
149149
if (!Pressing.ctrl && !Pressing.shift) {
150150
if (Cube.selected.length) {
@@ -426,7 +426,7 @@ export const CREATE_ACTION = createAction(`${PACKAGE.name}:create_vanilla_block_
426426
}
427427

428428
selected.forEachReverse(el => el.unselect())
429-
Group.selected && Group.selected.unselect()
429+
Group.first_selected && Group.first_selected.unselect()
430430
vanillaBlockDisplay.select()
431431

432432
Undo.finishEdit('Create Vanilla Block Display', {

src/outliner/vanillaItemDisplay.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ export class VanillaItemDisplay extends ResizableOutlinerElement {
151151
}
152152

153153
select() {
154-
if (Group.selected) {
155-
Group.selected.unselect()
154+
if (Group.first_selected) {
155+
Group.first_selected.unselect()
156156
}
157157
if (!Pressing.ctrl && !Pressing.shift) {
158158
if (Cube.selected.length) {
@@ -425,7 +425,7 @@ export const CREATE_ACTION = createAction(`${PACKAGE.name}:create_vanilla_item_d
425425
}
426426

427427
selected.forEachReverse(el => el.unselect())
428-
Group.selected && Group.selected.unselect()
428+
Group.first_selected && Group.first_selected.unselect()
429429
vanillaItemDisplay.select()
430430

431431
Undo.finishEdit('Create Vanilla Item Display', {

src/systems/resourcepackCompiler/1.20.4.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { MAX_PROGRESS, PROGRESS, PROGRESS_DESCRIPTION } from '../../interface/dialog/exportProgress'
22
import { isResourcePackPath, toSafeFuntionName } from '../../util/minecraftUtil'
3-
import { TRANSPARENT_TEXTURE } from '../../variants'
43
import { IntentionalExportError } from '../exporter'
54
import { ITextureAtlas } from '../minecraft/textureAtlas'
65
import { IRenderedNodes, IRenderedRig } from '../rigRenderer'
@@ -242,16 +241,6 @@ export default async function compileResourcePack(options: {
242241
}
243242
exportedFiles.set(blockAtlasPath, autoStringify(blockAtlas))
244243

245-
// Transparent texture
246-
const transparentTexturePath = PathModule.join(
247-
resourcePackFolder,
248-
'assets/animated_java/textures/blueprint/transparent.png'
249-
)
250-
exportedFiles.set(
251-
transparentTexturePath,
252-
nativeImage.createFromDataURL(TRANSPARENT_TEXTURE.source).toPNG()
253-
)
254-
255244
// Variant Models
256245
for (const variant of Object.values(rig.variants)) {
257246
for (const [boneUuid, variantModel] of Object.entries(variant.models)) {

src/systems/resourcepackCompiler/1.21.2.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { MAX_PROGRESS, PROGRESS, PROGRESS_DESCRIPTION } from '../../interface/dialog/exportProgress'
22
import { isResourcePackPath, toSafeFuntionName } from '../../util/minecraftUtil'
3-
import { TRANSPARENT_TEXTURE } from '../../variants'
43
import { IntentionalExportError } from '../exporter'
54
import { type ITextureAtlas } from '../minecraft/textureAtlas'
65
import { IRenderedNodes, IRenderedRig } from '../rigRenderer'
@@ -109,16 +108,6 @@ export default async function compileResourcePack(options: {
109108
)
110109
}
111110

112-
// Transparent texture
113-
const transparentTexturePath = PathModule.join(
114-
resourcePackFolder,
115-
'assets/animated_java/textures/blueprint/transparent.png'
116-
)
117-
exportedFiles.set(
118-
transparentTexturePath,
119-
nativeImage.createFromDataURL(TRANSPARENT_TEXTURE.source).toPNG()
120-
)
121-
122111
// Variant Models
123112
for (const variant of Object.values(rig.variants)) {
124113
for (const [boneUuid, variantModel] of Object.entries(variant.models)) {

0 commit comments

Comments
 (0)