added ladder fix to inventory

This commit is contained in:
mmaheshwari2 2025-02-25 15:53:53 -08:00
parent ff5882db30
commit 872ca99f08
2 changed files with 188489 additions and 188449 deletions

File diff suppressed because it is too large Load diff

View file

@ -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;
}
}