\\d{0,2}:?\\d{1,2}:\\d{2})");
- /**
- * The following two fields are accessed by
- * {@link codes.biscuit.skyblockaddons.listeners.RenderListener#drawPotionEffectTimers(float, ButtonLocation)} to retrieve lists for drawing.
- *
- * Both return a list of current Potion or Powerup timers. They can be empty, but are never null.
- */
- @Getter
- private final List potionTimers = new ArrayList<>();
- @Getter
- private final List powerupTimers = new ArrayList<>();
-
- @Getter
- private int effectCount;
-
- /**
- * The following two fields are accessed by
- * {@link codes.biscuit.skyblockaddons.listeners.RenderListener#drawPotionEffectTimers(float, ButtonLocation)}
- * to retrieve dummy lists for drawing when editing GUI locations while no Effects are active.
- *
- * Both return a list of dummy Potion or Powerup timers.
- */
- @Getter private static final List dummyPotionTimers = Arrays.asList(
- new TabEffect("§r§ePotion Effect II ", "12:34"),
- new TabEffect("§r§aEnchanting XP Boost III ", "1:23:45"));
- @Getter private static final List dummyPowerupTimers = Collections.singletonList(
- new TabEffect("§r§bHoming Snowballs ", "1:39"));
-
- /**
- * Adds a potion effect to the ones currently being displayed.
- *
- * @param potionEffect The potion effect text to be added.
- */
- public void putPotionEffect(String potionEffect, String timer) {
- putEffect(new TabEffect(potionEffect, timer), potionTimers);
- }
-
- /**
- * Adds a powerup to the ones currently being displayed.
- *
- * @param powerup The powerup text to be added.
- */
- public void putPowerup(String powerup, String timer) {
- putEffect(new TabEffect(powerup, timer), powerupTimers);
- }
-
- /**
- * Adds the effect to the specified list, after replacing the roman numerals on it- if applicable.
- *
- * @param effect The potion effect/powerup text to be added.
- * @param list The list to add it to (either potionTimers or powerupTimers).
- */
- private void putEffect(TabEffect effect, List list) {
- if (SkyblockAddons.getInstance().getConfigValues().isEnabled(Feature.REPLACE_ROMAN_NUMERALS_WITH_NUMBERS)) {
- effect.setEffect(RomanNumeralParser.replaceNumeralsWithIntegers(effect.getEffect()));
- }
- list.add(effect);
- }
-
- /**
- * Called by {@link codes.biscuit.skyblockaddons.listeners.PlayerListener#onTick(TickEvent.ClientTickEvent)} every second
- * to update the list of current effect timers.
- */
- public void update(String tabFooterString, String strippedTabFooterString) {
- potionTimers.clear();
- powerupTimers.clear();
- //System.out.println(strippedTabFooterString);
-
- if (tabFooterString == null) {
- return;
- }
-
- // Match the TabFooterString for Effects
- Matcher matcher = EFFECT_PATTERN.matcher(tabFooterString);
- String effectString;
- while (matcher.find()) {
- if ((effectString = matcher.group("potion")) != null) {
- putPotionEffect(effectString, matcher.group("timer"));
- } else if ((effectString = matcher.group("powerup")) != null) {
- putPowerup(effectString, matcher.group("timer"));
- }
- }
-
- matcher = EFFECT_COUNT_PATTERN.matcher(strippedTabFooterString);
- if (matcher.find()) {
- effectCount = Integer.parseInt(matcher.group("effectCount"));
- } else if ((matcher = GOD_POTION_PATTERN.matcher(strippedTabFooterString)).find()) {
- // Hard code
- putPotionEffect("§cGod Potion§r ", matcher.group("timer"));
- effectCount = 32;
- } else {
- effectCount = 0;
- }
- }
-}
\ No newline at end of file
diff --git a/src/main/java/codes/biscuit/skyblockaddons/gui/IslandWarpGui.java b/src/main/java/codes/biscuit/skyblockaddons/gui/IslandWarpGui.java
index 6366bd8ba..82eefd630 100644
--- a/src/main/java/codes/biscuit/skyblockaddons/gui/IslandWarpGui.java
+++ b/src/main/java/codes/biscuit/skyblockaddons/gui/IslandWarpGui.java
@@ -307,6 +307,7 @@ public enum Island {
THE_BARN("The Barn", 1125, 800),
HUB("Hub", 300, 724),
PRIVATE_ISLAND("Private Island", 275, 1122),
+ GARDEN("Garden", 50, 1000),
DUNGEON_HUB("Dungeon Hub", 1500, 1050);
private final String label;
@@ -353,6 +354,8 @@ public enum Island {
@Getter
public enum Marker {
PRIVATE_ISLAND("home", Translations.getMessage("warpMenu.home"), Island.PRIVATE_ISLAND, true, 72, 90),
+
+ GARDEN("garden", Translations.getMessage("warpMenu.spawn"), Island.GARDEN, true, 160, 70),
HUB("hub", Translations.getMessage("warpMenu.spawn"), Island.HUB, true, 600, 200),
CASTLE("castle", "Castle", Island.HUB, 130, 80),
@@ -381,6 +384,7 @@ public enum Marker {
THE_BARN("barn", Translations.getMessage("warpMenu.spawn"), Island.THE_BARN, true, 140, 150),
MUSHROOM_DESERT("desert", Translations.getMessage("warpMenu.spawn"), Island.MUSHROOM_DESERT, true, 210, 295),
+ TRAPPER("trapper", "Trapper's Hut", Island.MUSHROOM_DESERT, true, 300, 200),
GOLD_MINE("gold", Translations.getMessage("warpMenu.spawn"), Island.GOLD_MINE, true, 86, 259),
diff --git a/src/main/java/codes/biscuit/skyblockaddons/gui/SettingsGui.java b/src/main/java/codes/biscuit/skyblockaddons/gui/SettingsGui.java
index 8f7dd1035..a84b518b2 100644
--- a/src/main/java/codes/biscuit/skyblockaddons/gui/SettingsGui.java
+++ b/src/main/java/codes/biscuit/skyblockaddons/gui/SettingsGui.java
@@ -217,8 +217,8 @@ protected void actionPerformed(GuiButton abstractButton) {
closingGui = true;
Minecraft.getMinecraft().displayGuiScreen(new SettingsGui(feature, page, lastPage, lastTab, settings));
closingGui = false;
- } else if (feature == Feature.POWER_ORB_STATUS_DISPLAY && abstractButton instanceof ButtonSolid) {
- main.getConfigValues().setPowerOrbDisplayStyle(main.getConfigValues().getPowerOrbDisplayStyle().getNextType());
+ } else if (feature == Feature.DEPLOYABLE_STATUS_DISPLAY && abstractButton instanceof ButtonSolid) {
+ main.getConfigValues().setDeployableDisplayStyle(main.getConfigValues().getDeployableDisplayStyle().getNextType());
closingGui = true;
Minecraft.getMinecraft().displayGuiScreen(new SettingsGui(feature, page, lastPage, lastTab, settings));
closingGui = false;
@@ -313,7 +313,8 @@ private void addButton(EnumUtils.FeatureSetting setting) {
} else if (setting == EnumUtils.FeatureSetting.BACKPACK_STYLE) {
boxWidth = 140;
x = halfWidth - (boxWidth / 2);
- buttonList.add(new ButtonSolid(x, y, 140, 20, Translations.getMessage("settings.backpackStyle"), main, feature));
+ buttonList.add(new ButtonTextNew(halfWidth, (int) y - 10, Translations.getMessage("settings.backpackStyle"), true, 0xFFFFFFFF));
+ buttonList.add(new ButtonSolid(x, y, 140, 20, "%style%", main, feature));
} else if (setting == EnumUtils.FeatureSetting.ENABLE_MESSAGE_WHEN_ACTION_PREVENTED) {
boxWidth = 31;
x = halfWidth - (boxWidth / 2);
@@ -322,10 +323,11 @@ private void addButton(EnumUtils.FeatureSetting setting) {
buttonList.add(new ButtonToggleTitle(x, y, Translations.getMessage("settings.enableMessageWhenActionPrevented"), main, settingFeature));
- } else if (setting == EnumUtils.FeatureSetting.POWER_ORB_DISPLAY_STYLE) {
+ } else if (setting == EnumUtils.FeatureSetting.DEPLOYABLE_DISPLAY_STYLE) {
boxWidth = 140;
x = halfWidth - (boxWidth / 2);
- buttonList.add(new ButtonSolid(x, y, 140, 20, Translations.getMessage("settings.powerOrbDisplayStyle"), main, feature));
+ buttonList.add(new ButtonTextNew(halfWidth, (int) y - 10, Translations.getMessage("settings.deployableDisplayStyle"), true, 0xFFFFFFFF));
+ buttonList.add(new ButtonSolid(x, y, 140, 20, "%style%", main, feature));
} else if (setting == EnumUtils.FeatureSetting.DISCORD_RP_DETAILS || setting == EnumUtils.FeatureSetting.DISCORD_RP_STATE) {
boxWidth = 140;
x = halfWidth - (boxWidth / 2);
@@ -416,6 +418,9 @@ public void sliderUpdated(float value) {
} else if (feature == Feature.VOIDGLOOM_SLAYER_TRACKER) {
settingFeature = Feature.ENDERMAN_COLOR_BY_RARITY;
+ } else if (feature == Feature.INFERNO_SLAYER_TRACKER) {
+ settingFeature = Feature.INFERNO_COLOR_BY_RARITY;
+
} else if (feature == Feature.DRAGON_STATS_TRACKER) {
settingFeature = Feature.DRAGON_STATS_TRACKER_COLOR_BY_RARITY;
}
@@ -440,6 +445,9 @@ public void sliderUpdated(float value) {
} else if (feature == Feature.VOIDGLOOM_SLAYER_TRACKER) {
settingFeature = Feature.ENDERMAN_TEXT_MODE;
+ } else if (feature == Feature.INFERNO_SLAYER_TRACKER) {
+ settingFeature = Feature.INFERNO_TEXT_MODE;
+
} else if (feature == Feature.DRAGON_STATS_TRACKER_TEXT_MODE) {
settingFeature = Feature.DRAGON_STATS_TRACKER_TEXT_MODE;
}
diff --git a/src/main/java/codes/biscuit/skyblockaddons/gui/SkyblockAddonsGui.java b/src/main/java/codes/biscuit/skyblockaddons/gui/SkyblockAddonsGui.java
index 82fd7aa28..85c5ce82e 100644
--- a/src/main/java/codes/biscuit/skyblockaddons/gui/SkyblockAddonsGui.java
+++ b/src/main/java/codes/biscuit/skyblockaddons/gui/SkyblockAddonsGui.java
@@ -110,8 +110,8 @@ public void initGui() {
max = features.size() - skip - displayCount <= 0;
buttonList.add(new ButtonArrow(width / 2 - 15 + 50, height - 70, main, ButtonArrow.ArrowType.RIGHT, max));
- buttonList.add(new ButtonSocial(width / 2 + 200, 30, main, EnumUtils.Social.YOUTUBE));
- buttonList.add(new ButtonSocial(width / 2 + 175, 30, main, EnumUtils.Social.DISCORD));
+ //buttonList.add(new ButtonSocial(width / 2 + 200, 30, main, EnumUtils.Social.YOUTUBE));
+ //buttonList.add(new ButtonSocial(width / 2 + 175, 30, main, EnumUtils.Social.DISCORD));
buttonList.add(new ButtonSocial(width / 2 + 150, 30, main, EnumUtils.Social.GITHUB));
// buttonList.add(new ButtonSocial(width / 2 + 125, 30, main, EnumUtils.Social.PATREON));
@@ -355,13 +355,9 @@ static void drawDefaultTitleText(GuiScreen gui, int alpha) {
DrawUtils.drawModalRectWithCustomSizedTexture(scaledResolution.getScaledWidth()/2F-width/2F, 5, 0, 0, width, height, width, height, true);
GlStateManager.color(1,1,1, 1);
- String version = "v" + SkyblockAddons.VERSION.replace("beta", "b") + " by Biscut";
+ String version = "v" + SkyblockAddons.VERSION.replace("beta", "b") + " unofficial";
drawScaledString(gui, version, 55, defaultBlue, 1.3, 170 - Minecraft.getMinecraft().fontRendererObj.getStringWidth(version), false);
- if (gui instanceof SkyblockAddonsGui) {
- drawScaledString(gui, "Special Credits: InventiveTalent - Magma Boss Timer API", gui.height - 22, defaultBlue, 1, 0);
- }
-
SkyblockAddons.getInstance().getUtils().restoreGLOptions();
}
diff --git a/src/main/java/codes/biscuit/skyblockaddons/gui/buttons/ButtonSelect.java b/src/main/java/codes/biscuit/skyblockaddons/gui/buttons/ButtonSelect.java
index d4544a8dd..22e4c0f7d 100644
--- a/src/main/java/codes/biscuit/skyblockaddons/gui/buttons/ButtonSelect.java
+++ b/src/main/java/codes/biscuit/skyblockaddons/gui/buttons/ButtonSelect.java
@@ -1,6 +1,7 @@
package codes.biscuit.skyblockaddons.gui.buttons;
import codes.biscuit.skyblockaddons.SkyblockAddons;
+import codes.biscuit.skyblockaddons.core.Translations;
import codes.biscuit.skyblockaddons.utils.ColorCode;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
@@ -93,12 +94,12 @@ public void drawButton(Minecraft minecraft, int mouseX, int mouseY) {
int leftColor = SkyblockAddons.getInstance().getUtils().getDefaultColor(isOverLeftButton(mouseX, mouseY) ? 200 : 90);
int rightColor = SkyblockAddons.getInstance().getUtils().getDefaultColor(isOverRightButton(mouseX, mouseY) ? 200 : 90);
- String name = itemList.get(index).getName();
+ String name = Translations.getMessage(itemList.get(index).getName());
String trimmedName = minecraft.fontRendererObj.trimStringToWidth(name, textWidth);
if (!name.equals(trimmedName)) {
trimmedName = ellipsize(trimmedName);
}
- String description = itemList.get(index).getDescription();
+ String description = Translations.getMessage(itemList.get(index).getDescription());
// background / text area
drawRect(xPosition, yPosition, endX, yPosition + height, color);
// left button
diff --git a/src/main/java/codes/biscuit/skyblockaddons/gui/buttons/ButtonSolid.java b/src/main/java/codes/biscuit/skyblockaddons/gui/buttons/ButtonSolid.java
index 6a689af49..27b427b0c 100644
--- a/src/main/java/codes/biscuit/skyblockaddons/gui/buttons/ButtonSolid.java
+++ b/src/main/java/codes/biscuit/skyblockaddons/gui/buttons/ButtonSolid.java
@@ -39,6 +39,10 @@ public void drawButton(Minecraft mc, int mouseX, int mouseY) {
displayString = main.getConfigValues().getChromaMode().getMessage();
} else if (feature == Feature.WARNING_TIME) {
displayString = main.getConfigValues().getWarningSeconds()+"s";
+ } else if (feature == Feature.SHOW_BACKPACK_PREVIEW) {
+ displayString = main.getConfigValues().getBackpackStyle().getMessage();
+ } else if (feature == Feature.DEPLOYABLE_STATUS_DISPLAY) {
+ displayString = main.getConfigValues().getDeployableDisplayStyle().getMessage();
} else if (feature == Feature.TURN_ALL_FEATURES_CHROMA) {
boolean enable = false;
for (Feature loopFeature : Feature.values()) {
diff --git a/src/main/java/codes/biscuit/skyblockaddons/listeners/PlayerListener.java b/src/main/java/codes/biscuit/skyblockaddons/listeners/PlayerListener.java
index 7c86cc3c6..ef45b5777 100644
--- a/src/main/java/codes/biscuit/skyblockaddons/listeners/PlayerListener.java
+++ b/src/main/java/codes/biscuit/skyblockaddons/listeners/PlayerListener.java
@@ -21,10 +21,10 @@
import codes.biscuit.skyblockaddons.features.dungeonmap.DungeonMapManager;
import codes.biscuit.skyblockaddons.features.enchants.EnchantManager;
import codes.biscuit.skyblockaddons.features.fishParticles.FishParticleManager;
-import codes.biscuit.skyblockaddons.features.powerorbs.PowerOrbManager;
+import codes.biscuit.skyblockaddons.features.deployables.DeployableManager;
import codes.biscuit.skyblockaddons.features.slayertracker.SlayerTracker;
import codes.biscuit.skyblockaddons.features.tablist.TabListParser;
-import codes.biscuit.skyblockaddons.features.tabtimers.TabEffectManager;
+import codes.biscuit.skyblockaddons.features.tablist.TabStringType;
import codes.biscuit.skyblockaddons.gui.IslandWarpGui;
import codes.biscuit.skyblockaddons.misc.scheduler.Scheduler;
import codes.biscuit.skyblockaddons.misc.scheduler.SkyblockRunnable;
@@ -91,7 +91,6 @@ public class PlayerListener {
private static final Pattern NO_ARROWS_LEFT_PATTERN = Pattern.compile("(?:§r)?§cYou don't have any more Arrows left in your Quiver!§r");
private static final Pattern ONLY_HAVE_ARROWS_LEFT_PATTERN = Pattern.compile("(?:§r)?§cYou only have (?[0-9]+) Arrows left in your Quiver!§r");
- private static final String ENCHANT_LINE_STARTS_WITH = "§5§o§9";
private static final Pattern ABILITY_CHAT_PATTERN = Pattern.compile("§r§aUsed §r§6[A-Za-z ]+§r§a! §r§b\\([0-9]+ Mana\\)§r");
private static final Pattern PROFILE_CHAT_PATTERN = Pattern.compile("You are playing on profile: ([A-Za-z]+).*");
private static final Pattern SWITCH_PROFILE_CHAT_PATTERN = Pattern.compile("Your profile was changed to: ([A-Za-z]+).*");
@@ -133,7 +132,6 @@ public class PlayerListener {
Utils.getBlockMetaId(Blocks.wool, EnumDyeColor.GRAY.getMetadata()));
private long lastWorldJoin = -1;
- private long lastBoss = -1;
private long lastBal = -1;
private long lastBroodmother = -1;
private int balTick = -1;
@@ -169,11 +167,10 @@ public class PlayerListener {
// For caching for the PROFILE_TYPE_IN_CHAT feature, saves the last MAX_SIZE names.
private final LinkedHashMap namesWithSymbols = new LinkedHashMap(){
- private final int MAX_SIZE = 80;
-
protected boolean removeEldestEntry(Map.Entry eldest)
{
- return size() > MAX_SIZE;
+ // MAX_SIZE = 80
+ return size() > 80;
}
};
@@ -186,7 +183,6 @@ public void onWorldJoin(EntityJoinWorldEvent e) {
if (entity == Minecraft.getMinecraft().thePlayer) {
lastWorldJoin = Minecraft.getSystemTime();
- lastBoss = -1;
timerTick = 1;
main.getInventoryUtils().resetPreviousInventory();
countedEndermen.clear();
@@ -444,22 +440,12 @@ public void onChatReceive(ClientChatReceivedEvent e) {
} else if ((matcher = PROFILE_CHAT_PATTERN.matcher(strippedText)).matches()) {
String profile = matcher.group(1);
-
- // TODO: Slothpixel can no longer handle our queries
-/* if (!profile.equals(main.getUtils().getProfileName())) {
- APIManager.getInstance().onProfileSwitch(profile);
- }*/
-
main.getUtils().setProfileName(profile);
} else if ((matcher = SWITCH_PROFILE_CHAT_PATTERN.matcher(strippedText)).matches()) {
String profile = matcher.group(1);
-
-/* if (!profile.equals(main.getUtils().getProfileName())) {
- APIManager.getInstance().onProfileSwitch(profile);
- }*/
-
main.getUtils().setProfileName(profile);
+
}
}
}
@@ -470,12 +456,12 @@ private void playerSymbolsDisplay(ClientChatReceivedEvent e, String unformattedT
String username = TextUtils.stripColor(unformattedText.split(":")[0]);
// Remove chat channel prefix
if(username.contains(">")){
- username = username.substring(username.indexOf('>')+1);
+ username = username.substring(username.indexOf('>')+1).trim();
}
- // Remove rank prefix and guild rank suffix if exists
- username = TextUtils.trimWhitespaceAndResets(username.replaceAll("\\[[^\\[\\]]*\\]",""));
// Check if stripped username is a real username or the player
if (TextUtils.isUsername(username) || username.equals("**MINECRAFTUSERNAME**")) {
+ // Remove rank prefix and guild rank suffix if exists
+ username = TextUtils.stripUsername(username);
EntityPlayer chattingPlayer = Minecraft.getMinecraft().theWorld.getPlayerEntityByName(username);
// Put player in cache if found nearby
if(chattingPlayer != null) {
@@ -485,7 +471,10 @@ private void playerSymbolsDisplay(ClientChatReceivedEvent e, String unformattedT
else {
Collection networkPlayerInfos = Minecraft.getMinecraft().thePlayer.sendQueue.getPlayerInfoMap();
String finalUsername = username;
- Optional result = networkPlayerInfos.stream().filter(npi -> npi.getDisplayName() != null).filter(npi -> TextUtils.stripUsername(npi.getDisplayName().getUnformattedText()).equals(finalUsername)).findAny();
+ Optional result = networkPlayerInfos.stream()
+ .filter(npi -> npi.getDisplayName() != null)
+ .filter(npi -> TabStringType.usernameFromLine(npi.getDisplayName().getFormattedText()).equals(finalUsername))
+ .findAny();
// Put in cache if found
if(result.isPresent()){
namesWithSymbols.put(username, result.get().getDisplayName().getFormattedText());
@@ -498,14 +487,16 @@ private void playerSymbolsDisplay(ClientChatReceivedEvent e, String unformattedT
String suffix = " ";
if(main.getConfigValues().isEnabled(Feature.SHOW_PROFILE_TYPE)){
Matcher m = PROFILE_TYPE_SYMBOL.matcher(usernameWithSymbols);
- if(m.find()){
- suffix+=m.group(0);
+ if(m.find()) {
+ suffix += m.group(0);
}
}
if(main.getConfigValues().isEnabled(Feature.SHOW_NETHER_FACTION)){
Matcher m = NETHER_FACTION_SYMBOL.matcher(usernameWithSymbols);
- if(m.find()){
- suffix+=m.group(0);
+ if(m.find()) {
+ if (!suffix.equals(" "))
+ suffix += " ";
+ suffix += m.group(0);
}
}
if(!suffix.equals(" ")) {
@@ -620,8 +611,6 @@ public void onTick(TickEvent.ClientTickEvent e) {
// If above mana cap, do nothing
}
- this.parseTabList();
-
if (main.getConfigValues().isEnabled(Feature.DUNGEON_DEATH_COUNTER) && main.getUtils().isInDungeon()
&& main.getDungeonManager().isPlayerListInfoEnabled()) {
main.getDungeonManager().updateDeathsFromPlayerListInfo();
@@ -701,24 +690,6 @@ public void onTick(TickEvent.ClientTickEvent e) {
}
}
- // TODO Feature Rewrite
- public void parseTabList() {
- IChatComponent tabFooterChatComponent = Minecraft.getMinecraft().ingameGUI.getTabList().footer;
-
- String tabFooterString = null;
- String strippedTabFooterString = null;
- if (tabFooterChatComponent != null) {
- tabFooterString = tabFooterChatComponent.getFormattedText();
- strippedTabFooterString = TextUtils.stripColor(tabFooterString);
- }
-
- if (main.getUtils().isOnSkyblock()) {
- if (main.getConfigValues().isEnabled(Feature.TAB_EFFECT_TIMERS)) {
- TabEffectManager.getInstance().update(tabFooterString, strippedTabFooterString);
- }
- }
- }
-
@SubscribeEvent
public void onEntityEvent(LivingEvent.LivingUpdateEvent e) {
if (!main.getUtils().isOnSkyblock()) {
@@ -755,32 +726,40 @@ public void onEntityEvent(LivingEvent.LivingUpdateEvent e) {
}
}
- if (entity instanceof EntityArmorStand && entity.hasCustomName()) {
- PowerOrbManager.getInstance().detectPowerOrb(entity);
+ if (entity instanceof EntityArmorStand) {
+ DeployableManager.getInstance().detectDeployables((EntityArmorStand) entity);
- if (main.getUtils().getLocation() == Location.ISLAND) {
- int cooldown = main.getConfigValues().getWarningSeconds() * 1000 + 5000;
- if (main.getConfigValues().isEnabled(Feature.MINION_FULL_WARNING) &&
- entity.getCustomNameTag().equals("§cMy storage is full! :(")) {
- long now = System.currentTimeMillis();
- if (now - lastMinionSound > cooldown) {
- lastMinionSound = now;
- main.getUtils().playLoudSound("random.pop", 1);
- main.getRenderListener().setSubtitleFeature(Feature.MINION_FULL_WARNING);
- main.getScheduler().schedule(Scheduler.CommandType.RESET_SUBTITLE_FEATURE, main.getConfigValues().getWarningSeconds());
- }
- } else if (main.getConfigValues().isEnabled(Feature.MINION_STOP_WARNING)) {
- Matcher matcher = MINION_CANT_REACH_PATTERN.matcher(entity.getCustomNameTag());
- if (matcher.matches()) {
+ if (entity.hasCustomName()){
+ if (main.getUtils().getLocation() == Location.ISLAND) {
+ int cooldown = main.getConfigValues().getWarningSeconds() * 1000 + 5000;
+ if (main.getConfigValues().isEnabled(Feature.MINION_FULL_WARNING) &&
+ entity.getCustomNameTag().equals("§cMy storage is full! :(")) {
long now = System.currentTimeMillis();
if (now - lastMinionSound > cooldown) {
lastMinionSound = now;
- main.getUtils().playLoudSound("random.orb", 1);
-
- String mobName = matcher.group("mobName");
- main.getRenderListener().setCannotReachMobName(mobName);
- main.getRenderListener().setSubtitleFeature(Feature.MINION_STOP_WARNING);
- main.getScheduler().schedule(Scheduler.CommandType.RESET_SUBTITLE_FEATURE, main.getConfigValues().getWarningSeconds());
+ main.getUtils().playLoudSound("random.pop", 1);
+ main.getRenderListener().setSubtitleFeature(Feature.MINION_FULL_WARNING);
+ main.getScheduler().schedule(
+ Scheduler.CommandType.RESET_SUBTITLE_FEATURE
+ , main.getConfigValues().getWarningSeconds())
+ ;
+ }
+ } else if (main.getConfigValues().isEnabled(Feature.MINION_STOP_WARNING)) {
+ Matcher matcher = MINION_CANT_REACH_PATTERN.matcher(entity.getCustomNameTag());
+ if (matcher.matches()) {
+ long now = System.currentTimeMillis();
+ if (now - lastMinionSound > cooldown) {
+ lastMinionSound = now;
+ main.getUtils().playLoudSound("random.orb", 1);
+
+ String mobName = matcher.group("mobName");
+ main.getRenderListener().setCannotReachMobName(mobName);
+ main.getRenderListener().setSubtitleFeature(Feature.MINION_STOP_WARNING);
+ main.getScheduler().schedule(
+ Scheduler.CommandType.RESET_SUBTITLE_FEATURE
+ , main.getConfigValues().getWarningSeconds()
+ );
+ }
}
}
}
diff --git a/src/main/java/codes/biscuit/skyblockaddons/listeners/RenderListener.java b/src/main/java/codes/biscuit/skyblockaddons/listeners/RenderListener.java
index 095215fc9..ee34851e6 100644
--- a/src/main/java/codes/biscuit/skyblockaddons/listeners/RenderListener.java
+++ b/src/main/java/codes/biscuit/skyblockaddons/listeners/RenderListener.java
@@ -12,8 +12,8 @@
import codes.biscuit.skyblockaddons.features.dragontracker.DragonType;
import codes.biscuit.skyblockaddons.features.dragontracker.DragonsSince;
import codes.biscuit.skyblockaddons.features.healingcircle.HealingCircleManager;
-import codes.biscuit.skyblockaddons.features.powerorbs.PowerOrb;
-import codes.biscuit.skyblockaddons.features.powerorbs.PowerOrbManager;
+import codes.biscuit.skyblockaddons.features.deployables.Deployable;
+import codes.biscuit.skyblockaddons.features.deployables.DeployableManager;
import codes.biscuit.skyblockaddons.features.slayertracker.SlayerBoss;
import codes.biscuit.skyblockaddons.features.slayertracker.SlayerDrop;
import codes.biscuit.skyblockaddons.features.slayertracker.SlayerTracker;
@@ -21,8 +21,6 @@
import codes.biscuit.skyblockaddons.features.spookyevent.SpookyEventManager;
import codes.biscuit.skyblockaddons.features.tablist.TabListParser;
import codes.biscuit.skyblockaddons.features.tablist.TabListRenderer;
-import codes.biscuit.skyblockaddons.features.tabtimers.TabEffect;
-import codes.biscuit.skyblockaddons.features.tabtimers.TabEffectManager;
import codes.biscuit.skyblockaddons.gui.*;
import codes.biscuit.skyblockaddons.gui.buttons.ButtonLocation;
import codes.biscuit.skyblockaddons.misc.Updater;
@@ -43,6 +41,7 @@
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityArmorStand;
import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.monster.*;
import net.minecraft.entity.monster.EntityCaveSpider;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.monster.EntitySpider;
@@ -67,7 +66,7 @@
import java.awt.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
-import java.text.DecimalFormat;
+import java.text.ParseException;
import java.util.List;
import java.util.*;
@@ -117,6 +116,7 @@ public class RenderListener {
private static EntityCaveSpider caveSpider;
private static EntityWolf sven;
private static EntityEnderman enderman;
+ private static EntityBlaze inferno;
private final SkyblockAddons main = SkyblockAddons.getInstance();
@@ -314,7 +314,7 @@ private void renderWarnings(ScaledResolution scaledResolution) {
break;
case NO_ARROWS_LEFT_ALERT:
if (arrowsLeft != -1) {
- Translations.getMessage("messages.noArrowsLeft", TextUtils.NUMBER_FORMAT.format(arrowsLeft));
+ Translations.getMessage("messages.noArrowsLeft", TextUtils.formatNumber(arrowsLeft));
}
break;
}
@@ -673,22 +673,22 @@ public void drawText(Feature feature, float scale, Minecraft mc, ButtonLocation
String text;
int color = main.getConfigValues().getColor(feature);
if (feature == Feature.MANA_TEXT) {
- text = NUMBER_FORMAT.format(getAttribute(Attribute.MANA)) + "/" + NUMBER_FORMAT.format(getAttribute(Attribute.MAX_MANA));
+ text = TextUtils.formatNumber(getAttribute(Attribute.MANA)) + "/" + TextUtils.formatNumber(getAttribute(Attribute.MAX_MANA));
} else if (feature == Feature.OVERFLOW_MANA) {
if (getAttribute(Attribute.OVERFLOW_MANA) != 0 || buttonLocation != null) {
- text = getAttribute(Attribute.OVERFLOW_MANA) + "ʬ";
+ text = TextUtils.formatNumber(getAttribute(Attribute.OVERFLOW_MANA)) + "ʬ";
} else {
return;
}
} else if (feature == Feature.HEALTH_TEXT) {
- text = NUMBER_FORMAT.format(getAttribute(Attribute.HEALTH)) + "/" + NUMBER_FORMAT.format(getAttribute(Attribute.MAX_HEALTH));
+ text = TextUtils.formatNumber(getAttribute(Attribute.HEALTH)) + "/" + TextUtils.formatNumber(getAttribute(Attribute.MAX_HEALTH));
} else if (feature == Feature.CRIMSON_ARMOR_ABILITY_STACKS) {
text = getCrimsonArmorAbilityStacks();
if (text == null) return;
} else if (feature == Feature.DEFENCE_TEXT) {
- text = NUMBER_FORMAT.format(getAttribute(Attribute.DEFENCE));
+ text = TextUtils.formatNumber(getAttribute(Attribute.DEFENCE));
} else if (feature == Feature.OTHER_DEFENCE_STATS) {
text = main.getPlayerListener().getActionBarParser().getOtherDefense();
@@ -700,13 +700,13 @@ public void drawText(Feature feature, float scale, Minecraft mc, ButtonLocation
}
} else if (feature == Feature.EFFECTIVE_HEALTH_TEXT) {
- text = NUMBER_FORMAT.format(Math.round(getAttribute(Attribute.HEALTH) * (1 + getAttribute(Attribute.DEFENCE) / 100F)));
+ text = TextUtils.formatNumber(Math.round(getAttribute(Attribute.HEALTH) * (1 + getAttribute(Attribute.DEFENCE) / 100F)));
} else if (feature == Feature.DRILL_FUEL_TEXT) {
if (!ItemUtils.isDrill(mc.thePlayer.getHeldItem())) {
return;
}
- text = (getAttribute(Attribute.FUEL) + "/" + getAttribute(Attribute.MAX_FUEL)).replaceAll("000$", "k");
+ text = TextUtils.formatNumber(getAttribute(Attribute.FUEL)) + "/" + TextUtils.formatNumber(getAttribute(Attribute.MAX_FUEL));//.replaceAll("000$", "k");
} else if (feature == Feature.DEFENCE_PERCENTAGE) {
double doubleDefence = getAttribute(Attribute.DEFENCE);
double percentage = ((doubleDefence / 100) / ((doubleDefence / 100) + 1)) * 100; //Taken from https://hypixel.net/threads/how-armor-works-and-the-diminishing-return-of-higher-defence.2178928/
@@ -714,7 +714,7 @@ public void drawText(Feature feature, float scale, Minecraft mc, ButtonLocation
text = bigDecimal + "%";
} else if (feature == Feature.SPEED_PERCENTAGE) {
- String walkSpeed = NUMBER_FORMAT.format(Minecraft.getMinecraft().thePlayer.capabilities.getWalkSpeed() * 1000);
+ String walkSpeed = TextUtils.formatNumber(Minecraft.getMinecraft().thePlayer.capabilities.getWalkSpeed() * 1000);
text = walkSpeed.substring(0, Math.min(walkSpeed.length(), 3));
if (text.endsWith(".")) text = text.substring(0, text.indexOf('.')); //remove trailing periods
@@ -726,7 +726,7 @@ public void drawText(Feature feature, float scale, Minecraft mc, ButtonLocation
if (buttonLocation == null) {
if (healthUpdate != null) {
color = healthUpdate > 0 ? ColorCode.GREEN.getColor() : ColorCode.RED.getColor();
- text = (healthUpdate > 0 ? "+" : "-") + NUMBER_FORMAT.format(Math.abs(healthUpdate));
+ text = (healthUpdate > 0 ? "+" : "-") + TextUtils.formatNumber(Math.abs(healthUpdate));
} else {
return;
}
@@ -948,10 +948,10 @@ public void drawText(Feature feature, float scale, Minecraft mc, ButtonLocation
text = Integer.toString(deaths);
} else if (feature == Feature.ROCK_PET_TRACKER) {
- text = String.valueOf(main.getPersistentValuesManager().getPersistentValues().getOresMined());
+ text = TextUtils.formatNumber(main.getPersistentValuesManager().getPersistentValues().getOresMined());
} else if (feature == Feature.DOLPHIN_PET_TRACKER) {
- text = String.valueOf(main.getPersistentValuesManager().getPersistentValues().getSeaCreaturesKilled());
+ text = TextUtils.formatNumber(main.getPersistentValuesManager().getPersistentValues().getSeaCreaturesKilled());
} else if (feature == Feature.DUNGEONS_SECRETS_DISPLAY) {
if (buttonLocation == null && !main.getUtils().isInDungeon()) {
@@ -1179,10 +1179,15 @@ public void drawText(Feature feature, float scale, Minecraft mc, ButtonLocation
renderItem(dungeonMilestone.getDungeonClass().getItem(), x, y);
FontRendererHook.setupFeatureFont(feature);
DrawUtils.drawText(text, x + 18, y, color);
- double amount = Double.parseDouble(dungeonMilestone.getValue());
- DecimalFormat formatter = new DecimalFormat("#,###");
- DrawUtils.drawText(formatter.format(amount), x + 18 + mc.fontRendererObj.getStringWidth(text) / 2F
- - mc.fontRendererObj.getStringWidth(formatter.format(amount)) / 2F, y + 9, color);
+ Number amount;
+ try {
+ amount = NUMBER_FORMAT.parse(dungeonMilestone.getValue());
+ } catch (ParseException e) {
+ amount = -1;
+ }
+ String formattedAmount = TextUtils.formatNumber(amount);
+ DrawUtils.drawText(formattedAmount, x + 18 + mc.fontRendererObj.getStringWidth(text) / 2F
+ - mc.fontRendererObj.getStringWidth(formattedAmount) / 2F, y + 9, color);
FontRendererHook.endFeatureFont();
} else if (feature == Feature.DUNGEONS_COLLECTED_ESSENCES_DISPLAY) {
@@ -1525,7 +1530,7 @@ public void drawSlayerTrackers(Feature feature, Minecraft mc, float scale, Butto
slayerBoss = SlayerBoss.REVENANT;
} else if (feature == Feature.TARANTULA_SLAYER_TRACKER) {
if (buttonLocation == null && config.isEnabled(Feature.HIDE_WHEN_NOT_IN_SPIDERS_DEN) &&
- (quest != EnumUtils.SlayerQuest.TARANTULA_BROODFATHER || location != Location.SPIDERS_DEN)) {
+ (quest != EnumUtils.SlayerQuest.TARANTULA_BROODFATHER || (location != Location.SPIDER_MOUND && location != Location.ARACHNES_BURROW && location != Location.ARACHNES_SANCTUARY))) {
return;
}
@@ -1550,6 +1555,15 @@ public void drawSlayerTrackers(Feature feature, Minecraft mc, float scale, Butto
colorByRarity = config.isEnabled(Feature.ENDERMAN_COLOR_BY_RARITY);
textMode = config.isEnabled(Feature.ENDERMAN_TEXT_MODE);
slayerBoss = SlayerBoss.VOIDGLOOM;
+ } else if (feature == Feature.INFERNO_SLAYER_TRACKER) {
+ if (buttonLocation == null && config.isEnabled(Feature.HIDE_WHEN_NOT_IN_CRIMSON) &&
+ (quest != EnumUtils.SlayerQuest.INFERNO_DEMONLORD || (location != Location.CRIMSON_ISLE && location != Location.STRONGHOLD && location != Location.SMOLDERING_TOMB && location != Location.THE_WASTELAND))) {
+ return;
+ }
+
+ colorByRarity = config.isEnabled(Feature.INFERNO_COLOR_BY_RARITY);
+ textMode = config.isEnabled(Feature.INFERNO_TEXT_MODE);
+ slayerBoss = SlayerBoss.INFERNO;
} else {
return;
}
@@ -1636,6 +1650,9 @@ public void drawSlayerTrackers(Feature feature, Minecraft mc, float scale, Butto
} else if (feature == Feature.VOIDGLOOM_SLAYER_TRACKER) {
entityRenderY = 25;
textCenterX = 20;
+ } else if (feature == Feature.INFERNO_SLAYER_TRACKER) {
+ entityRenderY = 25;
+ textCenterX = 20;
} else {
entityRenderY = 36;
textCenterX = 15;
@@ -1717,6 +1734,16 @@ public void drawSlayerTrackers(Feature feature, Minecraft mc, float scale, Butto
drawEntity(enderman, (x + 15) / .7F, (y + 51) / .7F, -30);
GlStateManager.scale(1 / .7, 1 / .7, 1);
+ } else if (feature == Feature.INFERNO_SLAYER_TRACKER) {
+ if (inferno == null) {
+ inferno = new EntityBlaze(Utils.getDummyWorld());
+ inferno.setOnFire(true);
+
+ }
+ GlStateManager.color(1, 1, 1, 1);
+ inferno.ticksExisted = (int) main.getNewScheduler().getTotalTicks();
+ drawEntity(inferno, x + 15, y + 53, -15);
+
} else {
if (sven == null) {
sven = new EntityWolf(Utils.getDummyWorld());
@@ -1959,123 +1986,6 @@ public void drawRevenantIndicator(float scale, Minecraft mc, ButtonLocation butt
main.getUtils().restoreGLOptions();
}
- public void drawPotionEffectTimers(float scale, ButtonLocation buttonLocation) {
- float x = main.getConfigValues().getActualX(Feature.TAB_EFFECT_TIMERS);
- float y = main.getConfigValues().getActualY(Feature.TAB_EFFECT_TIMERS);
-
- TabEffectManager tabEffect = TabEffectManager.getInstance();
-
- List potionTimers = tabEffect.getPotionTimers();
- List powerupTimers = tabEffect.getPowerupTimers();
-
- if (buttonLocation == null) {
- if (potionTimers.isEmpty() && powerupTimers.isEmpty() && TabEffectManager.getInstance().getEffectCount() == 0) {
- return;
- }
- } else { // When editing GUI draw dummy timers.
- potionTimers = TabEffectManager.getDummyPotionTimers();
- powerupTimers = TabEffectManager.getDummyPowerupTimers();
- }
-
- EnumUtils.AnchorPoint anchorPoint = main.getConfigValues().getAnchorPoint(Feature.TAB_EFFECT_TIMERS);
- boolean topDown = (anchorPoint == EnumUtils.AnchorPoint.TOP_LEFT || anchorPoint == EnumUtils.AnchorPoint.TOP_RIGHT);
-
- int totalEffects = TabEffectManager.getDummyPotionTimers().size() + TabEffectManager.getDummyPowerupTimers().size() + 1; // + 1 to account for the "x Effects Active" line
- int spacer = (!TabEffectManager.getDummyPotionTimers().isEmpty() && !TabEffectManager.getDummyPowerupTimers().isEmpty()) ? 3 : 0;
-
- int lineHeight = 8 + 1; // 1 pixel between each line.
-
- //9 px per effect + 3px spacer between Potions and Powerups if both exist.
- int height = (totalEffects * lineHeight) + spacer - 1; // -1 Because last line doesn't need a pixel under.
- int width = 156; //String width of "Enchanting XP Boost III 1:23:45"
-
- x = transformXY(x, width, scale);
- y = transformXY(y, height, scale);
-
- if (buttonLocation != null) {
- buttonLocation.checkHoveredAndDrawBox(x, x + width, y, y + height, scale);
- GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
- }
-
- main.getUtils().enableStandardGLOptions();
-
- boolean alignRight = (anchorPoint == EnumUtils.AnchorPoint.TOP_RIGHT || anchorPoint == EnumUtils.AnchorPoint.BOTTOM_RIGHT);
-
- int color = main.getConfigValues().getColor(Feature.TAB_EFFECT_TIMERS);
-
- Minecraft mc = Minecraft.getMinecraft();
-
- // Draw the "x Effects Active" line
- FontRendererHook.setupFeatureFont(Feature.TAB_EFFECT_TIMERS);
- int effectCount = TabEffectManager.getInstance().getEffectCount();
- String text = effectCount == 1 ? Translations.getMessage("messages.effectActive") :
- Translations.getMessage("messages.effectsActive", String.valueOf(effectCount));
- float lineY;
- if (topDown) {
- lineY = y;
- } else {
- lineY = y + height - 8;
- }
- if (alignRight) {
- DrawUtils.drawText(text, x + width - mc.fontRendererObj.getStringWidth(text), lineY, color);
- } else {
- DrawUtils.drawText(text, x, lineY, color);
- }
- FontRendererHook.endFeatureFont();
-
- int drawnCount = 1; // 1 to account for the line above
- for (TabEffect potion : potionTimers) {
- if (topDown) {
- lineY = y + drawnCount * lineHeight;
- } else {
- lineY = y + height - drawnCount * lineHeight - 8;
- }
-
- String effect = potion.getEffect();
- String duration = potion.getDurationForDisplay();
-
- if (alignRight) {
- FontRendererHook.setupFeatureFont(Feature.TAB_EFFECT_TIMERS);
- DrawUtils.drawText(duration + " ", x + width - mc.fontRendererObj.getStringWidth(duration + " ")
- - mc.fontRendererObj.getStringWidth(effect.trim()), lineY, color);
- FontRendererHook.endFeatureFont();
- DrawUtils.drawText(effect.trim(), x + width - mc.fontRendererObj.getStringWidth(effect.trim()), lineY, color);
- } else {
- DrawUtils.drawText(effect, x, lineY, color);
- FontRendererHook.setupFeatureFont(Feature.TAB_EFFECT_TIMERS);
- DrawUtils.drawText(duration, x + mc.fontRendererObj.getStringWidth(effect), lineY, color);
- FontRendererHook.endFeatureFont();
- }
- drawnCount++;
- }
- for (TabEffect powerUp : powerupTimers) {
- if (topDown) {
- lineY = y + spacer + drawnCount * lineHeight;
- } else {
- lineY = y + height - drawnCount * lineHeight - spacer - 8;
- }
-
- String effect = powerUp.getEffect();
- String duration = powerUp.getDurationForDisplay();
-
- if (alignRight) {
- FontRendererHook.setupFeatureFont(Feature.TAB_EFFECT_TIMERS);
- DrawUtils.drawText(duration + " ", x + width - mc.fontRendererObj.getStringWidth(duration + " ")
- - mc.fontRendererObj.getStringWidth(effect.trim()), lineY, color);
- FontRendererHook.endFeatureFont();
- DrawUtils.drawText(effect, x + width - mc.fontRendererObj.getStringWidth(effect.trim()), lineY, color);
- } else {
- DrawUtils.drawText(effect, x, lineY, color);
- FontRendererHook.setupFeatureFont(Feature.TAB_EFFECT_TIMERS);
- DrawUtils.drawText(duration, x + mc.fontRendererObj.getStringWidth(effect), lineY, color);
- FontRendererHook.endFeatureFont();
- }
- drawnCount++;
- }
-
- main.getUtils().restoreGLOptions();
- }
-
private void renderItem(ItemStack item, float x, float y) {
GlStateManager.enableRescaleNormal();
RenderHelper.enableGUIStandardItemLighting();
@@ -2149,34 +2059,34 @@ public void drawItemPickupLog(float scale, ButtonLocation buttonLocation) {
main.getUtils().restoreGLOptions();
}
- public void drawPowerOrbStatus(Minecraft mc, float scale, ButtonLocation buttonLocation) {
- PowerOrbManager.PowerOrbEntry activePowerOrb = PowerOrbManager.getInstance().getActivePowerOrb();
+ public void drawDeployableStatus(Minecraft mc, float scale, ButtonLocation buttonLocation) {
+ DeployableManager.DeployableEntry activeDeployable = DeployableManager.getInstance().getActiveDeployable();
if (buttonLocation != null) {
- activePowerOrb = PowerOrbManager.DUMMY_POWER_ORB_ENTRY;
+ activeDeployable = DeployableManager.DUMMY_POWER_ORB_ENTRY;
}
- if (activePowerOrb != null) {
- PowerOrb powerOrb = activePowerOrb.getPowerOrb();
- int seconds = activePowerOrb.getSeconds();
+ if (activeDeployable != null) {
+ Deployable deployable = activeDeployable.getDeployable();
+ int seconds = activeDeployable.getSeconds();
- EnumUtils.PowerOrbDisplayStyle displayStyle = main.getConfigValues().getPowerOrbDisplayStyle();
- if (displayStyle == EnumUtils.PowerOrbDisplayStyle.DETAILED) {
- drawDetailedPowerOrbStatus(mc, scale, buttonLocation, powerOrb, seconds);
+ EnumUtils.DeployableDisplayStyle displayStyle = main.getConfigValues().getDeployableDisplayStyle();
+ if (displayStyle == EnumUtils.DeployableDisplayStyle.DETAILED) {
+ drawDetailedDeployableStatus(mc, scale, buttonLocation, deployable, seconds);
} else {
- drawCompactPowerOrbStatus(mc, scale, buttonLocation, powerOrb, seconds);
+ drawCompactDeployableStatus(mc, scale, buttonLocation, deployable, seconds);
}
}
}
/**
- * Displays the power orb display in a compact way with only the amount of seconds to the right of the icon.
+ * Displays the deployable display in a compact way with only the amount of seconds to the right of the icon.
*
- * --
+ * ----
* | | XXs
- * --
+ * ----
*/
- private void drawCompactPowerOrbStatus(Minecraft mc, float scale, ButtonLocation buttonLocation, PowerOrb powerOrb, int seconds) {
- float x = main.getConfigValues().getActualX(Feature.POWER_ORB_STATUS_DISPLAY);
- float y = main.getConfigValues().getActualY(Feature.POWER_ORB_STATUS_DISPLAY);
+ private void drawCompactDeployableStatus(Minecraft mc, float scale, ButtonLocation buttonLocation, Deployable deployable, int seconds) {
+ float x = main.getConfigValues().getActualX(Feature.DEPLOYABLE_STATUS_DISPLAY);
+ float y = main.getConfigValues().getActualY(Feature.DEPLOYABLE_STATUS_DISPLAY);
String secondsString = String.format("§e%ss", seconds);
int spacing = 1;
@@ -2192,8 +2102,8 @@ private void drawCompactPowerOrbStatus(Minecraft mc, float scale, ButtonLocation
}
Entity entity = null;
- if (PowerOrbManager.getInstance().getActivePowerOrb() != null && PowerOrbManager.getInstance().getActivePowerOrb().getUuid() != null) {
- entity = Utils.getEntityByUUID(PowerOrbManager.getInstance().getActivePowerOrb().getUuid());
+ if (DeployableManager.getInstance().getActiveDeployable() != null && DeployableManager.getInstance().getActiveDeployable().getUuid() != null) {
+ entity = Utils.getEntityByUUID(DeployableManager.getInstance().getActiveDeployable().getUuid());
}
if (entity == null && buttonLocation != null) {
@@ -2203,9 +2113,9 @@ private void drawCompactPowerOrbStatus(Minecraft mc, float scale, ButtonLocation
main.getUtils().enableStandardGLOptions();
if (entity instanceof EntityArmorStand) {
- drawPowerOrbArmorStand((EntityArmorStand) entity, x + 1, y + 4);
+ drawDeployableArmorStand((EntityArmorStand) entity, x + 1, y + 4);
} else {
- mc.getTextureManager().bindTexture(powerOrb.getResourceLocation());
+ mc.getTextureManager().bindTexture(deployable.getResourceLocation());
DrawUtils.drawModalRectWithCustomSizedTexture(x, y, 0, 0, iconSize, iconSize, iconSize, iconSize);
}
@@ -2215,37 +2125,58 @@ private void drawCompactPowerOrbStatus(Minecraft mc, float scale, ButtonLocation
}
/**
- * Displays the power orb with detailed stats about the boost you're receiving.
+ * Displays the deployable with detailed stats about the boost you're receiving.
*
- * -- +X ❤/s
+ * ---- +X ❤/s
* | | +X ✎/s
- * -- +X ❁
+ * ---- +X ❁
* XXs
*/
- private void drawDetailedPowerOrbStatus(Minecraft mc, float scale, ButtonLocation buttonLocation, PowerOrb powerOrb, int seconds) {
- float x = main.getConfigValues().getActualX(Feature.POWER_ORB_STATUS_DISPLAY);
- float y = main.getConfigValues().getActualY(Feature.POWER_ORB_STATUS_DISPLAY);
+ private void drawDetailedDeployableStatus(Minecraft mc, float scale, ButtonLocation buttonLocation, Deployable deployable, int seconds) {
+ float x = main.getConfigValues().getActualX(Feature.DEPLOYABLE_STATUS_DISPLAY);
+ float y = main.getConfigValues().getActualY(Feature.DEPLOYABLE_STATUS_DISPLAY);
+
+ List display = new LinkedList<>();
- float maxHealth = main.getUtils().getAttributes().get(Attribute.MAX_HEALTH).getValue();
- float healthRegen = (float) (maxHealth * powerOrb.getHealthRegen());
- if (main.getUtils().getSlayerQuest() == EnumUtils.SlayerQuest.TARANTULA_BROODFATHER && main.getUtils().getSlayerQuestLevel() >= 2) {
- healthRegen *= 0.5; // Tarantula boss 2+ reduces healing by 50%.
+ if (deployable.getHealthRegen() > 0.0) {
+ float maxHealth = main.getUtils().getAttributes().get(Attribute.MAX_HEALTH).getValue();
+ float healthRegen = (float) (maxHealth * deployable.getHealthRegen());
+ if (main.getUtils().getSlayerQuest() == EnumUtils.SlayerQuest.TARANTULA_BROODFATHER && main.getUtils().getSlayerQuestLevel() >= 2) {
+ healthRegen *= 0.5; // Tarantula boss 2+ reduces healing by 50%.
+ }
+ display.add(String.format("§c+%s ❤/s", TextUtils.formatNumber(healthRegen)));
}
- double healIncrease = powerOrb.getHealIncrease() * 100;
- List display = new LinkedList<>();
- display.add(String.format("§c+%s ❤/s", TextUtils.formatDouble(healthRegen)));
- if (powerOrb.getManaRegen() > 0) {
+ if (deployable.getManaRegen() > 0.0) {
float maxMana = main.getUtils().getAttributes().get(Attribute.MAX_MANA).getValue();
- float manaRegen = (float) Math.floor(maxMana / 50);
- manaRegen = (float) (manaRegen + manaRegen * powerOrb.getManaRegen());
- display.add(String.format("§b+%s ✎/s", TextUtils.formatDouble(manaRegen)));
+ float manaRegen = (float) (maxMana * deployable.getManaRegen() * 2.0 / 100.0);
+ display.add(String.format("§b+%s ✎/s", TextUtils.formatNumber(manaRegen)));
+ }
+
+ if (deployable.getStrength() > 0) {
+ display.add(String.format("§c+%d ❁", deployable.getStrength()));
+ }
+
+ if (deployable.getVitality() > 0.0) {
+ double vit = deployable.getVitality();
+ display.add(String.format("§4+%s ♨", vit % 1 == 0.0 ? Integer.toString((int) vit) : vit));
+ }
+
+ if (deployable.getMending() > 0.0) {
+ double mending = deployable.getMending();
+ display.add(String.format("§a+%s ☄", mending % 1 == 0.0 ? Integer.toString((int) mending) : mending));
+ }
+
+ if (deployable.getTrueDefense() > 0) {
+ display.add(String.format("§f+%s ❂", deployable.getTrueDefense()));
}
- if (powerOrb.getStrength() > 0) {
- display.add(String.format("§4+%d ❁", powerOrb.getStrength()));
+
+ if (deployable.getFerocity() > 0) {
+ display.add(String.format("§c+%s ⫽", deployable.getFerocity()));
}
- if (healIncrease > 0) {
- display.add(String.format("§2+%s%% Healing", TextUtils.formatDouble(healIncrease)));
+
+ if (deployable.getBonusAttackSpeed() > 0) {
+ display.add(String.format("§e+%s%% ⚔", deployable.getBonusAttackSpeed()));
}
Optional longestLine = display.stream().max(Comparator.comparingInt(String::length));
@@ -2262,14 +2193,15 @@ private void drawDetailedPowerOrbStatus(Minecraft mc, float scale, ButtonLocatio
x = transformXY(x, width, scale);
y = transformXY(y, height, scale);
+ float startY = Math.round(y + (iconAndSecondsHeight / 2f) - (effectsHeight / 2f));
if (buttonLocation != null) {
- buttonLocation.checkHoveredAndDrawBox(x, x + width, y, y + height, scale);
+ buttonLocation.checkHoveredAndDrawBox(x, x + width, startY, startY + height, scale);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
Entity entity = null;
- if (PowerOrbManager.getInstance().getActivePowerOrb() != null && PowerOrbManager.getInstance().getActivePowerOrb().getUuid() != null) {
- entity = Utils.getEntityByUUID(PowerOrbManager.getInstance().getActivePowerOrb().getUuid());
+ if (DeployableManager.getInstance().getActiveDeployable() != null && DeployableManager.getInstance().getActiveDeployable().getUuid() != null) {
+ entity = Utils.getEntityByUUID(DeployableManager.getInstance().getActiveDeployable().getUuid());
}
if (entity == null && buttonLocation != null) {
@@ -2279,16 +2211,15 @@ private void drawDetailedPowerOrbStatus(Minecraft mc, float scale, ButtonLocatio
main.getUtils().enableStandardGLOptions();
if (entity instanceof EntityArmorStand) {
- drawPowerOrbArmorStand((EntityArmorStand) entity, x + 1, y + 4);
+ drawDeployableArmorStand((EntityArmorStand) entity, x + 1, y + 4);
} else {
- mc.getTextureManager().bindTexture(powerOrb.getResourceLocation());
+ mc.getTextureManager().bindTexture(deployable.getResourceLocation());
DrawUtils.drawModalRectWithCustomSizedTexture(x, y, 0, 0, iconSize, iconSize, iconSize, iconSize);
}
String secondsString = String.format("§e%ss", seconds);
DrawUtils.drawText(secondsString, Math.round(x + (iconSize / 2F) - (mc.fontRendererObj.getStringWidth(secondsString) / 2F)), y + iconSize, ColorCode.WHITE.getColor(255));
- float startY = Math.round(y + (iconAndSecondsHeight / 2f) - (effectsHeight / 2f));
for (int i = 0; i < display.size(); i++) {
DrawUtils.drawText(display.get(i), x + iconSize + 2, startY + (i * (mc.fontRendererObj.FONT_HEIGHT + spacingBetweenLines)), ColorCode.WHITE.getColor(255));
}
@@ -2490,9 +2421,9 @@ public void onRenderWorld(RenderWorldLastEvent e) {
}
}
- private void drawPowerOrbArmorStand(EntityArmorStand powerOrbArmorStand, float x, float y) {
- float prevRenderYawOffset = powerOrbArmorStand.renderYawOffset;
- float prevPrevRenderYawOffset = powerOrbArmorStand.prevRenderYawOffset;
+ private void drawDeployableArmorStand(EntityArmorStand deployableArmorStand, float x, float y) {
+ float prevRenderYawOffset = deployableArmorStand.renderYawOffset;
+ float prevPrevRenderYawOffset = deployableArmorStand.prevRenderYawOffset;
GlStateManager.pushMatrix();
@@ -2512,12 +2443,12 @@ private void drawPowerOrbArmorStand(EntityArmorStand powerOrbArmorStand, float x
boolean shadowsEnabled = rendermanager.isRenderShadow();
rendermanager.setRenderShadow(false);
- powerOrbArmorStand.setInvisible(true);
+ deployableArmorStand.setInvisible(true);
float yaw = System.currentTimeMillis() % 1750 / 1750F * 360F;
- powerOrbArmorStand.renderYawOffset = yaw;
- powerOrbArmorStand.prevRenderYawOffset = yaw;
+ deployableArmorStand.renderYawOffset = yaw;
+ deployableArmorStand.prevRenderYawOffset = yaw;
- rendermanager.renderEntityWithPosYaw(powerOrbArmorStand, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
+ rendermanager.renderEntityWithPosYaw(deployableArmorStand, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
rendermanager.setRenderShadow(shadowsEnabled);
RenderHelper.disableStandardItemLighting();
@@ -2528,8 +2459,8 @@ private void drawPowerOrbArmorStand(EntityArmorStand powerOrbArmorStand, float x
GlStateManager.popMatrix();
- powerOrbArmorStand.renderYawOffset = prevRenderYawOffset;
- powerOrbArmorStand.prevRenderYawOffset = prevPrevRenderYawOffset;
+ deployableArmorStand.renderYawOffset = prevRenderYawOffset;
+ deployableArmorStand.prevRenderYawOffset = prevPrevRenderYawOffset;
}
private void drawEntity(EntityLivingBase entity, float x, float y, float yaw) {
@@ -2569,9 +2500,9 @@ public EntityArmorStand getRadiantDummyArmorStand() {
radiantDummyArmorStand = new EntityArmorStand(Utils.getDummyWorld());
- ItemStack orbItemStack = ItemUtils.createSkullItemStack(null, null, "3ae3572b-2679-40b4-ba50-14dd58cbbbf7", "7ab4c4d6ee69bc24bba2b8faf67b9f704a06b01aa93f3efa6aef7a9696c4feef");
+ ItemStack deployableItemStack = ItemUtils.createSkullItemStack(null, null, "3ae3572b-2679-40b4-ba50-14dd58cbbbf7", "c0062cc98ebda72a6a4b89783adcef2815b483a01d73ea87b3df76072a89d13b");
- radiantDummyArmorStand.setCurrentItemOrArmor(4, orbItemStack);
+ radiantDummyArmorStand.setCurrentItemOrArmor(4, deployableItemStack);
return radiantDummyArmorStand;
}
diff --git a/src/main/java/codes/biscuit/skyblockaddons/utils/ActionBarParser.java b/src/main/java/codes/biscuit/skyblockaddons/utils/ActionBarParser.java
index 7e5175eb5..094d3c63d 100644
--- a/src/main/java/codes/biscuit/skyblockaddons/utils/ActionBarParser.java
+++ b/src/main/java/codes/biscuit/skyblockaddons/utils/ActionBarParser.java
@@ -51,7 +51,7 @@
public class ActionBarParser {
private static final Pattern COLLECTIONS_CHAT_PATTERN = Pattern.compile("\\+(?[0-9,.]+) (?[A-Za-z]+) (?