mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-07-02 06:35:22 +02:00
added ladder fix to inventory
This commit is contained in:
parent
ff5882db30
commit
872ca99f08
2 changed files with 188489 additions and 188449 deletions
File diff suppressed because it is too large
Load diff
|
@ -28,8 +28,14 @@ function createInitialInventory(blueprint, agents) {
|
|||
for (const row of level.placement) {
|
||||
for (const block of row) {
|
||||
if (block !== 'air') {
|
||||
// Check if material contains 'door' in the name, convert to oak_door
|
||||
const materialKey = block.includes('door') ? 'oak_door' : block;
|
||||
// Check if material contains 'door' or 'ladder' and convert appropriately
|
||||
let materialKey = block;
|
||||
if (block.includes('door')) {
|
||||
materialKey = 'oak_door';
|
||||
} else if (block.includes('ladder')) {
|
||||
materialKey = 'ladder';
|
||||
}
|
||||
|
||||
materialCounts[materialKey] = (materialCounts[materialKey] || 0) + 1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue