Skip to content

Commit 8c92075

Browse files
authored
handers..equip.py: Reduce from_universal warning verbosity (#540)
* handers..equip.py: Reduce from_universal warning verbosity * even more filtering
1 parent 561ffe6 commit 8c92075

File tree

1 file changed

+11
-3
lines changed
  • minerl/herobraine/hero/handlers/agent/actions

1 file changed

+11
-3
lines changed

minerl/herobraine/hero/handlers/agent/actions/equip.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,15 @@ def from_universal(self, obs) -> str:
6666
self._previous_metadata = metadata
6767
return result
6868
else:
69-
self.logger.warning(f"Unexpected slots_gui_type={slots_gui_type}, "
70-
f"Abandoning processing and simply returning {self._default}"
71-
)
69+
expected_ignore_types = ( # Filter these out to reduce stderr clutter
70+
"class net.minecraft.inventory.ContainerWorkbench",
71+
"class net.minecraft.inventory.ContainerFurnace",
72+
"class net.minecraft.inventory.ContainerChest",
73+
"class net.minecraft.inventory.ContainerMerchant",
74+
)
75+
76+
if slots_gui_type not in expected_ignore_types:
77+
self.logger.debug(f"Unexpected slots_gui_type={slots_gui_type}, "
78+
f"Abandoning processing and simply returning '{self._default}'"
79+
)
7280
return self._default

0 commit comments

Comments
 (0)