From 4e04e197cf03a32518661c8142edbee35a6f67a6 Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Wed, 14 Sep 2022 11:56:16 +0200 Subject: Fixed collection displaynames (#280) --- .../profileviewer/ProfileViewer.java | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/main/java/io') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java index b6e56743..c9bd92a3 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java @@ -282,10 +282,10 @@ public class ProfileViewer { put("SUGAR_CANE", Utils.createItemStack(Items.reeds, EnumChatFormatting.YELLOW + "Sugar Cane")); put("FEATHER", Utils.createItemStack(Items.feather, EnumChatFormatting.YELLOW + "Feather")); put("LEATHER", Utils.createItemStack(Items.leather, EnumChatFormatting.YELLOW + "Leather")); - put("PORK", Utils.createItemStack(Items.porkchop, EnumChatFormatting.YELLOW + "Porkchop")); - put("RAW_CHICKEN", Utils.createItemStack(Items.chicken, EnumChatFormatting.YELLOW + "Chicken")); + put("PORK", Utils.createItemStack(Items.porkchop, EnumChatFormatting.YELLOW + "Raw Porkchop")); + put("RAW_CHICKEN", Utils.createItemStack(Items.chicken, EnumChatFormatting.YELLOW + "Raw Chicken")); put("MUTTON", Utils.createItemStack(Items.mutton, EnumChatFormatting.YELLOW + "Mutton")); - put("RABBIT", Utils.createItemStack(Items.rabbit, EnumChatFormatting.YELLOW + "Rabbit")); + put("RABBIT", Utils.createItemStack(Items.rabbit, EnumChatFormatting.YELLOW + "Raw Rabbit")); put("NETHER_STALK", Utils.createItemStack(Items.nether_wart, EnumChatFormatting.YELLOW + "Nether Wart")); /* MINING COLLECTIONS */ @@ -299,7 +299,7 @@ public class ProfileViewer { put("REDSTONE", Utils.createItemStack(Items.redstone, EnumChatFormatting.GRAY + "Redstone")); put("QUARTZ", Utils.createItemStack(Items.quartz, EnumChatFormatting.GRAY + "Nether Quartz")); put("OBSIDIAN", Utils.createItemStack(Item.getItemFromBlock(Blocks.obsidian), EnumChatFormatting.GRAY + "Obsidian")); - put("GLOWSTONE_DUST", Utils.createItemStack(Items.glowstone_dust, EnumChatFormatting.GRAY + "Glowstone")); + put("GLOWSTONE_DUST", Utils.createItemStack(Items.glowstone_dust, EnumChatFormatting.GRAY + "Glowstone Dust")); put("GRAVEL", Utils.createItemStack(Item.getItemFromBlock(Blocks.gravel), EnumChatFormatting.GRAY + "Gravel")); put("ICE", Utils.createItemStack(Item.getItemFromBlock(Blocks.ice), EnumChatFormatting.GRAY + "Ice")); put("NETHERRACK", Utils.createItemStack(Item.getItemFromBlock(Blocks.netherrack), EnumChatFormatting.GRAY + "Netherrack")); @@ -340,23 +340,23 @@ public class ProfileViewer { ); /* FORAGING COLLECTIONS */ - put("LOG", Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Oak")); - put("LOG:1", Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Spruce", 1)); - put("LOG:2", Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Birch", 2)); - put("LOG_2:1", Utils.createItemStack(Item.getItemFromBlock(Blocks.log2), EnumChatFormatting.DARK_GREEN + "Dark Oak", 1)); - put("LOG_2", Utils.createItemStack(Item.getItemFromBlock(Blocks.log2), EnumChatFormatting.DARK_GREEN + "Acacia")); - put("LOG:3", Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Jungle", 3)); + put("LOG", Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Oak Wood")); + put("LOG:1", Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Spruce Wood", 1)); + put("LOG:2", Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Birch Wood", 2)); + put("LOG_2:1", Utils.createItemStack(Item.getItemFromBlock(Blocks.log2), EnumChatFormatting.DARK_GREEN + "Dark Oak Wood", 1)); + put("LOG_2", Utils.createItemStack(Item.getItemFromBlock(Blocks.log2), EnumChatFormatting.DARK_GREEN + "Acacia Wood")); + put("LOG:3", Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Jungle Wood", 3)); /* FISHING COLLECTIONS */ - put("RAW_FISH", Utils.createItemStack(Items.fish, EnumChatFormatting.AQUA + "Fish")); - put("RAW_FISH:1", Utils.createItemStack(Items.fish, EnumChatFormatting.AQUA + "Salmon", 1)); + put("RAW_FISH", Utils.createItemStack(Items.fish, EnumChatFormatting.AQUA + "Raw Fish")); + put("RAW_FISH:1", Utils.createItemStack(Items.fish, EnumChatFormatting.AQUA + "Raw Salmon", 1)); put("RAW_FISH:2", Utils.createItemStack(Items.fish, EnumChatFormatting.AQUA + "Clownfish", 2)); put("RAW_FISH:3", Utils.createItemStack(Items.fish, EnumChatFormatting.AQUA + "Pufferfish", 3)); put("PRISMARINE_SHARD", Utils.createItemStack(Items.prismarine_shard, EnumChatFormatting.AQUA + "Prismarine Shard")); put("PRISMARINE_CRYSTALS", Utils.createItemStack(Items.prismarine_crystals, EnumChatFormatting.AQUA + "Prismarine Crystals")); put("CLAY_BALL", Utils.createItemStack(Items.clay_ball, EnumChatFormatting.AQUA + "Clay")); - put("WATER_LILY", Utils.createItemStack(Item.getItemFromBlock(Blocks.waterlily), EnumChatFormatting.AQUA + "Lilypad")); - put("INK_SACK", Utils.createItemStack(Items.dye, EnumChatFormatting.AQUA + "Ink Sack")); + put("WATER_LILY", Utils.createItemStack(Item.getItemFromBlock(Blocks.waterlily), EnumChatFormatting.AQUA + "Lily Pad")); + put("INK_SACK", Utils.createItemStack(Items.dye, EnumChatFormatting.AQUA + "Ink Sac")); put("SPONGE", Utils.createItemStack(Item.getItemFromBlock(Blocks.sponge), EnumChatFormatting.AQUA + "Sponge")); put( "MAGMA_FISH", -- cgit From 5e1cfdc20fa2d07f9448d0c0eee54cce9f1878f6 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Wed, 14 Sep 2022 22:29:29 +1000 Subject: Fixed expanded pet xp just running twice? (#270) --- .../listener/ItemTooltipListener.java | 70 ---------------------- 1 file changed, 70 deletions(-) (limited to 'src/main/java/io') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java index d4e0becd..1cd71eb6 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java @@ -689,18 +689,6 @@ public class ItemTooltipListener { index++; } - for (int i = newTooltip.size() - 1; i >= 0; i--) { - String line = Utils.cleanColour(newTooltip.get(i)); - for (int i1 = 0; i1 < Utils.rarityArr.length; i1++) { - if (line.equals(Utils.rarityArr[i1])) { - if (i - 2 < 0) { - break; - } - newTooltip.addAll(i - 1, petToolTipXPExtend(event)); - break; - } - } - } pressedShiftLast = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT); pressedArrowLast = Keyboard.isKeyDown(Keyboard.KEY_LEFT) || Keyboard.isKeyDown(Keyboard.KEY_RIGHT); @@ -718,64 +706,6 @@ public class ItemTooltipListener { } } - private List petToolTipXPExtend(ItemTooltipEvent event) { - List tooltipText = new ArrayList<>(); - if (NotEnoughUpdates.INSTANCE.config.tooltipTweaks.petExtendExp) { - if (event.itemStack.getTagCompound().hasKey("DisablePetExp")) { - if (event.itemStack.getTagCompound().getBoolean("DisablePetExp")) { - return tooltipText; - } - } - //7 is just a random number i chose, prob no pets with less lines than 7 - if (event.toolTip.size() > 7) { - if (Utils.cleanColour(event.toolTip.get(1)).matches(petToolTipRegex)) { - - GuiProfileViewer.PetLevel petlevel = null; - - //this is the item itself - NBTTagCompound tag = event.itemStack.getTagCompound(); - if (tag.hasKey("ExtraAttributes")) { - if (tag.getCompoundTag("ExtraAttributes").hasKey("petInfo")) { - JsonObject petInfo = NotEnoughUpdates.INSTANCE.manager.gson.fromJson(tag - .getCompoundTag("ExtraAttributes") - .getString("petInfo"), JsonObject.class); - if (petInfo.has("exp") && petInfo.get("exp").isJsonPrimitive()) { - JsonPrimitive exp = petInfo.getAsJsonPrimitive("exp"); - String petName = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(event.itemStack); - //Utils.getRarityFromInt(Utils.checkItemTypePet(event.toolTip))).getAsInt(); - petlevel = GuiProfileViewer.getPetLevel( - petName, - Utils.getRarityFromInt(Utils.checkItemTypePet(event.toolTip)), - exp.getAsLong() - ); - } - } - } - - if (petlevel != null) { - tooltipText.add(""); - if (petlevel.totalXp > petlevel.maxXP) { - tooltipText.add(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "MAX LEVEL"); - } else { - tooltipText.add( - EnumChatFormatting.GRAY + "Progress to Level " + (int) Math.floor(petlevel.level + 1) + ": " + - EnumChatFormatting.YELLOW + Utils.round(petlevel.levelPercentage * 100, 1) + "%"); - int levelpercentage = Math.round(petlevel.levelPercentage * 20); - tooltipText.add( - EnumChatFormatting.DARK_GREEN + String.join("", Collections.nCopies(levelpercentage, "-")) + - EnumChatFormatting.WHITE + String.join("", Collections.nCopies(20 - levelpercentage, "-"))); - tooltipText.add( - EnumChatFormatting.GRAY + "EXP: " + EnumChatFormatting.YELLOW + myFormatter.format(petlevel.levelXp) + - EnumChatFormatting.GOLD + "/" + EnumChatFormatting.YELLOW + - myFormatter.format(petlevel.currentLevelRequirement) + " EXP"); - } - } - } - } - } - return tooltipText; - } - private void petToolTipXPExtendPetMenu(ItemTooltipEvent event) { if (NotEnoughUpdates.INSTANCE.config.tooltipTweaks.petExtendExp) { //7 is just a random number i chose, prob no pets with less lines than 7 -- cgit From 18255a0e473092d0f389507a19944a7ddfc8078d Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Wed, 14 Sep 2022 22:30:25 +1000 Subject: Added chat message to let players turn on the storage gui if they accidentally turned it off (#273) * Added a chat message to turn the storage gui back on after turning it off in said storage gui * remove the skyclient mixin * map on by default --- .../notenoughupdates/commands/Commands.java | 2 ++ .../commands/dev/EnableStorageCommand.java | 39 ++++++++++++++++++++++ .../notenoughupdates/miscgui/StorageOverlay.java | 14 ++++++++ .../mixins/MixinSkyclientCosmetics.java | 39 ---------------------- .../options/seperateSections/DungeonMapConfig.java | 2 +- src/main/resources/mixins.notenoughupdates.json | 1 - 6 files changed, 56 insertions(+), 41 deletions(-) create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/commands/dev/EnableStorageCommand.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinSkyclientCosmetics.java (limited to 'src/main/java/io') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java index fcb2aaf9..62981a30 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java @@ -23,6 +23,7 @@ import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.commands.dev.DevTestCommand; import io.github.moulberry.notenoughupdates.commands.dev.DiagCommand; import io.github.moulberry.notenoughupdates.commands.dev.DungeonWinTestCommand; +import io.github.moulberry.notenoughupdates.commands.dev.EnableStorageCommand; import io.github.moulberry.notenoughupdates.commands.dev.NullzeeSphereCommand; import io.github.moulberry.notenoughupdates.commands.dev.PackDevCommand; import io.github.moulberry.notenoughupdates.commands.dev.ReloadRepoCommand; @@ -74,6 +75,7 @@ public class Commands { ClientCommandHandler.instance.registerCommand(new DiagCommand()); ClientCommandHandler.instance.registerCommand(new ReloadRepoCommand()); ClientCommandHandler.instance.registerCommand(new ResetRepoCommand()); + ClientCommandHandler.instance.registerCommand(new EnableStorageCommand()); // Profile Commands ClientCommandHandler.instance.registerCommand(new PeekCommand()); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/EnableStorageCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/EnableStorageCommand.java new file mode 100644 index 00000000..3415b030 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/EnableStorageCommand.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + +package io.github.moulberry.notenoughupdates.commands.dev; + +import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.commands.ClientCommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; + +public class EnableStorageCommand extends ClientCommandBase { + + public EnableStorageCommand() { + super("neuenablestorage"); + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + NotEnoughUpdates.INSTANCE.config.storageGUI.enableStorageGUI3 = true; + NotEnoughUpdates.INSTANCE.saveConfig(); + } + +} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java index 27fea377..8878c284 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java @@ -45,13 +45,17 @@ import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.shader.Framebuffer; +import net.minecraft.event.ClickEvent; +import net.minecraft.event.HoverEvent; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.inventory.ContainerChest; import net.minecraft.inventory.Slot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.ClientCommandHandler; import org.lwjgl.input.Keyboard; @@ -1966,6 +1970,16 @@ public class StorageOverlay extends GuiElement { switch (buttonIndex) { case 0: NotEnoughUpdates.INSTANCE.config.storageGUI.enableStorageGUI3 = false; + ChatComponentText storageMessage = new ChatComponentText( + EnumChatFormatting.YELLOW + "[NEU] " + EnumChatFormatting.YELLOW + + "You just disabled the custom storage gui, did you mean to do that? If not click this message to turn it back on."); + storageMessage.setChatStyle(Utils.createClickStyle(ClickEvent.Action.RUN_COMMAND, "/neuenablestorage")); + storageMessage.setChatStyle(storageMessage.getChatStyle().setChatHoverEvent( + new HoverEvent(HoverEvent.Action.SHOW_TEXT, + new ChatComponentText(EnumChatFormatting.YELLOW + "Click to enable the custom storage gui.")))); + ChatComponentText storageChatMessage = new ChatComponentText(""); + storageChatMessage.appendSibling(storageMessage); + Minecraft.getMinecraft().thePlayer.addChatMessage(storageChatMessage); break; case 1: int size = diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinSkyclientCosmetics.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinSkyclientCosmetics.java deleted file mode 100644 index 32c9f418..00000000 --- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinSkyclientCosmetics.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2022 NotEnoughUpdates contributors - * - * This file is part of NotEnoughUpdates. - * - * NotEnoughUpdates is free software: you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation, either - * version 3 of the License, or (at your option) any later version. - * - * NotEnoughUpdates is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with NotEnoughUpdates. If not, see . - */ - -package io.github.moulberry.notenoughupdates.mixins; - -import net.minecraftforge.event.world.WorldEvent; -import org.spongepowered.asm.mixin.Dynamic; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Pseudo; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Pseudo -@Mixin(targets = "co.skyclient.scc.SkyclientCosmetics") -public class MixinSkyclientCosmetics { - - @Dynamic - @Inject(method = "onWorldLoad", at = @At("HEAD"), cancellable = true, remap = false) - public void onWorldLoad(WorldEvent.Load event, CallbackInfo ci) { - ci.cancel(); - } -} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/DungeonMapConfig.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/DungeonMapConfig.java index 4397c02e..8e211bd6 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/DungeonMapConfig.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/DungeonMapConfig.java @@ -73,7 +73,7 @@ public class DungeonMapConfig { name = "Show Dungeon Map", desc = "Show/hide the NEU dungeon map" ) - public boolean dmEnable = false; + public boolean dmEnable = true; @Expose @ConfigOption( diff --git a/src/main/resources/mixins.notenoughupdates.json b/src/main/resources/mixins.notenoughupdates.json index 0a547b4b..ed1ba55a 100644 --- a/src/main/resources/mixins.notenoughupdates.json +++ b/src/main/resources/mixins.notenoughupdates.json @@ -40,7 +40,6 @@ "MixinRenderGlobal", "MixinRenderItem", "MixinRenderList", - "MixinSkyclientCosmetics", "MixinTextureManager", "MixinTileEntitySkullRenderer", "MixinTileEntitySpecialRenderer", -- cgit From c0eee7a5df9239a361d5e6363a172abe32fd0e84 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Wed, 14 Sep 2022 22:31:02 +1000 Subject: added a setting to toggle hex separate from /et (#275) --- .../notenoughupdates/listener/ItemTooltipListener.java | 6 +----- .../moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java | 4 ++-- .../notenoughupdates/options/seperateSections/Enchanting.java | 11 ++++++++++- 3 files changed, 13 insertions(+), 8 deletions(-) (limited to 'src/main/java/io') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java index 1cd71eb6..5d6a2bdc 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java @@ -836,15 +836,11 @@ public class ItemTooltipListener { boolean m = Keyboard.isKeyDown(Keyboard.KEY_M); boolean n = Keyboard.isKeyDown(Keyboard.KEY_N); boolean f = Keyboard.isKeyDown(Keyboard.KEY_F); - boolean l = Keyboard.isKeyDown(Keyboard.KEY_L); if (!copied && f && NotEnoughUpdates.INSTANCE.config.hidden.dev) { MiscUtils.copyToClipboard(NotEnoughUpdates.INSTANCE.manager.getSkullValueForItem(event.itemStack)); } - if (!copied && l) { - NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableTableGUI = !NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableTableGUI; - } event.toolTip.add( EnumChatFormatting.AQUA + "Internal Name: " + EnumChatFormatting.GRAY + internal + EnumChatFormatting.GOLD + @@ -883,7 +879,7 @@ public class ItemTooltipListener { } } - copied = k || m || n || f || l; + copied = k || m || n || f; } } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java index 39374f9d..c59a7003 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java @@ -243,7 +243,7 @@ public class GuiCustomHex extends Gui { searchField.setText(""); return false; } - boolean config = NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableTableGUI; + boolean config = NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableHexGUI; final List gemList = new ArrayList<>(Arrays.asList( "\u2764", "\u2748", @@ -4334,7 +4334,7 @@ public class GuiCustomHex extends Gui { switch (index) { case 0: { - NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableTableGUI = false; + NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableHexGUI = false; break; } case 2: { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Enchanting.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Enchanting.java index 2f3ffa36..306629f7 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Enchanting.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Enchanting.java @@ -28,7 +28,7 @@ import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigOption public class Enchanting { @ConfigOption( - name = "Enchant Table GUI", + name = "Enchant Table / Hex GUI", desc = "" ) @ConfigEditorAccordion(id = 1) @@ -43,6 +43,15 @@ public class Enchanting { @ConfigAccordionId(id = 1) public boolean enableTableGUI = true; + @Expose + @ConfigOption( + name = "Enable Hex GUI", + desc = "Show a custom GUI when using the Hex" + ) + @ConfigEditorBoolean + @ConfigAccordionId(id = 1) + public boolean enableHexGUI = true; + /*@Expose @ConfigOption( name = "Incompatible Enchants", -- cgit From 12fdc80608962c0ae70e0deb246076c1d40f7d8a Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Wed, 14 Sep 2022 22:31:40 +1000 Subject: fix 9 and b getting overridden (#276) --- .../listener/ItemTooltipListener.java | 32 ++++++++++++---------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'src/main/java/io') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java index 5d6a2bdc..c522e70a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java @@ -382,6 +382,7 @@ public class ItemTooltipListener { } } if (hasEnchantments || hasAttributes) { + ArrayList addedEnchants = new ArrayList<>(); for (String op : NotEnoughUpdates.INSTANCE.config.hidden.enchantColours) { List colourOps = GuiEnchantColour.splitter.splitToList(op); String enchantName = GuiEnchantColour.getColourOpIndex(colourOps, 0); @@ -475,20 +476,22 @@ public class ItemTooltipListener { String extraMods = extraModifiersBuilder.toString(); if (!colourCode.equals("z")) { - line = line.replace("\u00A79" + enchantText, "\u00A7" + colourCode + extraMods + enchantText); - line = line.replace("\u00A7b" + enchantText, "\u00A7" + colourCode + extraMods + enchantText); - line = line.replace( - "\u00A79\u00A7d\u00A7l" + enchantText, - "\u00A7" + colourCode + extraMods + enchantText - ); - line = line.replace( - "\u00A7b\u00A7d\u00A7l" + enchantText, - "\u00A7" + colourCode + extraMods + enchantText - ); - line = line.replace( - "\u00A7l\u00A7d\u00A7l" + enchantText, - "\u00A7" + colourCode + extraMods + enchantText - ); + if (!addedEnchants.contains(enchantText)) { + line = line.replace("\u00A79" + enchantText, "\u00A7" + colourCode + extraMods + enchantText); + line = line.replace("\u00A7b" + enchantText, "\u00A7" + colourCode + extraMods + enchantText); + line = line.replace( + "\u00A79\u00A7d\u00A7l" + enchantText, + "\u00A7" + colourCode + extraMods + enchantText + ); + line = line.replace( + "\u00A7b\u00A7d\u00A7l" + enchantText, + "\u00A7" + colourCode + extraMods + enchantText + ); + line = line.replace( + "\u00A7l\u00A7d\u00A7l" + enchantText, + "\u00A7" + colourCode + extraMods + enchantText + ); + } } else { int offset = Minecraft.getMinecraft().fontRendererObj.getStringWidth(line.replaceAll( "\\u00A79" + enchantText + ".*", @@ -516,6 +519,7 @@ public class ItemTooltipListener { Utils.chromaString(enchantText, offset / 12f + index, true) ); } + addedEnchants.add(enchantText); } } } -- cgit From 989b633329f00d9dd0b02e2ffc4ccf2a5d18bd30 Mon Sep 17 00:00:00 2001 From: Lulonaut <67191924+Lulonaut@users.noreply.github.com> Date: Wed, 14 Sep 2022 14:33:04 +0200 Subject: Fix tab overlay rendering in some guis (#278) * Don't render overlays when pressing tab in some guis * Made it only show if no gui screen is open Co-authored-by: nopo --- .../notenoughupdates/overlays/TextTabOverlay.java | 25 ++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'src/main/java/io') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java index 69a0cd00..8073062c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java @@ -36,12 +36,29 @@ public abstract class TextTabOverlay extends TextOverlay { } private boolean lastTabState = false; + private boolean shouldUpdateOverlay = true; - public void realTick() { - boolean currentTabState = Keyboard.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindPlayerList.getKeyCode()); - if (lastTabState != currentTabState) { - lastTabState = currentTabState; + @Override + public void tick() { + if (shouldUpdateOverlay) { update(); } } + + public void realTick() { + shouldUpdateOverlay = shouldUpdate(); + if (shouldUpdateOverlay) { + boolean currentTabState = + Keyboard.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindPlayerList.getKeyCode()); + if (lastTabState != currentTabState) { + lastTabState = currentTabState; + update(); + } + } + } + + private boolean shouldUpdate() { + //prevent rendering unless no gui is open + return Minecraft.getMinecraft().currentScreen == null; + } } -- cgit From 66560fdfedb95dcceed64c5d093d4b3703059616 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Wed, 14 Sep 2022 22:36:46 +1000 Subject: show quiver even when inventory api is disabled (it shows selected arrow) (#277) --- .../profileviewer/InventoriesPage.java | 48 ++++++++++++---------- 1 file changed, 26 insertions(+), 22 deletions(-) (limited to 'src/main/java/io') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/InventoriesPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/InventoriesPage.java index c98792ee..b4f1da30 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/InventoriesPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/InventoriesPage.java @@ -240,28 +240,6 @@ public class InventoriesPage extends GuiProfileViewerPage { if (currentInventoryIndex < 0) currentInventoryIndex = 0; ItemStack[][] inventory = inventories[currentInventoryIndex]; - if (inventory == null) { - if (selectedInventory.equalsIgnoreCase("personal_vault_contents")) { - Utils.drawStringCentered( - EnumChatFormatting.RED + "Personal Vault API not enabled!", - Minecraft.getMinecraft().fontRendererObj, - guiLeft + 317, - guiTop + 101, - true, - 0 - ); - } else { - Utils.drawStringCentered( - EnumChatFormatting.RED + "Inventory API not enabled!", - Minecraft.getMinecraft().fontRendererObj, - guiLeft + 317, - guiTop + 101, - true, - 0 - ); - } - return; - } if (bestWeapons == null) { bestWeapons = @@ -363,6 +341,32 @@ public class InventoriesPage extends GuiProfileViewerPage { } } + if (inventory == null) { + String strToRender = "Inventory API not enabled!"; + if (selectedInventory.equalsIgnoreCase("personal_vault_contents")) { + strToRender = "Personal Vault API not enabled!"; + } else if (selectedInventory.equalsIgnoreCase("backpack_contents")) { + strToRender = "Inventory API not enabled"; + Utils.drawStringCentered( + EnumChatFormatting.RED + "Or has no backpacks!", + Minecraft.getMinecraft().fontRendererObj, + guiLeft + 317, + guiTop + 112, + true, + 0 + ); + } + Utils.drawStringCentered( + EnumChatFormatting.RED + strToRender, + Minecraft.getMinecraft().fontRendererObj, + guiLeft + 317, + guiTop + 101, + true, + 0 + ); + return; + } + int inventoryRows = inventory.length; GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); -- cgit From 2d8c295a9280337bace055fd2cedae8af17995ee Mon Sep 17 00:00:00 2001 From: Walker Selby Date: Wed, 14 Sep 2022 07:38:35 -0500 Subject: Add Blaze to /peek (#279) * Add Blaze to /peek Add blaze slayer to /peek Add Carpentry to skill average in /peek Fix color of - in peek Add my IGN to DEV_TESTERS in DevTestCommand and actually commit it so I can stop manually re-adding myself to that list * Update 2.1.md Added changes to changelog * Update 2.1.md Changed formatting for readability --- Update Notes/2.1.md | 4 +++- .../notenoughupdates/commands/dev/DevTestCommand.java | 3 ++- .../notenoughupdates/commands/profile/PeekCommand.java | 15 ++++++++++++--- 3 files changed, 17 insertions(+), 5 deletions(-) (limited to 'src/main/java/io') diff --git a/Update Notes/2.1.md b/Update Notes/2.1.md index 50e2d0e4..e6b2b472 100644 --- a/Update Notes/2.1.md +++ b/Update Notes/2.1.md @@ -7,7 +7,7 @@ - Added combat skill overlay - nopo - Added slayer overlay - nopo - Added blocking clicks back to the enchanting minigames (because apparently, it's not bannable?) -- [Donpireso replied to a sba dev's email about some of sba features, and it seems to imply that blocking clicks in guis aren't bannable](https://cdn.discordapp.com/attachments/823769568933576764/906101631861526559/unknown.png) + - [Donpireso replied to a sba dev's email about some of sba features, and it seems to imply that blocking clicks in guis aren't bannable](https://cdn.discordapp.com/attachments/823769568933576764/906101631861526559/unknown.png) - Made it if you hold shift in the enchant solvers it overrides prevent missclicks - nopo - Fixed pet overlay not updating when going into /pets - nopo - Fixed pet overlay randomly going to level 100 - nopo @@ -153,6 +153,8 @@ - Fixed priceless items showing first in the missing tab of the accessory bag overlay - nopo - Fixed clicking outside of experimentation game causing it to go count that as a valid click - nopo - Fixed storage gui when having locked backpack slots - nopo +- Fixed hyphens in /peek being the wrong color - whalker +- Fixed skill average calculation to include carpentry in /peek - whalker ### **Other:** diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java index fdf59bb0..2a5e3305 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java @@ -57,7 +57,8 @@ public class DevTestCommand extends ClientCommandBase { "dediamondpro", "lulonaut", "craftyoldminer", - "eisengolem" + "eisengolem", + "whalker" ); private static final String[] DEV_FAIL_STRINGS = { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/profile/PeekCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/profile/PeekCommand.java index 421f7c10..75e779fc 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/profile/PeekCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/profile/PeekCommand.java @@ -122,7 +122,7 @@ public class PeekCommand extends ClientCommandBase { float totalSkillLVL = 0; float totalSkillCount = 0; - List skills = Arrays.asList("taming", "mining", "foraging", "enchanting", "farming", "combat", "fishing", "alchemy"); + List skills = Arrays.asList("taming", "mining", "foraging", "enchanting", "farming", "combat", "fishing", "alchemy", "carpentry"); for (String skillName : skills) { totalSkillLVL += skyblockInfo.get(skillName).level; totalSkillCount++; @@ -133,6 +133,7 @@ public class PeekCommand extends ClientCommandBase { float spider = skyblockInfo.get("spider").level; float wolf = skyblockInfo.get("wolf").level; float enderman = skyblockInfo.get("enderman").level; + float blaze = skyblockInfo.get("blaze").level; float avgSkillLVL = totalSkillLVL / totalSkillCount; @@ -143,6 +144,7 @@ public class PeekCommand extends ClientCommandBase { spider = 1; wolf = 2; enderman = 0; + blaze = 0; } EnumChatFormatting combatPrefix = combat > 20 @@ -161,6 +163,11 @@ public class PeekCommand extends ClientCommandBase { ? EnumChatFormatting.GREEN : EnumChatFormatting.YELLOW) : EnumChatFormatting.RED; + EnumChatFormatting blazePrefix = blaze > 3 + ? (blaze > 6 + ? EnumChatFormatting.GREEN + : EnumChatFormatting.YELLOW) + : EnumChatFormatting.RED; EnumChatFormatting avgPrefix = avgSkillLVL > 20 ? (avgSkillLVL > 35 ? EnumChatFormatting.GREEN @@ -171,6 +178,7 @@ public class PeekCommand extends ClientCommandBase { overallScore += spider * spider / 81f; overallScore += wolf * wolf / 81f; overallScore += enderman * enderman / 81f; + overallScore += blaze * blaze / 81f; overallScore += avgSkillLVL / 20f; int cata = (int) skyblockInfo.get("catacombs").level; @@ -187,8 +195,9 @@ public class PeekCommand extends ClientCommandBase { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText( g + "Slayer: " + zombiePrefix + (int) Math.floor(zombie) + g + "-" + spiderPrefix + (int) Math.floor(spider) + g + "-" + - wolfPrefix + (int) Math.floor(wolf) + "-" + - endermanPrefix + (int) Math.floor(enderman))); + wolfPrefix + (int) Math.floor(wolf) + g+ "-" + + endermanPrefix + (int) Math.floor(enderman) + g + "-" + + blazePrefix + (int) Math.floor(blaze))); } if (stats == null) { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText( -- cgit