Build/porting tools updated. Updater info updated.

This commit is contained in:
stfwi 2019-07-02 20:45:03 +02:00
parent 0748d9fec4
commit 973da5d4b3
8 changed files with 171 additions and 5 deletions

View file

@ -24,7 +24,7 @@ wildcardr=$(foreach d,$(wildcard $1*),$(call wildcardr,$d/,$2) $(filter $(subst
# #
# Targets # Targets
# #
.PHONY: default mod init clean clean-all mrproper all run install sanatize dist-check dist start-server .PHONY: default mod init clean clean-all mrproper all run install sanatize dist-check dist start-server assets
default: mod default: mod
@ -76,3 +76,8 @@ dist: sanatize dist-check clean-all mod
@mkdir -p dist @mkdir -p dist
@cp build/libs/$(MOD_JAR_PREFIX)* dist/ @cp build/libs/$(MOD_JAR_PREFIX)* dist/
@djs tasks.js dist @djs tasks.js dist
assets:
@echo "[1.14] Running asset generators ..."
@djs tasks.js create-slab-assets
@djs tasks.js create-half-slab-assets

View file

@ -0,0 +1,61 @@
#!/usr/bin/djs
// run from tasks.js directory
"use strict";
(function(constants, libassets){
const me = {};
const modid = constants.mod_registry_name();
const assets_root = constants.local_assets_root();
const hexchar = ['0','1','2','3','4','5','6','7','8','9','a','b','c','d','e']; // ('a'+parts) won't work so here we go
const create_item_model = function(prefix, texture) {
const model = {
parent: modid+":block/slab/generic/halfslab_inventory_model",
textures: { all: texture }
}
const path = "models/item/halfslab_"+prefix+".json";
if(!fs.writefile(path, JSON.stringify(model))) {
throw new Error("Failed to write item model file '"+ path +"'");
}
};
const create_block_models = function(prefix, texture) {
for(var parts=0; parts<15; ++parts) {
const model = {
parent: modid+":block/slab/generic/halfslab_s"+hexchar[parts]+"_model",
textures: { all:texture }
}
const path = "models/block/slab/specific/halfslab_"+prefix+"_s"+hexchar[parts]+"_model.json";
if(!fs.writefile(path, JSON.stringify(model))) {
throw new Error("Failed to write model file '"+ path +"'");
}
}
};
const create_blockstate = function(prefix) {
var variants = {};
for(var parts=0; parts<15; ++parts) {
variants[ ("parts="+parts).replace(/[\s]/g,"") ] = {
model: (modid+":block/slab/specific/halfslab_"+prefix+"_s"+hexchar[parts]+"_model").replace(/[\s]/g,"")
}
}
const path = "blockstates/halfslab_"+prefix+".json";
if(!fs.writefile(path, JSON.stringify({variants:variants},null,1))) throw new Error("Failed to write blockstate '"+path+"'");
return path;
};
me.create = function(data) {
const here = fs.cwd()
const registry_name_prefix = data.name_prefix;
const texture = data.texture;
if(!fs.chdir(assets_root)) throw new Error("Could not switch to assets root folder: '" + assets_root + "'");
try {
create_block_models(registry_name_prefix, texture);
create_item_model(registry_name_prefix, texture);
create_blockstate(registry_name_prefix, texture);
} finally {
fs.chdir(here);
}
}
Object.freeze(me);
return me;
});

View file

@ -0,0 +1,64 @@
#!/usr/bin/djs
// run from tasks.js directory
"use strict";
(function(constants, libassets){
const me = {};
const modid = constants.mod_registry_name();
const assets_root = constants.local_assets_root();
const create_item_model = function(prefix, texture_prefix) {
const model = {
parent: modid+":block/slab/generic/slab_inventory_model",
textures: { all: modid+":block/"+texture_prefix+"0" }
}
const path = "models/item/"+prefix+"_slab.json";
if(!fs.writefile(path, JSON.stringify(model))) {
throw new Error("Failed to write item model file '"+ path +"'");
}
};
const create_block_models = function(prefix, texture_prefix) {
for(var parts=0; parts<3; ++parts) {
for(var tvariant=0; tvariant<4; ++tvariant) {
const model = {
parent: modid+":block/slab/generic/slab_s"+parts+"_model",
textures: { all: modid+":block/"+texture_prefix+tvariant }
}
const path = "models/block/slab/specific/"+prefix+"_slab_s"+parts+"v"+tvariant+"_model.json";
if(!fs.writefile(path, JSON.stringify(model))) {
throw new Error("Failed to write model file '"+ path +"'");
}
}
}
};
const create_blockstate = function(prefix) {
var variants = {};
for(var parts=0; parts<3; ++parts) {
for(var tvariant=0; tvariant<4; ++tvariant) {
variants[ ("parts="+parts+",tvariant="+tvariant).replace(/[\s]/g,"") ] = {
model: (modid+":block/slab/specific/"+prefix+"_slab_s"+parts+"v"+tvariant+"_model").replace(/[\s]/g,"")
}
}
}
const path = "blockstates/"+prefix+"_slab.json";
if(!fs.writefile(path, JSON.stringify({variants:variants},null,1))) throw new Error("Failed to write blockstate '"+path+"'");
return path;
};
me.create = function(prefixes) {
const here = fs.cwd()
const registry_name_prefix = prefixes.name_prefix;
const texture_prefix = prefixes.texture_prefix;
if(!fs.chdir(assets_root)) throw new Error("Could not switch to assets root folder: '" + assets_root + "'");
try {
create_block_models(registry_name_prefix, texture_prefix);
create_item_model(registry_name_prefix, texture_prefix);
create_blockstate(registry_name_prefix, texture_prefix);
} finally {
fs.chdir(here);
}
}
Object.freeze(me);
return me;
});

View file

@ -1,6 +1,7 @@
{ {
"homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/", "homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/",
"1.14.2": { "1.14.2": {
"1.0.8-b3": "[A] Ported slabs and slab slices from 1.12.2.\n[A] IE independent (\"standalone\") recipes ported.",
"1.0.8-b2": "[U] Updated to Forge BETA 1.14.2-26.0.63/20190621-1.14.2, code adapted to new mappings.\n[M] Updated 1st/3rd person item model rotations/translations.", "1.0.8-b2": "[U] Updated to Forge BETA 1.14.2-26.0.63/20190621-1.14.2, code adapted to new mappings.\n[M] Updated 1st/3rd person item model rotations/translations.",
"1.0.8-b1": "[V] Feature set of 1.12 ported.\n[A] CTRL-SHIFT tooltips ported.\n[A] Ported stained clinker block/stairs.\n[M] Updated textures.\n[I] Issue: Scoped recipe constants still not working.", "1.0.8-b1": "[V] Feature set of 1.12 ported.\n[A] CTRL-SHIFT tooltips ported.\n[A] Ported stained clinker block/stairs.\n[M] Updated textures.\n[I] Issue: Scoped recipe constants still not working.",
"1.0.7-b5": "[U] Updated to Forge BETA 1.14.2-26.0.35/20190608-1.14.2.\n[A] Factory dropper functionality ported.\n[A] Small lab furnace functionality ported.\n[A] Small electrical lab furnace functionality ported.\n[A] Small waste incinerator functionality ported.\n[A] Fluid valves, Passive Fluid Accumulator ported.\n[I] Issue: Scoped recipe constants still not working.", "1.0.7-b5": "[U] Updated to Forge BETA 1.14.2-26.0.35/20190608-1.14.2.\n[A] Factory dropper functionality ported.\n[A] Small lab furnace functionality ported.\n[A] Small electrical lab furnace functionality ported.\n[A] Small waste incinerator functionality ported.\n[A] Fluid valves, Passive Fluid Accumulator ported.\n[I] Issue: Scoped recipe constants still not working.",
@ -9,6 +10,6 @@
}, },
"promos": { "promos": {
"1.14.2-recommended": "", "1.14.2-recommended": "",
"1.14.2-latest": "1.0.8-b2" "1.14.2-latest": "1.0.8-b3"
} }
} }

View file

@ -10,7 +10,8 @@ Mod sources for Minecraft version 1.14.2.
---- ----
## Version history ## Version history
~ v1.0.8-b3 [U] - v1.0.8-b3 [A] Ported slabs and slab slices from 1.12.2.
[A] IE independent ("standalone") recipes ported.
- v1.0.8-b2 [U] Updated to Forge BETA 1.14.2-26.0.63/20190621-1.14.2, - v1.0.8-b2 [U] Updated to Forge BETA 1.14.2-26.0.63/20190621-1.14.2,
code adapted to new mappings. code adapted to new mappings.

View file

@ -10,4 +10,36 @@ tasks["sync-languages"] = function() {
liblang.sync_languages(); liblang.sync_languages();
}; };
tasks["create-slab-assets"] = function() {
const libassets = include("../meta/lib/libassets.js")(constants);
const slab_assets = include("meta/lib/slab_assets.js")(constants, libassets);
const block_prefixes = [
{ name_prefix:"clinker_brick", texture_prefix:"clinker_brick/clinker_brick_texture" },
{ name_prefix:"clinker_brick_stained", texture_prefix:"clinker_brick/clinker_brick_stained_texture" },
{ name_prefix:"panzerglass", texture_prefix:"glass/panzerglass_block_texture" },
{ name_prefix:"rebar_concrete", texture_prefix:"concrete/rebar_concrete_texture" },
{ name_prefix:"rebar_concrete_tile", texture_prefix:"concrete/rebar_concrete_tile_texture" },
{ name_prefix:"slag_brick", texture_prefix:"slag_brick/slag_brick_texture" },
];
for(var i in block_prefixes) slab_assets.create(block_prefixes[i]);
}
tasks["create-half-slab-assets"] = function() {
const libassets = include("../meta/lib/libassets.js")(constants);
const halfslab_assets = include("meta/lib/halfslab_assets.js")(constants, libassets);
const modid = constants.mod_registry_name();
const block_data = [
{ name_prefix:"rebar_concrete", texture:modid+":block/concrete/rebar_concrete_texture0" },
{ name_prefix:"concrete", texture:modid+":block/ieoriginal/ie_stone_decoration_concrete" },
{ name_prefix:"treated_wood", texture:"immersiveengineering:blocks/treated_wood" },
{ name_prefix:"sheetmetal_iron", texture:"immersiveengineering:blocks/sheetmetal_iron" },
{ name_prefix:"sheetmetal_steel", texture:"immersiveengineering:blocks/sheetmetal_steel" },
{ name_prefix:"sheetmetal_copper", texture:"immersiveengineering:blocks/sheetmetal_copper" },
{ name_prefix:"sheetmetal_gold", texture:"immersiveengineering:blocks/sheetmetal_gold" },
{ name_prefix:"sheetmetal_aluminum", texture:"immersiveengineering:blocks/sheetmetal_aluminum" },
// { name_prefix:"clinker_brick", texture:modid+":block/clinker_brick/clinker_brick_texture0" }
];
for(var i in block_data) halfslab_assets.create(block_data[i]);
}
libtask.run(tasks, sys.args); libtask.run(tasks, sys.args);

View file

@ -2,6 +2,7 @@
(function(){ (function(){
var c = {}; var c = {};
c.mod_registry_name = function() { return "engineersdecor" } c.mod_registry_name = function() { return "engineersdecor" }
c.local_assets_root = function() { return "src/main/resources/assets/" + c.mod_registry_name(); }
c.reference_repository = function() { return "git@github.com:stfwi/engineers-decor.git"; } c.reference_repository = function() { return "git@github.com:stfwi/engineers-decor.git"; }
c.gradle_property_modversion = function() { return "version_engineersdecor"; } c.gradle_property_modversion = function() { return "version_engineersdecor"; }
c.gradle_property_version_minecraft = function() { return "version_minecraft"; } c.gradle_property_version_minecraft = function() { return "version_minecraft"; }

View file

@ -60,6 +60,7 @@
"1.0.0-a1": "[A] Initial port to 1.13.2 with Forge beta." "1.0.0-a1": "[A] Initial port to 1.13.2 with Forge beta."
}, },
"1.14.2": { "1.14.2": {
"1.0.8-b3": "[A] Ported slabs and slab slices from 1.12.2.\n[A] IE independent (\"standalone\") recipes ported.",
"1.0.8-b2": "[U] Updated to Forge BETA 1.14.2-26.0.63/20190621-1.14.2, code adapted to new mappings.\n[M] Updated 1st/3rd person item model rotations/translations.", "1.0.8-b2": "[U] Updated to Forge BETA 1.14.2-26.0.63/20190621-1.14.2, code adapted to new mappings.\n[M] Updated 1st/3rd person item model rotations/translations.",
"1.0.8-b1": "[V] Feature set of 1.12 ported.\n[A] CTRL-SHIFT tooltips ported.\n[A] Ported stained clinker block/stairs.\n[M] Updated textures.\n[I] Issue: Scoped recipe constants still not working.", "1.0.8-b1": "[V] Feature set of 1.12 ported.\n[A] CTRL-SHIFT tooltips ported.\n[A] Ported stained clinker block/stairs.\n[M] Updated textures.\n[I] Issue: Scoped recipe constants still not working.",
"1.0.7-b5": "[U] Updated to Forge BETA 1.14.2-26.0.35/20190608-1.14.2.\n[A] Factory dropper functionality ported.\n[A] Small lab furnace functionality ported.\n[A] Small electrical lab furnace functionality ported.\n[A] Small waste incinerator functionality ported.\n[A] Fluid valves, Passive Fluid Accumulator ported.\n[I] Issue: Scoped recipe constants still not working.", "1.0.7-b5": "[U] Updated to Forge BETA 1.14.2-26.0.35/20190608-1.14.2.\n[A] Factory dropper functionality ported.\n[A] Small lab furnace functionality ported.\n[A] Small electrical lab furnace functionality ported.\n[A] Small waste incinerator functionality ported.\n[A] Fluid valves, Passive Fluid Accumulator ported.\n[I] Issue: Scoped recipe constants still not working.",
@ -72,6 +73,6 @@
"1.13.2-recommended": "", "1.13.2-recommended": "",
"1.13.2-latest": "1.0.7-b5", "1.13.2-latest": "1.0.7-b5",
"1.14.2-recommended": "", "1.14.2-recommended": "",
"1.14.2-latest": "1.0.8-b2" "1.14.2-latest": "1.0.8-b3"
} }
} }