Allow more flexibility when registering BER (#1392)

(cherry picked from commit f801c28735)
This commit is contained in:
PepperCode1 2021-04-14 18:40:01 +01:00 committed by modmuss50
parent 5f00b70f07
commit aaa30be003
2 changed files with 2 additions and 2 deletions

View file

@ -39,5 +39,5 @@ public interface BlockEntityRendererRegistry {
* class is already loaded
* @param <E> the {@link BlockEntity}
*/
<E extends BlockEntity> void register(BlockEntityType<E> blockEntityType, BlockEntityRendererFactory<E> blockEntityRendererFactory);
<E extends BlockEntity> void register(BlockEntityType<E> blockEntityType, BlockEntityRendererFactory<? super E> blockEntityRendererFactory);
}

View file

@ -30,7 +30,7 @@ public class BlockEntityRendererRegistryImpl implements BlockEntityRendererRegis
private static BiConsumer<BlockEntityType<?>, BlockEntityRendererFactory<?>> handler = (type, function) -> map.put(type, function);
@Override
public <E extends BlockEntity> void register(BlockEntityType<E> blockEntityType, BlockEntityRendererFactory<E> blockEntityRendererFactory) {
public <E extends BlockEntity> void register(BlockEntityType<E> blockEntityType, BlockEntityRendererFactory<? super E> blockEntityRendererFactory) {
handler.accept(blockEntityType, blockEntityRendererFactory);
}