diff --git a/src/main/java/com/github/lunatrius/ingameinfo/command/InGameInfoCommand.java b/src/main/java/com/github/lunatrius/ingameinfo/command/InGameInfoCommand.java index 52403ad..c304c09 100644 --- a/src/main/java/com/github/lunatrius/ingameinfo/command/InGameInfoCommand.java +++ b/src/main/java/com/github/lunatrius/ingameinfo/command/InGameInfoCommand.java @@ -1,9 +1,9 @@ package com.github.lunatrius.ingameinfo.command; +import com.github.lunatrius.core.handler.DelayedGuiDisplayTicker; import com.github.lunatrius.ingameinfo.InGameInfoCore; import com.github.lunatrius.ingameinfo.client.gui.GuiTags; import com.github.lunatrius.ingameinfo.handler.ConfigurationHandler; -import com.github.lunatrius.ingameinfo.handler.DelayedGuiDisplayTicker; import com.github.lunatrius.ingameinfo.handler.Ticker; import com.github.lunatrius.ingameinfo.reference.Names; import net.minecraft.command.CommandBase; diff --git a/src/main/java/com/github/lunatrius/ingameinfo/handler/DelayedGuiDisplayTicker.java b/src/main/java/com/github/lunatrius/ingameinfo/handler/DelayedGuiDisplayTicker.java deleted file mode 100644 index dbde43e..0000000 --- a/src/main/java/com/github/lunatrius/ingameinfo/handler/DelayedGuiDisplayTicker.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.github.lunatrius.ingameinfo.handler; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiScreen; - -public class DelayedGuiDisplayTicker { - private final GuiScreen guiScreen; - private int ticks; - - private DelayedGuiDisplayTicker(GuiScreen guiScreen, int delay) { - this.guiScreen = guiScreen; - this.ticks = delay; - } - - @SubscribeEvent - public void onClientTick(ClientTickEvent event) { - this.ticks--; - - if (this.ticks <= 0) { - Minecraft.getMinecraft().displayGuiScreen(this.guiScreen); - FMLCommonHandler.instance().bus().unregister(this); - } - } - - public static void create(GuiScreen guiScreen, int delay) { - FMLCommonHandler.instance().bus().register(new DelayedGuiDisplayTicker(guiScreen, delay)); - } -}