]> git.lizzy.rs Git - BoundingBoxOutlineReloaded.git/blob - src/main/java/com/irtimaled/bbor/server/ThrowableConsumer.java
Update for 1.13.2
[BoundingBoxOutlineReloaded.git] / src / main / java / com / irtimaled / bbor / server / ThrowableConsumer.java
1 package com.irtimaled.bbor.server;
2
3 import com.irtimaled.bbor.common.TypeHelper;
4
5 import java.util.function.Consumer;
6
7 public interface ThrowableConsumer<T> extends Consumer<T> {
8     @Override
9     default void accept(final T elem) {
10         try {
11             acceptThrows(elem);
12         } catch (final Throwable t) {
13             throw TypeHelper.as(t, RuntimeException.class, () -> new RuntimeException(t));
14         }
15     }
16
17     void acceptThrows(T elem) throws Throwable;
18 }