workaround some scuff
This commit is contained in:
parent
ee6df270ce
commit
a75317cc2c
@ -101,5 +101,14 @@ public interface IBaritoneProcess {
|
||||
*
|
||||
* @return A display name that's suitable for a HUD
|
||||
*/
|
||||
String displayName();
|
||||
default String displayName() {
|
||||
if (!isActive()) {
|
||||
// i love it when impcat's scuffed HUD calls displayName for inactive processes for 1 tick too long
|
||||
// causing NPEs when the displayname relies on fields that become null when inactive
|
||||
return "INACTIVE";
|
||||
}
|
||||
return displayName0();
|
||||
}
|
||||
|
||||
String displayName0();
|
||||
}
|
||||
|
@ -543,7 +543,7 @@ public class BuilderProcess extends BaritoneProcessHelper implements IBuilderPro
|
||||
}
|
||||
|
||||
@Override
|
||||
public String displayName() {
|
||||
public String displayName0() {
|
||||
return "Building " + name;
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ public class CustomGoalProcess extends BaritoneProcessHelper implements ICustomG
|
||||
}
|
||||
|
||||
@Override
|
||||
public String displayName() {
|
||||
public String displayName0() {
|
||||
return "Custom Goal " + this.goal;
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ public class ExploreProcess extends BaritoneProcessHelper {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String displayName() {
|
||||
public String displayName0() {
|
||||
return "Exploring around " + explorationOrigin + ", currently going to " + closestUncachedChunk(explorationOrigin);
|
||||
}
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ public final class FollowProcess extends BaritoneProcessHelper implements IFollo
|
||||
}
|
||||
|
||||
@Override
|
||||
public String displayName() {
|
||||
public String displayName0() {
|
||||
return "Follow " + cache;
|
||||
}
|
||||
|
||||
|
@ -160,11 +160,11 @@ public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBl
|
||||
}
|
||||
|
||||
@Override
|
||||
public String displayName() {
|
||||
public String displayName0() {
|
||||
if (knownLocations.isEmpty()) {
|
||||
return "Exploring randomly to find " + gettingTo + ", no known locations";
|
||||
}
|
||||
return "Get To Block " + gettingTo + ", " + knownLocations.size() + " known locations";
|
||||
return "Get To " + gettingTo + ", " + knownLocations.size() + " known locations";
|
||||
}
|
||||
|
||||
private synchronized void rescan(List<BlockPos> known, CalculationContext context) {
|
||||
|
@ -117,7 +117,7 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro
|
||||
}
|
||||
|
||||
@Override
|
||||
public String displayName() {
|
||||
public String displayName0() {
|
||||
return "Mine " + mining;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user