aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/io')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/CustomItems.java5
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/GuiEnchantColour.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java20
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java3
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUOverlayPlacements.java35
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java137
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java42
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeNode.java4
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/cosmetics/NEUCape.java210
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/infopanes/CollectionLogInfoPane.java8
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBAnchorPoint.java4
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java4
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroupFloating.java58
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/Options.java6
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java36
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java4
17 files changed, 400 insertions, 180 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/CustomItems.java b/src/main/java/io/github/moulberry/notenoughupdates/CustomItems.java
index 58eaab72..dcd8cfb2 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/CustomItems.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/CustomItems.java
@@ -35,6 +35,11 @@ public class CustomItems {
"your buried duct tape problems are a thing of the past,",
"all for the low price of $7.99 or a subscription",
"to the Ducttapedigger youtube channel!");
+ public static JsonObject SPINAXX = create(
+ "SPINAXX",
+ "emerald",
+ "Spinaxx",
+ "Famous streamer btw :)");
public static JsonObject RUNE = create("RUNE", "paper", "No.", "I hate runes.");
public static JsonObject TWOBEETWOTEE = create("2B2T", "bedrock", "Minecraft's oldest anarchy Minecraft server in Minecraft.",
"This Minecraft anarchy server is the oldest server,",
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/GuiEnchantColour.java b/src/main/java/io/github/moulberry/notenoughupdates/GuiEnchantColour.java
index 98b08fd8..8e14598f 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/GuiEnchantColour.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/GuiEnchantColour.java
@@ -36,6 +36,8 @@ public class GuiEnchantColour extends GuiScreen {
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
+ drawDefaultBackground();
+
List<String> enchantColours = getEnchantColours();
ySize = 53+25*enchantColours.size();
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
index 30dc12c4..3a84dc5c 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
@@ -368,12 +368,13 @@ public class NEUManager {
*/
public void loadItemInformation() {
Thread thread = new Thread(() -> {
+ JDialog dialog = null;
try {
if(config.autoupdate.value) {
JOptionPane pane = new JOptionPane("Getting items to download from remote repository.");
- JDialog dialog = pane.createDialog("NotEnoughUpdates Remote Sync");
+ dialog = pane.createDialog("NotEnoughUpdates Remote Sync");
dialog.setModal(false);
- //dialog.setVisible(true);
+ if(config.dev.value) dialog.setVisible(true);
if (Display.isActive()) dialog.toFront();
@@ -389,6 +390,7 @@ public class NEUManager {
} catch (IOException e) {
}
} else {
+ dialog.setVisible(false);
return;
}
@@ -411,7 +413,7 @@ public class NEUManager {
for (String name : changedFiles.keySet()) {
pane.setMessage(startMessage + (++downloaded) + "/" + changedFiles.size() + ")\nCurrent: " + name);
dialog.pack();
- //dialog.setVisible(true);
+ if(config.dev.value) dialog.setVisible(true);
if (Display.isActive()) dialog.toFront();
File item = new File(repoLocation, name);
@@ -440,6 +442,7 @@ public class NEUManager {
try {
writeJson(itemShaConfig, itemShaLocation);
} catch (IOException e) {
+ e.printStackTrace();
}
} else {
Utils.recursiveDelete(repoLocation);
@@ -450,7 +453,7 @@ public class NEUManager {
pane.setMessage("Downloading NEU Master Archive. (DL# >20)");
dialog.pack();
- //dialog.setVisible(true);
+ if(config.dev.value) dialog.setVisible(true);
if (Display.isActive()) dialog.toFront();
File itemsZip = new File(repoLocation, "neu-items-master.zip");
@@ -471,6 +474,7 @@ public class NEUManager {
fileOutputStream.write(dataBuffer, 0, bytesRead);
}
} catch (IOException e) {
+ dialog.dispose();
return;
}
@@ -492,10 +496,12 @@ public class NEUManager {
}
}
}
-
- dialog.dispose();
}
- } catch(Exception e) {}
+ } catch(Exception e) {
+ e.printStackTrace();
+ } finally {
+ if(dialog != null) dialog.dispose();
+ }
File items = new File(repoLocation, "items");
if(items.exists()) {
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
index c2db41d0..0cb7a548 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
@@ -1103,6 +1103,9 @@ public class NEUOverlay extends Gui {
case "leocthl":
searchedItems.add(CustomItems.LEOCTHL);
break;
+ case "spinaxx":
+ searchedItems.add(CustomItems.SPINAXX);
+ break;
}
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlayPlacements.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlayPlacements.java
index 28ecbc8e..eb6357ae 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlayPlacements.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlayPlacements.java
@@ -4,9 +4,11 @@ import io.github.moulberry.notenoughupdates.mbgui.MBAnchorPoint;
import io.github.moulberry.notenoughupdates.mbgui.MBGuiElement;
import io.github.moulberry.notenoughupdates.mbgui.MBGuiGroup;
import io.github.moulberry.notenoughupdates.mbgui.MBGuiGroupFloating;
+import io.github.moulberry.notenoughupdates.util.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
+import net.minecraft.client.renderer.GlStateManager;
import org.lwjgl.input.Keyboard;
import org.lwjgl.util.vector.Vector2f;
@@ -27,6 +29,14 @@ public class NEUOverlayPlacements extends GuiScreen {
super.drawScreen(mouseX, mouseY, partialTicks);
drawDefaultBackground();
+ GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(icons);
+ GlStateManager.enableBlend();
+
+ GlStateManager.tryBlendFuncSeparate(775, 769, 1, 0);
+ GlStateManager.enableAlpha();
+ this.drawTexturedModalRect(width / 2 - 7, height / 2 - 7, 0, 0, 16, 16);
+
if(mouseX < 300 && mouseY < 300 && clickedElement != null) {
guiButton.yPosition = height - 5 - guiButton.height;
} else {
@@ -73,9 +83,14 @@ public class NEUOverlayPlacements extends GuiScreen {
new Color(200, 200, 200, 100).getRGB());
break;
case BOTMID:
+ case INV_BOTMID:
drawRect((int)position.x, (int)(position.y+element.getHeight()*0.9f),
(int)position.x+element.getWidth(), (int)position.y+element.getHeight(),
new Color(200, 200, 200, 100).getRGB());
+ if(anchorPoint.anchorPoint == MBAnchorPoint.AnchorPoint.INV_BOTMID) {
+ Utils.drawStringCentered("Inv-Relative", Minecraft.getMinecraft().fontRendererObj,
+ position.x+element.getWidth()*0.5f, position.y+element.getHeight()*0.5f, false, 0);
+ }
break;
case MIDMID:
drawRect((int)(position.x+element.getWidth()*0.45f), (int)(position.y+element.getHeight()*0.45f),
@@ -91,6 +106,7 @@ public class NEUOverlayPlacements extends GuiScreen {
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
super.mouseClicked(mouseX, mouseY, mouseButton);
MBGuiGroupFloating mainGroup = NotEnoughUpdates.INSTANCE.overlay.guiGroup;
+ int index=0;
for(MBGuiElement element : mainGroup.getChildren()) {
MBAnchorPoint anchorPoint = mainGroup.getChildrenMap().get(element);
Vector2f position = mainGroup.getChildrenPosition().get(element);
@@ -104,22 +120,27 @@ public class NEUOverlayPlacements extends GuiScreen {
clickedAnchorX = (int)anchorPoint.offset.x;
clickedAnchorY = (int)anchorPoint.offset.y;
} else {
- float anchorX = (width-element.getWidth()) * anchorPoint.anchorPoint.x + anchorPoint.offset.x;
- float anchorY = (height-element.getHeight()) * anchorPoint.anchorPoint.y + anchorPoint.offset.y;
-
MBAnchorPoint.AnchorPoint[] vals = MBAnchorPoint.AnchorPoint.values();
anchorPoint.anchorPoint = vals[(anchorPoint.anchorPoint.ordinal()+1)%vals.length];
- float screenX = (width-element.getWidth()) * anchorPoint.anchorPoint.x;
- float screenY = (height-element.getHeight()) * anchorPoint.anchorPoint.y;
- anchorPoint.offset.x = anchorX - screenX;
- anchorPoint.offset.y = anchorY - screenY;
+ mainGroup.recalculate();
+
+ anchorPoint.offset.x += position.x - mainGroup.getChildrenPosition().get(element).x;
+ anchorPoint.offset.y += position.y - mainGroup.getChildrenPosition().get(element).y;
mainGroup.recalculate();
+
+ if(index == 0) {
+ NotEnoughUpdates.INSTANCE.manager.config.overlaySearchBar.value = anchorPoint.toString();
+ } else if(index == 1) {
+ NotEnoughUpdates.INSTANCE.manager.config.overlayQuickCommand.value = anchorPoint.toString();
+ }
+ try { NotEnoughUpdates.INSTANCE.manager.saveConfig(); } catch(IOException ignored) {}
}
return;
}
}
+ index++;
}
if(guiButton.mousePressed(Minecraft.getMinecraft(), mouseX, mouseY)) {
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java
index 4b1e3c3c..fbcd3de3 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java
@@ -52,6 +52,7 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
+import org.apache.commons.lang3.StringUtils;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
@@ -77,7 +78,7 @@ import static io.github.moulberry.notenoughupdates.GuiTextures.*;
@Mod(modid = NotEnoughUpdates.MODID, version = NotEnoughUpdates.VERSION)
public class NotEnoughUpdates {
public static final String MODID = "notenoughupdates";
- public static final String VERSION = "REL-1.0.1";
+ public static final String VERSION = "1.1-REL";
public static NotEnoughUpdates INSTANCE = null;
@@ -180,16 +181,51 @@ public class NotEnoughUpdates {
}
});
- SimpleCommand viewProfileShortCommand = new SimpleCommand("pv", viewProfileRunnable, new SimpleCommand.TabCompleteRunnable() {
+ SimpleCommand viewProfileShortCommand = new SimpleCommand("pv", new SimpleCommand.ProcessCommandRunnable() {
+ @Override
+ public void processCommand(ICommandSender sender, String[] args) {
+ if(!hasSkyblockScoreboard()) {
+ Minecraft.getMinecraft().thePlayer.sendChatMessage("/pv " + StringUtils.join(args, " "));
+ } else {
+ viewProfileRunnable.processCommand(sender, args);
+ }
+ }
+ }, new SimpleCommand.TabCompleteRunnable() {
@Override
public List<String> tabComplete(ICommandSender sender, String[] args, BlockPos pos) {
- if(args.length != 1) return null;
-
- String lastArg = args[args.length-1];
+ if (args.length != 1) return null;
+
+ String lastArg = args[args.length - 1];
List<String> playerMatches = new ArrayList<>();
- for(EntityPlayer player : Minecraft.getMinecraft().theWorld.playerEntities) {
+ for (EntityPlayer player : Minecraft.getMinecraft().theWorld.playerEntities) {
String playerName = player.getName();
- if(playerName.toLowerCase().startsWith(lastArg.toLowerCase())) {
+ if (playerName.toLowerCase().startsWith(lastArg.toLowerCase())) {
+ playerMatches.add(playerName);
+ }
+ }
+ return playerMatches;
+ }
+ });
+
+ SimpleCommand viewProfileShort2Command = new SimpleCommand("vp", new SimpleCommand.ProcessCommandRunnable() {
+ @Override
+ public void processCommand(ICommandSender sender, String[] args) {
+ if(!hasSkyblockScoreboard()) {
+ Minecraft.getMinecraft().thePlayer.sendChatMessage("/vp " + StringUtils.join(args, " "));
+ } else {
+ viewProfileRunnable.processCommand(sender, args);
+ }
+ }
+ }, new SimpleCommand.TabCompleteRunnable() {
+ @Override
+ public List<String> tabComplete(ICommandSender sender, String[] args, BlockPos pos) {
+ if (args.length != 1) return null;
+
+ String lastArg = args[args.length - 1];
+ List<String> playerMatches = new ArrayList<>();
+ for (EntityPlayer player : Minecraft.getMinecraft().theWorld.playerEntities) {
+ String playerName = player.getName();
+ if (playerName.toLowerCase().startsWith(lastArg.toLowerCase())) {
playerMatches.add(playerName);
}
}
@@ -268,8 +304,9 @@ public class NotEnoughUpdates {
ClientCommandHandler.instance.registerCommand(cosmeticsCommand);
ClientCommandHandler.instance.registerCommand(linksCommand);
ClientCommandHandler.instance.registerCommand(viewProfileCommand);
- ClientCommandHandler.instance.registerCommand(tutorialCommand);
ClientCommandHandler.instance.registerCommand(viewProfileShortCommand);
+ ClientCommandHandler.instance.registerCommand(viewProfileShort2Command);
+ ClientCommandHandler.instance.registerCommand(tutorialCommand);
ClientCommandHandler.instance.registerCommand(overlayPlacementsCommand);
ClientCommandHandler.instance.registerCommand(enchantColourCommand);
ClientCommandHandler.instance.registerCommand(neuAhCommand);
@@ -442,6 +479,7 @@ public class NotEnoughUpdates {
*/
private HashMap<String, Long> newItemAddMap = new HashMap<>();
private long lastLongUpdate = 0;
+ private long lastSkyblockScoreboard = 0;
@SubscribeEvent
public void onTick(TickEvent.ClientTickEvent event) {
if(event.phase != TickEvent.Phase.START) return;
@@ -459,7 +497,7 @@ public class NotEnoughUpdates {
if(longUpdate) {
updateSkyblockScoreboard();
if(hasSkyblockScoreboard()) {
- manager.auctionManager.tick();
+ lastSkyblockScoreboard = currentTime;
if(!joinedSB && manager.config.showUpdateMsg.value) {
joinedSB = true;
displayUpdateMessageIfOutOfDate();
@@ -480,6 +518,11 @@ public class NotEnoughUpdates {
SBScoreboardData.getInstance().tick();
//GuiQuestLine.questLine.tick();
}
+ if(currentTime - lastSkyblockScoreboard < 5*60*1000) { //5 minutes
+ manager.auctionManager.tick();
+ } else {
+ manager.auctionManager.markNeedsUpdate();
+ }
//ItemRarityHalo.resetItemHaloCache();
}
if(currChatMessage != null && currentTime - lastChatMessage > CHAT_MSG_COOLDOWN) {
@@ -487,49 +530,61 @@ public class NotEnoughUpdates {
Minecraft.getMinecraft().thePlayer.sendChatMessage(currChatMessage);
currChatMessage = null;
}
- if(longUpdate && hasSkyblockScoreboard() && manager.getCurrentProfile() != null && manager.getCurrentProfile().length() > 0) {
- HashSet<String> newItem = new HashSet<>();
- if(Minecraft.getMinecraft().currentScreen instanceof GuiContainer &&
- !(Minecraft.getMinecraft().currentScreen instanceof GuiCrafting)) {
- boolean usableContainer = true;
- for(ItemStack stack : Minecraft.getMinecraft().thePlayer.openContainer.getInventory()) {
- if(stack == null) {
- continue;
+ if(longUpdate && hasSkyblockScoreboard()) {
+ if(manager.getCurrentProfile() == null || manager.getCurrentProfile().length() == 0) {
+ ProfileViewer.Profile profile = profileViewer.getProfile(
+ Minecraft.getMinecraft().thePlayer.getUniqueID().toString().replace("-", ""), (json) -> {});
+ if(profile != null) {
+ String latest = profile.getLatestProfile();
+ if(latest != null) {
+ manager.setCurrentProfileBackup(profile.getLatestProfile());
}
- if(stack.hasTagCompound()) {
- NBTTagCompound tag = stack.getTagCompound();
- if(tag.hasKey("ExtraAttributes", 10)) {
+ }
+ }
+ if(manager.getCurrentProfile() != null && manager.getCurrentProfile().length() > 0) {
+ HashSet<String> newItem = new HashSet<>();
+ if(Minecraft.getMinecraft().currentScreen instanceof GuiContainer &&
+ !(Minecraft.getMinecraft().currentScreen instanceof GuiCrafting)) {
+ boolean usableContainer = true;
+ for(ItemStack stack : Minecraft.getMinecraft().thePlayer.openContainer.getInventory()) {
+ if(stack == null) {
continue;
}
+ if(stack.hasTagCompound()) {
+ NBTTagCompound tag = stack.getTagCompound();
+ if(tag.hasKey("ExtraAttributes", 10)) {
+ continue;
+ }
+ }
+ usableContainer = false;
+ break;
}
- usableContainer = false;
- break;
- }
- if(!usableContainer) {
- if(Minecraft.getMinecraft().currentScreen instanceof GuiChest) {
- GuiChest chest = (GuiChest) Minecraft.getMinecraft().currentScreen;
- ContainerChest container = (ContainerChest) chest.inventorySlots;
- String containerName = container.getLowerChestInventory().getDisplayName().getUnformattedText();
-
- if(containerName.equals("Accessory Bag")) {
- usableContainer = true;
+ if(!usableContainer) {
+ if(Minecraft.getMinecraft().currentScreen instanceof GuiChest) {
+ GuiChest chest = (GuiChest) Minecraft.getMinecraft().currentScreen;
+ ContainerChest container = (ContainerChest) chest.inventorySlots;
+ String containerName = container.getLowerChestInventory().getDisplayName().getUnformattedText();
+
+ if(containerName.equals("Accessory Bag") || containerName.startsWith("Wardrobe")) {
+ usableContainer = true;
+ }
}
}
- }
- if(usableContainer) {
- for(ItemStack stack : Minecraft.getMinecraft().thePlayer.openContainer.getInventory()) {
- processUniqueStack(stack, newItem);
+ if(usableContainer) {
+ for(ItemStack stack : Minecraft.getMinecraft().thePlayer.inventory.mainInventory) {
+ processUniqueStack(stack, newItem);
+ }
+ for(ItemStack stack : Minecraft.getMinecraft().thePlayer.openContainer.getInventory()) {
+ processUniqueStack(stack, newItem);
+ }
}
+ } else {
for(ItemStack stack : Minecraft.getMinecraft().thePlayer.inventory.mainInventory) {
processUniqueStack(stack, newItem);
}
}
- } else {
- for(ItemStack stack : Minecraft.getMinecraft().thePlayer.inventory.mainInventory) {
- processUniqueStack(stack, newItem);
- }
+ newItemAddMap.keySet().retainAll(newItem);
}
- newItemAddMap.keySet().retainAll(newItem);
}
}
@@ -859,7 +914,6 @@ public class NotEnoughUpdates {
public void onGuiScreenDrawPost(GuiScreenEvent.DrawScreenEvent.Post event) {
if(!(event.gui instanceof CustomAHGui || manager.auctionManager.customAH.isRenderOverAuctionView())) {
if(shouldRenderOverlay(event.gui) && isOnSkyblock()) {
-
renderDungeonChestOverlay(event.gui);
if(!focusInv) {
@@ -947,7 +1001,6 @@ public class NotEnoughUpdates {
guiTop+14, true, 170, Color.BLACK.getRGB());
Utils.drawStringCenteredScaledMaxWidth(plString, Minecraft.getMinecraft().fontRendererObj, guiLeft+xSize+4+90,
guiTop+28, true, 170, Color.BLACK.getRGB());
-
}
} catch(Exception e) {
e.printStackTrace();
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java b/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java
index 6b29655c..33012194 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java
@@ -45,7 +45,9 @@ public class APIManager {
private long lastShortAuctionUpdate = 0;
private long lastCustomAHSearch = 0;
private long lastCleanup = 0;
+
private long lastApiUpdate = 0;
+ private long firstHypixelApiUpdate = 0;
public int activeAuctions = 0;
public int uniqueItems = 0;
@@ -112,6 +114,11 @@ public class APIManager {
}
}
+ public void markNeedsUpdate() {
+ firstHypixelApiUpdate = 0;
+ pagesToDownload = null;
+ }
+
public void tick() {
if(manager.config.apiKey.value == null || manager.config.apiKey.value.isEmpty()) return;
@@ -211,7 +218,7 @@ public class APIManager {
Set<String> toRemove = new HashSet<>();
for(Map.Entry<String, Auction> entry : auctionMap.entrySet()) {
long timeToEnd = entry.getValue().end - currTime;
- if(timeToEnd < -60) {
+ if(timeToEnd < -120*1000) { //2 minutes
toRemove.add(entry.getKey());
}
}
@@ -243,13 +250,15 @@ public class APIManager {
}
private void updatePageTickShort() {
+ if(pagesToDownload == null || pagesToDownload.isEmpty()) return;
+
+ if(firstHypixelApiUpdate == 0 || (System.currentTimeMillis() - firstHypixelApiUpdate)%(60*1000) > 15*1000) return;
+
JsonObject disable = Utils.getConstant("disable");
if(disable != null && disable.get("auctions").getAsBoolean()) return;
- if(pagesToDownload == null) {
- getPageFromAPI(0);
- } else if(!pagesToDownload.isEmpty()) {
- int page = pagesToDownload.getFirst();
+ while(!pagesToDownload.isEmpty()) {
+ int page = pagesToDownload.pop();
getPageFromAPI(page);
}
}
@@ -258,6 +267,10 @@ public class APIManager {
JsonObject disable = Utils.getConstant("disable");
if(disable != null && disable.get("auctions").getAsBoolean()) return;
+ if(pagesToDownload == null) {
+ getPageFromAPI(0);
+ }
+
manager.hypixelApi.getApiGZIPAsync("http://moulberry.codes/auction.json.gz", jsonObject -> {
if(jsonObject.get("success").getAsBoolean()) {
long apiUpdate = (long)jsonObject.get("time").getAsFloat();
@@ -269,18 +282,21 @@ public class APIManager {
JsonArray new_auctions = jsonObject.get("new_auctions").getAsJsonArray();
for(JsonElement auctionElement : new_auctions) {
JsonObject auction = auctionElement.getAsJsonObject();
+ //System.out.println("New auction " + auction);
processAuction(auction);
}
JsonArray new_bids = jsonObject.get("new_bids").getAsJsonArray();
for(JsonElement newBidElement : new_bids) {
JsonObject newBid = newBidElement.getAsJsonObject();
String newBidUUID = newBid.get("uuid").getAsString();
+ //System.out.println("new bid" + newBidUUID);
int newBidAmount = newBid.get("highest_bid_amount").getAsInt();
int end = newBid.get("end").getAsInt();
int bid_count = newBid.get("bid_count").getAsInt();
Auction auc = auctionMap.get(newBidUUID);
if(auc != null) {
+ //System.out.println("Setting auction " + newBidUUID + " price to " + newBidAmount);
auc.highest_bid_amount = newBidAmount;
auc.end = end;
auc.bid_count = bid_count;
@@ -456,10 +472,10 @@ public class APIManager {
if(itemType >= 0 && itemType < categoryItemType.length) {
category = categoryItemType[itemType];
}
- if(internalname.contains("ENCHANTED_BOOK")) category = "ebook";
- if(extras.endsWith("Potion")) category = "potion";
- if(extras.contains("Rune")) category = "rune";
- if(item_lore.split("\n")[0].endsWith("Furniture")) category = "furniture";
+ if(category.equals("consumables") && extras.contains("enchanted book")) category = "ebook";
+ if(category.equals("consumables") && extras.endsWith("potion")) category = "potion";
+ if(category.equals("misc") && extras.contains("rune")) category = "rune";
+ if(category.equals("misc") && item_lore.split("\n")[0].endsWith("Furniture")) category = "furniture";
if(item_lore.split("\n")[0].endsWith("Pet") ||
item_lore.split("\n")[0].endsWith("Mount")) category = "pet";
@@ -500,7 +516,9 @@ public class APIManager {
pagesToDownload.add(i);
}
}
- pagesToDownload.remove(Integer.valueOf(page));
+ if(firstHypixelApiUpdate == 0) {
+ firstHypixelApiUpdate = jsonObject.get("lastUpdated").getAsLong();
+ }
activeAuctions = jsonObject.get("totalAuctions").getAsInt();
long startProcess = System.currentTimeMillis();
@@ -511,7 +529,11 @@ public class APIManager {
processAuction(auction);
}
processMillis = (int)(System.currentTimeMillis() - startProcess);
+ } else {
+ pagesToDownload.addLast(page);
}
+ }, () -> {
+ pagesToDownload.addLast(page);
}
);
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java
index 331ba8b1..9b42f5a6 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java
@@ -20,7 +20,7 @@ public class CapeManager {
public static final CapeManager INSTANCE = new CapeManager();
private HashMap<String, Pair<NEUCape, String>> capeMap = new HashMap<>();
- private String[] capes = new String[]{"testcape", "nullzee", "gravy", "fade", "contrib"};
+ private String[] capes = new String[]{"patreon1", "patreon2", "gravy", "fade", "contrib"};
public static CapeManager getInstance() {
return INSTANCE;
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeNode.java b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeNode.java
index 1ec2dee3..bcd5e26e 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeNode.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeNode.java
@@ -110,14 +110,14 @@ public class CapeNode {
velocity.y -= gravity * (resistance)/(1-resistance);
float actualResistance = resistance;
- BlockPos pos = new BlockPos(
+ /*BlockPos pos = new BlockPos(
MathHelper.floor_double(position.x),
MathHelper.floor_double(position.y),
MathHelper.floor_double(position.z));
Block block = Minecraft.getMinecraft().theWorld.getBlockState(pos).getBlock();
if(block.getMaterial().isLiquid()) {
actualResistance = 0.8f;
- }
+ }*/
velocity.scale(1-actualResistance);
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/NEUCape.java b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/NEUCape.java
index 08d91057..9fc2a5ee 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/NEUCape.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/NEUCape.java
@@ -10,6 +10,7 @@ import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.potion.Potion;
import net.minecraft.util.BlockPos;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
@@ -27,6 +28,7 @@ import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.security.Key;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
@@ -45,6 +47,8 @@ public class NEUCape {
public static float targetDist = 1/20f;
+ private EntityPlayer currentPlayer;
+
private String shaderName = "cape";
public NEUCape(String capeName) {
@@ -223,6 +227,10 @@ public class NEUCape {
public void onRenderPlayer(RenderPlayerEvent.Post e) {
EntityPlayer player = e.entityPlayer;
+ if(currentPlayer != null && currentPlayer != player) return;
+
+ if(player.getActivePotionEffect(Potion.invisibility) != null) return;
+
ensureCapeNodesCreated(player);
Entity viewer = Minecraft.getMinecraft().getRenderViewEntity();
@@ -258,9 +266,18 @@ public class NEUCape {
lastRender = System.currentTimeMillis();
}
+ private boolean notRendering = false;
public void onTick(TickEvent.ClientTickEvent event, EntityPlayer player) {
- if(player != null && System.currentTimeMillis() - lastRender < 100) {
- ensureCapeNodesCreated(Minecraft.getMinecraft().thePlayer);
+ if(player == null) return;
+
+ if(System.currentTimeMillis() - lastRender < 500) {
+ if(currentPlayer == null) {
+ currentPlayer = player;
+ } else if(currentPlayer != player) {
+ return;
+ }
+
+ ensureCapeNodesCreated(player);
for(int y=0; y<nodes.size(); y++) {
for(int x=0; x<nodes.get(y).size(); x++) {
@@ -271,6 +288,12 @@ public class NEUCape {
}
}
updateCape(player);
+
+ notRendering = false;
+ } else {
+ currentPlayer = null;
+
+ notRendering = true;
}
}
@@ -346,128 +369,129 @@ public class NEUCape {
private double oldPlayerAngle;
private int crouchTicks = 0;
long startTime = 0;
- long updateMillis = 0;
- long renderMillis = 0;
private void updateCape(EntityPlayer player) {
Vector3f capeTranslation = updateFixedCapeNodes(player);
- if(System.currentTimeMillis() - lastRender > 100) {
+ if(notRendering) {
for (int y = 0; y < nodes.size(); y++) {
for (int x = 0; x < nodes.get(y).size(); x++) {
- Vector3f.add(nodes.get(y).get(x).position, capeTranslation, nodes.get(y).get(x).position);
- nodes.get(y).get(x).lastPosition.set(nodes.get(y).get(x).position);
- nodes.get(y).get(x).renderPosition.set(nodes.get(y).get(x).position);
+ CapeNode node = nodes.get(y).get(x);
+ if(!node.fixed) {
+ Vector3f.add(node.position, capeTranslation, node.position);
+ node.lastPosition.set(node.position);
+ node.renderPosition.set(node.position);
+ }
}
}
- } else {
- double playerAngle = Math.toRadians(player.renderYawOffset);
- double deltaAngle = playerAngle - oldPlayerAngle;
- if(deltaAngle > Math.PI) {
- deltaAngle = 2*Math.PI - deltaAngle;
- }
- if(deltaAngle < -Math.PI) {
- deltaAngle = 2*Math.PI + deltaAngle;
- }
- deltaAngleAccum *= 0.5f;
- deltaAngleAccum += deltaAngle;
+ }
- float dX = (float)Math.cos(playerAngle+Math.PI/2f);
- float dZ = (float)Math.sin(playerAngle+Math.PI/2f);
+ double playerAngle = Math.toRadians(player.renderYawOffset);
+ double deltaAngle = playerAngle - oldPlayerAngle;
+ if(deltaAngle > Math.PI) {
+ deltaAngle = 2*Math.PI - deltaAngle;
+ }
+ if(deltaAngle < -Math.PI) {
+ deltaAngle = 2*Math.PI + deltaAngle;
+ }
+ deltaAngleAccum *= 0.5f;
+ deltaAngleAccum += deltaAngle;
- float factor = (float)(deltaAngleAccum*deltaAngleAccum);
+ float dX = (float)Math.cos(playerAngle+Math.PI/2f);
+ float dZ = (float)Math.sin(playerAngle+Math.PI/2f);
- tl.handleKeyboardInput();
+ float factor = (float)(deltaAngleAccum*deltaAngleAccum);
- float capeTransLength = capeTranslation.length();
+ tl.handleKeyboardInput();
- float capeTranslationFactor = 0f;
- if(capeTransLength > 0.5f) {
- capeTranslationFactor = (capeTransLength-0.5f)/capeTransLength;
- }
- Vector3f lookDir = new Vector3f(dX, 0, dZ);
- Vector3f lookDirNorm = lookDir.normalise(null);
- float dot = Vector3f.dot(capeTranslation, lookDirNorm);
- if(dot < 0) { //Moving backwards
- for(int y=0; y<nodes.size(); y++) {
- for(int x=0; x<nodes.get(y).size(); x++) {
- CapeNode node = nodes.get(y).get(x);
- if(!node.fixed) {
- node.position.x += lookDirNorm.x*dot;
- node.position.y += lookDirNorm.y*dot;
- node.position.z += lookDirNorm.z*dot;
- }
- }
- }
- //Apply small backwards force
- factor = 0.05f;
- }
+ float capeTransLength = capeTranslation.length();
- if(factor > 0) {
- for(int y=0; y<nodes.size(); y++) {
- for(int x=0; x<nodes.get(y).size(); x++) {
- nodes.get(y).get(x).applyForce(-dX*factor, 0, -dZ*factor);
+ float capeTranslationFactor = 0f;
+ if(capeTransLength > 0.5f) {
+ capeTranslationFactor = (capeTransLength-0.5f)/capeTransLength;
+ }
+ Vector3f lookDir = new Vector3f(dX, 0, dZ);
+ Vector3f lookDirNorm = lookDir.normalise(null);
+ float dot = Vector3f.dot(capeTranslation, lookDirNorm);
+ if(dot < 0) { //Moving backwards
+ for(int y=0; y<nodes.size(); y++) {
+ for(int x=0; x<nodes.get(y).size(); x++) {
+ CapeNode node = nodes.get(y).get(x);
+ if(!node.fixed) {
+ node.position.x += lookDirNorm.x*dot;
+ node.position.y += lookDirNorm.y*dot;
+ node.position.z += lookDirNorm.z*dot;
}
}
}
+ //Apply small backwards force
+ factor = 0.05f;
+ }
- if(capeTranslationFactor > 0f) {
- float capeDX = capeTranslation.x*capeTranslationFactor;
- float capeDY = capeTranslation.y*capeTranslationFactor;
- float capeDZ = capeTranslation.z*capeTranslationFactor;
-
- for(int y=0; y<nodes.size(); y++) {
- for(int x=0; x<nodes.get(y).size(); x++) {
- CapeNode node = nodes.get(y).get(x);
- if(!node.fixed) {
- node.position.x += capeDX;
- node.position.y += capeDY;
- node.position.z += capeDZ;
- }
- }
+ if(factor > 0) {
+ for(int y=0; y<nodes.size(); y++) {
+ for(int x=0; x<nodes.get(y).size(); x++) {
+ nodes.get(y).get(x).applyForce(-dX*factor, 0, -dZ*factor);
}
}
+ }
- //Wind
- float currTime = (System.currentTimeMillis()-startTime)/1000f;
- float windRandom = Math.abs((float)(0.5f*Math.sin(0.22f*currTime)+Math.sin(0.44f*currTime)*Math.sin(0.47f*currTime)));
- double windDir = playerAngle+Math.PI/4f*Math.sin(0.2f*currTime);
+ if(capeTranslationFactor > 0f) {
+ float capeDX = capeTranslation.x*capeTranslationFactor;
+ float capeDY = capeTranslation.y*capeTranslationFactor;
+ float capeDZ = capeTranslation.z*capeTranslationFactor;
- float windDX = (float)Math.cos(windDir+Math.PI/2f);
- float windDZ = (float)Math.sin(windDir+Math.PI/2f);
for(int y=0; y<nodes.size(); y++) {
for(int x=0; x<nodes.get(y).size(); x++) {
- nodes.get(y).get(x).applyForce(-windDX*windRandom*0.01f, 0, -windDZ*windRandom*0.01f);
+ CapeNode node = nodes.get(y).get(x);
+ if(!node.fixed) {
+ node.position.x += capeDX;
+ node.position.y += capeDY;
+ node.position.z += capeDZ;
+ }
}
}
+ }
- if(player.isSneaking()) {
- crouchTicks++;
- float mult = 0.5f;
- if(crouchTicks < 5) {
- mult = 2f;
- }
- for(int y=0; y<8; y++) {
- for(int x=0; x<nodes.get(y).size(); x++) {
- nodes.get(y).get(x).applyForce(-dX*mult, 0, -dZ*mult);
- }
+ //Wind
+ float currTime = (System.currentTimeMillis()-startTime)/1000f;
+ float windRandom = Math.abs((float)(0.5f*Math.sin(0.22f*currTime)+Math.sin(0.44f*currTime)*Math.sin(0.47f*currTime)));
+ double windDir = playerAngle+Math.PI/4f*Math.sin(0.2f*currTime);
+
+ float windDX = (float)Math.cos(windDir+Math.PI/2f);
+ float windDZ = (float)Math.sin(windDir+Math.PI/2f);
+ for(int y=0; y<nodes.size(); y++) {
+ for(int x=0; x<nodes.get(y).size(); x++) {
+ nodes.get(y).get(x).applyForce(-windDX*windRandom*0.01f, 0, -windDZ*windRandom*0.01f);
+ }
+ }
+
+ if(player.isSneaking()) {
+ crouchTicks++;
+ float mult = 0.5f;
+ if(crouchTicks < 5) {
+ mult = 2f;
+ }
+ for(int y=0; y<8; y++) {
+ for(int x=0; x<nodes.get(y).size(); x++) {
+ nodes.get(y).get(x).applyForce(-dX*mult, 0, -dZ*mult);
}
- } else {
- crouchTicks = 0;
}
+ } else {
+ crouchTicks = 0;
+ }
- oldPlayerAngle = playerAngle;
+ oldPlayerAngle = playerAngle;
+ for(int y=0; y<nodes.size(); y++) {
+ for(int x=0; x<nodes.get(y).size(); x++) {
+ nodes.get(y).get(x).update();
+ }
+ }
+ int updates = player == Minecraft.getMinecraft().thePlayer ? 50 : 25;
+ for(int i=0; i<updates; i++) {
for(int y=0; y<nodes.size(); y++) {
for(int x=0; x<nodes.get(y).size(); x++) {
- nodes.get(y).get(x).update();
- }
- }
- int updates = player == Minecraft.getMinecraft().thePlayer ? 50 : 25;
- for(int i=0; i<updates; i++) {
- for(int y=0; y<nodes.size(); y++) {
- for(int x=0; x<nodes.get(y).size(); x++) {
- nodes.get(y).get(x).resolveAll(2+1f*y/nodes.size(), false);
- }
+ nodes.get(y).get(x).resolveAll(2+1f*y/nodes.size(), false);
}
}
}
@@ -549,7 +573,7 @@ public class NEUCape {
private void renderCape(EntityPlayer player, float partialRenderTick) {
ensureCapeNodesCreated(player);
- if(System.currentTimeMillis() - lastRender > 100) {
+ if(System.currentTimeMillis() - lastRender > 500) {
updateCape(player);
}
updateFixedCapeNodesPartial(player, partialRenderTick);
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/infopanes/CollectionLogInfoPane.java b/src/main/java/io/github/moulberry/notenoughupdates/infopanes/CollectionLogInfoPane.java
index e4c524f2..1516aae1 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/infopanes/CollectionLogInfoPane.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/infopanes/CollectionLogInfoPane.java
@@ -47,13 +47,13 @@ public class CollectionLogInfoPane extends ScrollableInfoPane {
private static final int FILTER_ARMOR = 2;
private static final int FILTER_ACCESSORY = 3;
private static final int FILTER_PET = 4;
- private static final int FILTER_TOOL = 5;
+ private static final int FILTER_DUNGEON = 5;
private static final int FILTER_SLAYER_ZOMBIE = 6;
private static final int FILTER_SLAYER_WOLF = 7;
private static final int FILTER_SLAYER_SPIDER = 8;
private int filterMode = FILTER_ALL;
private String[] filterPrettyNames = new String[]{"ALL","WEAPON","ARMOR",
- "ACCESSORY","PET","TOOL","ZOMBIE SLAYER","WOLF SLAYER","SPIDER SLAYER"};
+ "ACCESSORY","PET","DUNGEON","ZOMBIE SLAYER","WOLF SLAYER","SPIDER SLAYER"};
private Framebuffer itemFramebuffer = null;
private Framebuffer itemBGFramebuffer = null;
@@ -94,8 +94,8 @@ public class CollectionLogInfoPane extends ScrollableInfoPane {
case FILTER_PET:
if(!internalname.matches(petRegex) || !item.get("displayname").getAsString().contains("[")) continue;
break;
- case FILTER_TOOL:
- if(overlay.checkItemType(lore, "AXE", "PICKAXE", "FISHING ROD", "SHOVEL", "HOE") < 0) continue;
+ case FILTER_DUNGEON:
+ if(Utils.checkItemType(lore, true, "DUNGEON") < 0) continue;
break;
case FILTER_SLAYER_ZOMBIE:
if(!item.has("slayer_req") || !item.get("slayer_req").getAsString().startsWith("ZOMBIE")) continue;
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBAnchorPoint.java b/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBAnchorPoint.java
index 7f0eb46f..06dfd246 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBAnchorPoint.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBAnchorPoint.java
@@ -9,7 +9,9 @@ public class MBAnchorPoint implements Serializable {
public enum AnchorPoint {
TOPLEFT(0, 0), TOPMID(0.5f, 0), TOPRIGHT(1, 0),
MIDRIGHT(1, 0.5f), BOTRIGHT(1, 1), BOTMID(0.5f, 1),
- BOTLEFT(0, 1), MIDLEFT(0, 0.5f), MIDMID(0.5f, 0.5f);
+ BOTLEFT(0, 1), MIDLEFT(0, 0.5f), MIDMID(0.5f, 0.5f),
+
+ INV_BOTMID(0.5f, 1f);
public final float x;
public final float y;
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java b/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java
index 4759d99b..aba1d743 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java
@@ -54,8 +54,10 @@ public abstract class MBGuiGroup extends MBGuiElement {
@Override
public void render(float x, float y) {
+ Map<MBGuiElement, Vector2f> childrenPos = getChildrenPosition();
+
for(MBGuiElement child : getChildren()) {
- Vector2f childPos = childrenPosition.get(child);
+ Vector2f childPos = childrenPos.get(child);
child.render(x+childPos.x, y+childPos.y);
}
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroupFloating.java b/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroupFloating.java
index 91cca2d7..6bdd25fd 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroupFloating.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroupFloating.java
@@ -1,5 +1,9 @@
package io.github.moulberry.notenoughupdates.mbgui;
+import io.github.moulberry.notenoughupdates.util.Utils;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.GuiScreen;
+import net.minecraft.client.gui.inventory.GuiContainer;
import org.lwjgl.util.vector.Vector2f;
import java.util.*;
@@ -7,6 +11,8 @@ import java.util.*;
public class MBGuiGroupFloating extends MBGuiGroup {
private LinkedHashMap<MBGuiElement, MBAnchorPoint> children;
+ private GuiContainer lastContainer = null;
+ private HashMap<MBGuiElement, Vector2f> childrenPositionOffset = new HashMap<>();
public MBGuiGroupFloating(int width, int height, LinkedHashMap<MBGuiElement, MBAnchorPoint> children) {
this.width = width;
@@ -20,7 +26,53 @@ public class MBGuiGroupFloating extends MBGuiGroup {
}
@Override
+ public Map<MBGuiElement, Vector2f> getChildrenPosition() {
+ GuiScreen currentScreen = Minecraft.getMinecraft().currentScreen;
+
+ if(currentScreen instanceof GuiContainer) {
+ GuiContainer currentContainer = (GuiContainer) currentScreen;
+ if(lastContainer != currentContainer) {
+ lastContainer = currentContainer;
+ for(Map.Entry<MBGuiElement, MBAnchorPoint> entry : children.entrySet()) {
+ MBGuiElement child = entry.getKey();
+ MBAnchorPoint anchorPoint = entry.getValue();
+
+ Vector2f childPos;
+ if(childrenPosition.containsKey(child)) {
+ childPos = new Vector2f(childrenPosition.get(child));
+ } else {
+ childPos = new Vector2f();
+ }
+
+ if(anchorPoint.anchorPoint == MBAnchorPoint.AnchorPoint.INV_BOTMID) {
+ try {
+ int xSize = (int) Utils.getField(GuiContainer.class, currentContainer, "xSize", "field_146999_f");
+ int ySize = (int) Utils.getField(GuiContainer.class, currentContainer, "ySize", "field_147000_g");
+ int guiLeft = (int) Utils.getField(GuiContainer.class, currentContainer, "guiLeft", "field_147003_i");
+ int guiTop = (int) Utils.getField(GuiContainer.class, currentContainer, "guiTop", "field_147009_r");
+
+ int defGuiLeft = (this.width - xSize) / 2;
+ int defGuiTop = (this.height - ySize) / 2;
+
+ childPos.x += guiLeft-defGuiLeft + (anchorPoint.anchorPoint.x-0.5f)*xSize;
+ childPos.y += guiTop-defGuiTop + (anchorPoint.anchorPoint.y-0.5f)*ySize;
+ } catch(Exception ignored) {
+ }
+ }
+
+ childrenPositionOffset.put(child, childPos);
+ }
+ }
+ return Collections.unmodifiableMap(childrenPositionOffset);
+ } else {
+ return Collections.unmodifiableMap(childrenPosition);
+ }
+ }
+
+ @Override
public void recalculate() {
+ lastContainer = null;
+
for(MBGuiElement child : children.keySet()) {
child.recalculate();
}
@@ -30,6 +82,12 @@ public class MBGuiGroupFloating extends MBGuiGroup {
MBAnchorPoint anchorPoint = entry.getValue();
float x = anchorPoint.anchorPoint.x * width - anchorPoint.anchorPoint.x * child.getWidth() + anchorPoint.offset.x;
float y = anchorPoint.anchorPoint.y * height - anchorPoint.anchorPoint.y * child.getHeight() + anchorPoint.offset.y;
+
+ if(anchorPoint.anchorPoint == MBAnchorPoint.AnchorPoint.INV_BOTMID) {
+ x = width*0.5f + anchorPoint.offset.x;
+ y = height*0.5f + anchorPoint.offset.y;
+ }
+
childrenPosition.put(child, new Vector2f(x, y));
}
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/Options.java b/src/main/java/io/github/moulberry/notenoughupdates/options/Options.java
index 7844cf37..88165d08 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/options/Options.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/options/Options.java
@@ -78,11 +78,6 @@ public class Options {
"Hide Apikey Setting",
false,
"Hides the Apikey setting (please try not to leak Apikey if you're recording)");
- public Option<Boolean> quickAHUpdate = new Option(
- false,
- "NeuAH Quick Update",
- false,
- "Will instantly update the whole AH when an api update is detected (aka as fast as possible). Warning: Uses lots of data.");
public Option<Double> bgBlurFactor = new Option(
5.0,
"Background Blur",
@@ -299,7 +294,6 @@ public class Options {
tryAddOption(tooltipBorderColours, options);
tryAddOption(hideApiKey, options);
tryAddOption(streamerMode, options);
- tryAddOption(quickAHUpdate, options);
tryAddOption(autoupdate, options);
tryAddOption(cacheRenderedItempane, options);
tryAddOption(itemStyle, options);
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
index 24a3d49d..76da035a 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
@@ -734,6 +734,10 @@ public class GuiProfileViewer extends GuiScreen {
float exp = pet.get("exp").getAsFloat();
if(tierNum == null) continue;
+ if(pet.has("heldItem") && pet.get("heldItem").getAsString().equals("PET_ITEM_TIER_BOOST")) {
+ tierNum = ""+(Integer.parseInt(tierNum)+1);
+ }
+
int petRarityOffset = petsJson.get("pet_rarity_offset").getAsJsonObject().get(tier).getAsInt();
JsonArray levelsArr = petsJson.get("pet_levels").getAsJsonArray();
@@ -1689,6 +1693,7 @@ public class GuiProfileViewer extends GuiScreen {
for(Map.Entry<String, JsonElement> entry : skillInfo.entrySet()) {
if(entry.getKey().startsWith("level_skill")) {
+ if(entry.getKey().contains("runecrafting")) continue;
totalSkillLVL += entry.getValue().getAsFloat();
totalSkillCount++;
} else if(entry.getKey().startsWith("level_slayer")) {
@@ -1739,15 +1744,34 @@ public class GuiProfileViewer extends GuiScreen {
guiLeft+xStart+xOffset, guiTop+yStartBottom, 76);
renderAlignedString(EnumChatFormatting.DARK_AQUA+"Revenant T4", EnumChatFormatting.WHITE.toString()+(int)zombie_boss_kills_tier_3,
guiLeft+xStart+xOffset, guiTop+yStartBottom+yOffset, 76);
- renderAlignedString(EnumChatFormatting.DARK_AQUA+"Sven T3", EnumChatFormatting.WHITE.toString()+(int)spider_boss_kills_tier_2,
+ renderAlignedString(EnumChatFormatting.DARK_AQUA+"Sven T3", EnumChatFormatting.WHITE.toString()+(int)wolf_boss_kills_tier_2,
guiLeft+xStart+xOffset, guiTop+yStartBottom+yOffset*2, 76);
- renderAlignedString(EnumChatFormatting.DARK_AQUA+"Sven T4", EnumChatFormatting.WHITE.toString()+(int)spider_boss_kills_tier_3,
+ renderAlignedString(EnumChatFormatting.DARK_AQUA+"Sven T4", EnumChatFormatting.WHITE.toString()+(int)wolf_boss_kills_tier_3,
guiLeft+xStart+xOffset, guiTop+yStartBottom+yOffset*3, 76);
- renderAlignedString(EnumChatFormatting.DARK_AQUA+"Tarantula T3", EnumChatFormatting.WHITE.toString()+(int)wolf_boss_kills_tier_2,
+ renderAlignedString(EnumChatFormatting.DARK_AQUA+"Tarantula T3", EnumChatFormatting.WHITE.toString()+(int)spider_boss_kills_tier_2,
guiLeft+xStart+xOffset, guiTop+yStartBottom+yOffset*4, 76);
- renderAlignedString(EnumChatFormatting.DARK_AQUA+"Tarantula T4", EnumChatFormatting.WHITE.toString()+(int)wolf_boss_kills_tier_3,
+ renderAlignedString(EnumChatFormatting.DARK_AQUA+"Tarantula T4", EnumChatFormatting.WHITE.toString()+(int)spider_boss_kills_tier_3,
guiLeft+xStart+xOffset, guiTop+yStartBottom+yOffset*5, 76);
+ float pet_milestone_ores_mined = Utils.getElementAsFloat(Utils.getElement(profileInfo, "stats.pet_milestone_ores_mined"), 0);
+ float pet_milestone_sea_creatures_killed = Utils.getElementAsFloat(Utils.getElement(profileInfo, "stats.pet_milestone_sea_creatures_killed"), 0);
+
+ float items_fished = Utils.getElementAsFloat(Utils.getElement(profileInfo, "stats.items_fished"), 0);
+ float items_fished_treasure = Utils.getElementAsFloat(Utils.getElement(profileInfo, "stats.items_fished_treasure"), 0);
+ float items_fished_large_treasure = Utils.getElementAsFloat(Utils.getElement(profileInfo, "stats.items_fished_large_treasure"), 0);
+
+ renderAlignedString(EnumChatFormatting.GREEN+"Ores Mined", EnumChatFormatting.WHITE.toString()+(int)pet_milestone_ores_mined,
+ guiLeft+xStart+xOffset*2, guiTop+yStartTop, 76);
+ renderAlignedString(EnumChatFormatting.GREEN+"Sea Creatures Killed", EnumChatFormatting.WHITE.toString()+(int)pet_milestone_sea_creatures_killed,
+ guiLeft+xStart+xOffset*2, guiTop+yStartTop+yOffset, 76);
+
+ renderAlignedString(EnumChatFormatting.GREEN+"Items Fished", EnumChatFormatting.WHITE.toString()+(int)items_fished,
+ guiLeft+xStart+xOffset*2, guiTop+yStartTop+yOffset*3, 76);
+ renderAlignedString(EnumChatFormatting.GREEN+"Treasures Fished", EnumChatFormatting.WHITE.toString()+(int)items_fished_treasure,
+ guiLeft+xStart+xOffset*2, guiTop+yStartTop+yOffset*4, 76);
+ renderAlignedString(EnumChatFormatting.GREEN+"Large Treasures", EnumChatFormatting.WHITE.toString()+(int)items_fished_large_treasure,
+ guiLeft+xStart+xOffset*2, guiTop+yStartTop+yOffset*5, 76);
+
if(topKills == null) {
topKills = new TreeMap<>();
JsonObject stats = profileInfo.get("stats").getAsJsonObject();
@@ -2336,6 +2360,10 @@ public class GuiProfileViewer extends GuiScreen {
playerLocationSkin = null;
playerLocationCape = null;
skinType = null;
+ petsPage = 0;
+ sortedPets = null;
+ sortedPetsStack = null;
+ selectedPet = -1;
}
Shader blurShaderHorz = null;
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 a5b474c6..d2b5ea23 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java
@@ -203,11 +203,11 @@ public class ProfileViewer {
collectionToCollectionDisplayMap.put("LOG:2", Utils.createItemStack(Item.getItemFromBlock(Blocks.log),
EnumChatFormatting.DARK_GREEN+"Spruce", 2));
collectionToCollectionDisplayMap.put("LOG_2:1", Utils.createItemStack(Item.getItemFromBlock(Blocks.log2),
- EnumChatFormatting.DARK_GREEN+"Jungle", 1));
+ EnumChatFormatting.DARK_GREEN+"Dark Oak", 1));
collectionToCollectionDisplayMap.put("LOG_2", Utils.createItemStack(Item.getItemFromBlock(Blocks.log2),
EnumChatFormatting.DARK_GREEN+"Acacia"));
collectionToCollectionDisplayMap.put("LOG:3", Utils.createItemStack(Item.getItemFromBlock(Blocks.log),
- EnumChatFormatting.DARK_GREEN+"Dark Oak", 3));
+ EnumChatFormatting.DARK_GREEN+"Jungle", 3));
/** FISHING COLLECTIONS **/
collectionToCollectionDisplayMap.put("RAW_FISH", Utils.createItemStack(Items.fish,