Skip to content

Commit eb12419

Browse files
author
ozelot379
committed
Fix enchanted item glint
1 parent dcb30dc commit eb12419

3 files changed

Lines changed: 53 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## [x]
4+
- Fix enchanted item glint
5+
36
## [2.0.2]
47
- Support java v1.15 and bedrock v1.14
58
- Convert hotbar, bars, buttons and tabs ui and inventory icons
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import {AbstractConverter} from "./AbstractConverter";
2+
import {MetadataConverter} from "./MetadataConverter";
3+
4+
/**
5+
* Class EnchantedItemGlintConverter
6+
*/
7+
class EnchantedItemGlintConverter extends AbstractConverter {
8+
/**
9+
* @inheritDoc
10+
*/
11+
async convert() {
12+
if (MetadataConverter.mcmeta.pack.pack_format < 5) {
13+
return [];
14+
}
15+
16+
const from = this.data;
17+
18+
if (!await this.output.exists(from)) {
19+
return [];
20+
}
21+
22+
this.log.log(`Convert enchanted item glint ${from}`);
23+
24+
const image = await this.readImage(from);
25+
26+
image.color([{
27+
apply: "saturate",
28+
params: [-100]
29+
}]);
30+
31+
image.rotateSimple(-90);
32+
33+
await this.writeImage(from, image);
34+
35+
return [];
36+
}
37+
38+
/**
39+
* @inheritDoc
40+
*/
41+
static get DEFAULT_CONVERTER_DATA() {
42+
return [
43+
"textures/misc/enchanted_item_glint.png"
44+
];
45+
}
46+
}
47+
48+
export {EnchantedItemGlintConverter};

‎src/converter/converters.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {DeleteConverter} from "./DeleteConverter";
1616
import {DespriteConverter} from "./DespriteConverter";
1717
import {DestroyStageConverter} from "./DestroyStageConverter";
1818
import {DrownedConverter} from "./DrownedConverter";
19+
import {EnchantedItemGlintConverter} from "./EnchantedItemGlintConverter";
1920
import {FishHookConverter} from "./FishingConverter";
2021
import {FireworksConverter} from "./FireworksConverter";
2122
import {FoxConverter} from "./FoxConverter";
@@ -79,6 +80,7 @@ const converters = [
7980
...Particles1_13Converter.getDefaultConverters(),
8081
...SpriteConverter.getDefaultConverters(),
8182
...DestroyStageConverter.getDefaultConverters(),
83+
...EnchantedItemGlintConverter.getDefaultConverters(),
8284
...PngToTgaConverter.getDefaultConverters(),
8385
...CopyConverter.getDefaultConverters(),
8486
...DeleteConverter.getDefaultConverters()

0 commit comments

Comments
 (0)