Make getBaritoneForPlayer null-safe
This commit is contained in:
parent
3a3d880d81
commit
bfd8773efa
@ -21,6 +21,7 @@ import baritone.api.cache.IWorldScanner;
|
|||||||
import net.minecraft.client.entity.EntityPlayerSP;
|
import net.minecraft.client.entity.EntityPlayerSP;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides the present {@link IBaritone} instances
|
* Provides the present {@link IBaritone} instances
|
||||||
@ -57,7 +58,7 @@ public interface IBaritoneProvider {
|
|||||||
*/
|
*/
|
||||||
default IBaritone getBaritoneForPlayer(EntityPlayerSP player) {
|
default IBaritone getBaritoneForPlayer(EntityPlayerSP player) {
|
||||||
for (IBaritone baritone : getAllBaritones()) {
|
for (IBaritone baritone : getAllBaritones()) {
|
||||||
if (player.equals(baritone.getPlayerContext().player())) {
|
if (Objects.equals(player, baritone.getPlayerContext().player())) {
|
||||||
return baritone;
|
return baritone;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user