Skip to content

Commit

Permalink
added bazaar price to tooltip + german translation and update to 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LifeIsAParadox committed Oct 10, 2021
1 parent 37d1379 commit 7314235
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 14 deletions.
7 changes: 4 additions & 3 deletions FEATURES.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
* Bars: Health and absorption, Mana, Defense, XP
* Hide Messages: Ability Cooldown, Heal, AOTE, Implosion, Molten Wave
* Dungeon Minimap
* Dungeon Puzzle Solver: Three Weirdos
* Dwarven Mines Solver: Fetchur, Puzzler, Blaze
* Dungeon Puzzle Solver: Three Weirdos, Blaze
* F7 Terminal: Order, Color, Name
* Dwarven Mines Solver: Fetchur, Puzzler
* Drill Fuel in Item Durability Bar
* Hotbar Slot Lock Keybind (Select the hotbar slot you want to lock/unlock and press the button)
* price tooltip
* price tooltip: bazaar, ah
* reparty: write /rp to reparty
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ clothconfig_version=5.0.38
mod_menu_version=2.0.4

# Mod Properties
mod_version = 1.1.1
mod_version = 1.2.0
maven_group = me.xmrvizzy
archives_base_name = skyblocker
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,26 @@
import java.util.zip.GZIPInputStream;

public class PriceInfoTooltip {
private JsonObject auctionPricesJson = null;
private JsonObject bazaarPricesJson = null;
public static JsonObject prices;
public static JsonObject bazaarPricesJson;
public static JsonObject auctionPricesJson;

public static void onInjectTooltip(ItemStack stack, TooltipContext context, List<Text> list) {
String name = getInternalNameForItem(stack);

try {
if(!list.toString().contains("Avg. BIN Price") && prices != null && prices.has(name) ){
JsonElement getPrice = prices.get(name);
if(!list.toString().contains("Avg. BIN Price") && auctionPricesJson != null && auctionPricesJson.has(name) ){
JsonElement getPrice = auctionPricesJson.get(name);
String price = round(getPrice.getAsDouble(), 2);

list.add(new LiteralText("Avg. BIN Price: ").formatted(Formatting.GOLD).append(new LiteralText(price + " Coins").formatted(Formatting.DARK_AQUA)));
}
else if(!list.toString().contains("Bazaar Price") && bazaarPricesJson != null && bazaarPricesJson.has(name) ){
JsonObject getItem = bazaarPricesJson.getAsJsonObject(name);
String buyprice = round(getItem.get("buyPrice").getAsDouble(), 2);
String sellprice = round(getItem.get("sellPrice").getAsDouble(), 2);
list.add(new LiteralText("Bazaar buy Price: ").formatted(Formatting.GOLD).append(new LiteralText(buyprice + " Coins").formatted(Formatting.DARK_AQUA)));
list.add(new LiteralText("Bazaar sell Price: ").formatted(Formatting.GOLD).append(new LiteralText(sellprice + " Coins").formatted(Formatting.DARK_AQUA)));
}
}catch(Exception e) {
MinecraftClient.getInstance().player.sendMessage(new LiteralText(e.toString()), false);
}
Expand Down Expand Up @@ -84,6 +90,7 @@ public static String getInternalnameFromNBT(NbtCompound tag) {

public static void init() {
MinecraftClient.getInstance().execute(PriceInfoTooltip::downloadPrices);
MinecraftClient.getInstance().execute(PriceInfoTooltip::downloadbazaarPrices);
}

private static void downloadPrices() {
Expand All @@ -101,6 +108,18 @@ private static void downloadPrices() {
catch(IOException e) {
LogManager.getLogger(PriceInfoTooltip.class.getName()).warn("[Skyblocker] Failed to download item prices!", e);
}
prices = result;
auctionPricesJson = result;
}
private static void downloadbazaarPrices() {
JsonObject result = null;
try {
URL apiAddr = new URL("https://sky.shiiyu.moe/api/v2/bazaar");
InputStreamReader reader = new InputStreamReader(apiAddr.openStream());
result = new Gson().fromJson(reader, JsonObject.class);
}
catch(IOException e) {
LogManager.getLogger(PriceInfoTooltip.class.getName()).warn("[Skyblocker] Failed to download item prices!", e);
}
bazaarPricesJson = result;
}
}
34 changes: 34 additions & 0 deletions src/main/resources/assets/skyblocker/lang/de_de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"key.categories.skyblocker": "Skyblocker",
"key.hotbarSlotLock": "Schlitzsperre (Hotbar)",

"text.autoconfig.skyblocker.title": "Skyblocker-Einstellungen",

"text.autoconfig.skyblocker.category.general": "Allgemein",
"text.autoconfig.skyblocker.option.general.apiKey": "Hypixel API Schlüssel (WIP)",
"text.autoconfig.skyblocker.option.general.bars": "Gesundheits-, Mana-, Verteidigungs- und XP-Balken",
"text.autoconfig.skyblocker.option.general.bars.enableBars": "Balken aktivieren",

"text.autoconfig.skyblocker.category.locations": "Standorte",
"text.autoconfig.skyblocker.option.locations.dungeons": "Dungeons",
"text.autoconfig.skyblocker.option.locations.dungeons.enableMap": "Karte aktivieren",
"text.autoconfig.skyblocker.option.locations.dungeons.solveThreeWeirdos": "Drei Verrückte Rätsel lösen",
"text.autoconfig.skyblocker.option.locations.dungeons.blazesolver": "Blaze Rätsel lösen",
"text.autoconfig.skyblocker.option.locations.dungeons.solveTrivia": "Rätsel lösen",
"text.autoconfig.skyblocker.option.locations.dungeons.terminals": "Terminal Löser",
"text.autoconfig.skyblocker.option.locations.dungeons.terminals.solveColor": "Wähle die richtige Farbe",
"text.autoconfig.skyblocker.option.locations.dungeons.terminals.solveOrder": "Klick in der Reihenfolge lösen",
"text.autoconfig.skyblocker.option.locations.dungeons.terminals.solveStartsWith": "Beginnt mit lösen",
"text.autoconfig.skyblocker.option.locations.dwarvenMines": "Zwergenminen",
"text.autoconfig.skyblocker.option.locations.dwarvenMines.enableDrillFuel": "Bohrtreibstoff aktivieren",
"text.autoconfig.skyblocker.option.locations.dwarvenMines.solveFetchur": "Löse Fetchur",
"text.autoconfig.skyblocker.option.locations.dwarvenMines.solvePuzzler": "Puzzler-Rätsel lösen",

"text.autoconfig.skyblocker.category.messages": "Nachrichten",
"text.autoconfig.skyblocker.option.messages.hideAbility": "Abklingzeit der Fähigkeit nachricht verbergen",
"text.autoconfig.skyblocker.option.messages.hideHeal": "Heilungsnachrichten verbergen",
"text.autoconfig.skyblocker.option.messages.hideAOTE": "AOTE-Meldungen ausblenden",
"text.autoconfig.skyblocker.option.messages.hideImplosion": "Implosionsmeldung ausblenden",
"text.autoconfig.skyblocker.option.messages.hideMoltenWave": "Nachricht über Molten Wave ausblenden",
"text.autoconfig.skyblocker.option.messages.hideAds": "Werbung im öffentlichen Chat ausblenden"
}
12 changes: 8 additions & 4 deletions src/main/resources/assets/skyblocker/lang/ru_ru.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
{
"key.categories.skyblocker": "Skyblocker",
"key.hotbarSlotLock": "Блокировка слота (хотбар)",
"key.hotbarSlotLock": "Блокировка слотов (Хотбар)",

"text.autoconfig.skyblocker.title": "Настройки Skyblocker",

"text.autoconfig.skyblocker.category.general": "Основные",
"text.autoconfig.skyblocker.option.general.apiKey": "Hypixel API-ключ (В РАЗРАБОТКЕ)",
"text.autoconfig.skyblocker.option.general.bars": "Бары здоровья, маны, защиты, опыта",
"text.autoconfig.skyblocker.option.general.apiKey": "Hypixel API-ключ ( в разработке)",
"text.autoconfig.skyblocker.option.general.bars": " Бары здоровья, маны, защиты и XP",
"text.autoconfig.skyblocker.option.general.bars.enableBars": "Включить бары",

"text.autoconfig.skyblocker.category.locations": "Локации",
"text.autoconfig.skyblocker.option.locations.dungeons": "Подземелья",
"text.autoconfig.skyblocker.option.locations.dungeons.enableMap": "Включить карту",
"text.autoconfig.skyblocker.option.locations.dungeons.solveThreeWeirdos": "Решить загадку \"Три чудака\"",
"text.autoconfig.skyblocker.option.locations.dungeons.blazesolver": "Решить головоломку Блейза",
"text.autoconfig.skyblocker.option.locations.dungeons.solveTrivia": "Решить головоломку Тривия",
"text.autoconfig.skyblocker.option.locations.dwarvenMines": "Гномьи шахты",
"text.autoconfig.skyblocker.option.locations.dwarvenMines.enableDrillFuel": "Включить топливо дрели",
"text.autoconfig.skyblocker.option.locations.dwarvenMines.solveFetchur": "Solve Fetchur",
"text.autoconfig.skyblocker.option.locations.dwarvenMines.solvePuzzler": "Решить загадку \"Puzzler\"",

"text.autoconfig.skyblocker.category.messages": "Сообщения",
"text.autoconfig.skyblocker.option.messages.hideAbility": "Скрыть откат способностей",
"text.autoconfig.skyblocker.option.messages.hideHeal": "Скрыть сообщения об исцелении",
"text.autoconfig.skyblocker.option.messages.hideAOTE": "Скрыть сообщения от \"AOTE\"",
"text.autoconfig.skyblocker.option.messages.hideImplosion": "Скрыть сообщение \"Implosion\"",
"text.autoconfig.skyblocker.option.messages.hideMoltenWave": "Скрыть сообщение \"Molten Wave\""
"text.autoconfig.skyblocker.option.messages.hideMoltenWave": "Скрыть сообщение \"Molten Wave\"",
"text.autoconfig.skyblocker.option.messages.hideAds": "Скрывать рекламу из публичного чата"
}

0 comments on commit 7314235

Please sign in to comment.