workaround some scuff

This commit is contained in:
Leijurv 2019-03-13 09:17:25 -07:00
parent ee6df270ce
commit a75317cc2c
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
7 changed files with 17 additions and 8 deletions

View File

@ -101,5 +101,14 @@ public interface IBaritoneProcess {
* *
* @return A display name that's suitable for a HUD * @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();
} }

View File

@ -543,7 +543,7 @@ public class BuilderProcess extends BaritoneProcessHelper implements IBuilderPro
} }
@Override @Override
public String displayName() { public String displayName0() {
return "Building " + name; return "Building " + name;
} }

View File

@ -105,7 +105,7 @@ public class CustomGoalProcess extends BaritoneProcessHelper implements ICustomG
} }
@Override @Override
public String displayName() { public String displayName0() {
return "Custom Goal " + this.goal; return "Custom Goal " + this.goal;
} }

View File

@ -94,7 +94,7 @@ public class ExploreProcess extends BaritoneProcessHelper {
} }
@Override @Override
public String displayName() { public String displayName0() {
return "Exploring around " + explorationOrigin + ", currently going to " + closestUncachedChunk(explorationOrigin); return "Exploring around " + explorationOrigin + ", currently going to " + closestUncachedChunk(explorationOrigin);
} }
} }

View File

@ -101,7 +101,7 @@ public final class FollowProcess extends BaritoneProcessHelper implements IFollo
} }
@Override @Override
public String displayName() { public String displayName0() {
return "Follow " + cache; return "Follow " + cache;
} }

View File

@ -160,11 +160,11 @@ public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBl
} }
@Override @Override
public String displayName() { public String displayName0() {
if (knownLocations.isEmpty()) { if (knownLocations.isEmpty()) {
return "Exploring randomly to find " + gettingTo + ", no known locations"; 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) { private synchronized void rescan(List<BlockPos> known, CalculationContext context) {

View File

@ -117,7 +117,7 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro
} }
@Override @Override
public String displayName() { public String displayName0() {
return "Mine " + mining; return "Mine " + mining;
} }