Refactor some event related things

This commit is contained in:
Brady 2018-08-11 00:03:16 -05:00
parent 6900fb2ade
commit 273a00753d
No known key found for this signature in database
GPG Key ID: 73A788379A197567
5 changed files with 321 additions and 269 deletions

View File

@ -21,6 +21,7 @@ import baritone.bot.behavior.Behavior;
import baritone.bot.behavior.impl.LookBehavior;
import baritone.bot.behavior.impl.MemoryBehavior;
import baritone.bot.behavior.impl.PathingBehavior;
import baritone.bot.event.GameEventHandler;
import java.util.ArrayList;
import java.util.List;

View File

@ -17,7 +17,7 @@
package baritone.bot.behavior;
import baritone.bot.event.AbstractGameEventListener;
import baritone.bot.event.listener.AbstractGameEventListener;
import baritone.bot.utils.Helper;
/**

View File

@ -15,13 +15,32 @@
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
*/
package baritone.bot;
/*
* 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,
* 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/>.
*/
package baritone.bot.event;
import baritone.bot.Baritone;
import baritone.bot.InputOverrideHandler;
import baritone.bot.behavior.Behavior;
import baritone.bot.chunk.CachedWorld;
import baritone.bot.chunk.CachedWorldProvider;
import baritone.bot.chunk.ChunkPacker;
import baritone.bot.event.IGameEventListener;
import baritone.bot.event.listener.IGameEventListener;
import baritone.bot.event.events.*;
import baritone.bot.event.events.type.EventState;
import baritone.bot.utils.Helper;
@ -40,8 +59,6 @@ import java.util.function.Consumer;
*/
public final class GameEventHandler implements IGameEventListener, Helper {
GameEventHandler() {}
@Override
public final void onTick(TickEvent event) {
dispatch(behavior -> behavior.onTick(event));

View File

@ -15,7 +15,24 @@
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
*/
package baritone.bot.event;
/*
* 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,
* 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/>.
*/
package baritone.bot.event.listener;
import baritone.bot.event.events.*;

View File

@ -15,7 +15,24 @@
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
*/
package baritone.bot.event;
/*
* 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,
* 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/>.
*/
package baritone.bot.event.listener;
import baritone.bot.event.events.*;
import io.netty.util.concurrent.GenericFutureListener;