mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
Overrides!
This commit is contained in:
parent
fcb420c4c7
commit
8b949c4c9a
3 changed files with 32 additions and 12 deletions
|
|
@ -32,8 +32,8 @@ void ContentBuilder::add(ContentPackRuntime* pack) {
|
|||
Block& ContentBuilder::createBlock(std::string id) {
|
||||
auto found = blockDefs.find(id);
|
||||
if (found != blockDefs.end()) {
|
||||
//return found->second;
|
||||
throw namereuse_error("name "+id+" is already used", contenttype::item);
|
||||
return *found->second;
|
||||
// throw namereuse_error("name "+id+" is already used", contenttype::item);
|
||||
}
|
||||
Block* block = new Block(id);
|
||||
add(block);
|
||||
|
|
@ -43,10 +43,10 @@ Block& ContentBuilder::createBlock(std::string id) {
|
|||
ItemDef& ContentBuilder::createItem(std::string id) {
|
||||
auto found = itemDefs.find(id);
|
||||
if (found != itemDefs.end()) {
|
||||
if (found->second->generated) {
|
||||
return *found->second;
|
||||
}
|
||||
throw namereuse_error("name "+id+" is already used", contenttype::item);
|
||||
// if (found->second->generated) {
|
||||
return *found->second;
|
||||
// }
|
||||
// throw namereuse_error("name "+id+" is already used", contenttype::item);
|
||||
}
|
||||
ItemDef* item = new ItemDef(id);
|
||||
add(item);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue