diff options
| author | BuildTools <james.jenour@protonmail.com> | 2021-01-30 18:22:49 +0800 |
|---|---|---|
| committer | BuildTools <james.jenour@protonmail.com> | 2021-01-30 18:22:49 +0800 |
| commit | 3290259e39e9816fd92afa85710de01a6ddfa3b9 (patch) | |
| tree | e105bcfccfbc38f091848a94667dd612271eed7c /src | |
| parent | 659a0e4981640802058d9eef35fec16fab82c5f2 (diff) | |
| download | NotEnoughUpdates-3290259e39e9816fd92afa85710de01a6ddfa3b9.tar.gz NotEnoughUpdates-3290259e39e9816fd92afa85710de01a6ddfa3b9.tar.bz2 NotEnoughUpdates-3290259e39e9816fd92afa85710de01a6ddfa3b9.zip | |
PRE13.2
Diffstat (limited to 'src')
19 files changed, 363 insertions, 247 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java b/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java index cafbff05..401898d2 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java @@ -27,7 +27,94 @@ public class ItemPriceInformation { NumberFormat format = NumberFormat.getInstance(Locale.US); - if(auctionItem) { + if(bazaarItem) { + int[] lines = { + NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line1, + NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line2, + NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line3, + NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line4, + NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line5, + NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line6 + }; + + boolean added = false; + + boolean shiftPressed = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT); + + int stackMultiplier = 1; + int shiftStackMultiplier = 64; + if(shiftPressed) { + stackMultiplier = shiftStackMultiplier; + } + + //values = {"", "Buy", "Sell", "Buy (Insta)", "Sell (Insta)", "Raw Craft Cost"} + for(int lineId : lines) { + switch (lineId) { + case 0: + continue; + case 1: + if(bazaarInfo.has("avg_buy")) { + if(!added) { + tooltip.add(""); + if(!shiftPressed) tooltip.add(EnumChatFormatting.DARK_GRAY.toString()+"[SHIFT show x"+shiftStackMultiplier+"]"); + added = true; + } + int bazaarBuyPrice = (int)bazaarInfo.get("avg_buy").getAsFloat()*stackMultiplier; + tooltip.add(EnumChatFormatting.YELLOW.toString()+EnumChatFormatting.BOLD+"Bazaar Buy: "+ + EnumChatFormatting.GOLD+EnumChatFormatting.BOLD+format.format(bazaarBuyPrice)+" coins"); + } + break; + case 2: + if(bazaarInfo.has("avg_sell")) { + if(!added) { + tooltip.add(""); + if(!shiftPressed) tooltip.add(EnumChatFormatting.DARK_GRAY.toString()+"[SHIFT show x"+shiftStackMultiplier+"]"); + added = true; + } + int bazaarSellPrice = (int)bazaarInfo.get("avg_sell").getAsFloat()*stackMultiplier; + tooltip.add(EnumChatFormatting.YELLOW.toString()+EnumChatFormatting.BOLD+"Bazaar Sell: "+ + EnumChatFormatting.GOLD+EnumChatFormatting.BOLD+format.format(bazaarSellPrice)+" coins"); + } + break; + case 3: + if(bazaarInfo.has("curr_buy")) { + if(!added) { + tooltip.add(""); + if(!shiftPressed) tooltip.add(EnumChatFormatting.DARK_GRAY.toString()+"[SHIFT show x"+shiftStackMultiplier+"]"); + added = true; + } + int bazaarInstantBuyPrice = (int)bazaarInfo.get("curr_buy").getAsFloat()*stackMultiplier; + tooltip.add(EnumChatFormatting.YELLOW.toString()+EnumChatFormatting.BOLD+"Bazaar Insta-Buy: "+ + EnumChatFormatting.GOLD+EnumChatFormatting.BOLD+format.format(bazaarInstantBuyPrice)+" coins"); + } + break; + case 4: + if(bazaarInfo.has("curr_sell")) { + if(!added) { + tooltip.add(""); + if(!shiftPressed) tooltip.add(EnumChatFormatting.DARK_GRAY.toString()+"[SHIFT show x"+shiftStackMultiplier+"]"); + added = true; + } + int bazaarInstantSellPrice = (int)bazaarInfo.get("curr_sell").getAsFloat()*stackMultiplier; + tooltip.add(EnumChatFormatting.YELLOW.toString()+EnumChatFormatting.BOLD+"Bazaar Insta-Sell: "+ + EnumChatFormatting.GOLD+EnumChatFormatting.BOLD+format.format(bazaarInstantSellPrice)+" coins"); + } + break; + case 5: + if(craftCost.fromRecipe) { + if(!added) { + tooltip.add(""); + added = true; + } + tooltip.add(EnumChatFormatting.YELLOW.toString()+EnumChatFormatting.BOLD+"Raw Craft Cost: "+ + EnumChatFormatting.GOLD+EnumChatFormatting.BOLD+format.format((int)craftCost.craftCost)+" coins"); + } + break; + } + } + + return added; + } else if(auctionItem) { int[] lines = { NotEnoughUpdates.INSTANCE.config.priceInfoAuc.line1, NotEnoughUpdates.INSTANCE.config.priceInfoAuc.line2, @@ -151,93 +238,6 @@ public class ItemPriceInformation { } return added; - } else if(bazaarItem) { - int[] lines = { - NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line1, - NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line2, - NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line3, - NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line4, - NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line5, - NotEnoughUpdates.INSTANCE.config.priceInfoBaz.line6 - }; - - boolean added = false; - - boolean shiftPressed = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT); - - int stackMultiplier = 1; - int shiftStackMultiplier = 64; - if(shiftPressed) { - stackMultiplier = shiftStackMultiplier; - } - - //values = {"", "Buy", "Sell", "Buy (Insta)", "Sell (Insta)", "Raw Craft Cost"} - for(int lineId : lines) { - switch (lineId) { - case 0: - continue; - case 1: - if(bazaarInfo.has("avg_buy")) { - if(!added) { - tooltip.add(""); - if(!shiftPressed) tooltip.add(EnumChatFormatting.DARK_GRAY.toString()+"[SHIFT show x"+shiftStackMultiplier+"]"); - added = true; - } - int bazaarBuyPrice = (int)bazaarInfo.get("avg_buy").getAsFloat()*stackMultiplier; - tooltip.add(EnumChatFormatting.YELLOW.toString()+EnumChatFormatting.BOLD+"Bazaar Buy: "+ - EnumChatFormatting.GOLD+EnumChatFormatting.BOLD+format.format(bazaarBuyPrice)+" coins"); - } - break; - case 2: - if(bazaarInfo.has("avg_sell")) { - if(!added) { - tooltip.add(""); - if(!shiftPressed) tooltip.add(EnumChatFormatting.DARK_GRAY.toString()+"[SHIFT show x"+shiftStackMultiplier+"]"); - added = true; - } - int bazaarSellPrice = (int)bazaarInfo.get("avg_sell").getAsFloat()*stackMultiplier; - tooltip.add(EnumChatFormatting.YELLOW.toString()+EnumChatFormatting.BOLD+"Bazaar Sell: "+ - EnumChatFormatting.GOLD+EnumChatFormatting.BOLD+format.format(bazaarSellPrice)+" coins"); - } - break; - case 3: - if(bazaarInfo.has("curr_buy")) { - if(!added) { - tooltip.add(""); - if(!shiftPressed) tooltip.add(EnumChatFormatting.DARK_GRAY.toString()+"[SHIFT show x"+shiftStackMultiplier+"]"); - added = true; - } - int bazaarInstantBuyPrice = (int)bazaarInfo.get("curr_buy").getAsFloat()*stackMultiplier; - tooltip.add(EnumChatFormatting.YELLOW.toString()+EnumChatFormatting.BOLD+"Bazaar Insta-Buy: "+ - EnumChatFormatting.GOLD+EnumChatFormatting.BOLD+format.format(bazaarInstantBuyPrice)+" coins"); - } - break; - case 4: - if(bazaarInfo.has("curr_sell")) { - if(!added) { - tooltip.add(""); - if(!shiftPressed) tooltip.add(EnumChatFormatting.DARK_GRAY.toString()+"[SHIFT show x"+shiftStackMultiplier+"]"); - added = true; - } - int bazaarInstantSellPrice = (int)bazaarInfo.get("curr_sell").getAsFloat()*stackMultiplier; - tooltip.add(EnumChatFormatting.YELLOW.toString()+EnumChatFormatting.BOLD+"Bazaar Insta-Sell: "+ - EnumChatFormatting.GOLD+EnumChatFormatting.BOLD+format.format(bazaarInstantSellPrice)+" coins"); - } - break; - case 5: - if(craftCost.fromRecipe) { - if(!added) { - tooltip.add(""); - added = true; - } - tooltip.add(EnumChatFormatting.YELLOW.toString()+EnumChatFormatting.BOLD+"Raw Craft Cost: "+ - EnumChatFormatting.GOLD+EnumChatFormatting.BOLD+format.format((int)craftCost.craftCost)+" coins"); - } - break; - } - } - - return added; } return false; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java index 9e31c19e..8a842558 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java @@ -3,8 +3,6 @@ package io.github.moulberry.notenoughupdates; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.mojang.authlib.GameProfile; -import com.mojang.authlib.minecraft.MinecraftProfileTexture; import io.github.moulberry.notenoughupdates.auction.CustomAHGui; import io.github.moulberry.notenoughupdates.core.config.Position; import io.github.moulberry.notenoughupdates.cosmetics.CapeManager; @@ -13,7 +11,6 @@ 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.mixins.MinecraftAccessor; import io.github.moulberry.notenoughupdates.overlays.CommissionOverlay; import io.github.moulberry.notenoughupdates.overlays.FarmingOverlay; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer; @@ -30,7 +27,8 @@ import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiEditSign; import net.minecraft.client.network.NetworkPlayerInfo; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.event.ClickEvent; import net.minecraft.init.Blocks; @@ -41,10 +39,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTUtil; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; +import net.minecraft.util.*; import net.minecraftforge.client.event.*; import net.minecraftforge.event.entity.player.EntityInteractEvent; import net.minecraftforge.event.entity.player.ItemTooltipEvent; @@ -53,7 +48,6 @@ 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.io.FileUtils; import org.apache.commons.lang3.text.WordUtils; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; @@ -64,8 +58,6 @@ import java.awt.*; import java.awt.datatransfer.StringSelection; import java.io.File; import java.io.IOException; -import java.net.HttpURLConnection; -import java.net.URL; import java.text.NumberFormat; import java.util.List; import java.util.*; @@ -188,7 +180,6 @@ public class NEUEventListener { }); } } else if(!toPreload.isEmpty()) { - System.out.println("Preload size:"+toPreload.size()); Utils.drawItemStack(toPreload.get(0), -100, -100); toPreload.remove(0); } else { @@ -207,6 +198,14 @@ public class NEUEventListener { } DungeonWin.tick(); if(longUpdate) { + /*for(Entity entity : Minecraft.getMinecraft().theWorld.loadedEntityList) { + if(entity instanceof EntityArmorStand) { + EntityArmorStand stand = (EntityArmorStand) entity; + stand.setInvisible(false); + stand.getDataWatcher().updateObject(10, (byte)(stand.getDataWatcher().getWatchableObjectByte(10) & 0b1111111101111)); + } + }*/ + CrystalOverlay.tick(); DwarvenMinesTextures.tick(); FairySouls.tick(); @@ -626,6 +625,51 @@ public class NEUEventListener { } } + private IChatComponent processChatComponent(IChatComponent chatComponent) { + IChatComponent newComponent; + if(chatComponent instanceof ChatComponentText) { + ChatComponentText text = (ChatComponentText) chatComponent; + + newComponent = new ChatComponentText(processText(text.getUnformattedTextForChat())); + newComponent.setChatStyle(text.getChatStyle().createShallowCopy()); + + for(IChatComponent sibling : text.getSiblings()) { + newComponent.appendSibling(processChatComponent(sibling)); + } + } else if(chatComponent instanceof ChatComponentTranslation) { + ChatComponentTranslation trans = (ChatComponentTranslation) chatComponent; + + Object[] args = trans.getFormatArgs(); + Object[] newArgs = new Object[args.length]; + for(int i=0; i<trans.getFormatArgs().length; i++) { + if(args[i] instanceof IChatComponent) { + newArgs[i] = processChatComponent((IChatComponent) args[i]); + } else { + newArgs[i] = args[i]; + } + } + newComponent = new ChatComponentTranslation(trans.getKey(), newArgs); + + for(IChatComponent sibling : trans.getSiblings()) { + newComponent.appendSibling(processChatComponent(sibling)); + } + } else { + newComponent = chatComponent.createCopy(); + } + + return newComponent; + } + + private String processText(String text) { + if(SBInfo.getInstance().getLocation() == null) return text; + if(!SBInfo.getInstance().getLocation().startsWith("mining_")) return text; + + if(Minecraft.getMinecraft().thePlayer == null) return text; + if(!NotEnoughUpdates.INSTANCE.config.mining.drillFuelBar) return text; + + return Utils.trimIgnoreColour(text.replaceAll(EnumChatFormatting.DARK_GREEN+"\\S+ Drill Fuel", "")); + } + /** * 1) When receiving "You are playing on profile" messages, will set the current profile. * 2) When a /viewrecipe command fails (i.e. player does not have recipe unlocked, will open the custom recipe GUI) @@ -633,6 +677,11 @@ public class NEUEventListener { */ @SubscribeEvent(priority = EventPriority.LOW) public void onGuiChat(ClientChatReceivedEvent e) { + if(e.type == 2) { + e.message = processChatComponent(e.message); + return; + } + DungeonWin.onChatMessage(e); String r = null; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java index cd81da0b..592ed628 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java @@ -1227,19 +1227,22 @@ public class NEUOverlay extends Gui { this.searchedItems = searchedItems; this.searchedItemsSubgroup = searchedItemsSubgroup; - searchedItemsArr = null; + this.searchedItemsArr = null; + redrawItems = true; }); } /** * Returns an index-able array containing the elements in searchedItems. - * Whenever searchedItems is updated via the above method, the array is recreated here. + * Whenever searchedItems is updated in updateSearch(), the array is recreated here. */ public JsonObject[] getSearchedItems() { - if(searchedItems==null) { + if(searchedItems == null) { updateSearch(); + return new JsonObject[0]; } + if(searchedItemsArr==null) { searchedItemsArr = new JsonObject[searchedItems.size()]; int i=0; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java index b70dcc24..adfe13d5 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java @@ -660,6 +660,13 @@ 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"); + } + }); + SimpleCommand viewCataCommand = new SimpleCommand("cata", new SimpleCommand.ProcessCommandRunnable() { @Override public void processCommand(ICommandSender sender, String[] args) { @@ -818,24 +825,19 @@ public class NotEnoughUpdates { } }); - SimpleCommand settingsCommand = new SimpleCommand("neu", new SimpleCommand.ProcessCommandRunnable() { - public void processCommand(ICommandSender sender, String[] args) { - openGui = new GuiScreenElementWrapper(new NEUConfigEditor(config)); - } - }); - - SimpleCommand settingsCommand2 = new SimpleCommand("neusettings", new SimpleCommand.ProcessCommandRunnable() { - public void processCommand(ICommandSender sender, String[] args) { - openGui = new GuiScreenElementWrapper(new NEUConfigEditor(config)); - } - }); - - SimpleCommand settingsCommand3 = new SimpleCommand("neuconfig", new SimpleCommand.ProcessCommandRunnable() { + SimpleCommand.ProcessCommandRunnable settingsRunnable = new SimpleCommand.ProcessCommandRunnable() { public void processCommand(ICommandSender sender, String[] args) { - openGui = new GuiScreenElementWrapper(new NEUConfigEditor(config)); + if(args.length > 0) { + openGui = new GuiScreenElementWrapper(new NEUConfigEditor(config, StringUtils.join(args, " "))); + } else { + openGui = new GuiScreenElementWrapper(new NEUConfigEditor(config)); + } } - }); + }; + SimpleCommand settingsCommand = new SimpleCommand("neu", settingsRunnable); + SimpleCommand settingsCommand2 = new SimpleCommand("neusettings", settingsRunnable); + SimpleCommand settingsCommand3 = new SimpleCommand("neuconfig", settingsRunnable); SimpleCommand calendarCommand = new SimpleCommand("neucalendar", new SimpleCommand.ProcessCommandRunnable() { public void processCommand(ICommandSender sender, String[] args) { @@ -922,6 +924,7 @@ public class NotEnoughUpdates { ClientCommandHandler.instance.registerCommand(joinDungeonCommand); ClientCommandHandler.instance.registerCommand(viewProfileCommand); ClientCommandHandler.instance.registerCommand(viewProfileShortCommand); + ClientCommandHandler.instance.registerCommand(dhCommand); if(!Loader.isModLoaded("skyblockextras")) ClientCommandHandler.instance.registerCommand(viewCataCommand); ClientCommandHandler.instance.registerCommand(peekCommand); ClientCommandHandler.instance.registerCommand(tutorialCommand); @@ -1059,27 +1062,12 @@ public class NotEnoughUpdates { return hasSkyblockScoreboard; } - //Stolen from Biscut's SkyblockAddons public void updateSkyblockScoreboard() { - final Pattern SERVER_BRAND_PATTERN = Pattern.compile("(.+) <- (?:.+)"); - Minecraft mc = Minecraft.getMinecraft(); if (mc != null && mc.theWorld != null && mc.thePlayer != null) { - if (!mc.isSingleplayer() && mc.thePlayer.getClientBrand() != null) { - Matcher matcher = SERVER_BRAND_PATTERN.matcher(mc.thePlayer.getClientBrand()); - - if (matcher.find()) { - // Group 1 is the server brand. - if(!matcher.group(1).toLowerCase().contains("hypixel")) { - hasSkyblockScoreboard = false; - return; - } - } else { - hasSkyblockScoreboard = false; - return; - } - } else { + if (mc.isSingleplayer() || mc.thePlayer.getClientBrand() == null || + !mc.thePlayer.getClientBrand().toLowerCase().contains("hypixel")) { hasSkyblockScoreboard = false; return; } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/GuiScreenElementWrapper.java b/src/main/java/io/github/moulberry/notenoughupdates/core/GuiScreenElementWrapper.java index c270397b..8d32d6c3 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/core/GuiScreenElementWrapper.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/core/GuiScreenElementWrapper.java @@ -7,7 +7,7 @@ import java.io.IOException; public class GuiScreenElementWrapper extends GuiScreen { - private final GuiElement element; + public final GuiElement element; public GuiScreenElementWrapper(GuiElement element) { this.element = element; 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 fa51cdca..16ce5875 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java @@ -366,7 +366,7 @@ public class DungeonMap { private HashMap<Integer, Float> borderRadiusCache = new HashMap<>(); public float getBorderRadius() { - int borderSizeOption = NotEnoughUpdates.INSTANCE.config.dungeonMap.dmBorderSize; + int borderSizeOption = Math.round(NotEnoughUpdates.INSTANCE.config.dungeonMap.dmBorderSize); String sizeId = borderSizeOption == 0 ? "small" : borderSizeOption == 2 ? "large" : "medium"; int style = NotEnoughUpdates.INSTANCE.config.dungeonMap.dmBorderStyle; @@ -414,7 +414,7 @@ public class DungeonMap { maxRoomY = Math.max(offset.y, maxRoomY); } - int borderSizeOption = NotEnoughUpdates.INSTANCE.config.dungeonMap.dmBorderSize; + int borderSizeOption = Math.round(NotEnoughUpdates.INSTANCE.config.dungeonMap.dmBorderSize); int renderRoomSize = getRenderRoomSize(); int renderConnSize = getRenderConnSize(); @@ -434,7 +434,7 @@ public class DungeonMap { int mapSizeX; int mapSizeY; if(NotEnoughUpdates.INSTANCE.config.dungeonMap.dmBorderStyle <= 1) { - mapSizeX = 80 + (int)Math.round(40*NotEnoughUpdates.INSTANCE.config.dungeonMap.dmBorderSize); + mapSizeX = 80 + Math.round(40*NotEnoughUpdates.INSTANCE.config.dungeonMap.dmBorderSize); } else { mapSizeX = borderSizeOption == 0 ? 90 : borderSizeOption == 1 ? 120 : borderSizeOption == 2 ? 160 : 240; } @@ -653,7 +653,8 @@ public class DungeonMap { pixelWidth = pixelHeight = 12; } GlStateManager.color(1, 1, 1, 1); - if(NotEnoughUpdates.INSTANCE.config.dungeonMap.dmPlayerHeads >= 1 && + if((playerMarkerMapPositions.size() <= 1 || minU != 1/4f) && + NotEnoughUpdates.INSTANCE.config.dungeonMap.dmPlayerHeads >= 1 && playerSkinMap.containsKey(entry.getKey())) { Minecraft.getMinecraft().getTextureManager().bindTexture(playerSkinMap.get(entry.getKey())); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonWin.java b/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonWin.java index 1bcd7fe8..c6f00c56 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonWin.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonWin.java @@ -140,6 +140,8 @@ public class DungeonWin { } public static void onChatMessage(ClientChatReceivedEvent e) { + if(e.type == 2) return; + if(NotEnoughUpdates.INSTANCE.config.dungeonWin.dungeonWinMillis < 100 || !NotEnoughUpdates.INSTANCE.config.dungeonWin.enableDungeonWin) return; long currentTime = System.currentTimeMillis(); String unformatted = Utils.cleanColour(e.message.getUnformattedText()); @@ -165,7 +167,7 @@ public class DungeonWin { TEAM_SCORE = D; break; } - SES.schedule(()->{ + SES.schedule(()-> { NotEnoughUpdates.INSTANCE.sendChatMessage("/showextrastats"); }, 100L, TimeUnit.MILLISECONDS); } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java index c011ac9b..36f4b908 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java @@ -31,12 +31,16 @@ public class DamageCommas { if(formatted.length() >= 7 && formatted.startsWith("\u00A7f\u2727") && formatted.endsWith("\u2727\u00a7r")) { + StringBuilder builder = new StringBuilder(); boolean numLast = false; boolean colLast = false; + boolean colLastLast; int numCount = 0; for(int i=formatted.length()-4; i>=3; i--) { char c = formatted.charAt(i); + colLastLast = colLast; + if(c == '\u00a7') { |
