20
20
*/
21
21
package com .falsepattern .lib .internal .proxy ;
22
22
23
- import com .falsepattern .lib .internal .Share ;
24
- import com .falsepattern .lib .internal .Tags ;
25
23
import com .falsepattern .lib .internal .impl .config .event .ClientEventHandlerPost ;
26
24
import com .falsepattern .lib .internal .impl .config .event .ClientEventHandlerPre ;
27
25
import com .falsepattern .lib .internal .impl .toast .GuiToastImpl ;
28
- import com .falsepattern .lib .updates .UpdateChecker ;
29
- import lombok .val ;
30
26
31
27
import net .minecraft .client .Minecraft ;
32
- import net .minecraft .client .entity .EntityPlayerSP ;
33
- import net .minecraft .util .IChatComponent ;
34
28
import net .minecraftforge .common .MinecraftForge ;
35
- import net .minecraftforge .event .entity .EntityJoinWorldEvent ;
36
29
import cpw .mods .fml .common .event .FMLConstructionEvent ;
37
30
import cpw .mods .fml .common .event .FMLPostInitializationEvent ;
38
31
import cpw .mods .fml .common .event .FMLPreInitializationEvent ;
39
- import cpw .mods .fml .common .eventhandler .SubscribeEvent ;
40
32
import cpw .mods .fml .relauncher .Side ;
41
33
import cpw .mods .fml .relauncher .SideOnly ;
42
34
46
38
47
39
@ SideOnly (Side .CLIENT )
48
40
public class ClientProxy extends CommonProxy {
49
- private CompletableFuture <List <IChatComponent >> chatFuture ;
50
-
51
41
@ Override
52
42
public void construct (FMLConstructionEvent e ) {
53
43
super .construct (e );
@@ -65,27 +55,5 @@ public void preInit(FMLPreInitializationEvent e) {
65
55
public void postInit (FMLPostInitializationEvent e ) {
66
56
super .postInit (e );
67
57
ClientEventHandlerPost .registerBus ();
68
- chatFuture = updatesFuture .handleAsync ((updates , exception ) -> {
69
- if (exception != null || updates .isEmpty ()) {
70
- return Collections .emptyList ();
71
- }
72
- return UpdateChecker .updateListToChatMessages (Tags .MODNAME , updates );
73
- });
74
- }
75
-
76
- @ SubscribeEvent
77
- public void onSinglePlayer (EntityJoinWorldEvent e ) {
78
- if (chatFuture == null || !(e .entity instanceof EntityPlayerSP )) {
79
- return ;
80
- }
81
- val player = (EntityPlayerSP ) e .entity ;
82
- try {
83
- for (val line : chatFuture .get ()) {
84
- player .addChatMessage (line );
85
- }
86
- chatFuture = null ;
87
- } catch (Exception ex ) {
88
- Share .LOG .warn (ex );
89
- }
90
58
}
91
59
}
0 commit comments