File tree Expand file tree Collapse file tree
src/api/java/baritone/api Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929import net .minecraft .world .item .Item ;
3030import net .minecraft .world .level .block .Block ;
3131import net .minecraft .world .level .block .Blocks ;
32+ import org .slf4j .Logger ;
33+ import org .slf4j .LoggerFactory ;
3234
3335import java .awt .*;
3436import java .lang .annotation .ElementType ;
5052 * @author leijurv
5153 */
5254public final class Settings {
55+ private static final Logger LOGGER = LoggerFactory .getLogger ("Baritone" );
5356
5457 /**
5558 * Allow Baritone to break blocks
@@ -1216,8 +1219,12 @@ public final class Settings {
12161219 */
12171220 @ JavaOnly
12181221 public final Setting <Consumer <Component >> logger = new Setting <>((msg ) -> {
1219- final GuiMessageTag tag = useMessageTag .value ? Helper .MESSAGE_TAG : null ;
1220- Minecraft .getInstance ().gui .getChat ().addMessage (msg , null , tag );
1222+ try {
1223+ final GuiMessageTag tag = useMessageTag .value ? Helper .MESSAGE_TAG : null ;
1224+ Minecraft .getInstance ().gui .getChat ().addMessage (msg , null , tag );
1225+ } catch (Throwable t ) {
1226+ LOGGER .warn ("Failed to log message to chat: " + msg .getString (), t );
1227+ }
12211228 });
12221229
12231230 /**
You can’t perform that action at this time.
0 commit comments