[CraftingRecipe] Fixed shaped recipe matching.

This commit is contained in:
Quentin Bazin 2019-12-30 18:09:22 +09:00
parent 44ea538282
commit b070e58b0e
5 changed files with 5 additions and 9 deletions

2
TODO
View File

@ -7,7 +7,7 @@ TODO
# Issues
• DONE: Crafting doesnt always work
TODO: A mix of pickaxe + axe recipes gives a pickaxe?!
• DONE: A mix of pickaxe + axe recipes gives a pickaxe?!
• TODO: Shapeless recipe code isnt working
• TODO: `Workbench` and `Furnace` are not scaled correctly with lower GUI scale settings
• TODO: Blocks can be accessed from outside the world (will need a refactoring)

View File

@ -21,7 +21,7 @@ bool Config::isNoClipEnabled = false;
// Graphics
bool Config::isTorchSmoothLightingEnabled = true;
bool Config::isSunSmoothLightingEnabled = false;
bool Config::isSunSmoothLightingEnabled = true;
bool Config::isAmbientOcclusionEnabled = false;
bool Config::isWireframeModeEnabled = false;
u16 Config::renderDistance = 8;

View File

@ -114,7 +114,7 @@ bool CraftingRecipe::checkMatch(const Inventory &inventory, int offsetX, int off
std::string inventoryItem = inventory.getStack(offsetX + x, offsetY + y).item().name();
if (m_pattern[y][x] == ' ') {
itemFound = !inventoryItem.empty();
itemFound = inventoryItem.empty();
}
else {
auto it = m_keys.find(m_pattern[y][x]);

View File

@ -1,9 +1,3 @@
mod:block {
id = "",
name = "Air",
texture = 0,
}
mod:block {
id = "dirt",
name = "Dirt",

View File

@ -29,6 +29,8 @@ void ServerApplication::init() {
m_port = std::stoi(m_argumentParser.getArgument("port").parameter);
Registry::setInstance(m_registry);
m_registry.registerBlock<ServerBlock>(0, "", "Air");
m_registry.registerItem(0, "", "Air").setIsBlock(true);
m_scriptEngine.init();
// m_luaCore.setPlayer(m_player); // FIXME