baritone/src/main/java/baritone/BaritoneProvider.java

68 lines
1.8 KiB
Java
Raw Normal View History

/*
* This file is part of Baritone.
*
* Baritone is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
*/
package baritone;
2018-11-04 05:11:52 +00:00
import baritone.api.IBaritone;
import baritone.api.IBaritoneProvider;
2018-11-14 03:45:26 +00:00
import baritone.api.cache.IWorldScanner;
2019-10-06 20:20:42 +00:00
import baritone.api.command.ICommandSystem;
import baritone.command.BaritoneChatControl;
2018-11-14 03:45:26 +00:00
import baritone.cache.WorldScanner;
2019-10-06 20:20:42 +00:00
import baritone.command.CommandSystem;
2018-11-14 03:45:26 +00:00
import java.util.Collections;
2018-11-14 22:00:56 +00:00
import java.util.List;
2018-11-14 03:45:26 +00:00
/**
* @author Brady
* @since 9/29/2018
*/
public final class BaritoneProvider implements IBaritoneProvider {
2018-11-14 03:45:26 +00:00
2019-09-19 20:30:40 +00:00
private final Baritone primary;
private final List<IBaritone> all;
2018-11-14 05:34:11 +00:00
2019-09-07 07:21:54 +00:00
{
this.primary = new Baritone();
this.all = Collections.singletonList(this.primary);
// Setup chat control, just for the primary instance
new BaritoneChatControl(this.primary);
2019-09-07 07:21:54 +00:00
}
2018-11-14 03:45:26 +00:00
@Override
public IBaritone getPrimaryBaritone() {
2018-11-14 05:34:11 +00:00
return primary;
2018-11-14 03:45:26 +00:00
}
@Override
2018-11-14 22:00:56 +00:00
public List<IBaritone> getAllBaritones() {
2019-06-15 18:04:05 +00:00
return all;
2018-11-14 03:45:26 +00:00
}
@Override
public IWorldScanner getWorldScanner() {
return WorldScanner.INSTANCE;
2018-10-07 01:16:38 +00:00
}
2019-10-04 23:12:36 +00:00
@Override
public ICommandSystem getCommandSystem() {
return CommandSystem.INSTANCE;
}
}