|
1 | | -import { encodeId, IdInput, NormalizedId, prefix } from '../../common/id.js' |
2 | | -import CustomEmitter from '../custom.js' |
| 1 | +import { Acceptor } from '@pssbletrngle/pack-resolver' |
| 2 | +import { encodeId, IdInput, NormalizedId, prefix, suffix } from '../../common/id.js' |
3 | 3 | import { Model } from '../../schema/assets/model.js' |
| 4 | +import CustomEmitter from '../custom.js' |
4 | 5 | import { ClearableEmitter } from '../index.js' |
5 | | -import { Acceptor } from '@pssbletrngle/pack-resolver' |
6 | 6 |
|
7 | 7 | export interface ModelRules { |
8 | 8 | add(id: IdInput, blockstate: Model): NormalizedId |
@@ -58,22 +58,25 @@ export default class ModelEmitter implements ModelRules, ClearableEmitter { |
58 | 58 | } |
59 | 59 |
|
60 | 60 | cog(id: IdInput, large: boolean, texture = prefix(id, 'block/')) { |
61 | | - if (large) { |
62 | | - return this.add(id, { |
63 | | - parent: 'create:block/large_cogwheel', |
64 | | - textures: { |
65 | | - '4': texture, |
66 | | - particle: texture, |
67 | | - }, |
68 | | - }) |
69 | | - } else { |
70 | | - return this.add(id, { |
71 | | - parent: 'create:block/cogwheel', |
72 | | - textures: { |
73 | | - '1_2': texture, |
74 | | - particle: texture, |
75 | | - }, |
76 | | - }) |
77 | | - } |
| 61 | + const suffixes = ['', '_shaftless'] |
| 62 | + return suffixes.map(it => { |
| 63 | + if (large) { |
| 64 | + return this.add(suffix(id, it), { |
| 65 | + parent: 'create:block/large_cogwheel' + it, |
| 66 | + textures: { |
| 67 | + '4': texture, |
| 68 | + particle: texture, |
| 69 | + }, |
| 70 | + }) |
| 71 | + } else { |
| 72 | + return this.add(suffix(id, it), { |
| 73 | + parent: 'create:block/cogwheel' + it, |
| 74 | + textures: { |
| 75 | + '1_2': texture, |
| 76 | + particle: texture, |
| 77 | + }, |
| 78 | + }) |
| 79 | + } |
| 80 | + })[0] |
78 | 81 | } |
79 | 82 | } |
0 commit comments