Fix several deprecation warnings

This commit is contained in:
SquidDev
2019-04-09 16:30:44 +01:00
parent fcaa777c95
commit 23ddd4feb5
5 changed files with 20 additions and 13 deletions
@@ -75,8 +75,9 @@ public final class ComputerCraftProxyClient
ModLoadingContext.get().registerExtensionPoint( ExtensionPoint.GUIFACTORY, () -> packet -> {
ContainerType<?> type = ContainerType.factories.get( packet.getId() ).get();
if( packet.getAdditionalData() != null ) type.fromBytes( packet.getAdditionalData() );
return ((BiFunction<ContainerType<?>, EntityPlayer, GuiContainer>) ContainerType.guiFactories.get( packet.getId() ))
.apply( type, Minecraft.getInstance().player );
@SuppressWarnings( "unchecked" )
BiFunction<ContainerType<?>, EntityPlayer, GuiContainer> factory = (BiFunction<ContainerType<?>, EntityPlayer, GuiContainer>) ContainerType.guiFactories.get( packet.getId() );
return factory.apply( type, Minecraft.getInstance().player );
} );
}