aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/TheMod.java
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2020-10-05 18:19:52 -0400
committerbowser0000 <bowser0000@gmail.com>2020-10-05 18:19:52 -0400
commit0379a3c43be18b22d77056eb5b26b4f239d9988e (patch)
tree6dbb1efbace7a4ab5ab85f7aee98b09c70cc4a84 /src/main/java/me/Danker/TheMod.java
parent2a1c6ec74089d247e63e80682b48e1777b9dd388 (diff)
downloadSkyblockMod-0379a3c43be18b22d77056eb5b26b4f239d9988e.tar.gz
SkyblockMod-0379a3c43be18b22d77056eb5b26b4f239d9988e.tar.bz2
SkyblockMod-0379a3c43be18b22d77056eb5b26b4f239d9988e.zip
Add auto slayer tracker display
Diffstat (limited to 'src/main/java/me/Danker/TheMod.java')
-rw-r--r--src/main/java/me/Danker/TheMod.java30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java
index ababc34..973a0da 100644
--- a/src/main/java/me/Danker/TheMod.java
+++ b/src/main/java/me/Danker/TheMod.java
@@ -56,6 +56,7 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.scoreboard.ScoreObjective;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IChatComponent;
@@ -1804,14 +1805,33 @@ public class TheMod
// Check if player is in Skyblock every second
tickAmount++;
if (tickAmount % 20 == 0) {
- EntityPlayerSP player = Minecraft.getMinecraft().thePlayer;
+ Minecraft mc = Minecraft.getMinecraft();
+ EntityPlayerSP player = mc.thePlayer;
+
if (player != null) {
Utils.checkForSkyblock();
- // if (Utils.inSkyblock) {
- // System.out.println("Autosyncing inventory to server...");
- // player.inventoryContainer.detectAndSendChanges(); // Spirit boot fix every 1 second
- // }
}
+
+ if (DisplayCommand.auto && mc != null && mc.theWorld != null) {
+ List<String> scoreboard = ScoreboardHandler.getSidebarLines();
+ boolean found = false;
+ for (String s : scoreboard) {
+ String sCleaned = ScoreboardHandler.cleanSB(s);
+ if (sCleaned.contains("Sven Packmaster")) {
+ DisplayCommand.display = "wolf";
+ found = true;
+ } else if (sCleaned.contains("Tarantula Broodfather")) {
+ DisplayCommand.display = "spider";
+ found = true;
+ } else if (sCleaned.contains("Revenant Horror")) {
+ DisplayCommand.display = "zombie";
+ found = true;
+ }
+ }
+ if (!found) DisplayCommand.display = "off";
+ ConfigHandler.writeStringConfig("misc", "display", DisplayCommand.display);
+ }
+
tickAmount = 0;
}