Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed BlockState issue, removed echo, changed object creation #29

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions adk/data/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
Object::Object(std::string id) { mod_id = id; }

void Object::init() {
Registry<Block>* blocks = new Registry<Block>(mod_id);
Registry<Item>* items = new Registry<Item>(mod_id);
Registry<Block> blocks(mod_id);
Registry<Item> items(mod_id);

globalregistry.push_back(blocks);
globalregistry.push_back(items);

blocks->subscribe("custom_block", new Block(BlockProperty()));
items->subscribe("custom_item", new Item(ItemProperty()));
blocks.subscribe("custom_block", new Block(BlockProperty()));
items.subscribe("custom_item", new Item(ItemProperty()));
}
1 change: 0 additions & 1 deletion adk/data/compile.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
echo %1
cmake -S ./data/adk -B adk-build -DCMAKE_BUILD_TYPE=Release -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_TOOLCHAIN_FILE=%1
cmake --build adk-build --config Release --parallel
.\adk-build\Release\adk.exe
8 changes: 8 additions & 0 deletions adk/data/include/generator/BlockState.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ void simpleBlock(std::string block, std::string texture) {

j["minecraft:block"]["components"]["minecraft:material_instances"]["*"]
["texture"] = texture;
j["minecraft:block"]["components"]["minecraft:unit_cube"] =
nlohmann::json::object();

TempFile.close();
std::ofstream MyFile("./BP/blocks/" + block + ".json");
Expand Down Expand Up @@ -80,6 +82,8 @@ void simpleBlock(std::string block, std::string north, std::string east,
["texture"] = up;
j["minecraft:block"]["components"]["minecraft:material_instances"]["down"]
["texture"] = down;
j["minecraft:block"]["components"]["minecraft:unit_cube"] =
nlohmann::json::object();

TempFile.close();
std::ofstream MyFile("./BP/blocks/" + block + ".json");
Expand Down Expand Up @@ -116,6 +120,8 @@ void axisBlock(std::string block, std::string sides, std::string ends) {
["texture"] = "ends";
j["minecraft:block"]["components"]["minecraft:material_instances"]["down"]
["texture"] = "ends";
j["minecraft:block"]["components"]["minecraft:unit_cube"] =
nlohmann::json::object();

TempFile.close();
std::ofstream MyFile("./BP/blocks/" + block + ".json");
Expand Down Expand Up @@ -172,6 +178,8 @@ void tintedGlass(std::string block, std::string texture) {
["texture"] = texture;
j["minecraft:block"]["components"]["minecraft:material_instances"]["*"]
["render_method"] = "blend";
j["minecraft:block"]["components"]["minecraft:unit_cube"] =
nlohmann::json::object();

TempFile.close();
std::ofstream MyFile("./BP/blocks/" + block + ".json");
Expand Down
Loading