diff --git a/src/main/java/com/falsepattern/lib/internal/proxy/ClientProxy.java b/src/main/java/com/falsepattern/lib/internal/proxy/ClientProxy.java index 07fc05c..8a2ac05 100644 --- a/src/main/java/com/falsepattern/lib/internal/proxy/ClientProxy.java +++ b/src/main/java/com/falsepattern/lib/internal/proxy/ClientProxy.java @@ -20,23 +20,15 @@ */ package com.falsepattern.lib.internal.proxy; -import com.falsepattern.lib.internal.Share; -import com.falsepattern.lib.internal.Tags; import com.falsepattern.lib.internal.impl.config.event.ClientEventHandlerPost; import com.falsepattern.lib.internal.impl.config.event.ClientEventHandlerPre; import com.falsepattern.lib.internal.impl.toast.GuiToastImpl; -import com.falsepattern.lib.updates.UpdateChecker; -import lombok.val; import net.minecraft.client.Minecraft; -import net.minecraft.client.entity.EntityPlayerSP; -import net.minecraft.util.IChatComponent; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; import cpw.mods.fml.common.event.FMLConstructionEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -46,8 +38,6 @@ import java.util.concurrent.CompletableFuture; @SideOnly(Side.CLIENT) public class ClientProxy extends CommonProxy { - private CompletableFuture> chatFuture; - @Override public void construct(FMLConstructionEvent e) { super.construct(e); @@ -65,27 +55,5 @@ public class ClientProxy extends CommonProxy { public void postInit(FMLPostInitializationEvent e) { super.postInit(e); ClientEventHandlerPost.registerBus(); - chatFuture = updatesFuture.handleAsync((updates, exception) -> { - if (exception != null || updates.isEmpty()) { - return Collections.emptyList(); - } - return UpdateChecker.updateListToChatMessages(Tags.MODNAME, updates); - }); - } - - @SubscribeEvent - public void onSinglePlayer(EntityJoinWorldEvent e) { - if (chatFuture == null || !(e.entity instanceof EntityPlayerSP)) { - return; - } - val player = (EntityPlayerSP) e.entity; - try { - for (val line : chatFuture.get()) { - player.addChatMessage(line); - } - chatFuture = null; - } catch (Exception ex) { - Share.LOG.warn(ex); - } } } diff --git a/src/main/java/com/falsepattern/lib/internal/proxy/CommonProxy.java b/src/main/java/com/falsepattern/lib/internal/proxy/CommonProxy.java index 3520e58..6d911fc 100644 --- a/src/main/java/com/falsepattern/lib/internal/proxy/CommonProxy.java +++ b/src/main/java/com/falsepattern/lib/internal/proxy/CommonProxy.java @@ -45,9 +45,6 @@ import java.util.List; import java.util.concurrent.CompletableFuture; public class CommonProxy { - - protected CompletableFuture> updatesFuture; - public void construct(FMLConstructionEvent e) { FalsePatternLib.NETWORK.registerMessage(SyncRequestHandler.class, SyncRequest.class, 0, Side.SERVER); FalsePatternLib.NETWORK.registerMessage(SyncReplyHandler.class, SyncReply.class, 1, Side.CLIENT); @@ -58,7 +55,7 @@ public class CommonProxy { CommonEventHandlerPre.registerBus(); if (LibraryConfig.ENABLE_UPDATE_CHECKER) { Share.LOG.info("Launching asynchronous update check."); - updatesFuture = UpdateChecker.fetchUpdatesAsyncV2(FalsePatternLib.UPDATE_URL).thenApplyAsync(updates -> { + UpdateChecker.fetchUpdatesAsyncV2(FalsePatternLib.UPDATE_URL).thenApplyAsync(updates -> { if (updates == null) { updates = Collections.emptyList(); } @@ -75,8 +72,6 @@ public class CommonProxy { Share.LOG.error("Failed to check for updates!", ex); return Collections.emptyList(); }); - } else { - updatesFuture = CompletableFuture.completedFuture(Collections.emptyList()); } }