|
22 | 22 | import lombok.Setter; |
23 | 23 | import org.angellock.impl.commands.CommandSpec; |
24 | 24 | import org.angellock.impl.events.IConnectListener; |
25 | | -import org.angellock.impl.events.IDisconnectListener; |
26 | | -import org.angellock.impl.events.TranslatableBundle; |
27 | | -import org.angellock.impl.events.handlers.*; |
| 25 | +import org.angellock.impl.events.handlers.ChatCommandHandler; |
| 26 | +import org.angellock.impl.events.handlers.DisconnectReasonHandler; |
| 27 | +import org.angellock.impl.events.handlers.PlayerEmergeHandler; |
| 28 | +import org.angellock.impl.events.handlers.ServerChatCommandHandler; |
28 | 29 | import org.angellock.impl.events.packets.EntityMovePacket; |
29 | 30 | import org.angellock.impl.events.packets.PlayerPositionPacket; |
30 | 31 | import org.angellock.impl.events.packets.debugger.PacketDebugger; |
|
34 | 35 | import org.angellock.impl.managers.ConfigManager; |
35 | 36 | import org.angellock.impl.managers.ProfileObject; |
36 | 37 | import org.angellock.impl.managers.TerminalCommandManager; |
37 | | -import org.angellock.impl.plugin.Plugin; |
| 38 | +import org.angellock.impl.plugin.AbstractPlugin; |
38 | 39 | import org.angellock.impl.plugin.PluginManager; |
39 | 40 | import org.angellock.impl.plugin.SessionProvider; |
40 | 41 | import org.angellock.impl.util.ConsoleTokens; |
41 | | -import org.angellock.impl.util.PlainTextSerializer; |
| 42 | +import org.angellock.impl.util.TranslatableUtil; |
42 | 43 | import org.geysermc.mcprotocollib.network.BuiltinFlags; |
43 | 44 | import org.geysermc.mcprotocollib.network.ProxyInfo; |
44 | 45 | import org.geysermc.mcprotocollib.network.Session; |
|
59 | 60 |
|
60 | 61 | public abstract class AbstractRobot implements ISendable, SessionProvider, IOptionalProcedures { |
61 | 62 | protected TcpClientSession serverSession; |
| 63 | + @Getter |
62 | 64 | protected static final Logger log = LoggerFactory.getLogger(ConsoleTokens.colorizeText("&aDolphinBot")); |
63 | 65 | private final ScheduledExecutorService reconnectScheduler = Executors.newScheduledThreadPool(1); |
64 | 66 | @Getter |
@@ -117,7 +119,8 @@ public AbstractRobot withPassword(String password){ |
117 | 119 | this.infoHelper.setPassword(password); |
118 | 120 | return this; |
119 | 121 | } |
120 | | - public AbstractRobot withDefaultPlugins(List<Plugin> plugins){ |
| 122 | + |
| 123 | + public AbstractRobot withDefaultPlugins(List<AbstractPlugin> plugins) { |
121 | 124 | this.pluginManager.getDefaultPlugins().addAll(plugins); |
122 | 125 | return this; |
123 | 126 | } |
@@ -187,19 +190,19 @@ public void connect(){ |
187 | 190 | catch (InterruptedException e){ |
188 | 191 | throw new RuntimeException(e); |
189 | 192 | } catch (IllegalArgumentException e) { |
190 | | - TranslatableBundle.warnTranslatableOf(EnumSystemEvents.PACKET_ERROR, e); |
| 193 | + TranslatableUtil.warnTranslatableOf(EnumSystemEvents.PACKET_ERROR, e); |
191 | 194 | } |
192 | 195 | } |
193 | 196 | } finally { |
194 | | - this.serverSession.disconnect("Interrupted"); |
| 197 | + this.serverSession.disconnect("Connection was Interrupted"); |
195 | 198 | scheduleReconnect(); |
196 | 199 | } |
197 | 200 | } |
198 | 201 |
|
199 | 202 | public abstract boolean canSendMessages(); |
200 | 203 |
|
201 | 204 | public void scheduleReconnect() { |
202 | | - TranslatableBundle.infoTranslatableOf(EnumSystemEvents.RECONNECT); |
| 205 | + TranslatableUtil.infoTranslatableOf(EnumSystemEvents.RECONNECT); |
203 | 206 | try { |
204 | 207 | Thread.sleep(this.config().getReconnectDelay()); |
205 | 208 | } catch (InterruptedException e) { |
|
0 commit comments