baritone/src/main/java/baritone/bot/event/IGameEventListener.java

100 lines
3.0 KiB
Java
Raw Normal View History

2018-08-08 03:16:53 +00:00
/*
* This file is part of Baritone.
*
* Baritone is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Baritone is distributed in the hope that it will be useful,
2018-08-08 03:16:53 +00:00
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
*/
2018-08-01 17:10:48 +00:00
package baritone.bot.event;
2018-08-05 23:50:24 +00:00
import baritone.bot.event.events.*;
import io.netty.util.concurrent.GenericFutureListener;
2018-08-01 17:10:48 +00:00
import net.minecraft.client.Minecraft;
2018-08-02 01:46:51 +00:00
import net.minecraft.client.entity.EntityPlayerSP;
2018-08-02 07:45:15 +00:00
import net.minecraft.client.multiplayer.WorldClient;
2018-08-05 02:58:32 +00:00
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
2018-08-01 17:10:48 +00:00
/**
* @author Brady
* @since 7/31/2018 11:05 PM
*/
public interface IGameEventListener {
/**
2018-08-02 07:45:15 +00:00
* Run once per game tick before screen input is handled.
*
* @see Minecraft#runTick()
2018-08-01 17:10:48 +00:00
*/
2018-08-05 23:50:24 +00:00
void onTick(TickEvent event);
2018-08-05 02:58:32 +00:00
/**
* Run once per game tick from before the player rotation is sent to the server.
* @see EntityPlayerSP#onUpdate()
*/
void onPlayerUpdate();
/**
2018-08-02 07:45:15 +00:00
* Run once per game tick from before keybinds are processed.
*
* @see Minecraft#processKeyBinds()
*/
void onProcessKeyBinds();
2018-08-02 01:46:51 +00:00
/**
2018-08-02 07:45:15 +00:00
* Runs whenever the client player sends a message to the server.
*
* @see EntityPlayerSP#sendChatMessage(String)
2018-08-02 01:46:51 +00:00
*/
void onSendChatMessage(ChatEvent event);
2018-08-02 07:45:15 +00:00
/**
* Runs before and after whenever a chunk is either loaded, unloaded, or populated.
2018-08-02 07:45:15 +00:00
*
* @see WorldClient#doPreChunk(int, int, boolean)
*/
void onChunkEvent(ChunkEvent event);
2018-08-05 01:55:38 +00:00
/**
* Runs once per world render pass. Two passes are made when {@link GameSettings#anaglyph} is on.
* <p>
* <b>Note:</b> {@link GameSettings#anaglyph} has been removed in Minecraft 1.13
2018-08-05 02:58:32 +00:00
*
* @see EntityRenderer#renderWorldPass(int, float, long)
2018-08-05 01:55:38 +00:00
*/
void onRenderPass(RenderEvent event);
2018-08-05 04:44:42 +00:00
/**
* Runs before and after whenever a new world is loaded
*
* @see Minecraft#loadWorld(WorldClient, String)
*/
void onWorldEvent(WorldEvent event);
/**
* Runs before a outbound packet is sent
*
* @see NetworkManager#dispatchPacket(Packet, GenericFutureListener[])
*/
void onSendPacket(PacketEvent event);
/**
* Runs before an inbound packet is processed
*
* @see NetworkManager#dispatchPacket(Packet, GenericFutureListener[])
*/
void onReceivePacket(PacketEvent event);
2018-08-01 17:10:48 +00:00
}