aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
diff options
context:
space:
mode:
authorCobble8 <41165207+Cobble8@users.noreply.github.com>2023-03-22 05:27:46 -0400
committerGitHub <noreply@github.com>2023-03-22 20:27:46 +1100
commitd1600393e933ff993a11fc81c2c43a2f23c49b50 (patch)
tree0f2a69bf73fcd11c3307f3116f13cd216a1dd24b /src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
parent5763a1749196e8ea4afd519f268ce59e2727f1f0 (diff)
downloadnotenoughupdates-d1600393e933ff993a11fc81c2c43a2f23c49b50.tar.gz
notenoughupdates-d1600393e933ff993a11fc81c2c43a2f23c49b50.tar.bz2
notenoughupdates-d1600393e933ff993a11fc81c2c43a2f23c49b50.zip
Made it so you can use per hour instead of per minute on crops and coins (#625)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java28
1 files changed, 5 insertions, 23 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
index 9d2d1056..ffde9ca1 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
@@ -37,10 +37,6 @@ import net.minecraft.inventory.ContainerChest;
import net.minecraft.inventory.Slot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-import net.minecraft.scoreboard.Score;
-import net.minecraft.scoreboard.ScoreObjective;
-import net.minecraft.scoreboard.ScorePlayerTeam;
-import net.minecraft.scoreboard.Scoreboard;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IChatComponent;
import net.minecraftforge.client.event.ClientChatReceivedEvent;
@@ -315,7 +311,6 @@ public class SBInfo {
private static final Pattern SKILL_LEVEL_PATTERN = Pattern.compile("([^0-9:]+) (\\d{1,2})");
public void tick() {
- boolean tempIsInDungeon = false;
long currentTime = System.currentTimeMillis();
@@ -367,26 +362,13 @@ public class SBInfo {
}
try {
- Scoreboard scoreboard = Minecraft.getMinecraft().thePlayer.getWorldScoreboard();
-
- ScoreObjective sidebarObjective = scoreboard.getObjectiveInDisplaySlot(1);
-
- List<Score> scores = new ArrayList<>(scoreboard.getSortedScores(sidebarObjective));
-
- List<String> lines = new ArrayList<>();
- for (int i = scores.size() - 1; i >= 0; i--) {
- Score score = scores.get(i);
- ScorePlayerTeam scoreplayerteam1 = scoreboard.getPlayersTeam(score.getPlayerName());
- String line = ScorePlayerTeam.formatPlayerName(scoreplayerteam1, score.getPlayerName());
- line = Utils.cleanDuplicateColourCodes(line);
-
- String cleanLine = Utils.cleanColour(line);
-
- if (cleanLine.contains("Cleared:") && cleanLine.contains("%")) {
+ List<String> lines = SidebarUtil.readSidebarLines();
+ boolean tempIsInDungeon = false;
+ for (String line : lines) {
+ if (line.contains("Cleared:") && line.contains("%")) {
tempIsInDungeon = true;
+ break;
}
-
- lines.add(line);
}
isInDungeon = tempIsInDungeon;