From c40f8e737c62c8dadef294f8621716529d354796 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Fri, 5 Feb 2021 03:52:39 +0800 Subject: PRE15 --- .../notenoughupdates/NEUEventListener.java | 203 ++++++++++++++++++--- .../notenoughupdates/NotEnoughUpdates.java | 5 +- .../notenoughupdates/core/config/Position.java | 58 +++--- .../core/config/gui/GuiOptionEditor.java | 2 +- .../config/gui/GuiOptionEditorDraggableList.java | 42 ++++- .../core/config/gui/GuiPositionEditor.java | 8 +- .../notenoughupdates/cosmetics/CapeManager.java | 4 + .../notenoughupdates/dungeons/DungeonMap.java | 7 +- .../dungeons/GuiDungeonMapEditor.java | 4 +- .../miscfeatures/BetterContainers.java | 1 + .../miscfeatures/DwarvenMinesWaypoints.java | 35 ++-- .../notenoughupdates/miscfeatures/FlyFix.java | 70 +++++++ .../notenoughupdates/miscfeatures/MiningStuff.java | 7 +- .../notenoughupdates/mixins/MixinContainer.java | 4 + .../notenoughupdates/mixins/MixinGuiContainer.java | 1 + .../mixins/MixinNetHandlerPlayClient.java | 23 ++- .../mixins/MixinPlayerControllerMP.java | 3 + .../notenoughupdates/options/NEUConfig.java | 201 +++++++++++--------- .../overlays/CommissionOverlay.java | 149 --------------- .../notenoughupdates/overlays/FarmingOverlay.java | 44 +++-- .../notenoughupdates/overlays/FuelBar.java | 4 +- .../notenoughupdates/overlays/MiningOverlay.java | 160 ++++++++++++++++ .../notenoughupdates/overlays/OverlayManager.java | 61 +++++++ .../notenoughupdates/overlays/TextOverlay.java | 113 +++++++----- .../profileviewer/ProfileViewer.java | 12 +- .../moulberry/notenoughupdates/util/Constants.java | 2 + .../moulberry/notenoughupdates/util/Utils.java | 8 + .../notenoughupdates/util/XPInformation.java | 21 ++- 28 files changed, 868 insertions(+), 384 deletions(-) create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FlyFix.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/overlays/CommissionOverlay.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java (limited to 'src') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java index 9d619c78..8a6f77ea 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java @@ -1,8 +1,10 @@ package io.github.moulberry.notenoughupdates; +import com.google.common.collect.Lists; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; import io.github.moulberry.notenoughupdates.auction.CustomAHGui; import io.github.moulberry.notenoughupdates.core.BackgroundBlur; import io.github.moulberry.notenoughupdates.core.config.Position; @@ -12,11 +14,8 @@ import io.github.moulberry.notenoughupdates.dungeons.DungeonWin; import io.github.moulberry.notenoughupdates.gamemodes.SBGamemodes; import io.github.moulberry.notenoughupdates.miscfeatures.*; import io.github.moulberry.notenoughupdates.miscgui.*; -import io.github.moulberry.notenoughupdates.overlays.CommissionOverlay; -import io.github.moulberry.notenoughupdates.overlays.FarmingOverlay; +import io.github.moulberry.notenoughupdates.overlays.*; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer; -import io.github.moulberry.notenoughupdates.overlays.TextOverlay; -import io.github.moulberry.notenoughupdates.overlays.TextOverlayStyle; import io.github.moulberry.notenoughupdates.util.*; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; @@ -49,6 +48,7 @@ import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.text.WordUtils; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; @@ -140,19 +140,6 @@ public class NEUEventListener { private static final Pattern BAD_ITEM_REGEX = Pattern.compile("x[0-9]{1,2}$"); - public static Class dontRenderOverlay = null; - private final List textOverlays = new ArrayList<>(); - { - textOverlays.add(new CommissionOverlay(NotEnoughUpdates.INSTANCE.config.mining.overlayPosition, () -> { - int style = NotEnoughUpdates.INSTANCE.config.mining.overlayStyle; - if(style >= 0 && style < TextOverlayStyle.values().length) { - return TextOverlayStyle.values()[style]; - } - return TextOverlayStyle.BACKGROUND; - })); - textOverlays.add(new FarmingOverlay(new Position(20, 300), () -> TextOverlayStyle.BACKGROUND)); - } - /** * 1)Will send the cached message from #sendChatMessage when at least 200ms has passed since the last message. * This is used in order to prevent the mod spamming messages. @@ -198,6 +185,12 @@ public class NEUEventListener { DungeonBlocks.tick(); } DungeonWin.tick(); + FlyFix.tick(); + + for(TextOverlay overlay : OverlayManager.textOverlays) { + overlay.shouldUpdateFrequent = true; + } + if(longUpdate) { /*for(Entity entity : Minecraft.getMinecraft().theWorld.loadedEntityList) { if(entity instanceof EntityArmorStand) { @@ -211,10 +204,11 @@ public class NEUEventListener { DwarvenMinesTextures.tick(); FairySouls.tick(); MiningStuff.tick(); + XPInformation.getInstance().tick(); ProfileApiSyncer.getInstance().tick(); DamageCommas.tick(); BackgroundBlur.tick(); - for(TextOverlay overlay : textOverlays) { + for(TextOverlay overlay : OverlayManager.textOverlays) { overlay.tick(); } if(TradeWindow.hypixelTradeWindowActive()) { @@ -425,13 +419,13 @@ public class NEUEventListener { long timeRemaining = 15000 - (System.currentTimeMillis() - notificationDisplayMillis); if(event.type == RenderGameOverlayEvent.ElementType.ALL) { DungeonWin.render(event.partialTicks); - for(TextOverlay overlay : textOverlays) { - if(dontRenderOverlay != null && dontRenderOverlay.isAssignableFrom(overlay.getClass())) { + for(TextOverlay overlay : OverlayManager.textOverlays) { + if(OverlayManager.dontRenderOverlay != null && OverlayManager.dontRenderOverlay.isAssignableFrom(overlay.getClass())) { continue; } overlay.render(); } - dontRenderOverlay = null; + OverlayManager.dontRenderOverlay = null; } if(event.type == RenderGameOverlayEvent.ElementType.ALL && timeRemaining > 0 && notificationLines != null && notificationLines.size() > 0) { @@ -1259,6 +1253,30 @@ public class NEUEventListener { EnumChatFormatting.RED+EnumChatFormatting.BOLD.toString()+"VERY SPECIAL", EnumChatFormatting.DARK_RED+EnumChatFormatting.BOLD.toString()+"SUPREME", }; + private static final HashMap rarityArrMap = new HashMap<>(); + static { + rarityArrMap.put("COMMON", rarityArrC[0]); + rarityArrMap.put("UNCOMMON", rarityArrC[1]); + rarityArrMap.put("RARE", rarityArrC[2]); + rarityArrMap.put("EPIC", rarityArrC[3]); + rarityArrMap.put("LEGENDARY", rarityArrC[4]); + rarityArrMap.put("MYTHIC", rarityArrC[5]); + } + + private HashSet percentStats = new HashSet<>(); + { + percentStats.add("bonus_attack_speed"); + percentStats.add("crit_damage"); + percentStats.add("crit_chance"); + percentStats.add("sea_creature_chance"); + percentStats.add("ability_damage"); + } + + private String currentRarity = "COMMON"; + private boolean showReforgeStoneStats = true; + private boolean pressedArrowLast = false; + private boolean pressedShiftLast = false; + @SubscribeEvent(priority = EventPriority.LOW) public void onItemTooltipLow(ItemTooltipEvent event) { if(!NotEnoughUpdates.INSTANCE.isOnSkyblock()) return; @@ -1323,7 +1341,145 @@ public class NEUEventListener { int index = 0; List newTooltip = new ArrayList<>(); for(String line : event.toolTip) { - if(line.contains("\u00A7cR\u00A76a\u00A7ei\u00A7an\u00A7bb\u00A79o\u00A7dw\u00A79 Rune")) { + if(line.endsWith(EnumChatFormatting.DARK_GRAY+"Reforge Stone")) { + JsonObject reforgeStones = Constants.REFORGESTONES; + + if(reforgeStones != null && reforgeStones.has(internalname)) { + boolean shift = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT); + if(!pressedShiftLast && shift) { + showReforgeStoneStats = !showReforgeStoneStats; + } + pressedShiftLast = shift; + + newTooltip.add(line); + newTooltip.add(""); + if(!showReforgeStoneStats) { + newTooltip.add(EnumChatFormatting.DARK_GRAY+"[Press SHIFT to show extra info]"); + } else { + newTooltip.add(EnumChatFormatting.DARK_GRAY+"[Press SHIFT to hide extra info]"); + } + + JsonObject reforgeInfo = reforgeStones.get(internalname).getAsJsonObject(); + JsonArray requiredRaritiesArray = reforgeInfo.get("requiredRarities").getAsJsonArray(); + + if(showReforgeStoneStats && requiredRaritiesArray.size() > 0) { + String reforgeName = Utils.getElementAsString(reforgeInfo.get("reforgeName"), ""); + + String[] requiredRarities = new String[requiredRaritiesArray.size()]; + for(int i=0; i= requiredRarities.length) rarityIndex = requiredRarities.length-1; + currentRarity = requiredRarities[rarityIndex]; + rarity = currentRarity; + } + pressedArrowLast = left || right; + + JsonElement statsE = reforgeInfo.get("reforgeStats"); + if(statsE != null && statsE.isJsonObject()) { + JsonObject stats = statsE.getAsJsonObject(); + + String rarityFormatted = rarityArrMap.getOrDefault(rarity, rarity); + + JsonElement reforgeAbilityE = reforgeInfo.get("reforgeAbility"); + String reforgeAbility = null; + if(reforgeAbilityE != null) { + if(reforgeAbilityE.isJsonPrimitive() && reforgeAbilityE.getAsJsonPrimitive().isString()) { + reforgeAbility = Utils.getElementAsString(reforgeInfo.get("reforgeAbility"), ""); + + } else if(reforgeAbilityE.isJsonObject()) { + if(reforgeAbilityE.getAsJsonObject().has(rarity)) { + reforgeAbility = reforgeAbilityE.getAsJsonObject().get(rarity).getAsString(); + } + } + } + + if(reforgeAbility != null && !reforgeAbility.isEmpty()) { + String text = EnumChatFormatting.BLUE + (reforgeName.isEmpty() ? "Bonus: " : reforgeName + " Bonus: ") + + EnumChatFormatting.GRAY+reforgeAbility; + boolean first = true; + for(String s : Minecraft.getMinecraft().fontRendererObj.listFormattedStringToWidth(text, 150)) { + newTooltip.add((first ? "" : " ") + s); + first = false; + } + newTooltip.add(""); + } + + newTooltip.add(EnumChatFormatting.BLUE+"Stats for "+rarityFormatted+"\u00a79: [\u00a7l\u00a7m< \u00a79Switch\u00a7l\u27a1\u00a79]"); + + JsonElement statsRarE = stats.get(rarity); + if(statsRarE != null && statsRarE.isJsonObject()) { + JsonObject statsRar = statsRarE.getAsJsonObject(); + + TreeSet> sorted = new TreeSet<>(Map.Entry.comparingByKey()); + sorted.addAll(statsRar.entrySet()); + + for(Map.Entry entry : sorted) { + if(entry.getValue().isJsonPrimitive() && ((JsonPrimitive)entry.getValue()).isNumber()) { + float statNumF = entry.getValue().getAsFloat(); + String statNumS; + if(statNumF % 1 == 0) { + statNumS = String.valueOf(Math.round(statNumF)); + } else { + statNumS = Utils.floatToString(statNumF, 1); + } + String reforgeNamePretty = WordUtils.capitalizeFully(entry.getKey().replace("_", " ")); + String text = EnumChatFormatting.GRAY + reforgeNamePretty + ": " + EnumChatFormatting.GREEN+"+"+statNumS; + if(percentStats.contains(entry.getKey())) { + text += "%"; + } + newTooltip.add(" "+text); + } + } + } + + JsonElement reforgeCostsE = reforgeInfo.get("reforgeCosts"); + int reforgeCost = -1; + if(reforgeCostsE != null) { + if(reforgeCostsE.isJsonPrimitive() && reforgeCostsE.getAsJsonPrimitive().isNumber()) { + reforgeCost = (int)Utils.getElementAsFloat(reforgeInfo.get("reforgeAbility"), -1); + + } else if(reforgeCostsE.isJsonObject()) { + if(reforgeCostsE.getAsJsonObject().has(rarity)) { + reforgeCost = (int)Utils.getElementAsFloat(reforgeCostsE.getAsJsonObject().get(rarity), -1); + } + } + } + + if(reforgeCost >= 0) { + String text = EnumChatFormatting.BLUE + "Apply Cost: " + EnumChatFormatting.GOLD+NumberFormat.getNumberInstance().format(reforgeCost) +" coins"; + newTooltip.add(""); + newTooltip.add(text); + } + + } + } + + continue; + } + + } else if(line.contains("\u00A7cR\u00A76a\u00A7ei\u00A7an\u00A7bb\u00A79o\u00A7dw\u00A79 Rune")) { line = line.replace("\u00A7cR\u00A76a\u00A7ei\u00A7an\u00A7bb\u00A79o\u00A7dw\u00A79 Rune", Utils.chromaString("Rainbow Rune", index, false)+EnumChatFormatting.BLUE); } else if(hasEnchantments) { @@ -1652,6 +1808,9 @@ public class NEUEventListener { index++; } + pressedShiftLast = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT); + pressedArrowLast = Keyboard.isKeyDown(Keyboard.KEY_LEFT) || Keyboard.isKeyDown(Keyboard.KEY_RIGHT); + event.toolTip.clear(); event.toolTip.addAll(newTooltip); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java index adfe13d5..f77279b0 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java @@ -45,6 +45,7 @@ import net.minecraft.event.ClickEvent; import net.minecraft.event.HoverEvent; import net.minecraft.item.ItemMap; import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C13PacketPlayerAbilities; import net.minecraft.scoreboard.ScoreObjective; import net.minecraft.scoreboard.Scoreboard; import net.minecraft.util.*; @@ -663,7 +664,9 @@ public class NotEnoughUpdates { SimpleCommand dhCommand = new SimpleCommand("dh", new SimpleCommand.ProcessCommandRunnable() { @Override public void processCommand(ICommandSender sender, String[] args) { - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp dungeon_hub"); + //Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp dungeon_hub"); + Minecraft.getMinecraft().thePlayer.capabilities.isFlying = !Minecraft.getMinecraft().thePlayer.capabilities.isFlying; + Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(new C13PacketPlayerAbilities(Minecraft.getMinecraft().thePlayer.capabilities)); } }); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/config/Position.java b/src/main/java/io/github/moulberry/notenoughupdates/core/config/Position.java index 3bd4e9d2..ef27a51d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/core/config/Position.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/core/config/Position.java @@ -14,6 +14,8 @@ public class Position { @Expose private boolean centerY; + private static final int EDGE_OFFSET = 0; + public Position(int x, int y) { this(x, y, false, false); } @@ -45,7 +47,7 @@ public class Position { return y; } - public int getAbsX(ScaledResolution scaledResolution) { + public int getAbsX(ScaledResolution scaledResolution, int objWidth) { int width = scaledResolution.getScaledWidth(); if(centerX) { @@ -58,12 +60,12 @@ public class Position { } if(ret < 0) ret = 0; - if(ret > width) ret = width; + if(ret > width) ret = width - objWidth; return ret; } - public int getAbsY(ScaledResolution scaledResolution) { + public int getAbsY(ScaledResolution scaledResolution, int objHeight) { int height = scaledResolution.getScaledHeight(); if(centerY) { @@ -76,7 +78,7 @@ public class Position { } if(ret < 0) ret = 0; - if(ret > height) ret = height; + if(ret > height) ret = height - objHeight; return ret; } @@ -102,22 +104,22 @@ public class Position { } if(wasPositiveX) { - if(this.x < 2) { - deltaX += 2-this.x; - this.x = 2; + if(this.x < EDGE_OFFSET) { + deltaX += EDGE_OFFSET-this.x; + this.x = EDGE_OFFSET; } - if(this.x > screenWidth-2) { - deltaX += screenWidth-2-this.x; - this.x = screenWidth-2; + if(this.x > screenWidth-EDGE_OFFSET) { + deltaX += screenWidth-EDGE_OFFSET-this.x; + this.x = screenWidth-EDGE_OFFSET; } } else { - if(this.x+objWidth > -2) { - deltaX += -2-objWidth-this.x; - this.x = -2-objWidth; + if(this.x+objWidth > -EDGE_OFFSET) { + deltaX += -EDGE_OFFSET-objWidth-this.x; + this.x = -EDGE_OFFSET-objWidth; } - if(this.x+screenWidth < 2) { - deltaX += 2-screenWidth-this.x; - this.x = 2-screenWidth; + if(this.x+screenWidth < EDGE_OFFSET) { + deltaX += EDGE_OFFSET-screenWidth-this.x; + this.x = EDGE_OFFSET-screenWidth; } } @@ -151,22 +153,22 @@ public class Position { } if(wasPositiveY) { - if(this.y < 2) { - deltaY += 2-this.y; - this.y = 2; + if(this.y < EDGE_OFFSET) { + deltaY += EDGE_OFFSET-this.y; + this.y = EDGE_OFFSET; } - if(this.y > screenHeight-2) { - deltaY += screenHeight-2-this.y; - this.y = screenHeight-2; + if(this.y > screenHeight-EDGE_OFFSET) { + deltaY += screenHeight-EDGE_OFFSET-this.y; + this.y = screenHeight-EDGE_OFFSET; } } else { - if(this.y+objHeight > -2) { - deltaY += -2-objHeight-this.y; - this.y = -2-objHeight; + if(this.y+objHeight > -EDGE_OFFSET) { + deltaY += -EDGE_OFFSET-objHeight-this.y; + this.y = -EDGE_OFFSET-objHeight; } - if(this.y+screenHeight < 2) { - deltaY += 2-screenHeight-this.y; - this.y = 2-screenHeight; + if(this.y+screenHeight < EDGE_OFFSET) { + deltaY += EDGE_OFFSET-screenHeight-this.y; + this.y = EDGE_OFFSET-screenHeight; } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditor.java index f10b63f1..e28c5a32 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditor.java @@ -32,7 +32,7 @@ public abstract class GuiOptionEditor { float paraHeight = 9 * lineCount - 1; - while(paraHeight >= height-10) { + while(paraHeight >= HEIGHT-10) { scale -= 1/8f; lineCount = fr.listFormattedStringToWidth(option.desc, (int)(width*2/3/scale-10)).size(); paraHeight = (int)(9*scale * lineCount - 1*scale); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorDraggableList.java b/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorDraggableList.java index cd26b03d..103a8c92 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorDraggableList.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorDraggableList.java @@ -49,7 +49,8 @@ public class GuiOptionEditorDraggableList extends GuiOptionEditor { int height = super.getHeight() + 13; for(int strIndex : activeText) { - height += 10; + String str = exampleText[strIndex]; + height += 10 * str.split("\n").length; } return height; @@ -88,12 +89,20 @@ public class GuiOptionEditorDraggableList extends GuiOptionEditor { for(int strIndex : activeText) { String str = exampleText[strIndex]; + String[] multilines = str.split("\n"); + + int ySize = multilines.length * 10; + if(i++ != dragStartIndex) { - Utils.drawStringScaledMaxWidth("\u2261 "+str+EnumChatFormatting.RESET, Minecraft.getMinecraft().fontRendererObj, - x+10, y+50+yOff, true, width-20, 0xffffffff); + for(int multilineIndex=0; multilineIndex= 0) { @@ -151,9 +161,20 @@ public class GuiOptionEditorDraggableList extends GuiOptionEditor { String str = exampleText[currentDragging]; + String[] multilines = str.split("\n"); + GlStateManager.enableBlend(); - Utils.drawStringScaledMaxWidth("\u2261 "+str+EnumChatFormatting.RESET, Minecraft.getMinecraft().fontRendererObj, - dragOffsetX + mouseX, dragOffsetY + mouseY, true, width-20, 0xffffff | (opacity << 24)); + for(int multilineIndex=0; multilineIndex availableCapes = new HashSet<>(); + private JsonObject lastJsonSync = null; + private String[] capes = new String[]{"patreon1", "patreon2", "fade", "contrib", "nullzee", "gravy", "space", "mcworld", "lava", "packshq", "mbstaff", "thebakery", "negative", "void", "ironmoon", "krusty", "furf" }; public Boolean[] specialCapes = new Boolean[]{ true, true, false, true, true, true, false, false, false, true, true, true, false, false, true, false, true }; @@ -62,6 +64,8 @@ public class CapeManager { private void updateCapes() { NotEnoughUpdates.INSTANCE.manager.hypixelApi.getMyApiAsync("activecapes.json", (jsonObject) -> { if(jsonObject.get("success").getAsBoolean()) { + lastJsonSync = jsonObject; + lastCapeSynced = System.currentTimeMillis(); capeMap.clear(); for(JsonElement active : jsonObject.get("active").getAsJsonArray()) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java b/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java index 47d3a461..ea561e30 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java @@ -654,7 +654,8 @@ public class DungeonMap { pixelWidth = pixelHeight = 12; } GlStateManager.color(1, 1, 1, 1); - if((playerMarkerMapPositions.size() <= 1 || minU != 1/4f) && + if((!NotEnoughUpdates.INSTANCE.config.dungeonMapOpen.showOwnHeadAsMarker || + playerMarkerMapPositions.size() <= 1 || minU != 1/4f) && NotEnoughUpdates.INSTANCE.config.dungeonMap.dmPlayerHeads >= 1 && playerSkinMap.containsKey(entry.getKey())) { Minecraft.getMinecraft().getTextureManager().bindTexture(playerSkinMap.get(entry.getKey())); @@ -1033,7 +1034,7 @@ public class DungeonMap { Score score = scores.get(i); ScorePlayerTeam scoreplayerteam1 = scoreboard.getPlayersTeam(score.getPlayerName()); String line = ScorePlayerTeam.formatPlayerName(scoreplayerteam1, score.getPlayerName()); - line = Utils.cleanDuplicateColourCodes(line); + line = Utils.cleanColour(line); if(line.contains("(F1)")) { isFloorOne = true; @@ -1496,7 +1497,7 @@ public class DungeonMap { int size = 80 + Math.round(40*NotEnoughUpdates.INSTANCE.config.dungeonMap.dmBorderSize); ScaledResolution scaledResolution = Utils.pushGuiScale(2); - renderMap(pos.getAbsX(scaledResolution)+size/2, pos.getAbsY(scaledResolution)+size/2, + renderMap(pos.getAbsX(scaledResolution, size/2)+size/2, pos.getAbsY(scaledResolution, size/2)+size/2, colourMap, decorations, roomSizeBlocks, actualPlayers, true, event.partialTicks); Utils.pushGuiScale(-1); } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/dungeons/GuiDungeonMapEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/dungeons/GuiDungeonMapEditor.java index 041cd842..c6ae6e4d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/dungeons/GuiDungeonMapEditor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/dungeons/GuiDungeonMapEditor.java @@ -478,8 +478,8 @@ public class GuiDungeonMapEditor extends GuiScreen { NotEnoughUpdates.INSTANCE.config.dungeonMap.dmPosition, size, size, () -> { ScaledResolution scaledResolution = Utils.pushGuiScale(2); - demoMap.renderMap(NotEnoughUpdates.INSTANCE.config.dungeonMap.dmPosition.getAbsX(scaledResolution)+size/2, - NotEnoughUpdates.INSTANCE.config.dungeonMap.dmPosition.getAbsY(scaledResolution)+size/2, + demoMap.renderMap(NotEnoughUpdates.INSTANCE.config.dungeonMap.dmPosition.getAbsX(scaledResolution, size/2)+size/2, + NotEnoughUpdates.INSTANCE.config.dungeonMap.dmPosition.getAbsY(scaledResolution, size/2)+size/2, NotEnoughUpdates.INSTANCE.colourMap, decorations, 0, players, false, 0); Utils.pushGuiScale(-1); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java index 2b682e4f..b2ab13e6 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java @@ -102,6 +102,7 @@ public class BetterContainers { return; } } + GlStateManager.enableBlend(); textureManager.bindTexture(location); } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesWaypoints.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesWaypoints.java index e206fdcc..96efe962 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesWaypoints.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesWaypoints.java @@ -1,7 +1,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; -import io.github.moulberry.notenoughupdates.overlays.CommissionOverlay; +import io.github.moulberry.notenoughupdates.overlays.MiningOverlay; import io.github.moulberry.notenoughupdates.util.SBInfo; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; @@ -29,6 +29,8 @@ import org.lwjgl.util.vector.Vector3f; import java.util.HashMap; import java.util.HashSet; import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; public class DwarvenMinesWaypoints { @@ -88,16 +90,23 @@ public class DwarvenMinesWaypoints { } } - private long powderGhastMillis = 0; - private String powderGhastLocation = null; - private final String ghastString = "\u00A7r\u00A7eFind the \u00A7r\u00A76Powder Ghast\u00A7r\u00A7e near the \u00A7r\u00A7b"; + private long dynamicMillis = 0; + private String dynamicLocation = null; + private final Pattern ghastRegex = Pattern.compile("\u00A7r\u00A7eFind the \u00A7r\u00A76Powder Ghast\u00A7r\u00A7e near the \u00A7r\u00A7b(.+)!"); + private final Pattern fallenStarRegex = Pattern.compile("\u00A7r\u00A75Fallen Star \u00A7r\u00A7ehas crashed at \u00A7r\u00A7b(.+)\u00A7r\u00A7e!"); @SubscribeEvent public void onChat(ClientChatReceivedEvent event) { - if(event.message.getFormattedText().startsWith(ghastString)) { - String sub = event.message.getFormattedText().substring(ghastString.length()); - powderGhastLocation = Utils.cleanColour(sub).replace("!", "").trim(); - powderGhastMillis = System.currentTimeMillis(); + Matcher matcherGhast = ghastRegex.matcher(event.message.getFormattedText()); + if(matcherGhast.find()) { + dynamicLocation = Utils.cleanColour(matcherGhast.group(1).trim()); + dynamicMillis = System.currentTimeMillis(); + } else { + Matcher matcherStar = fallenStarRegex.matcher(event.message.getFormattedText()); + if(matcherStar.find()) { + dynamicLocation = Utils.cleanColour(matcherStar.group(1).trim()); + dynamicMillis = System.currentTimeMillis(); + } } } @@ -176,10 +185,10 @@ public class DwarvenMinesWaypoints { int locWaypoint = NotEnoughUpdates.INSTANCE.config.mining.locWaypoints; - if(powderGhastLocation != null && - System.currentTimeMillis() - powderGhastMillis < 30*1000) { + if(dynamicLocation != null && + System.currentTimeMillis() - dynamicMillis < 30*1000) { for(Map.Entry entry : waypointsMap.entrySet()) { - if(entry.getKey().equals(powderGhastLocation)) { + if(entry.getKey().equals(dynamicLocation)) { renderWayPoint(EnumChatFormatting.GOLD+"Powder Ghast", new Vector3f(entry.getValue()).translate(0, 15, 0), event.partialTicks); break; @@ -192,7 +201,7 @@ public class DwarvenMinesWaypoints { if(locWaypoint >= 2) { renderWayPoint(EnumChatFormatting.AQUA+entry.getKey(), entry.getValue(), event.partialTicks); } else { - for(String commissionName : CommissionOverlay.commissionProgress.keySet()) { + for(String commissionName : MiningOverlay.commissionProgress.keySet()) { if(commissionName.toLowerCase().contains(entry.getKey().toLowerCase())) { if(commissionName.contains("Titanium")) { renderWayPoint(EnumChatFormatting.WHITE+entry.getKey(), entry.getValue(), event.partialTicks); @@ -210,7 +219,7 @@ public class DwarvenMinesWaypoints { if(NotEnoughUpdates.INSTANCE.config.mining.emissaryWaypoints == 0) return; if(!commissionFinished) { - for(float f : CommissionOverlay.commissionProgress.values()) { + for(float f : MiningOverlay.commissionProgress.values()) { if (f >= 1) { commissionFinished = true; break; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FlyFix.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FlyFix.java new file mode 100644 index 00000000..9ccaff31 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FlyFix.java @@ -0,0 +1,70 @@ +package io.github.moulberry.notenoughupdates.miscfeatures; + +import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.util.SBInfo; +import net.minecraft.client.Minecraft; +import net.minecraft.network.play.client.C13PacketPlayerAbilities; +import net.minecraft.network.play.server.S39PacketPlayerAbilities; + +public class FlyFix { + + private static boolean serverWantFly = false; + private static boolean clientWantFly = false; + private static long lastAbilitySend = 0; + + public static void onSendAbilities(C13PacketPlayerAbilities packet) { + if(!NotEnoughUpdates.INSTANCE.config.misc.flyFix) return; + if(Minecraft.getMinecraft().thePlayer == null) return; + if(!Minecraft.getMinecraft().thePlayer.capabilities.allowFlying) return; + if(!NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) return; + if(SBInfo.getInstance().getLocation() == null) return; + if(!SBInfo.getInstance().getLocation().equals("dynamic")) return; + + long currentTime = System.currentTimeMillis(); + + clientWantFly = packet.isFlying(); + if(clientWantFly != serverWantFly) lastAbilitySend = currentTime; + } + + public static void onReceiveAbilities(S39PacketPlayerAbilities packet) { + if(!NotEnoughUpdates.INSTANCE.config.misc.flyFix) return; + if(Minecraft.getMinecraft().thePlayer == null) return; + if(!Minecraft.getMinecraft().thePlayer.capabilities.allowFlying) return; + if(!NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) return; + if(SBInfo.getInstance().getLocation() == null) return; + if(!SBInfo.getInstance().getLocation().equals("dynamic")) return; + + long currentTime = System.currentTimeMillis(); + + serverWantFly = packet.isFlying(); + if(serverWantFly != clientWantFly) { + if(currentTime - lastAbilitySend > 0 && currentTime - lastAbilitySend < 500) { + packet.setFlying(clientWantFly); + } else { + clientWantFly = serverWantFly; + } + } + } + + public static void tick() { + if(!NotEnoughUpdates.INSTANCE.config.misc.flyFix) return; + if(Minecraft.getMinecraft().thePlayer == null) return; + if(!Minecraft.getMinecraft().thePlayer.capabilities.allowFlying) return; + if(!NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) return; + if(SBInfo.getInstance().getLocation() == null) return; + if(!SBInfo.getInstance().getLocation().equals("dynamic")) return; + + long currentTime = System.currentTimeMillis(); + + if(currentTime - lastAbilitySend > 1000 && currentTime - lastAbilitySend < 5000) { + if(clientWantFly != serverWantFly) { + Minecraft.getMinecraft().thePlayer.capabilities.isFlying = serverWantFly; + Minecraft.getMinecraft().thePlayer.sendPlayerAbilities(); + clientWantFly = serverWantFly; + } + } else { + clientWantFly = Minecraft.getMinecraft().thePlayer.capabilities.isFlying; + } + } + +} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/MiningStuff.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/MiningStuff.java index 8b130d24..1c509359 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/MiningStuff.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/MiningStuff.java @@ -2,7 +2,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.core.util.render.TextRenderUtils; -import io.github.moulberry.notenoughupdates.overlays.CommissionOverlay; +import io.github.moulberry.notenoughupdates.overlays.MiningOverlay; import io.github.moulberry.notenoughupdates.util.SBInfo; import io.github.moulberry.notenoughupdates.util.SpecialColour; import io.github.moulberry.notenoughupdates.util.Utils; @@ -38,7 +38,7 @@ public class MiningStuff { SBInfo.getInstance().getLocation().startsWith("mining_") && state.getBlock() == Blocks.stone && state.getValue(BlockStone.VARIANT) == BlockStone.EnumType.DIORITE_SMOOTH) { - for(String s : CommissionOverlay.commissionProgress.keySet()) { + for(String s : MiningOverlay.commissionProgress.keySet()) { if(s.contains("Titanium")) { BlockPos pos = packetIn.getBlockPosition(); @@ -193,7 +193,8 @@ public class MiningStuff { if(NotEnoughUpdates.INSTANCE.config.mining.dontMineStone && state != null && SBInfo.getInstance().getLocation() != null && SBInfo.getInstance().getLocation().startsWith("mining_") && - state.getBlock() == Blocks.stone && state.getValue(BlockStone.VARIANT) == BlockStone.EnumType.STONE) { + (state.getBlock() == Blocks.stone && state.getValue(BlockStone.VARIANT) == BlockStone.EnumType.STONE || + state.getBlock() == Blocks.cobblestone)) { return true; } return false; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinContainer.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinContainer.java index d3c96896..fb6fba4e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinContainer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinContainer.java @@ -2,11 +2,15 @@ package io.github.moulberry.notenoughupdates.mixins; import io.github.moulberry.notenoughupdates.miscfeatures.EnchantingSolvers; import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerChest; +import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +import org.lwjgl.input.Keyboard; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(Container.class) public class MixinContainer { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java index 12d1f929..0ca0133b 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java @@ -83,6 +83,7 @@ public abstract class MixinGuiContainer extends GuiScreen { @Redirect(method="drawSlot", at=@At(value="INVOKE", target=TARGET_GETSTACK)) public ItemStack drawSlot_getStack(Slot slot) { GuiContainer $this = (GuiContainer)(Object)this; + ItemStack stack = slot.getStack(); if(stack != null) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinNetHandlerPlayClient.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinNetHandlerPlayClient.java index 876338da..5cb2dc8d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinNetHandlerPlayClient.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinNetHandlerPlayClient.java @@ -1,19 +1,21 @@ package io.github.moulberry.notenoughupdates.mixins; -import io.github.moulberry.notenoughupdates.miscfeatures.CustomItemEffects; -import io.github.moulberry.notenoughupdates.miscfeatures.EnchantingSolvers; +import io.github.moulberry.notenoughupdates.miscfeatures.*; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; -import io.github.moulberry.notenoughupdates.miscfeatures.ItemCooldowns; -import io.github.moulberry.notenoughupdates.miscfeatures.MiningStuff; import net.minecraft.client.network.NetHandlerPlayClient; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.network.Packet; +import net.minecraft.network.play.client.C13PacketPlayerAbilities; import net.minecraft.network.play.server.S23PacketBlockChange; import net.minecraft.network.play.server.S2FPacketSetSlot; +import net.minecraft.network.play.server.S39PacketPlayerAbilities; +import org.lwjgl.opengl.Display; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(NetHandlerPlayClient.class) public class MixinNetHandlerPlayClient { @@ -40,6 +42,19 @@ public class MixinNetHandlerPlayClient { ItemCooldowns.processBlockChangePacket(packetIn); } + @Inject(method="handlePlayerAbilities", at=@At("HEAD")) + public void handlePlayerAbilities(S39PacketPlayerAbilities packetIn, CallbackInfo ci) { + FlyFix.onReceiveAbilities(packetIn); + } + + @Inject(method="addToSendQueue", at=@At("HEAD")) + public void addToSendQueue(Packet packet, CallbackInfo ci) { + if(packet instanceof C13PacketPlayerAbilities) { + C13PacketPlayerAbilities abilities = (C13PacketPlayerAbilities) packet; + FlyFix.onSendAbilities(abilities); + } + } + } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinPlayerControllerMP.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinPlayerControllerMP.java index 69444c45..2183e437 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinPlayerControllerMP.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinPlayerControllerMP.java @@ -4,7 +4,9 @@ import io.github.moulberry.notenoughupdates.miscfeatures.DwarvenMinesTextures; import io.github.moulberry.notenoughupdates.miscfeatures.FairySouls; import io.github.moulberry.notenoughupdates.miscfeatures.ItemCooldowns; import io.github.moulberry.notenoughupdates.miscfeatures.MiningStuff; +import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.PlayerControllerMP; +import net.minecraft.network.play.client.C07PacketPlayerDigging; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import org.spongepowered.asm.mixin.Mixin; @@ -20,6 +22,7 @@ public class MixinPlayerControllerMP { ItemCooldowns.blockClicked(loc); if(MiningStuff.blockClicked(loc)) { cir.setReturnValue(false); + ((PlayerControllerMP)(Object)this).resetBlockRemoving(); } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java index 19b9b7b0..3a2678b2 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java @@ -2,17 +2,16 @@ package io.github.moulberry.notenoughupdates.options; import com.google.common.collect.Lists; import com.google.gson.annotations.Expose; -import io.github.moulberry.notenoughupdates.NEUEventListener; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.core.GuiScreenElementWrapper; import io.github.moulberry.notenoughupdates.core.config.Config; import io.github.moulberry.notenoughupdates.core.config.Position; import io.github.moulberry.notenoughupdates.core.config.annotations.*; import io.github.moulberry.notenoughupdates.core.config.gui.GuiPositionEditor; -import io.github.moulberry.notenoughupdates.overlays.CommissionOverlay; -import io.github.moulberry.notenoughupdates.overlays.TextOverlayStyle; +import io.github.moulberry.notenoughupdates.overlays.*; import net.minecraft.client.Minecraft; import net.minecraftforge.client.ClientCommandHandler; +import org.lwjgl.util.vector.Vector2f; import java.util.ArrayList; import java.util.Arrays; @@ -20,9 +19,21 @@ import java.util.List; public class NEUConfig extends Config { + private void editOverlay(String activeConfig, TextOverlay overlay, Position position) { + Vector2f size = overlay.getDummySize(); + int width = (int)size.x; + int height = (int)size.y; + Minecraft.getMinecraft().displayGuiScreen(new GuiPositionEditor(position, width, height, () -> { + overlay.renderDummy(); + OverlayManager.dontRenderOverlay = overlay.getClass(); + }, () -> { + }, () -> NotEnoughUpdates.INSTANCE.openGui = new GuiScreenElementWrapper( + new NEUConfigEditor(NotEnoughUpdates.INSTANCE.config, activeConfig)) + )); + } + @Override public void executeRunnable(int runnableId) { - String activeConfigCategory = null; if(Minecraft.getMinecraft().currentScreen instanceof GuiScreenElementWrapper) { GuiScreenElementWrapper wrapper = (GuiScreenElementWrapper) Minecraft.getMinecraft().currentScreen; @@ -37,33 +48,7 @@ public class NEUConfig extends Config { ClientCommandHandler.instance.executeCommand(Minecraft.getMinecraft().thePlayer, "/neumap"); return; case 1: - final CommissionOverlay overlay = new CommissionOverlay(NotEnoughUpdates.INSTANCE.config.mining.overlayPosition, () -> { - int style = NotEnoughUpdates.INSTANCE.config.mining.overlayStyle; - if(style >= 0 && style < TextOverlayStyle.values().length) { - return TextOverlayStyle.values()[style]; - } - return TextOverlayStyle.BACKGROUND; - }); - overlay.tick(); - if(overlay.overlayWidth <= 0 || overlay.overlayHeight <= 0) { - Minecraft.getMinecraft().displayGuiScreen(new GuiPositionEditor( - NotEnoughUpdates.INSTANCE.config.mining.overlayPosition, - 150, 75, () -> { - }, () -> { - }, () -> NotEnoughUpdates.INSTANCE.openGui = new GuiScreenElementWrapper( - new NEUConfigEditor(NotEnoughUpdates.INSTANCE.config, activeConfigCategoryF)) - )); - } else { - Minecraft.getMinecraft().displayGuiScreen(new GuiPositionEditor( - NotEnoughUpdates.INSTANCE.config.mining.overlayPosition, - overlay.overlayWidth+10, overlay.overlayHeight+10, () -> { - overlay.render(); - NEUEventListener.dontRenderOverlay = CommissionOverlay.class; - }, () -> { - }, () -> NotEnoughUpdates.INSTANCE.openGui = new GuiScreenElementWrapper( - new NEUConfigEditor(NotEnoughUpdates.INSTANCE.config, activeConfigCategoryF)) - )); - } + editOverlay(activeConfigCategory, OverlayManager.miningOverlay, mining.overlayPosition); return; case 2: Minecraft.getMinecraft().displayGuiScreen(new GuiPositionEditor( @@ -74,6 +59,9 @@ public class NEUConfig extends Config { new NEUConfigEditor(NotEnoughUpdates.INSTANCE.config, activeConfigCategoryF)) )); return; + case 3: + editOverlay(activeConfigCategory, OverlayManager.farmingOverlay, skillOverlays.farmingPosition); + return; } } @@ -126,6 +114,13 @@ public class NEUConfig extends Config { ) public PriceInfoBaz priceInfoBaz = new PriceInfoBaz(); + @Expose + @Category( + name = "Skill Overlays", + desc = "Skill Overlays" + ) + public SkillOverlays skillOverlays = new SkillOverlays(); + @Expose @Category( name = "Dungeon Profit", @@ -263,6 +258,14 @@ public class NEUConfig extends Config { @ConfigEditorBoolean public boolean onlyShowOnSkyblock = true; + @Expose + @ConfigOption( + name = "Private Island Fly Fix", + desc = "Fix flying being delaying on private islands" + ) + @ConfigEditorBoolean + public boolean flyFix = true; + @Expose @ConfigOption( name = "Hide Potion Effects", @@ -635,10 +638,19 @@ public class NEUConfig extends Config { } public static class SkillOverlays { + @Expose + @ConfigOption( + name = "Enable Farming Overlay", + desc = "Show an overlay while farming with useful information" + ) + @ConfigEditorBoolean + public boolean farmingOverlay = true; + @Expose @ConfigOption( name = "Farming Text", - desc = "" + desc = "\u00a7eDrag text to change the appearance of the overlay\n" + + "\u00a7rHold a mathematical hoe or use an axe while gaining farming xp to show the overlay" ) @ConfigEditorDraggableList( exampleText = {"\u00a7bCounter: \u00a7e37,547,860", @@ -647,9 +659,31 @@ public class NEUConfig extends Config { "\u00a7bCurrent XP: \u00a7e6,734", "\u00a7bRemaining XP: \u00a7e3,265", "\u00a7bXP/h: \u00a7e238,129", - "\u00a7bYaw: \u00a7e68.25\u00a7l\u1D52"} + "\u00a7bYaw: \u00a7e68.25\u00a7l\u1D52", + "\u00a7bETA: 13h12m"} ) - public List priceInfoAuc = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6)); + public List farmingText = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 7, 6)); + + @Expose + @ConfigOption( + name = "Farming Position", + desc = "Change the position of the Farming overlay" + ) + @ConfigEditorButton( + runnableId = 3, + buttonText = "Edit" + ) + public Position farmingPosition = new Position(10, 200); + + @Expose + @ConfigOption( + name = "Farming Style", + desc = "Change the style of the Farming overlay" + ) + @ConfigEditorDropdown( + values = {"Background", "No Shadow", "Shadow", "Full Shadow"} + ) + public int farmingStyle = 0; } public static class DungeonProfit { @@ -840,87 +874,78 @@ public class NEUConfig extends Config { @Expose @ConfigOption( - name = "Overlay Position", - desc = "Change the position of the Dwarven Mines information overlay (commisions, powder & forge statuses)" - ) - @ConfigEditorButton( - runnableId = 1, - buttonText = "Edit" + name = "Drill Fuel Bar", + desc = "Show a fancy drill fuel bar when holding a drill in mining areas" ) - public Position overlayPosition = new Position(10, 100); + @ConfigEditorBoolean + public boolean drillFuelBar = true; @Expose @ConfigOption( - name = "Overlay Style", - desc = "Change the style of the Dwarven Mines information overlay" + name = "Fuel Bar Width", + desc = "Change the width of the drill fuel bar" ) - @ConfigEditorDropdown( - values = {"Background", "No Shadow", "Shadow", "Full Shadow"} + @ConfigEditorSlider( + minValue = 50, + maxValue = 400, + minStep = 10 ) - public int overlayStyle = 0; + public int drillFuelBarWidth = 200; @Expose @ConfigOption( - name = "Commissions Overlay", - desc = "Show current commissions on the screen while in Dwarven Mines" + name = "Fuel Bar Position", + desc = "Set the position of the drill fuel bar" ) - @ConfigEditorBoolean - public boolean commissionsOverlay = true; - - @Expose - @ConfigOption( - name = "Powder Overlay", - desc = "Show powder count on the screen while in Dwarven Mines" + @ConfigEditorButton( + runnableId = 2, + buttonText = "Edit" ) - @ConfigEditorBoolean - public boolean powderOverlay = true; + public Position drillFuelBarPosition = new Position(0, -100, true, false); - @Expose - @ConfigOption( - name = "Forges Overlay", - desc = "Show forge statuses on the screen while in Dwarven Mines" - ) - @ConfigEditorBoolean - public boolean forgeOverlay = true; @Expose @ConfigOption( - name = "Hide Empty Forges", - desc = "Hide empty forges in the information overlay" + name = "Dwarven Overlay", + desc = "Show an overlay with useful information on the screen while in Dwarven Mines" ) @ConfigEditorBoolean - public boolean hideEmptyForges = true; + public boolean dwarvenOverlay = true; @Expose @ConfigOption( - name = "Drill Fuel Bar", - desc = "Show a fancy drill fuel bar when holding a drill in mining areas" + name = "Dwarven Text", + desc = "\u00a7eDrag text to change the appearance of the overlay\n" + + "\u00a7rGo to the Dwarven Mines to show this overlay with useful information" ) - @ConfigEditorBoolean - public boolean drillFuelBar = true; + @ConfigEditorDraggableList( + exampleText = {"\u00a73Goblin Slayer: \u00a7626.5%\n\u00a73Lucky Raffle: \u00a7c0.0%", + "\u00a73Mithril Powder: \u00a726,243", + "\u00a73Forge 1) \u00a79Diamonite\u00a77: \u00a7aReady!", + "\u00a73Forge 2) \u00a77EMPTY\n\u00a73Forge 3) \u00a77EMPTY\n\u00a73Forge 4) \u00a77EMPTY"} + ) + public List dwarvenText = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); @Expose @ConfigOption( - name = "Fuel Bar Width", - desc = "Change the width of the drill fuel bar" + name = "Overlay Position", + desc = "Change the position of the Dwarven Mines information overlay (commisions, powder & forge statuses)" ) - @ConfigEditorSlider( - minValue = 50, - maxValue = 400, - minStep = 10 + @ConfigEditorButton( + runnableId = 1, + buttonText = "Edit" ) - public int drillFuelBarWidth = 200; + public Position overlayPosition = new Position(10, 100); @Expose @ConfigOption( - name = "Fuel Bar Position", - desc = "Set the position of the drill fuel bar" + name = "Overlay Style", + desc = "Change the style of the Dwarven Mines information overlay" ) - @ConfigEditorButton( - runnableId = 2, - buttonText = "Edit" + @ConfigEditorDropdown( + values = {"Background", "No Shadow", "Shadow", "Full Shadow"}