1.13.4 • Published 5 years ago

@ozelot379/convert-java-texture-to-bedrock v1.13.4

Weekly downloads
-
License
GPL-3.0-only
Repository
github
Last release
5 years ago

THIS PROJECT IS NO OFFICIAL MINECRAFT PRODUCT - NOT AUTHORIZED OR ASSOCIATED BY MOJANG


Convert Minecraft Java texture packs to Minecraft Bedrock texture packs

Look at https://ozelot379.github.io/ConvertJavaTextureToBedrock

It works directly in your browser

It supports currently the follow Minecraft versions:

MinecraftVersion
Javav1.13.x or v1.14.x
Bedrockv1.13.x

Currently it supports to convert blocks, items, entities, paintings, particles, map icons and mob effects textures

Some conversions of HD texture packs may takes a while

This project is inspired by the no longer continued PCTexture2PE

CLI

As an alternative you can also use the cli version

First be sure you have installed NodeJS (At least the LTS version) and install Yarn

Then install this global so you can use the binary

yarn global add @ozelot379/convert-java-texture-to-bedrock

You can now convert your texture packs like

ConvertJavaTextureToBedrock -i input/java_texture_pack.zip -o output/bedrock_texture_pack.mcpack
ParameterDescription
-i (Required)Input folder or zip path
-o (Required)Output folder or zip path
-lShow log (Default true)

Known issues

  • Convert horse textures is very tricky and may buggy
  • Convert weather textures (rain and snow) may not works (seems to be an other format as the default)

Extras (for texture pack creators)

UUID

You can create the bedrock_uuid_header and bedrock_uuid_module files in your input, to keep the same uuid on repeating conversions - otherwise, random uuids are generated each time and you need to reselect the texture pack again in the game

Custom textures

You can put custom textures in a bedrock_textures folder in your input

For instance for textures, that can not be converted or are not converted correctly

This files are applied additionally before output

Debug and build

First clone this repo and install the dependencies

yarn

Then you can start the debug

cli:

yarn debug:cli

webapp:

yarn debug:webapp

You can create a build

yarn build

How this work

This project uses the follow main features or external libraries:

  • Web Worker for convert it in the background to not freeze the gui
  • jszip for read, modify and write zip files
  • jimp for graphic manipulation
  • file-saver for deliver the converted pack to download
  • webpack for bundle the dist code
  • gh-pages for publish a new version to the github static page

Use it direct in your code

Add it as a dependency to your package.json

yarn add @ozelot379/convert-java-texture-to-bedrock

Import it in your code, if you use webpack

import ConvertJavaTextureToBedrock, {ConsoleLog, Input, LocalFileInputEntry, LocalFileOutput} from "@ozelot379/convert-java-texture-to-bedrock";

or require it if you use native NodeJs

const {default: ConvertJavaTextureToBedrock, ConsoleLog, Input, LocalFileInputEntry, LocalFileOutput} = require("@ozelot379/convert-java-texture-to-bedrock");

You can now convert your texture packs in an async function

let output;
try {
    output = await new ConvertJavaTextureToBedrock(input, output, log).convert();
} catch (err) {

}

or self handle the Promise

new ConvertJavaTextureToBedrock(input, output, log).convert().then((output) => {}).catch((err) => {});

Input

ImportDescription
InputThe input consists on one input entry (Common)
ArrayInputThe input consists on multiple input entries (For instance a selected folder with multiple FileInputEntry)
AbstractInputBase input

Input entry

ImportFor type
BufferInputEntryArrayBufferBlobBufferUint8Array
FileInputEntryFile
LocalFileInputEntryLocal file
LocalFolderInputEntryLocal folder
AbstractInputEntryBase input entry

Output

ImportFor type
ArrayBufferOutputArrayBuffer
BlobOutputBlob
BufferOutputBuffer
FileBlobOutputFile
LocalFileOutputLocal file
LocalFolderOutputLocal folder
Uint8ArrayOutputUint8Array
AbstractOutputBase output

Log

ImportDescription
ConsoleLogLog to console
SlientLogDisable log
AbstractLogBase log

Example

import ConvertJavaTextureToBedrock, {ConsoleLog, Input, LocalFileInputEntry, LocalFileOutput} from "@ozelot379/convert-java-texture-to-bedrock";

(async () => {
    let output;

    try {
        output = await new ConvertJavaTextureToBedrock(new Input(new LocalFileInputEntry("input/java_texture_pack.zip")), new LocalFileOutput("output/bedrock_texture_pack.mcpack"), new ConsoleLog()).convert();
    } catch (err) {
        console.log(err);

        return;
    }

    console.log(`Output: ${output}`);
})();
1.13.4

5 years ago