diff options
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui')
17 files changed, 440 insertions, 41 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java index 95e21cd0..c8fd0fde 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java @@ -1,3 +1,22 @@ +/* + * 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 <https://www.gnu.org/licenses/>. + */ + package io.github.moulberry.notenoughupdates.miscgui; import com.google.gson.JsonArray; @@ -33,8 +52,14 @@ import org.lwjgl.opengl.GL14; import java.awt.*; import java.io.ByteArrayInputStream; import java.io.IOException; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; import java.util.List; -import java.util.*; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -55,7 +80,8 @@ public class AccessoryBagOverlay { Utils.createItemStack(Items.diamond_sword, EnumChatFormatting.DARK_AQUA + "Total Stat Bonuses", 0 ), - Utils.createItemStack(Item.getItemFromBlock(Blocks.anvil), + Utils.createItemStack( + Item.getItemFromBlock(Blocks.anvil), EnumChatFormatting.DARK_AQUA + "Total Stat Bonuses (from reforges)", 0 ), @@ -211,7 +237,8 @@ public class AccessoryBagOverlay { } } - Utils.drawStringCenteredScaledMaxWidth("# By Rarity", + Utils.drawStringCenteredScaledMaxWidth( + "# By Rarity", Minecraft.getMinecraft().fontRendererObj, x + 40, y + 12, @@ -244,7 +271,8 @@ public class AccessoryBagOverlay { } } - Utils.drawStringCenteredScaledMaxWidth("Total Stats", + Utils.drawStringCenteredScaledMaxWidth( + "Total Stats", Minecraft.getMinecraft().fontRendererObj, x + 40, y + 12, @@ -291,7 +319,8 @@ public class AccessoryBagOverlay { } } - Utils.drawStringCenteredScaledMaxWidth("Reforge Stats", + Utils.drawStringCenteredScaledMaxWidth( + "Reforge Stats", Minecraft.getMinecraft().fontRendererObj, x + 40, y + 12, @@ -334,7 +363,8 @@ public class AccessoryBagOverlay { if (duplicates == null) { JsonObject misc = Constants.MISC; if (misc == null) { - Utils.drawStringCenteredScaledMaxWidth("Duplicates: ERROR", + Utils.drawStringCenteredScaledMaxWidth( + "Duplicates: ERROR", Minecraft.getMinecraft().fontRendererObj, x + 40, y + 12, @@ -346,7 +376,8 @@ public class AccessoryBagOverlay { } JsonElement talisman_upgrades_element = misc.get("talisman_upgrades"); if (talisman_upgrades_element == null) { - Utils.drawStringCenteredScaledMaxWidth("Duplicates: ERROR", + Utils.drawStringCenteredScaledMaxWidth( + "Duplicates: ERROR", Minecraft.getMinecraft().fontRendererObj, x + 40, y + 12, @@ -388,7 +419,8 @@ public class AccessoryBagOverlay { } } if (duplicates.isEmpty()) { - Utils.drawStringCenteredScaledMaxWidth("No Duplicates", + Utils.drawStringCenteredScaledMaxWidth( + "No Duplicates", Minecraft.getMinecraft().fontRendererObj, x + 40, y + 12, @@ -397,7 +429,8 @@ public class AccessoryBagOverlay { new Color(80, 80, 80).getRGB() ); } else { - Utils.drawStringCenteredScaledMaxWidth("Duplicates: " + duplicates.size(), + Utils.drawStringCenteredScaledMaxWidth( + "Duplicates: " + duplicates.size(), Minecraft.getMinecraft().fontRendererObj, x + 40, y + 12, @@ -432,7 +465,8 @@ public class AccessoryBagOverlay { if (missing == null) { JsonObject misc = Constants.MISC; if (misc == null) { - Utils.drawStringCenteredScaledMaxWidth("Duplicates: ERROR", + Utils.drawStringCenteredScaledMaxWidth( + "Duplicates: ERROR", Minecraft.getMinecraft().fontRendererObj, x + 40, y + 12, @@ -444,7 +478,8 @@ public class AccessoryBagOverlay { } JsonElement talisman_upgrades_element = misc.get("talisman_upgrades"); if (talisman_upgrades_element == null) { - Utils.drawStringCenteredScaledMaxWidth("Duplicates: ERROR", + Utils.drawStringCenteredScaledMaxWidth( + "Duplicates: ERROR", Minecraft.getMinecraft().fontRendererObj, x + 40, y + 12, @@ -519,7 +554,8 @@ public class AccessoryBagOverlay { } } if (missing.isEmpty()) { - Utils.drawStringCenteredScaledMaxWidth("No Missing", + Utils.drawStringCenteredScaledMaxWidth( + "No Missing", Minecraft.getMinecraft().fontRendererObj, x + 40, y + 12, @@ -528,7 +564,8 @@ public class AccessoryBagOverlay { new Color(80, 80, 80).getRGB() ); } else { - Utils.drawStringCenteredScaledMaxWidth("Missing: " + missing.size(), + Utils.drawStringCenteredScaledMaxWidth( + "Missing: " + missing.size(), Minecraft.getMinecraft().fontRendererObj, x + 40, y + 12, @@ -653,7 +690,8 @@ public class AccessoryBagOverlay { private static int mainWeapon = 1; public static void renderOptimizerOverlay(int x, int y) { - Utils.drawStringCenteredScaledMaxWidth("Optimizer", + Utils.drawStringCenteredScaledMaxWidth( + "Optimizer", Minecraft.getMinecraft().fontRendererObj, x + 40, y + 12, @@ -686,7 +724,8 @@ public class AccessoryBagOverlay { dark ); - Utils.drawStringCenteredScaledMaxWidth("Force 100% CC", + Utils.drawStringCenteredScaledMaxWidth( + "Force 100% CC", Minecraft.getMinecraft().fontRendererObj, x + 40, y + 27, @@ -698,7 +737,8 @@ public class AccessoryBagOverlay { Minecraft.getMinecraft().fontRendererObj, x + 20, y + 37, true, 30, new Color(80, 80, 80).getRGB() ); - Utils.drawStringCenteredScaledMaxWidth((forceCC ? EnumChatFormatting.GRAY : EnumChatFormatting.RED) + "NO", + Utils.drawStringCenteredScaledMaxWidth( + (forceCC ? EnumChatFormatting.GRAY : EnumChatFormatting.RED) + "NO", Minecraft.getMinecraft().fontRendererObj, x + 60, y + 37, @@ -707,7 +747,8 @@ public class AccessoryBagOverlay { new Color(80, 80, 80).getRGB() ); - Utils.drawStringCenteredScaledMaxWidth("Force 100% ATKSPEED", + Utils.drawStringCenteredScaledMaxWidth( + "Force 100% ATKSPEED", Minecraft.getMinecraft().fontRendererObj, x + 40, y + 47, @@ -715,7 +756,8 @@ public class AccessoryBagOverlay { 70, new Color(80, 80, 80).getRGB() ); - Utils.drawStringCenteredScaledMaxWidth((forceAS ? EnumChatFormatting.GREEN : EnumChatFormatting.GRAY) + "YES", + Utils.drawStringCenteredScaledMaxWidth( + (forceAS ? EnumChatFormatting.GREEN : EnumChatFormatting.GRAY) + "YES", Minecraft.getMinecraft().fontRendererObj, x + 20, y + 57, @@ -723,7 +765,8 @@ public class AccessoryBagOverlay { 30, new Color(80, 80, 80).getRGB() ); - Utils.drawStringCenteredScaledMaxWidth((forceAS ? EnumChatFormatting.GRAY : EnumChatFormatting.RED) + "NO", + Utils.drawStringCenteredScaledMaxWidth( + (forceAS ? EnumChatFormatting.GRAY : EnumChatFormatting.RED) + "NO", Minecraft.getMinecraft().fontRendererObj, x + 60, y + 57, @@ -732,7 +775,8 @@ public class AccessoryBagOverlay { new Color(80, 80, 80).getRGB() ); - Utils.drawStringCenteredScaledMaxWidth("Use God Potion", + Utils.drawStringCenteredScaledMaxWidth( + "Use God Potion", Minecraft.getMinecraft().fontRendererObj, x + 40, y + 67, @@ -740,7 +784,8 @@ public class AccessoryBagOverlay { 70, new Color(80, 80, 80).getRGB() ); - Utils.drawStringCenteredScaledMaxWidth((useGodPot ? EnumChatFormatting.GREEN : EnumChatFormatting.GRAY) + "YES", + Utils.drawStringCenteredScaledMaxWidth( + (useGodPot ? EnumChatFormatting.GREEN : EnumChatFormatting.GRAY) + "YES", Minecraft.getMinecraft().fontRendererObj, x + 20, y + 77, @@ -748,7 +793,8 @@ public class AccessoryBagOverlay { 30, new Color(80, 80, 80).getRGB() ); - Utils.drawStringCenteredScaledMaxWidth((useGodPot ? EnumChatFormatting.GRAY : EnumChatFormatting.RED) + "NO", + Utils.drawStringCenteredScaledMaxWidth( + (useGodPot ? EnumChatFormatting.GRAY : EnumChatFormatting.RED) + "NO", Minecraft.getMinecraft().fontRendererObj, x + 60, y + 77, @@ -757,7 +803,8 @@ public class AccessoryBagOverlay { new Color(80, 80, 80).getRGB() ); - Utils.drawStringCenteredScaledMaxWidth("Use God Potion", + Utils.drawStringCenteredScaledMaxWidth( + "Use God Potion", Minecraft.getMinecraft().fontRendererObj, x + 40, y + 87, @@ -774,7 +821,8 @@ public class AccessoryBagOverlay { true, 30, new Color(80, 80, 80).getRGB() ); - Utils.drawStringCenteredScaledMaxWidth("Main Weapon", + Utils.drawStringCenteredScaledMaxWidth( + "Main Weapon", Minecraft.getMinecraft().fontRendererObj, x + 40, y + 107, @@ -836,7 +884,8 @@ public class AccessoryBagOverlay { GuiChest eventGui = (GuiChest) Minecraft.getMinecraft().currentScreen; ContainerChest cc = (ContainerChest) eventGui.inventorySlots; String containerName = cc.getLowerChestInventory().getDisplayName().getUnformattedText(); - if (containerName.trim().startsWith("Accessory Bag") && !containerName.contains("Thaumaturgy") && !containerName.contains("Upgrades")) { + if (containerName.trim().startsWith("Accessory Bag") && !containerName.contains("Thaumaturgy") && + !containerName.contains("Upgrades")) { inAccessoryBag = true; try { int xSize = (int) Utils.getField(GuiContainer.class, eventGui, "xSize", "field_146999_f"); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java index 06cf28e1..64396905 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java @@ -1,3 +1,22 @@ +/* + * 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 <https://www.gnu.org/licenses/>. + */ + package io.github.moulberry.notenoughupdates.miscgui; import com.google.gson.JsonArray; @@ -36,7 +55,12 @@ import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; import java.io.File; -import java.util.*; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java index 42340259..8ba3a98a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java @@ -1,3 +1,22 @@ +/* + * 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 <https://www.gnu.org/licenses/>. + */ + package io.github.moulberry.notenoughupdates.miscgui; import com.google.common.collect.Lists; @@ -39,7 +58,12 @@ import org.lwjgl.opengl.GL11; import org.lwjgl.util.glu.Project; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import java.util.*; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Objects; +import java.util.Random; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -946,7 +970,7 @@ public class GuiCustomEnchant extends Gui { GlStateManager.pushMatrix(); GlStateManager.translate(guiLeft + 102 - 8, guiTop + 191 - (inventoryStartIndex / 9 * 18 + 89), 0); Slot slot = cc.getSlot(inventoryStartIndex + i); - ((AccessorGuiContainer)chest).doDrawSlot(slot); + ((AccessorGuiContainer) chest).doDrawSlot(slot); GlStateManager.popMatrix(); if (mouseX >= itemX && mouseX < itemX + 18 && diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java index 2ed708e9..31713189 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java @@ -1,13 +1,34 @@ +/* + * 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 <https://www.gnu.org/licenses/>. + */ + package io.github.moulberry.notenoughupdates.miscgui; import com.google.common.base.Splitter; import com.google.common.collect.Lists; -import com.google.gson.*; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; +import com.google.gson.JsonParser; +import com.google.gson.JsonPrimitive; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.core.util.lerp.LerpingInteger; import io.github.moulberry.notenoughupdates.itemeditor.GuiElementTextField; import io.github.moulberry.notenoughupdates.options.NEUConfig; -import io.github.moulberry.notenoughupdates.util.Constants; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java index d65a18b0..40e12e35 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java @@ -1,3 +1,22 @@ +/* + * 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 <https://www.gnu.org/licenses/>. + */ + package io.github.moulberry.notenoughupdates.miscgui; import com.google.gson.JsonArray; @@ -22,7 +41,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.ResourceLocation; -import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemCustomize.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemCustomize.java index 0645ede7..7d541296 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemCustomize.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemCustomize.java @@ -1,3 +1,22 @@ +/* + * 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 <https://www.gnu.org/licenses/>. + */ + package io.github.moulberry.notenoughupdates.miscgui; import com.google.common.collect.Lists; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java index 129e25e7..69343e99 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java @@ -1,3 +1,22 @@ +/* + * 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 <https://www.gnu.org/licenses/>. + */ + package io.github.moulberry.notenoughupdates.miscgui; import com.google.common.collect.ImmutableList; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiNavigation.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiNavigation.java index d34988f6..dcb1344c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiNavigation.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiNavigation.java @@ -1,3 +1,22 @@ +/* + * 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 <https://www.gnu.org/licenses/>. + */ + package io.github.moulberry.notenoughupdates.miscgui; import com.google.gson.JsonObject; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiPriceGraph.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiPriceGraph.java index e2381503..ed8d5d92 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiPriceGraph.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiPriceGraph.java @@ -1,3 +1,22 @@ +/* + * 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 <https://www.gnu.org/licenses/>. + */ + package io.github.moulberry.notenoughupdates.miscgui; import com.google.common.reflect.TypeToken; @@ -17,14 +36,26 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; -import java.io.*; +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; import java.lang.reflect.Type; import java.nio.charset.StandardCharsets; import java.text.DecimalFormat; import java.text.NumberFormat; import java.text.SimpleDateFormat; import java.time.Instant; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.TreeMap; import java.util.stream.Collectors; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; @@ -347,7 +378,7 @@ public class GuiPriceGraph extends GuiScreen { itemData = new ItemData( new TreeMap<>(itemData.get().entrySet().stream() .filter(e -> e.getKey() > System.currentTimeMillis() / 1000 - - (mode == 0 ? 3600 : mode == 1 ? 86400 : 604800)) + (mode == 0 ? 3600 : mode == 1 ? 86400 : 604800)) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue))), itemData.isBz() ); @@ -428,7 +459,12 @@ public class GuiPriceGraph extends GuiScreen { } } - private static void addOrUpdateItemPriceInfo(Map.Entry<String, JsonElement> item, HashMap<String, ItemData> prices, long timestamp, boolean bazaar) { + private static void addOrUpdateItemPriceInfo( + Map.Entry<String, JsonElement> item, + HashMap<String, ItemData> prices, + long timestamp, + boolean bazaar + ) { String itemName = item.getKey(); ItemData existingItemData = null; if (prices.containsKey(itemName)) { @@ -456,7 +492,8 @@ public class GuiPriceGraph extends GuiScreen { BzData bzData = new BzData( item.getValue().getAsJsonObject().get("curr_buy").getAsFloat(), - item.getValue().getAsJsonObject().get("curr_sell").getAsFloat()); + item.getValue().getAsJsonObject().get("curr_sell").getAsFloat() + ); if (existingItemData != null) { existingItemData.bz.put(timestamp, bzData); @@ -485,7 +522,8 @@ public class GuiPriceGraph extends GuiScreen { else trimmed.ah = new TreeMap<>(); int zones = NotEnoughUpdates.INSTANCE.config.ahGraph.graphZones; - Long[] dataArray = !itemData.isBz() ? itemData.ah.keySet().toArray(new Long[0]) : itemData.bz.keySet().toArray(new Long[0]); + Long[] dataArray = + !itemData.isBz() ? itemData.ah.keySet().toArray(new Long[0]) : itemData.bz.keySet().toArray(new Long[0]); int prev = 0; for (int i = 0; i < zones; i++) { long lowest = (long) map(i, 0, zones, first, last); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java index 3932c9d5..0abf3f11 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java @@ -1,3 +1,22 @@ +/* + * 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 <https://www.gnu.org/licenses/>. + */ + package io.github.moulberry.notenoughupdates.miscgui; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/KatSitterOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/KatSitterOverlay.java index 5a763411..b22ff11f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/KatSitterOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/KatSitterOverlay.java @@ -1,3 +1,22 @@ +/* + * 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 <https://www.gnu.org/licenses/>. + */ + package io.github.moulberry.notenoughupdates.miscgui; import com.google.gson.JsonObject; @@ -62,12 +81,23 @@ public class KatSitterOverlay { int currentWidth = font.getStringWidth(currentText); String upgradedText = "Upgraded pet level: " + upgradedLevel; int upgradedWidth = font.getStringWidth(upgradedText); - int left = ((AccessorGuiContainer)gui).getGuiLeft() - 30 - (upgradedLevel == null ? Math.max(upgradedWidth, currentWidth) : currentWidth); + int left = ((AccessorGuiContainer) gui).getGuiLeft() - 30 - (upgradedLevel == null ? Math.max( + upgradedWidth, + currentWidth + ) : currentWidth); GlStateManager.disableLighting(); GlStateManager.color(1F, 1F, 1F, 1F); - Utils.drawStringScaled(currentText, font, left, ((AccessorGuiContainer)gui).getGuiTop() + 25, false, 0xFFD700, 1F); + Utils.drawStringScaled(currentText, font, left, ((AccessorGuiContainer) gui).getGuiTop() + 25, false, 0xFFD700, 1F); if (upgradedLevel != null) - Utils.drawStringScaled(upgradedText, font, left, ((AccessorGuiContainer)gui).getGuiTop() + 45, false, 0xFFD700, 1F); + Utils.drawStringScaled( + upgradedText, + font, + left, + ((AccessorGuiContainer) gui).getGuiTop() + 45, + false, + 0xFFD700, + 1F + ); } public String nextRarity(String currentRarity) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/NEUOverlayPlacements.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/NEUOverlayPlacements.java index f95302ef..ac96f527 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/NEUOverlayPlacements.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/NEUOverlayPlacements.java @@ -1,3 +1,22 @@ +/* + * 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 <https://www.gnu.org/licenses/>. + */ + package io.github.moulberry.notenoughupdates.miscgui; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; 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 e5e0ff5c..98efa381 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java @@ -1,3 +1,22 @@ +/* + * 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 <https://www.gnu.org/licenses/>. + */ + package io.github.moulberry.notenoughupdates.miscgui; import com.google.common.collect.Lists; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java index 1f47e6ee..086b6e06 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java @@ -1,3 +1,22 @@ +/* + * 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 <https://www.gnu.org/licenses/>. + */ + package io.github.moulberry.notenoughupdates.miscgui; import com.google.gson.JsonObject; @@ -560,7 +579,12 @@ public class TradeWindow { int y = 104 + 18 * (index / 9); if (index < 9) y = 180; - ((AccessorGuiContainer)chest).doDrawSlot(new Slot(Minecraft.getMinecraft().thePlayer.inventory, index, guiLeft + x, guiTop + y)); + ((AccessorGuiContainer) chest).doDrawSlot(new Slot( + Minecraft.getMinecraft().thePlayer.inventory, + index, + guiLeft + x, + guiTop + y + )); int col = 0x80ffffff; if (SlotLocking.getInstance().isSlotIndexLocked(index)) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/tutorials/NeuConfigTutorial.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/tutorials/NeuConfigTutorial.java index 938f3f98..6a2602f8 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/tutorials/NeuConfigTutorial.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/tutorials/NeuConfigTutorial.java @@ -1,3 +1,22 @@ +/* + * 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 <https://www.gnu.org/licenses/>. + */ + package io.github.moulberry.notenoughupdates.miscgui.tutorials; public class NeuConfigTutorial extends TutorialBase { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/tutorials/NeuTutorial.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/tutorials/NeuTutorial.java index 24c6bb7f..c0a5d8c8 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/tutorials/NeuTutorial.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/tutorials/NeuTutorial.java @@ -1,3 +1,22 @@ +/* + * 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 <https://www.gnu.org/licenses/>. + */ + package io.github.moulberry.notenoughupdates.miscgui.tutorials; import net.minecraft.client.Minecraft; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/tutorials/TutorialBase.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/tutorials/TutorialBase.java index 34167b3f..27172ed8 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/tutorials/TutorialBase.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/tutorials/TutorialBase.java @@ -1,3 +1,22 @@ +/* + * 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 <https://www.gnu.org/licenses/>. + */ + package io.github.moulberry.notenoughupdates.miscgui.tutorials; import com.google.gson.JsonArray; |