Naming consistency

This commit is contained in:
Brady
2020-03-09 21:27:52 -05:00
parent 22ed50a739
commit 29f700d1c9
5 changed files with 17 additions and 17 deletions

View File

@@ -25,7 +25,7 @@ import baritone.api.event.events.type.EventState;
import baritone.api.utils.IPlayerController;
import baritone.bot.spec.BotMinecraft;
import baritone.bot.spec.BotWorld;
import baritone.bot.spec.EntityBot;
import baritone.bot.spec.BotEntity;
import baritone.utils.player.WrappedPlayerController;
import com.mojang.authlib.GameProfile;
import net.minecraft.client.multiplayer.PlayerControllerMP;
@@ -52,7 +52,7 @@ public final class BaritoneUser implements IBaritoneUser {
private NetHandlerPlayClient netHandlerPlayClient;
private BotMinecraft mc;
private BotWorld world;
private EntityBot player;
private BotEntity player;
private IPlayerController playerController;
BaritoneUser(UserManager manager, NetworkManager networkManager, Session session, ServerData serverData) {
@@ -70,7 +70,7 @@ public final class BaritoneUser implements IBaritoneUser {
this.netHandlerPlayClient = netHandlerPlayClient;
}
public void onWorldLoad(BotWorld world, EntityBot player, PlayerControllerMP controller) {
public void onWorldLoad(BotWorld world, BotEntity player, PlayerControllerMP controller) {
this.baritone.getGameEventHandler().onWorldEvent(new WorldEvent(world, EventState.PRE));
this.mc.player = this.player = player;
@@ -91,7 +91,7 @@ public final class BaritoneUser implements IBaritoneUser {
}
@Override
public EntityBot getEntity() {
public BotEntity getEntity() {
return this.player;
}

View File

@@ -28,7 +28,7 @@ import baritone.api.utils.Helper;
import baritone.bot.connect.ConnectionResult;
import baritone.bot.handler.BotNetHandlerLoginClient;
import baritone.bot.spec.BotWorld;
import baritone.bot.spec.EntityBot;
import baritone.bot.spec.BotEntity;
import baritone.utils.accessor.IIntegratedServer;
import baritone.utils.accessor.IThreadLanServerPing;
import net.minecraft.client.multiplayer.ServerAddress;
@@ -179,7 +179,7 @@ public enum UserManager implements IUserManager, Helper {
(reason == null ? "Unknown" : reason.getUnformattedText()));
if (user.getEntity() != null && user.getWorld() != null) {
((BotWorld) user.getWorld()).handleWorldRemove((EntityBot) user.getEntity());
((BotWorld) user.getWorld()).handleWorldRemove((BotEntity) user.getEntity());
}
}
}

View File

@@ -22,7 +22,7 @@ import baritone.bot.BaritoneUser;
import baritone.bot.spec.BotMinecraft;
import baritone.bot.spec.BotPlayerController;
import baritone.bot.spec.BotWorld;
import baritone.bot.spec.EntityBot;
import baritone.bot.spec.BotEntity;
import baritone.utils.accessor.INetHandlerPlayClient;
import com.mojang.authlib.GameProfile;
import io.netty.buffer.Unpooled;
@@ -68,7 +68,7 @@ public final class BotNetHandlerPlayClient extends NetHandlerPlayClient {
/**
* The bot entity
*/
private EntityBot player;
private BotEntity player;
/**
* The current world.
@@ -255,7 +255,7 @@ public final class BotNetHandlerPlayClient extends NetHandlerPlayClient {
this.playerController = new BotPlayerController(this.user, this);
this.world = this.user.getManager().getWorldProvider().getWorld(packetIn.getDimension());
((INetHandlerPlayClient) (Object) this).setWorld(this.world);
this.player = new EntityBot(this.user, this.client, this.world, this, new StatisticsManager(), new RecipeBookClient());
this.player = new BotEntity(this.user, this.client, this.world, this, new StatisticsManager(), new RecipeBookClient());
this.user.onWorldLoad(this.world, this.player, this.playerController);
this.player.preparePlayerToSpawn();
this.player.setEntityId(packetIn.getPlayerId());
@@ -311,9 +311,9 @@ public final class BotNetHandlerPlayClient extends NetHandlerPlayClient {
((INetHandlerPlayClient) (Object) this).setWorld(this.world);
}
EntityBot prev = this.player;
BotEntity prev = this.player;
this.player = new EntityBot(this.user, this.client, this.world, this, prev.getStatFileWriter(), prev.getRecipeBook());
this.player = new BotEntity(this.user, this.client, this.world, this, prev.getStatFileWriter(), prev.getRecipeBook());
this.user.onWorldLoad(this.world, this.player, this.playerController);
// noinspection ConstantConditions
this.player.getDataManager().setEntryValues(prev.getDataManager().getAll());
@@ -476,7 +476,7 @@ public final class BotNetHandlerPlayClient extends NetHandlerPlayClient {
throw new UnsupportedOperationException("This method shouldn't have been called; That is unepic!");
}
public EntityBot player() {
public BotEntity player() {
return player;
}

View File

@@ -53,12 +53,12 @@ import javax.annotation.Nullable;
* @since 10/23/2018
*/
@SuppressWarnings("EntityConstructor")
public final class EntityBot extends EntityPlayerSP {
public final class BotEntity extends EntityPlayerSP {
private final IBaritoneUser user;
private NetworkPlayerInfo playerInfo;
public EntityBot(IBaritoneUser user, Minecraft mc, World world, NetHandlerPlayClient netHandlerPlayClient, StatisticsManager statisticsManager, RecipeBook recipeBook) {
public BotEntity(IBaritoneUser user, Minecraft mc, World world, NetHandlerPlayClient netHandlerPlayClient, StatisticsManager statisticsManager, RecipeBook recipeBook) {
super(mc, world, netHandlerPlayClient, statisticsManager, recipeBook);
this.user = user;
this.movementInput = new PlayerMovementInput(this.user.getBaritone().getInputOverrideHandler());

View File

@@ -59,7 +59,7 @@ public final class BotWorld extends WorldClient {
@Override
public Entity removeEntityFromWorld(int entityID) {
Entity entity = this.entitiesById.lookup(entityID);
if (entity != null && !(entity instanceof EntityBot)) {
if (entity != null && !(entity instanceof BotEntity)) {
this.removeEntity(entity);
this.entitiesById.removeObject(entityID);
}
@@ -79,7 +79,7 @@ public final class BotWorld extends WorldClient {
* @param load {@code true} if the chunk is being loaded, {@code false} if the chunk is being unloaded.
* @return Whether or not the chunk needs to be loaded or unloaded accordingly.
*/
public boolean handlePreChunk(EntityBot bot, int chunkX, int chunkZ, boolean load) {
public boolean handlePreChunk(BotEntity bot, int chunkX, int chunkZ, boolean load) {
IntSet bots = this.loadedChunksMap.computeIfAbsent(new ChunkPos(chunkX, chunkZ), $ -> new IntArraySet());
if (load) {
boolean wasEmpty = bots.isEmpty();
@@ -91,7 +91,7 @@ public final class BotWorld extends WorldClient {
}
}
public void handleWorldRemove(EntityBot bot) {
public void handleWorldRemove(BotEntity bot) {
// Remove Bot from world
this.removeEntity(bot);
this.entitiesById.removeObject(bot.getEntityId());