aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java9
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUApi.java10
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java566
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java85
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java78
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java162
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java8
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java16
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/core/util/render/RenderUtils.java85
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java6
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/cosmetics/GuiCosmetics.java48
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/cosmetics/NEUCape.java61
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java5
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonWin.java11
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java126
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java138
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomSkulls.java3
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesWaypoints.java88
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java134
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java4
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java4
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java42
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java44
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java18
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java3
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java228
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java84
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemCustomize.java3
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/HelpGUI.java189
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java59
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/tutorials/NeuConfigTutorial.java9
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/tutorials/NeuTutorial.java127
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/tutorials/TutorialBase.java319
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinEntityPlayerSP.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java11
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinInventoryPlayer.java12
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinMinecraft.java11
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinRendererLivingEntity.java4
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java57
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ItemOverlays.java91
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Mining.java336
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java22
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/SlotLocking.java13
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Toolbar.java40
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/TooltipTweaks.java37
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/BonemerangOverlay.java118
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/CraftingOverlay.java118
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/CrystalHollowOverlay.java403
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java551
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java65
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java35
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java458
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java4
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java39
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/HypixelApi.java5
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java17
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java134
57 files changed, 4362 insertions, 993 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java b/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java
index ff618f10..83c4b7ae 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java
@@ -2,6 +2,7 @@ package io.github.moulberry.notenoughupdates;
import com.google.gson.JsonObject;
import io.github.moulberry.notenoughupdates.auction.APIManager;
+import io.github.moulberry.notenoughupdates.core.config.KeybindHelper;
import io.github.moulberry.notenoughupdates.util.Constants;
import io.github.moulberry.notenoughupdates.util.Utils;
import net.minecraft.item.ItemStack;
@@ -20,6 +21,12 @@ public class ItemPriceInformation {
}
public static boolean addToTooltip(List<String> tooltip, String internalname, ItemStack stack, boolean useStackSize) {
+ if(stack.getTagCompound().hasKey("disableNeuTooltip") && stack.getTagCompound().getBoolean("disableNeuTooltip")){
+ return false;
+ }
+ if(NotEnoughUpdates.INSTANCE.config.tooltipTweaks.disablePriceKey && !KeybindHelper.isKeyDown(NotEnoughUpdates.INSTANCE.config.tooltipTweaks.disablePriceKeyKeybind)){
+ return false;
+ }
JsonObject auctionInfo = NotEnoughUpdates.INSTANCE.manager.auctionManager.getItemAuctionInfo(internalname);
JsonObject bazaarInfo = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo(internalname);
float lowestBinAvg = NotEnoughUpdates.INSTANCE.manager.auctionManager.getItemAvgBin(internalname);
@@ -98,6 +105,7 @@ public class ItemPriceInformation {
break;
case 4:
if(craftCost.fromRecipe) {
+ if((int)craftCost.craftCost == 0){ continue;}
if(!added) {
tooltip.add("");
added = true;
@@ -165,6 +173,7 @@ public class ItemPriceInformation {
break;
case 3:
if(craftCost.fromRecipe) {
+ if((int)craftCost.craftCost == 0){ continue;}
if(!added) {
tooltip.add("");
added = true;
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUApi.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUApi.java
new file mode 100644
index 00000000..56a196b4
--- /dev/null
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUApi.java
@@ -0,0 +1,10 @@
+package io.github.moulberry.notenoughupdates;
+
+import net.minecraftforge.fml.relauncher.ReflectionHelper;
+
+public class NEUApi {
+ static boolean disableInventoryButtons = false;
+ public static void setInventoryButtonsToDisabled(){
+ disableInventoryButtons = true;
+ }
+}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
index b849c890..48cd0e57 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
@@ -1,10 +1,7 @@
package io.github.moulberry.notenoughupdates;
import com.google.common.collect.Lists;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonPrimitive;
+import com.google.gson.*;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import io.github.moulberry.notenoughupdates.auction.CustomAHGui;
@@ -15,14 +12,10 @@ import io.github.moulberry.notenoughupdates.core.util.render.RenderUtils;
import io.github.moulberry.notenoughupdates.cosmetics.CapeManager;
import io.github.moulberry.notenoughupdates.dungeons.DungeonBlocks;
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.options.NEUConfig;
-import io.github.moulberry.notenoughupdates.overlays.AuctionSearchOverlay;
-import io.github.moulberry.notenoughupdates.overlays.OverlayManager;
-import io.github.moulberry.notenoughupdates.overlays.RancherBootOverlay;
-import io.github.moulberry.notenoughupdates.overlays.TextOverlay;
+import io.github.moulberry.notenoughupdates.overlays.*;
import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer;
import io.github.moulberry.notenoughupdates.util.*;
import net.minecraft.client.Minecraft;
@@ -41,6 +34,7 @@ import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.ContainerChest;
import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -51,6 +45,7 @@ import net.minecraftforge.client.ClientCommandHandler;
import net.minecraftforge.client.event.*;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.event.world.WorldEvent;
+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;
@@ -64,6 +59,7 @@ import java.awt.*;
import java.awt.datatransfer.StringSelection;
import java.io.File;
import java.io.IOException;
+import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.List;
import java.util.*;
@@ -170,10 +166,12 @@ public class NEUEventListener {
@SubscribeEvent
public void onWorldLoad(WorldEvent.Unload event) {
NotEnoughUpdates.INSTANCE.saveConfig();
+ CrystalMetalDetectorSolver.reset();
}
private static long notificationDisplayMillis = 0;
private static List<String> notificationLines = null;
+ private static boolean showNotificationOverInv = false;
private static final Pattern BAD_ITEM_REGEX = Pattern.compile("x[0-9]{1,2}$");
@@ -192,18 +190,23 @@ public class NEUEventListener {
private int inventoryLoadedTicks = 0;
private String loadedInvName = "";
public static boolean inventoryLoaded = false;
-
public static void displayNotification(List<String> lines, boolean showForever) {
+ displayNotification(lines, showForever, false);
+ }
+
+ public static void displayNotification(List<String> lines, boolean showForever, boolean overInventory) {
if(showForever) {
notificationDisplayMillis = -420;
} else {
notificationDisplayMillis = System.currentTimeMillis();
}
notificationLines = lines;
+ showNotificationOverInv = overInventory;
}
@SubscribeEvent
public void onTick(TickEvent.ClientTickEvent event) {
+ Keyboard.enableRepeatEvents(false);
if(event.phase != TickEvent.Phase.START) return;
if(Minecraft.getMinecraft().theWorld == null) return;
if(Minecraft.getMinecraft().thePlayer == null) return;
@@ -340,7 +343,7 @@ public class NEUEventListener {
if(!joinedSB) {
joinedSB = true;
- SBGamemodes.loadFromFile();
+ //SBGamemodes.loadFromFile();
if(NotEnoughUpdates.INSTANCE.config.notifications.showUpdateMsg) {
@@ -363,14 +366,26 @@ public class NEUEventListener {
if(!NotEnoughUpdates.INSTANCE.config.hidden.loadedModBefore) {
NotEnoughUpdates.INSTANCE.config.hidden.loadedModBefore = true;
-
+ if(Constants.MISC == null || !Constants.MISC.has("featureslist")){
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(""+EnumChatFormatting.DARK_RED+EnumChatFormatting.BOLD+"WARNING: "+EnumChatFormatting.RESET+EnumChatFormatting.RED+"Could not load Feature List URL from repo."));
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(""+EnumChatFormatting.RED+ "Please run "+EnumChatFormatting.BOLD+"/neuresetrepo"+EnumChatFormatting.RESET+EnumChatFormatting.RED+" and "+EnumChatFormatting.BOLD+"restart your game"+EnumChatFormatting.RESET+EnumChatFormatting.RED+" in order to fix. "+EnumChatFormatting.DARK_RED+EnumChatFormatting.BOLD+"If that doesn't fix it"+EnumChatFormatting.RESET+EnumChatFormatting.RED+", please join discord.gg/moulberry and post in #neu-support"));
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(""));
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(""+EnumChatFormatting.GOLD+"To view the feature list after restarting type /neufeatures"));
+ } else {
+ String url = Constants.MISC.get("featureslist").getAsString();
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(""));
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(
+ EnumChatFormatting.BLUE + "It seems this is your first time using NotEnoughUpdates."));
+ ChatComponentText clickTextFeatures = new ChatComponentText(
+ EnumChatFormatting.YELLOW + "Click this message if you would like to view a list of NotEnoughUpdate's Features.");
+ clickTextFeatures.setChatStyle(Utils.createClickStyle(ClickEvent.Action.OPEN_URL, url));
+ Minecraft.getMinecraft().thePlayer.addChatMessage(clickTextFeatures);
+ }
Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(""));
- Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(
- EnumChatFormatting.BLUE+"It seems this is your first time using NotEnoughUpdates."));
- ChatComponentText clickText = new ChatComponentText(
- EnumChatFormatting.YELLOW+"Click this message if you would like to view a short tutorial.");
- clickText.setChatStyle(Utils.createClickStyle(ClickEvent.Action.RUN_COMMAND, "/neututorial"));
- Minecraft.getMinecraft().thePlayer.addChatMessage(clickText);
+ ChatComponentText clickTextHelp = new ChatComponentText(
+ EnumChatFormatting.YELLOW+"Click this message if you would like to view a list of NotEnoughUpdate's commands.");
+ clickTextHelp.setChatStyle(Utils.createClickStyle(ClickEvent.Action.RUN_COMMAND, "/neuhelp"));
+ Minecraft.getMinecraft().thePlayer.addChatMessage(clickTextHelp);
Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(""));
}
}
@@ -501,13 +516,20 @@ public class NEUEventListener {
if(Keyboard.isKeyDown(Keyboard.KEY_X)) {
notificationDisplayMillis = 0;
}
+
+ if(event.type == RenderGameOverlayEvent.ElementType.ALL){
+ renderNotification();
+ }
+
+ }
+ private static void renderNotification(){
+
long timeRemaining = 15000 - (System.currentTimeMillis() - notificationDisplayMillis);
boolean display = timeRemaining > 0 || notificationDisplayMillis == -420;
- if(event.type == RenderGameOverlayEvent.ElementType.ALL &&
- display && notificationLines != null && notificationLines.size() > 0) {
+ if(display && notificationLines != null && notificationLines.size() > 0) {
int width = 0;
int height = notificationLines.size()*10+10;
-
+
for(String line : notificationLines) {
int len = Minecraft.getMinecraft().fontRendererObj.getStringWidth(line) + 8;
if(len > width) {
@@ -556,6 +578,9 @@ public class NEUEventListener {
AtomicBoolean missingRecipe = new AtomicBoolean(false);
@SubscribeEvent
public void onGuiOpen(GuiOpenEvent event) {
+ CraftingOverlay.shouldRender = false;
+ NEUApi.disableInventoryButtons = false;
+
if((Minecraft.getMinecraft().currentScreen instanceof GuiScreenElementWrapper ||
Minecraft.getMinecraft().currentScreen instanceof GuiItemRecipe) &&
event.gui == null && !(Keyboard.getEventKeyState() && Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) &&
@@ -756,7 +781,7 @@ public class NEUEventListener {
private String processText(String text) {
if(SBInfo.getInstance().getLocation() == null) return text;
- if(!SBInfo.getInstance().getLocation().startsWith("mining_")) return text;
+ if(!SBInfo.getInstance().getLocation().startsWith("mining_")&&!SBInfo.getInstance().getLocation().equals("crystal_hollows")) return text;
if(Minecraft.getMinecraft().thePlayer == null) return text;
if(!NotEnoughUpdates.INSTANCE.config.mining.drillFuelBar) return text;
@@ -764,6 +789,20 @@ public class NEUEventListener {
return Utils.trimIgnoreColour(text.replaceAll(EnumChatFormatting.DARK_GREEN+"\\S+ Drill Fuel", ""));
}
+
+ private IChatComponent replaceSocialControlsWithPV(IChatComponent chatComponent){
+
+ if(NotEnoughUpdates.INSTANCE.config.misc.replaceSocialOptions && chatComponent.getChatStyle() != null && chatComponent.getChatStyle().getChatClickEvent() != null && chatComponent.getChatStyle().getChatClickEvent().getAction() == ClickEvent.Action.RUN_COMMAND){
+ if(chatComponent.getChatStyle().getChatClickEvent().getValue().startsWith("/socialoptions")){
+ String username = chatComponent.getChatStyle().getChatClickEvent().getValue().substring(15);
+
+ chatComponent.setChatStyle(Utils.createClickStyle(ClickEvent.Action.RUN_COMMAND, "/pv "+username, ""+EnumChatFormatting.YELLOW+"Click to open "+EnumChatFormatting.AQUA+EnumChatFormatting.BOLD+username+EnumChatFormatting.RESET+EnumChatFormatting.YELLOW+"'s profile in "+EnumChatFormatting.DARK_PURPLE+EnumChatFormatting.BOLD+"NEU's"+EnumChatFormatting.RESET+EnumChatFormatting.YELLOW+ " profile viewer."));
+ return chatComponent;
+ }
+ }
+ return chatComponent;
+ }
+
/**
* 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)
@@ -772,8 +811,11 @@ public class NEUEventListener {
@SubscribeEvent(priority = EventPriority.LOW, receiveCanceled = true)
public void onGuiChat(ClientChatReceivedEvent e) {
if(e.type == 2) {
+ CrystalMetalDetectorSolver.process(e.message);
e.message = processChatComponent(e.message);
return;
+ } else if(e.type == 0){
+ e.message = replaceSocialControlsWithPV(e.message);
}
DungeonWin.onChatMessage(e);
@@ -819,6 +861,12 @@ public class NEUEventListener {
e.message = new ChatComponentText(m2);
}
}
+ if (unformatted.startsWith("You found ") && SBInfo.getInstance().getLocation() != null && SBInfo.getInstance().getLocation().equals("crystal_hollows")){
+ CrystalMetalDetectorSolver.reset();
+ }
+ if(unformatted.startsWith("[NPC] Keeper of ") | unformatted.startsWith("[NPC] Professor Robot: ") || unformatted.startsWith(" ") || unformatted.startsWith("✦") ||
+ unformatted.equals(" You've earned a Crystal Loot Bundle!"))
+ OverlayManager.crystalHollowOverlay.message(unformatted);
}
public static boolean drawingGuiScreen = false;
@@ -836,6 +884,11 @@ public class NEUEventListener {
*/
@SubscribeEvent
public void onGuiBackgroundDraw(GuiScreenEvent.BackgroundDrawnEvent event) {
+ if(showNotificationOverInv){
+
+ renderNotification();
+
+ }
if((shouldRenderOverlay(event.gui) || event.gui instanceof CustomAHGui) && neu.isOnSkyblock()) {
ScaledResolution scaledresolution = new ScaledResolution(Minecraft.getMinecraft());
int width = scaledresolution.getScaledWidth();
@@ -913,6 +966,21 @@ public class NEUEventListener {
GuiChest eventGui = (GuiChest) guiScreen;
ContainerChest c