|
@@ -1,10 +1,10 @@
|
|
#include "common/block/BlockRegistry.h"
|
|
#include "common/block/BlockRegistry.h"
|
|
|
|
|
|
BlockRegistry::BlockRegistry() {
|
|
BlockRegistry::BlockRegistry() {
|
|
- add("air", BlockBuilder());
|
|
|
|
- add("stone", BlockBuilder());
|
|
|
|
- add("dirt", BlockBuilder());
|
|
|
|
- add("grass", BlockBuilder());
|
|
|
|
|
|
+ add("air");
|
|
|
|
+ add("stone");
|
|
|
|
+ add("dirt");
|
|
|
|
+ add("grass");
|
|
}
|
|
}
|
|
|
|
|
|
void BlockRegistry::forEach(void(*f)(const Block&)) const {
|
|
void BlockRegistry::forEach(void(*f)(const Block&)) const {
|
|
@@ -13,9 +13,9 @@ void BlockRegistry::forEach(void(*f)(const Block&)) const {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-void BlockRegistry::add(const char* registry, const BlockBuilder& builder) {
|
|
|
|
|
|
+void BlockRegistry::add(const char* registry) {
|
|
BlockId id = blocks.getLength();
|
|
BlockId id = blocks.getLength();
|
|
- blocks.add(Block(id, registry, builder));
|
|
|
|
|
|
+ blocks.add(id, registry);
|
|
registryToId.add(registry, id);
|
|
registryToId.add(registry, id);
|
|
}
|
|
}
|
|
|
|
|