Skip to content

Commit

Permalink
Merge pull request #517 from bernie-g/master
Browse files Browse the repository at this point in the history
GeckoLib: fix armor template
  • Loading branch information
JannisX11 authored Apr 30, 2024
2 parents 5408d87 + 0d01b8c commit 5977f79
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 26 deletions.
6 changes: 4 additions & 2 deletions plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,10 @@
"author": "Eliot Lash, Gecko, McHorse, AzureDoom, Tslat",
"icon": "movie_filter",
"description": "Create animated blocks, items, entity, and armor using the GeckoLib library and plugin. https://github.com/bernie-g/geckolib/wiki",
"tags": ["Minecraft: Java Edition"],
"version": "3.0.7",
"tags": [
"Minecraft: Java Edition"
],
"version": "3.0.8",
"min_version": "4.0.0",
"await_loading": true,
"variant": "both",
Expand Down
4 changes: 2 additions & 2 deletions plugins/animation_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ const getIcon = (name) => {
/*! exports provided: meta, name, geo_name, resolution, elements, outliner, textures, default */
/***/ (function(module) {

module.exports = JSON.parse("{\"meta\":{\"format_version\":\"3.2\",\"model_format\":\"animated_entity_model\",\"box_uv\":true},\"name\":\"CustomArmor\",\"geo_name\":\"CustomArmor\",\"resolution\":{\"width\":64,\"height\":64},\"elements\":[{\"name\":\"dontTouch\",\"from\":[-4,24,-4],\"to\":[4,32,4],\"autouv\":1,\"color\":0,\"export\":false,\"locked\":true,\"origin\":[0,0,0],\"uuid\":\"9675593e-b27d-b70e-e1ea-1fc29f46a294\"},{\"name\":\"dontTouch\",\"from\":[-4,12,-2],\"to\":[4,24,2],\"autouv\":1,\"color\":0,\"export\":false,\"locked\":true,\"origin\":[0,24,0],\"uuid\":\"fa43156a-2a62-948c-082f-483d525f6d1f\"},{\"name\":\"dontTouch\",\"from\":[4,12,-2],\"to\":[8,24,2],\"autouv\":1,\"color\":0,\"export\":false,\"locked\":true,\"origin\":[4,22,0],\"uuid\":\"aa51170c-8b32-fb62-71f1-58ac0b7785a8\"},{\"name\":\"dontTouch\",\"from\":[-8,12,-2],\"to\":[-4,24,2],\"autouv\":1,\"color\":0,\"export\":false,\"locked\":true,\"origin\":[4,22,0],\"uuid\":\"bf2c2539-20e3-cfcc-94c0-491734019889\"},{\"name\":\"dontTouch\",\"from\":[-4,0,-2],\"to\":[0,12,2],\"autouv\":1,\"color\":0,\"export\":false,\"locked\":true,\"origin\":[4,22,0],\"uuid\":\"17b9bae0-356a-9bba-fad9-4672e2671191\"},{\"name\":\"dontTouch\",\"from\":[0,0,-2],\"to\":[4,12,2],\"autouv\":1,\"color\":0,\"export\":false,\"locked\":true,\"origin\":[4,22,0],\"uuid\":\"7b31bac4-dc40-2b93-1204-7bbdcfe7d924\"}],\"outliner\":[{\"name\":\"bipedHead\",\"uuid\":\"d340b6fa-56aa-9c0f-3560-7a067643b77d\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[0,24,0],\"children\":[\"9675593e-b27d-b70e-e1ea-1fc29f46a294\",{\"name\":\"armorHead\",\"uuid\":\"6ab88dea-c816-d2bb-6be9-05ed7838da97\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[0,24,0],\"children\":[]}]},{\"name\":\"bipedBody\",\"uuid\":\"ce5b366c-fd87-41ae-9a73-e0a4d4b05f8d\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[0,24,0],\"children\":[\"fa43156a-2a62-948c-082f-483d525f6d1f\",{\"name\":\"armorBody\",\"uuid\":\"282fcdbb-8ea9-4a13-4154-f2ed20d696c8\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[0,24,0],\"children\":[]}]},{\"name\":\"bipedLeftArm\",\"uuid\":\"d8113cc7-7e10-0930-259e-b8e4211ce9da\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[4,22,0],\"children\":[\"aa51170c-8b32-fb62-71f1-58ac0b7785a8\",{\"name\":\"armorLeftArm\",\"uuid\":\"c5300e23-fd2f-b56c-3552-45d6650e11c6\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[4,22,0],\"children\":[]}]},{\"name\":\"bipedRightArm\",\"uuid\":\"3b8901e8-3420-0834-51eb-76d64ff2ae8f\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[-4,22,0],\"children\":[\"bf2c2539-20e3-cfcc-94c0-491734019889\",{\"name\":\"armorRightArm\",\"uuid\":\"b0d41a53-f4ce-53c1-f899-5a2048c90ac2\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[-4,22,0],\"children\":[]}]},{\"name\":\"bipedLeftLeg\",\"uuid\":\"37231be7-a8ef-22ca-7fea-40aed58003bb\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[2,12,0],\"children\":[\"17b9bae0-356a-9bba-fad9-4672e2671191\",{\"name\":\"armorLeftLeg\",\"uuid\":\"e4b19746-2d17-1f56-befe-00718165ae50\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[2,12,0],\"children\":[]},{\"name\":\"armorLeftBoot\",\"uuid\":\"9fe26b9a-ad66-9e6b-2fa2-4168e333b4be\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[2,12,0],\"children\":[]}]},{\"name\":\"bipedRightLeg\",\"uuid\":\"45c031a5-b6be-e0a7-5454-b45d07f28429\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[-2,12,0],\"children\":[\"7b31bac4-dc40-2b93-1204-7bbdcfe7d924\",{\"name\":\"armorRightLeg\",\"uuid\":\"60238f18-e74b-c863-cb45-2e2f162221bd\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[-2,12,0],\"children\":[]},{\"name\":\"armorRightBoot\",\"uuid\":\"eb3db34b-ccfe-dae9-ac4d-4e22c3222f70\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[-2,12,0],\"children\":[]}]}],\"textures\":[]}");
module.exports = JSON.parse("{\"meta\":{\"format_version\":\"3.2\",\"model_format\":\"animated_entity_model\",\"box_uv\":true},\"name\":\"CustomArmor\",\"geo_name\":\"CustomArmor\",\"resolution\":{\"width\":64,\"height\":64},\"elements\":[{\"name\":\"dontTouch\",\"from\":[-4,24,-4],\"to\":[4,32,4],\"autouv\":1,\"color\":0,\"export\":false,\"locked\":true,\"origin\":[0,0,0],\"uuid\":\"9675593e-b27d-b70e-e1ea-1fc29f46a294\"},{\"name\":\"dontTouch\",\"from\":[-4,12,-2],\"to\":[4,24,2],\"autouv\":1,\"color\":0,\"export\":false,\"locked\":true,\"origin\":[0,24,0],\"uuid\":\"fa43156a-2a62-948c-082f-483d525f6d1f\"},{\"name\":\"dontTouch\",\"from\":[4,12,-2],\"to\":[8,24,2],\"autouv\":1,\"color\":0,\"export\":false,\"locked\":true,\"origin\":[4,22,0],\"uuid\":\"aa51170c-8b32-fb62-71f1-58ac0b7785a8\"},{\"name\":\"dontTouch\",\"from\":[-8,12,-2],\"to\":[-4,24,2],\"autouv\":1,\"color\":0,\"export\":false,\"locked\":true,\"origin\":[4,22,0],\"uuid\":\"bf2c2539-20e3-cfcc-94c0-491734019889\"},{\"name\":\"dontTouch\",\"from\":[-4,0,-2],\"to\":[0,12,2],\"autouv\":1,\"color\":0,\"export\":false,\"locked\":true,\"origin\":[4,22,0],\"uuid\":\"17b9bae0-356a-9bba-fad9-4672e2671191\"},{\"name\":\"dontTouch\",\"from\":[0,0,-2],\"to\":[4,12,2],\"autouv\":1,\"color\":0,\"export\":false,\"locked\":true,\"origin\":[4,22,0],\"uuid\":\"7b31bac4-dc40-2b93-1204-7bbdcfe7d924\"}],\"outliner\":[{\"name\":\"bipedHead\",\"uuid\":\"d340b6fa-56aa-9c0f-3560-7a067643b77d\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[0,24,0],\"children\":[\"9675593e-b27d-b70e-e1ea-1fc29f46a294\",{\"name\":\"armorHead\",\"uuid\":\"6ab88dea-c816-d2bb-6be9-05ed7838da97\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[0,24,0],\"children\":[]}]},{\"name\":\"bipedBody\",\"uuid\":\"ce5b366c-fd87-41ae-9a73-e0a4d4b05f8d\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[0,24,0],\"children\":[\"fa43156a-2a62-948c-082f-483d525f6d1f\",{\"name\":\"armorBody\",\"uuid\":\"282fcdbb-8ea9-4a13-4154-f2ed20d696c8\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[0,24,0],\"children\":[]}]},{\"name\":\"bipedRightArm\",\"uuid\":\"d8113cc7-7e10-0930-259e-b8e4211ce9da\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[4,22,0],\"children\":[\"aa51170c-8b32-fb62-71f1-58ac0b7785a8\",{\"name\":\"armorRightArm\",\"uuid\":\"c5300e23-fd2f-b56c-3552-45d6650e11c6\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[4,22,0],\"children\":[]}]},{\"name\":\"bipedLeftArm\",\"uuid\":\"3b8901e8-3420-0834-51eb-76d64ff2ae8f\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[-4,22,0],\"children\":[\"bf2c2539-20e3-cfcc-94c0-491734019889\",{\"name\":\"armorLeftArm\",\"uuid\":\"b0d41a53-f4ce-53c1-f899-5a2048c90ac2\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[-4,22,0],\"children\":[]}]},{\"name\":\"bipedLeftLeg\",\"uuid\":\"37231be7-a8ef-22ca-7fea-40aed58003bb\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[2,12,0],\"children\":[\"17b9bae0-356a-9bba-fad9-4672e2671191\",{\"name\":\"armorLeftLeg\",\"uuid\":\"e4b19746-2d17-1f56-befe-00718165ae50\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[2,12,0],\"children\":[]},{\"name\":\"armorLeftBoot\",\"uuid\":\"9fe26b9a-ad66-9e6b-2fa2-4168e333b4be\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[2,12,0],\"children\":[]}]},{\"name\":\"bipedRightLeg\",\"uuid\":\"45c031a5-b6be-e0a7-5454-b45d07f28429\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[-2,12,0],\"children\":[\"7b31bac4-dc40-2b93-1204-7bbdcfe7d924\",{\"name\":\"armorRightLeg\",\"uuid\":\"60238f18-e74b-c863-cb45-2e2f162221bd\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[-2,12,0],\"children\":[]},{\"name\":\"armorRightBoot\",\"uuid\":\"eb3db34b-ccfe-dae9-ac4d-4e22c3222f70\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[-2,12,0],\"children\":[]}]}],\"textures\":[]}");

/***/ }),

Expand Down Expand Up @@ -8305,7 +8305,7 @@ module.exports = function(module) {
/*! exports provided: name, version, private, description, main, scripts, author, license, blockbenchConfig, sideEffects, devDependencies, dependencies, default */
/***/ (function(module) {

module.exports = JSON.parse("{\"name\":\"animation_utils\",\"version\":\"3.0.7\",\"private\":true,\"description\":\"GeckoLib Animation Utils\",\"main\":\"index.js\",\"scripts\":{\"build\":\"webpack && node scripts/updateManifest.js\",\"start\":\"webpack --watch --mode=development\",\"lint\":\"eslint .\",\"lint:fix\":\"eslint --fix .\",\"pretest\":\"npm run lint\",\"test\":\"echo \\\"Error: no test specified\\\" && exit 1\"},\"author\":\"Eliot Lash, Gecko, McHorse, AzureDoom\",\"license\":\"MIT\",\"blockbenchConfig\":{\"title\":\"GeckoLib Animation Utils\",\"author\":\"Eliot Lash, Gecko, McHorse, AzureDoom, Tslat\",\"icon\":\"movie_filter\",\"description\":\"Create animated blocks, items, entity, and armor using the GeckoLib library and plugin. https://github.com/bernie-g/geckolib/wiki\",\"min_version\":\"4.0.0\",\"max_version\":\"5.0.0\",\"variant\":\"both\"},\"sideEffects\":[\"./index.js\"],\"devDependencies\":{\"eol\":\"0.9.1\",\"eslint\":\"7.7.0\",\"webpack\":\"4.43.0\",\"webpack-cli\":\"3.3.12\"},\"dependencies\":{\"lodash\":\"^4.17.21\",\"semver\":\"7.3.2\"}}");
module.exports = JSON.parse("{\"name\":\"animation_utils\",\"version\":\"3.0.8\",\"private\":true,\"description\":\"GeckoLib Animation Utils\",\"main\":\"index.js\",\"scripts\":{\"build\":\"webpack && npm run update_manifest\",\"update_manifest\":\"node scripts/updateManifest.js\",\"start\":\"webpack --watch --mode=development\",\"lint\":\"eslint .\",\"lint:fix\":\"eslint --fix .\",\"pretest\":\"npm run lint\",\"test\":\"echo \\\"Error: no test specified\\\" && exit 1\"},\"author\":\"Eliot Lash, Gecko, McHorse, AzureDoom, Tslat\",\"license\":\"MIT\",\"blockbenchConfig\":{\"title\":\"GeckoLib Animation Utils\",\"author\":\"Eliot Lash, Gecko, McHorse, AzureDoom, Tslat\",\"icon\":\"movie_filter\",\"description\":\"Create animated blocks, items, entity, and armor using the GeckoLib library and plugin. https://github.com/bernie-g/geckolib/wiki\",\"min_version\":\"4.0.0\",\"max_version\":\"5.0.0\",\"variant\":\"both\"},\"sideEffects\":[\"./index.js\"],\"devDependencies\":{\"eol\":\"0.9.1\",\"eslint\":\"7.7.0\",\"webpack\":\"4.43.0\",\"webpack-cli\":\"3.3.12\",\"indent-string\":\"^5.0.0\"},\"dependencies\":{\"lodash\":\"^4.17.21\",\"semver\":\"7.3.2\"}}");

/***/ }),

Expand Down
8 changes: 4 additions & 4 deletions src/animation_utils/armorTemplate.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
]
},
{
"name": "bipedLeftArm",
"name": "bipedRightArm",
"uuid": "d8113cc7-7e10-0930-259e-b8e4211ce9da",
"export": true,
"isOpen": true,
Expand All @@ -230,7 +230,7 @@
"children": [
"aa51170c-8b32-fb62-71f1-58ac0b7785a8",
{
"name": "armorLeftArm",
"name": "armorRightArm",
"uuid": "c5300e23-fd2f-b56c-3552-45d6650e11c6",
"export": true,
"isOpen": true,
Expand All @@ -248,7 +248,7 @@
]
},
{
"name": "bipedRightArm",
"name": "bipedLeftArm",
"uuid": "3b8901e8-3420-0834-51eb-76d64ff2ae8f",
"export": true,
"isOpen": true,
Expand All @@ -262,7 +262,7 @@
"children": [
"bf2c2539-20e3-cfcc-94c0-491734019889",
{
"name": "armorRightArm",
"name": "armorLeftArm",
"uuid": "b0d41a53-f4ce-53c1-f899-5a2048c90ac2",
"export": true,
"isOpen": true,
Expand Down
17 changes: 17 additions & 0 deletions src/animation_utils/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions src/animation_utils/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
{
"name": "animation_utils",
"version": "3.0.7",
"version": "3.0.8",
"private": true,
"description": "GeckoLib Animation Utils",
"main": "index.js",
"scripts": {
"build": "webpack && node scripts/updateManifest.js",
"build": "webpack && npm run update_manifest",
"update_manifest": "node scripts/updateManifest.js",
"start": "webpack --watch --mode=development",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"pretest": "npm run lint",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Eliot Lash, Gecko, McHorse, AzureDoom",
"author": "Eliot Lash, Gecko, McHorse, AzureDoom, Tslat",
"license": "MIT",
"blockbenchConfig": {
"title": "GeckoLib Animation Utils",
Expand All @@ -30,7 +31,8 @@
"eol": "0.9.1",
"eslint": "7.7.0",
"webpack": "4.43.0",
"webpack-cli": "3.3.12"
"webpack-cli": "3.3.12",
"indent-string": "^5.0.0"
},
"dependencies": {
"lodash": "^4.17.21",
Expand Down
46 changes: 32 additions & 14 deletions src/animation_utils/scripts/updateManifest.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,37 @@
const fs = require('fs');
const eol = require('eol');
const { version, blockbenchConfig } = require('../package.json');
const PACKAGE_MANIFEST_PATH = '../../plugins.json';
const manifest = require(`../${PACKAGE_MANIFEST_PATH}`);
(async () => {
const indentString = (await import('indent-string')).default;
const path = require('path');
const fs = require('fs');
const eol = require('eol');
const url = require('url');
// @ts-ignore

// console.log({ version, blockbenchConfig });
const PACKAGE_JSON_PATH = './package.json'
const PLUGINS_MANIFEST_PATH = '../../plugins.json'

Object.assign(
manifest.animation_utils,
{ version },
blockbenchConfig,
);
const pluginsString = fs.readFileSync(PLUGINS_MANIFEST_PATH, { encoding: 'utf8' });
const pluginsObj = JSON.parse(pluginsString);

fs.writeFileSync(PACKAGE_MANIFEST_PATH, eol.crlf(JSON.stringify(manifest, null, '\t')));
const packageJsonString = fs.readFileSync(PACKAGE_JSON_PATH, { encoding: 'utf8' });
const { version, blockbenchConfig } = JSON.parse(packageJsonString);

// console.log('manifest', manifest);
// console.log({ version, blockbenchConfig });

// console.log(`Wrote manifest to ${PACKAGE_MANIFEST_PATH}.`);
const newAnimationUtilsManifest = Object.assign(
{},
pluginsObj.animation_utils,
{ version },
blockbenchConfig,
);
const newAnimationUtilsManifestString =
indentString(
JSON.stringify(newAnimationUtilsManifest, null, '\t'),
1,
{ indent: '\t' }
)
.trimStart();

const newPluginsString = pluginsString.replace(/("animation_utils":\s*)({[\s\S.]*?})/, `$1${newAnimationUtilsManifestString}`);

fs.writeFileSync(PLUGINS_MANIFEST_PATH, eol.lf(newPluginsString));
})();

0 comments on commit 5977f79

Please sign in to comment.