Skip to content

Commit 197838e

Browse files
author
ozelot379
committed
Merge branch 'develop' into 'master'
Develop See merge request minecraft/ConvertJavaTextureToBedrock!25
2 parents d94e36b + 5cc328b commit 197838e

10 files changed

Lines changed: 153 additions & 293 deletions

‎CHANGELOG.md‎

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

3+
## [3.1.0]
4+
- Possible speed up texture pack loading
5+
- First sounds support
6+
- Improve dialog ui (Experimental)
7+
- More table icons (Experimental)
8+
39
## [3.0.4]
410
- Improve error handling
511

‎README.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ Some conversions of HD texture packs may takes a while
1414

1515
This project is inspired by the no longer continued [PCTexture2PE](https://github.com/rodrigojxd/PCTexture2PE)
1616

17-
It supports to convert blocks, items, entities, paintings, particles, map icons, mob effects and some more basic ui textures (hotbar)
17+
It supports to convert blocks, items, entities, paintings, particles, map icons, mob effects and hotbar
1818

19-
Some experimental conversions are disabled by default, but can be enabled if you want to try:
19+
Some experimental conversions are disabled by default, but can be enabled if you want to try, but please be warned, it contains many bugs and may are not beautiful and may not usable:
2020
- UI
2121
- Buttons
2222
- Tabs
2323
- Dialogs
24-
- Inventory
24+
- Inventory / Recipe book
25+
- Tables
2526

2627
## Web app
2728
Look at https://ozelot379.github.io/ConvertJavaTextureToBedrock

‎package.json‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@ozelot379/convert-minecraft-java-texture-to-bedrock",
33
"productName": "ConvertJavaTextureToBedrock",
4-
"version": "3.0.4",
4+
"version": "3.1.0",
55
"description": "Convert Minecraft Java texture packs to Bedrock texture packs",
66
"keywords": [
77
"Minecraft",
@@ -46,7 +46,6 @@
4646
"webpack": "^4.39.2",
4747
"webpack-cli": "^3.3.7",
4848
"webpack-dev-server": "^3.8.2",
49-
"webpack-pwa-manifest": "^4.0.0",
5049
"worker-loader": "^2.0.0",
5150
"yargs": "^14.0.0"
5251
},

‎src/converter/DeleteConverter.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ class DeleteConverter extends AbstractConverter {
2626
*/
2727
static get DEFAULT_CONVERTER_DATA() {
2828
return [
29+
"assets/", // Speed up loading
30+
2931
"textures/blocks/conduit.png",
3032
"textures/entity/conduit/break_particle.png",
3133

‎src/converter/DespriteExperimentalConverter.js‎

Lines changed: 79 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@ class DespriteExperimentalConverter extends AbstractConverter {
2626

2727
const factor = (image_from.getWidth() / factor_detect);
2828

29-
for (const [x, y, width, height, to] of sprites) {
29+
for (const [x, y, width, height, to, empty_area_alternative] of sprites) {
3030
this.log.log(`Desprite ${to} (Experimental)`);
3131

32-
const image = image_from.clone().crop((x * factor), (y * factor), (width * factor), (height * factor));
32+
let image = image_from.clone().crop((x * factor), (y * factor), (width * factor), (height * factor));
33+
34+
if (image.isEmptyArea(0, 0, image.getWidth(), image.getHeight()) && empty_area_alternative) {
35+
image = image_from.clone().crop((empty_area_alternative[0] * factor), (empty_area_alternative[1] * factor), (empty_area_alternative[2] * factor), (empty_area_alternative[3] * factor));
36+
}
3337

3438
await this.writeImage(to, image);
3539
}
@@ -42,6 +46,16 @@ class DespriteExperimentalConverter extends AbstractConverter {
4246
*/
4347
static get DEFAULT_CONVERTER_DATA() {
4448
return [
49+
[
50+
"textures/gui/recipe_book.png",
51+
256,
52+
[
53+
[152, 41, 26, 16, "textures/ui/craft_toggle_off.png"],
54+
[152, 59, 26, 16, "textures/ui/craft_toggle_off_hover.png"],
55+
[180, 41, 26, 16, "textures/ui/craft_toggle_on.png"],
56+
[180, 59, 26, 16, "textures/ui/craft_toggle_on_hover.png"]
57+
]
58+
],
4559
[
4660
"textures/gui/widgets.png",
4761
256,
@@ -54,17 +68,67 @@ class DespriteExperimentalConverter extends AbstractConverter {
5468
"textures/gui/container/anvil.png",
5569
256,
5670
[
57-
[102, 48, 22, 15, "textures/ui/arrow_large.png"],
71+
[99, 45, 22, 15, "textures/ui/arrow_large.png"],
5872
[17, 7, 30, 30, "textures/ui/anvil_icon.png"],
59-
[53, 49, 13, 13, "textures/ui/anvil-plus.png"]
73+
[53, 49, 13, 13, "textures/ui/anvil-plus.png"],
74+
[176, 0, 28, 21, "textures/ui/crossout.png"]
75+
]
76+
],
77+
[
78+
"textures/gui/container/beacon.png",
79+
256,
80+
[
81+
[58, 108, 5, 18, "textures/ui/beacon_item_seperator_pocket.png"],
82+
[58, 108, 5, 18, "textures/ui/item_seperator.png"],
83+
[18, 22, 19, 22, "textures/ui/pyramid_level_1.png"],
84+
[18, 47, 19, 22, "textures/ui/pyramid_level_2.png"],
85+
[18, 72, 19, 22, "textures/ui/pyramid_level_3.png"],
86+
[158, 22, 19, 22, "textures/ui/pyramid_level_4.png"],
87+
[88, 219, 22, 22, "textures/ui/confirm.png"],
88+
[110, 219, 22, 22, "textures/ui/cancel.png"]
89+
]
90+
],
91+
[
92+
"textures/gui/container/brewing_stand.png",
93+
256,
94+
[
95+
[17, 17, 16, 16, "textures/ui/brewing_fuel_empty.png"],
96+
[56, 51, 16, 16, "textures/ui/bottle_empty.png"],
97+
[60, 43, 19, 6, "textures/ui/brewing_fuel_bar_empty.png"],
98+
[176, 29, 18, 4, "textures/ui/brewing_fuel_bar_full.png"],
99+
[63, 14, 12, 29, "textures/ui/bubbles_empty.png"],
100+
[185, 0, 12, 29, "textures/ui/bubbles_full.png"],
101+
[34, 28, 26, 20, "textures/ui/brewing_fuel_pipes.png"],
102+
[73, 34, 28, 23, "textures/ui/brewing_pipes.png"],
103+
[73, 34, 28, 23, "textures/ui/brewing_pipes_large.png"],
104+
[97, 16, 9, 28, "textures/ui/brewing_arrow_empty.png"],
105+
[97, 16, 9, 28, "textures/ui/brewing_arrow_large_empty.png"],
106+
[176, 0, 9, 28, "textures/ui/brewing_arrow_full.png"],
107+
[176, 0, 9, 28, "textures/ui/brewing_arrow_large_full.png"]
108+
]
109+
],
110+
[
111+
"textures/gui/container/enchanting_table.png",
112+
256,
113+
[
114+
[35, 47, 16, 16, "textures/ui/lapis.png"],
115+
[35, 47, 16, 16, "textures/ui/lapis_image.png"],
116+
[3, 225, 13, 11, "textures/ui/dust_selectable_1.png"],
117+
[19, 225, 13, 11, "textures/ui/dust_selectable_2.png"],
118+
[34, 225, 13, 11, "textures/ui/dust_selectable_3.png"],
119+
[3, 241, 13, 11, "textures/ui/dust_unselectable_1.png"],
120+
[19, 241, 13, 11, "textures/ui/dust_unselectable_2.png"],
121+
[34, 241, 13, 11, "textures/ui/dust_unselectable_3.png"]
60122
]
61123
],
62124
[
63125
"textures/gui/container/furnace.png",
64126
256,
65127
[
66-
[80, 35, 22, 15, "textures/ui/arrow_inactive.png"],
67-
[177, 14, 22, 15, "textures/ui/arrow_active.png"]
128+
[79, 35, 24, 17, "textures/ui/arrow_inactive.png"],
129+
[176, 14, 24, 17, "textures/ui/arrow_active.png"],
130+
[56, 36, 14, 14, "textures/ui/flame_empty_image.png"],
131+
[176, 0, 14, 14, "textures/ui/flame_full_image.png"]
68132
]
69133
],
70134
[
@@ -82,6 +146,15 @@ class DespriteExperimentalConverter extends AbstractConverter {
82146
[
83147
[135, 29, 16, 13, "textures/ui/arrow.png"]
84148
]
149+
],
150+
[
151+
"textures/gui/container/loom.png",
152+
256,
153+
[
154+
[176, 0, 16, 16, "textures/ui/loom_banner_empty.png", [13, 26, 16, 16]],
155+
[192, 0, 16, 16, "textures/ui/loom_dye_empty.png", [33, 26, 16, 16]],
156+
[208, 0, 16, 16, "textures/ui/loom_pattern_item_empty.png", [23, 45, 16, 16]]
157+
]
85158
]
86159
];
87160
}

‎src/converter/DialogConverter.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {AbstractConverter} from "./AbstractConverter";
2+
import Jimp from "jimp";
23

34
/**
45
* Class DialogConverter
@@ -41,7 +42,7 @@ class DialogConverter extends AbstractConverter {
4142
to_image.composite(await image.clone().crop((image.getWidth() - base_nineslice_size[2]), 0, base_nineslice_size[2], base_nineslice_size[1]).borderImage((2 * factor), (2 * factor), (2 * factor), (2 * factor), to_nineslice_size[2], to_nineslice_size[1]), (to_image.getWidth() - to_nineslice_size[2]), 0);
4243

4344
to_image.composite(await image.clone().crop(0, base_nineslice_size[1], base_nineslice_size[0], (image.getHeight() - base_nineslice_size[1] - base_nineslice_size[3])).borderImage((2 * factor), (2 * factor), (2 * factor), (2 * factor), to_nineslice_size[0], (to_image.getHeight() - to_nineslice_size[1] - to_nineslice_size[3])), 0, to_nineslice_size[1]);
44-
to_image.composite(await image.clone().crop(base_nineslice_size[0], base_nineslice_size[1], (image.getWidth() - base_nineslice_size[0] - base_nineslice_size[2]), (image.getHeight() - base_nineslice_size[1] - base_nineslice_size[3])).borderImage((2 * factor), (2 * factor), (2 * factor), (2 * factor), (to_image.getWidth() - to_nineslice_size[0] - to_nineslice_size[2]), (to_image.getHeight() - to_nineslice_size[1] - to_nineslice_size[3])), to_nineslice_size[0], to_nineslice_size[1]);
45+
to_image.composite(await image.clone().crop(base_nineslice_size[0], base_nineslice_size[1], (image.getWidth() - base_nineslice_size[0] - base_nineslice_size[2]), (image.getHeight() - base_nineslice_size[1] - base_nineslice_size[3])).resize(1, 1, Jimp.RESIZE_NEAREST_NEIGHBOR).resize((to_image.getWidth() - to_nineslice_size[0] - to_nineslice_size[2]), (to_image.getHeight() - to_nineslice_size[1] - to_nineslice_size[3]), Jimp.RESIZE_NEAREST_NEIGHBOR), to_nineslice_size[0], to_nineslice_size[1]);
4546
to_image.composite(await image.clone().crop((image.getWidth() - base_nineslice_size[2]), base_nineslice_size[1], base_nineslice_size[2], (image.getHeight() - base_nineslice_size[1] - base_nineslice_size[3])).borderImage((2 * factor), (2 * factor), (2 * factor), (2 * factor), to_nineslice_size[2], (to_image.getHeight() - to_nineslice_size[1] - to_nineslice_size[3])), (to_image.getWidth() - to_nineslice_size[2]), to_nineslice_size[1]);
4647

4748
to_image.composite(await image.clone().crop(0, (image.getHeight() - base_nineslice_size[3]), base_nineslice_size[0], base_nineslice_size[2]).borderImage((2 * factor), (2 * factor), (2 * factor), (2 * factor), to_nineslice_size[0], to_nineslice_size[3]), 0, (to_image.getHeight() - to_nineslice_size[3]));

‎src/converter/NineSliceConverter.js‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,20 @@ class NineSliceConverter extends AbstractConverter {
6666
*/
6767
static get DEFAULT_CONVERTER_DATA() {
6868
return [
69+
[
70+
"textures/gui/recipe_book.png",
71+
256,
72+
[
73+
[54, 206, 24, 24, 5, [
74+
"textures/ui/cell_image_red",
75+
"textures/ui/recipe_book_red_button",
76+
"textures/ui/recipe_book_red_button_pressed",
77+
"textures/ui/button_trade_red",
78+
"textures/ui/button_trade_red_pressed"
79+
]]
80+
],
81+
[]
82+
],
6983
[
7084
"textures/gui/widgets.png",
7185
256,
@@ -95,6 +109,9 @@ class NineSliceConverter extends AbstractConverter {
95109
"textures/ui/recipe_book_button_borderless_lightpressed",
96110
"textures/ui/recipe_book_dark_button_pressed",
97111
"textures/ui/recipe_book_light_button_pressed"
112+
]],
113+
[0, 22, 24, 24, 5, [
114+
"textures/ui/cell_image_invert"
98115
]]
99116
],
100117
[
@@ -106,12 +123,49 @@ class NineSliceConverter extends AbstractConverter {
106123
"textures/ui/world_screenshot_focus_border"
107124
]
108125
],
126+
[
127+
"textures/gui/container/beacon.png",
128+
256,
129+
[
130+
[0, 219, 22, 22, 5, [
131+
"textures/ui/beacon_button_default"
132+
]],
133+
[22, 219, 22, 22, 5, [
134+
"textures/ui/beacon_button_pressed"
135+
]],
136+
[44, 219, 22, 22, 5, [
137+
"textures/ui/beacon_button_locked"
138+
]],
139+
[66, 219, 22, 22, 5, [
140+
"textures/ui/beacon_button_hover"
141+
]]
142+
],
143+
[]
144+
],
145+
[
146+
"textures/gui/container/enchanting_table.png",
147+
256,
148+
[
149+
[0, 166, 108, 19, 5, [
150+
"textures/ui/enchanting_active_background"
151+
]],
152+
[0, 185, 108, 19, 5, [
153+
"textures/ui/enchanting_dark_background"
154+
]],
155+
[0, 204, 108, 19, 5, [
156+
"textures/ui/enchanting_active_background_with_hover_text"
157+
]]
158+
],
159+
[]
160+
],
109161
[
110162
"textures/gui/container/generic_54.png",
111163
256,
112164
[
113165
[7, 17, 18, 18, 5, [
114166
"textures/ui/cell_image",
167+
"textures/ui/cell_image_normal",
168+
"textures/ui/item_cell",
115169
"textures/ui/recipe_book_item_bg"
116170
]],
117171
[2, 2, 1, 1, 0, [

‎src/converter/RenameConverter.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class RenameConverter extends AbstractConverter {
3131

3232
// Base folder
3333
["assets/minecraft/textures/", "textures/"],
34+
["assets/minecraft/sounds/", "sounds/"],
3435

3536
// Folder
3637
["textures/block/", "textures/blocks/"],

‎webpack.config.webapp.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = {
2929
test: /worker\.js$/,
3030
loader: "worker-loader",
3131
options: {
32-
name: "[name].[contenthash].[ext]"
32+
name: "[name].[ext]?h=[contenthash]"
3333
}
3434
}
3535
]
@@ -38,7 +38,7 @@ module.exports = {
3838
minimizer: (isDebug ? [] : [new TerserJSPlugin({}), new OptimizeCSSAssetsPlugin()]),
3939
},
4040
output: {
41-
filename: "[name].[contenthash].js",
41+
filename: "[name].js?h=[contenthash]",
4242
path: __dirname + "/dist/webapp",
4343
globalObject: "this" // Fix worker
4444
},
@@ -56,7 +56,7 @@ module.exports = {
5656
template: "./src/webapp/html/index.html"
5757
}),
5858
new MiniCssExtractPlugin({
59-
filename: "[name].[contenthash].css",
59+
filename: "[name].css?h=[contenthash]",
6060
}),
6161
new FaviconsWebpackPlugin({
6262
devMode: "webapp",

0 commit comments

Comments
 (0)