This commit is contained in:
parent
11f416ba0b
commit
fc720a6541
32
build.gradle
32
build.gradle
|
@ -1,6 +1,5 @@
|
|||
plugins {
|
||||
id 'fabric-loom' version '1.2-SNAPSHOT'
|
||||
id 'maven-publish'
|
||||
}
|
||||
|
||||
version = "${project.mod_version}+${project.minecraft_version}"
|
||||
|
@ -12,6 +11,8 @@ repositories {
|
|||
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
|
||||
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
|
||||
// for more information about repositories.
|
||||
maven { url "https://maven.terraformersmc.com/releases" }
|
||||
maven { url "https://maven.shedaniel.me/" }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -19,6 +20,12 @@ dependencies {
|
|||
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
|
||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||
|
||||
modImplementation("me.shedaniel.cloth:cloth-config-fabric:${project.clothconfig_version}") {
|
||||
exclude group: "net.fabricmc.fabric-api"
|
||||
exclude module: "modmenu"
|
||||
}
|
||||
include "me.shedaniel.cloth:cloth-config-fabric:${project.clothconfig_version}"
|
||||
|
||||
// Fabric API. This is technically optional, but you probably want it anyway.
|
||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
||||
}
|
||||
|
@ -36,12 +43,6 @@ processResources {
|
|||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
// ensure that the encoding is set to UTF-8, no matter what the system default is
|
||||
// this fixes some edge cases with special characters not displaying correctly
|
||||
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
|
||||
// If Javadoc is generated, this must be specified in that task too.
|
||||
|
||||
|
||||
// Minecraft 1.18 upwards uses Java 17.
|
||||
it.options.release = 17
|
||||
}
|
||||
|
@ -61,20 +62,3 @@ jar {
|
|||
rename { "${it}_${base.archivesName.get()}"}
|
||||
}
|
||||
}
|
||||
|
||||
// configure the maven publication
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
|
||||
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
|
||||
repositories {
|
||||
// Add repositories to publish to here.
|
||||
// Notice: This block does NOT have the same function as the block in the top level.
|
||||
// The repositories here will be used for publishing your artifact, not for
|
||||
// retrieving dependencies.
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
# Done to increase the memory available to gradle.
|
||||
org.gradle.jvmargs=-Xmx1G
|
||||
org.gradle.jvmargs=-Xmx4G
|
||||
org.gradle.parallel=true
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/develop
|
||||
minecraft_version=1.19.4
|
||||
yarn_mappings=1.19.4+build.2
|
||||
loader_version=0.14.20
|
||||
loader_version=0.14.21
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.0.0
|
||||
|
@ -14,4 +14,5 @@ maven_group = lel.flummi
|
|||
archives_base_name = skilloverlay
|
||||
|
||||
# Dependencies
|
||||
fabric_version=0.79.0+1.19.4
|
||||
fabric_version=0.83.0+1.19.4
|
||||
clothconfig_version=10.0.96
|
||||
|
|
92
gradlew.bat
vendored
Normal file
92
gradlew.bat
vendored
Normal file
|
@ -0,0 +1,92 @@
|
|||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
|
@ -2,51 +2,50 @@ package lel.flummi.skilloverlay.api;
|
|||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
import lel.flummi.skilloverlay.api.records.PlayerProfiles;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URL;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URL;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import lel.flummi.skilloverlay.api.records.Profile;
|
||||
import lel.flummi.skilloverlay.api.records.Profile.Profiles.Member;
|
||||
import lel.flummi.skilloverlay.config.skilloverlayconfig;
|
||||
|
||||
public class PlayerProfile {
|
||||
public static PlayerProfiles.PlayerProfile PROFILE;
|
||||
public static Member PROFILE;
|
||||
|
||||
public static void init() {
|
||||
Timer timer = new Timer();
|
||||
timer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
PlayerProfiles profiles = PlayerProfile.updateProfile();
|
||||
String apikey = skilloverlayconfig.get().general.apiKey;
|
||||
String uuid = MinecraftClient.getInstance().getSession().getUuidOrNull().toString().replace("-", "");
|
||||
String apiurl = "https://api.hypixel.net/skyblock/profiles?key=" + apikey + "&uuid=" + uuid;
|
||||
|
||||
PlayerProfiles.PlayerProfile currentProfile = profiles.profiles().get("");
|
||||
|
||||
for (PlayerProfiles.PlayerProfile profile: profiles.profiles().values()) {
|
||||
if(profile.current() == true) {
|
||||
currentProfile = profile;
|
||||
}
|
||||
}
|
||||
|
||||
PROFILE = currentProfile;
|
||||
if(apikey.length() > 0) {
|
||||
Profile profile = PlayerProfile.updateProfile(apiurl);
|
||||
if(profile != null) {
|
||||
profile.profiles().removeIf(p -> !p.selected());
|
||||
PROFILE = profile.profiles().get(0).members().get(uuid);
|
||||
}
|
||||
}, 0, 60 * 1000);
|
||||
else {
|
||||
System.out.println("leer uff");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static PlayerProfiles updateProfile() {
|
||||
public static Profile updateProfile(String apiurl) {
|
||||
if(apiurl.length() == 0)
|
||||
return null;
|
||||
|
||||
try {
|
||||
URL url = new URL("https://sky.shiiyu.moe/api/v2/profile/" + MinecraftClient.getInstance().getSession().getUsername());
|
||||
URL url = new URL(apiurl);
|
||||
InputStreamReader reader = new InputStreamReader(url.openStream());
|
||||
Gson gson = new GsonBuilder()
|
||||
.serializeNulls()
|
||||
.create();
|
||||
return gson.fromJson(reader, PlayerProfiles.class);
|
||||
return gson.fromJson(reader, Profile.class);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
package lel.flummi.skilloverlay.api.records;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public record Enchanting(boolean experimented, HashMap<String, Experiment> experiments){
|
||||
public record Experiment(
|
||||
String name,
|
||||
Stats stats,
|
||||
Tier[] tiers
|
||||
|
||||
){
|
||||
public record Stats(
|
||||
@SerializedName("last_attempt") PlayerProfiles.PlayerProfile.Data.LastUpdated lastAttempt,
|
||||
@SerializedName("bonus_clicks") int bonusClicks,
|
||||
@SerializedName("last_claimed") PlayerProfiles.PlayerProfile.Data.LastUpdated lastClaimed
|
||||
){}
|
||||
public record Tier(
|
||||
String name,
|
||||
int attempts,
|
||||
int claims,
|
||||
@SerializedName("best_score") int bestScore
|
||||
){}
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
package lel.flummi.skilloverlay.api.records;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public record Farming(
|
||||
boolean talked,
|
||||
@SerializedName("current_badges") Badges currentBadges,
|
||||
@SerializedName("total_badges") Badges totalBadges,
|
||||
Perks perks,
|
||||
@SerializedName("unique_golds") int unique_golds,
|
||||
HashMap<String, Crop> crops,
|
||||
Contests contests
|
||||
){
|
||||
public record Badges(int bronze, int silver, int gold){}
|
||||
public record Perks(@SerializedName("double_drops") int doubleDrops, @SerializedName("farming_level_cap") int farmingLevelCap){}
|
||||
public record Crop(
|
||||
String name,
|
||||
boolean attended,
|
||||
@SerializedName("unique_gold") boolean uniqueGold,
|
||||
int contests,
|
||||
@SerializedName("personal_best") int personalBest,
|
||||
Badges badges
|
||||
){}
|
||||
public record Contests(@SerializedName("attended_contests") int attendedContests, @SerializedName("all_contests") Contest[] allContests){}
|
||||
public record Contest(String date, String crop, int collected, boolean claimed, String medal, Placing placing){
|
||||
public record Placing(int position, double percentage){}
|
||||
}
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
package lel.flummi.skilloverlay.api.records;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public record Items(
|
||||
Item[] armor,
|
||||
Item[][] wardrobe,
|
||||
Item[] inventory,
|
||||
Item[] enderchest,
|
||||
@SerializedName("talisman_bag") Item[] talismanBag,
|
||||
@SerializedName("fishing_bag") Item[] fishingBag,
|
||||
Item[] quiver,
|
||||
@SerializedName("potion_bag") Item[] potionBag,
|
||||
@SerializedName("personal_vault") Item[] personalVault,
|
||||
Item[] storage,
|
||||
Item[] weapons,
|
||||
Item[] hoes,
|
||||
Item[] pickaxes,
|
||||
Item[] rods,
|
||||
@SerializedName("highest_rarity_sword") Item highestRaritySword,
|
||||
@SerializedName("highest_rarity_bow") Item highestRarityBow,
|
||||
@SerializedName("highest_rarity_rod") Item highestRarityRod,
|
||||
@SerializedName("armor_set_rarity") String armorSetRarity
|
||||
){
|
||||
public record Item(
|
||||
@SerializedName("Count") byte count,
|
||||
int damage,
|
||||
Tag tag,
|
||||
boolean isInactive,
|
||||
boolean inBackpack,
|
||||
Item[] containsItems
|
||||
){
|
||||
public record Tag(
|
||||
@SerializedName("ExtraAttributes") ExtraAttributes extraAttributes,
|
||||
Display display,
|
||||
@SerializedName("SkullOwner") SkullOwner skullOwner,
|
||||
Enchant[] ench
|
||||
){
|
||||
public record ExtraAttributes(String id, HashMap<String, Integer> enchantments){}
|
||||
public record Display(@SerializedName("Name") String name, @SerializedName("Lore") String[] lore, Integer color){}
|
||||
public record SkullOwner(
|
||||
@SerializedName("Id") String id,
|
||||
@SerializedName("Properties") Properties properties
|
||||
){
|
||||
public record Properties(HashMap<String, String>[] textures){}
|
||||
}
|
||||
public record Enchant(int lvl, int id){}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,164 +0,0 @@
|
|||
package lel.flummi.skilloverlay.api.records;
|
||||
|
||||
import lel.flummi.skilloverlay.api.records.dungeons.Dungeons;
|
||||
import lel.flummi.skilloverlay.api.records.mining.Mining;
|
||||
import lel.flummi.skilloverlay.api.records.misc.Misc;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import java.util.HashMap;
|
||||
|
||||
public record PlayerProfiles(HashMap<String, PlayerProfile> profiles) {
|
||||
public record PlayerProfile(
|
||||
@SerializedName("profile_id") String profileId,
|
||||
@SerializedName("cute_name") String cuteName,
|
||||
boolean current,
|
||||
@SerializedName("last_save") long lastSave,
|
||||
Items items,
|
||||
Data data) {
|
||||
public record Data(
|
||||
Stats stats,
|
||||
@SerializedName("fairy_bonus") Stats fairyBonus,
|
||||
@SerializedName("fairy_souls") FairySouls fairySouls,
|
||||
@SerializedName("levels") HashMap<String, Level> skills,
|
||||
@SerializedName("average_level") double averageLevel,
|
||||
@SerializedName("average_level_no_progress") double trueAverageLevel,
|
||||
@SerializedName("total_skill_xp") double totalSkillXp,
|
||||
@SerializedName("skill_bonus") HashMap<String, Stats> skillBonus,
|
||||
@SerializedName("average_level_rank") double averageLevelRank,
|
||||
@SerializedName("slayer_coins_spent") HashMap<String, Integer> slayerCoinsSpent,
|
||||
@SerializedName("slayer_bonus") HashMap<String, Stats> slayerBonus,
|
||||
HashMap<String, Slayer> slayers,
|
||||
@SerializedName("slayer_xp") int slayerXp,
|
||||
@SerializedName("display_name") String username,
|
||||
String uuid,
|
||||
double bank,
|
||||
double purse,
|
||||
@SerializedName("current_area") String currentArea,
|
||||
Entity[] kills,
|
||||
Entity[] deaths,
|
||||
@SerializedName("wardrobe_equipped_slot") int wardrobeEquippedSlot,
|
||||
@SerializedName("skin_data") SkinData skinData,
|
||||
Profile profile,
|
||||
Member[] members,
|
||||
Minion[] minions,
|
||||
@SerializedName("minion_slots") MinionSlots minionSlots,
|
||||
HashMap<String, Collection> collections,
|
||||
Social social,
|
||||
Dungeons dungeons,
|
||||
Fishing fishing,
|
||||
Farming farming,
|
||||
Enchanting Enchanting,
|
||||
Mining mining,
|
||||
Misc misc,
|
||||
@SerializedName("auctions_bought") Auctions auctionsBought,
|
||||
@SerializedName("auctions_sold") Auctions auctionsSold,
|
||||
@SerializedName("last_updated") LastUpdated lastUpdated,
|
||||
@SerializedName("first_join") LastUpdated firstJoin
|
||||
) {
|
||||
public record Stats(
|
||||
int health,
|
||||
int defense,
|
||||
@SerializedName("effective_health") int effectiveHealth,
|
||||
int strength,
|
||||
int speed,
|
||||
@SerializedName("crit_chance") double critChance,
|
||||
@SerializedName("crit_damage") int critDamage,
|
||||
@SerializedName("bonus_attack_speed") int bonusAttackSpeed,
|
||||
int intelligence,
|
||||
@SerializedName("sea_creature_chance") int seaCreatureChance,
|
||||
@SerializedName("magic_find") int magicFind,
|
||||
@SerializedName("pet_luck") int petLuck,
|
||||
int ferocity,
|
||||
@SerializedName("ability_damage") double abilityDamage,
|
||||
@SerializedName("mining_speed") int miningSpeed,
|
||||
@SerializedName("mining_fortune") int miningFortune,
|
||||
@SerializedName("farming_fortune") int farmingFortune,
|
||||
@SerializedName("foraging_fortune") int foragingFortune,
|
||||
int pristine,
|
||||
int damage,
|
||||
@SerializedName("damage_increase") double damageIncrease) {
|
||||
}
|
||||
|
||||
public record FairySouls(int collected, int total, double progress) {
|
||||
}
|
||||
|
||||
public record Level(
|
||||
Double xp,
|
||||
Integer level,
|
||||
Integer maxLevel,
|
||||
Long xpCurrent,
|
||||
Integer xpForNext,
|
||||
Double progress,
|
||||
Integer levelCap,
|
||||
Integer uncappedLevel,
|
||||
Integer rank,
|
||||
Double levelWithProgress,
|
||||
Double unlockableLevelWithProgress) {
|
||||
}
|
||||
|
||||
public record Entity(String type, String entityId, int amount, String entityName) {
|
||||
}
|
||||
|
||||
public record SkinData(@SerializedName("skinurl") String skinUrl, String model) {
|
||||
}
|
||||
|
||||
public record Profile(String gamemode) {
|
||||
}
|
||||
|
||||
public record Member(
|
||||
String uuid,
|
||||
@SerializedName("display_name") String displayName,
|
||||
@SerializedName("last_updated") LastUpdated lastUpdated,
|
||||
@SerializedName("skin_data") SkinData skinData) {
|
||||
}
|
||||
|
||||
public record LastUpdated(long unix, String text) {
|
||||
}
|
||||
|
||||
public record Minion(
|
||||
String id,
|
||||
String type,
|
||||
int tiers,
|
||||
String name,
|
||||
Integer[] levels
|
||||
|
||||
) {
|
||||
}
|
||||
|
||||
public record MinionSlots(int currentSlots, int toNext, int toNextSlot) {
|
||||
}
|
||||
|
||||
public record Collection(int tier, long amount, long totalAmount, UserAmount[] amounts) {
|
||||
public record UserAmount(String username, long amount) {
|
||||
}
|
||||
}
|
||||
|
||||
public record Social(
|
||||
@SerializedName("DISCORD") String discord,
|
||||
@SerializedName("HYPIXEL") String hypixel,
|
||||
@SerializedName("TWITTER") String twitter,
|
||||
@SerializedName("YOUTUBE") String youtube,
|
||||
@SerializedName("INSTAGRAM") String instagram,
|
||||
@SerializedName("TWITCH") String twitch) {
|
||||
}
|
||||
|
||||
public record Fishing(
|
||||
int total,
|
||||
int treasure,
|
||||
@SerializedName("treasure_large") int treasureLarge,
|
||||
@SerializedName("shredder_fished") int shredderFished,
|
||||
@SerializedName("shredder_bait") int shredderBait) {
|
||||
}
|
||||
|
||||
public record Auctions(
|
||||
int uncommon,
|
||||
int rare,
|
||||
int epic,
|
||||
int common,
|
||||
int legendary,
|
||||
int special) {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package lel.flummi.skilloverlay.api.records;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public record Profile(
|
||||
boolean success,
|
||||
List<Profiles> profiles
|
||||
) {
|
||||
public record Profiles(
|
||||
@SerializedName("profile_id") String profileId,
|
||||
@SerializedName("last_save") long lastSave,
|
||||
HashMap<String, Member> members,
|
||||
boolean selected
|
||||
) {
|
||||
public record Member(
|
||||
double experience_skill_farming
|
||||
){}
|
||||
}
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
package lel.flummi.skilloverlay.api.records;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public record Slayer(
|
||||
PlayerProfiles.PlayerProfile.Data.Level level,
|
||||
Kills kills,
|
||||
@SerializedName("claimed_levels") ClaimedLevels claimedLevels,
|
||||
int xp,
|
||||
@SerializedName("boss_kills_tier_0") int bossKillsTier0,
|
||||
@SerializedName("boss_kills_tier_1") int bossKillsTier1,
|
||||
@SerializedName("boss_kills_tier_2") int bossKillsTier2,
|
||||
@SerializedName("boss_kills_tier_3") int bossKillsTier3
|
||||
){
|
||||
public record Kills(@Nullable HashMap<String, Integer> kills){}
|
||||
public record ClaimedLevels(
|
||||
@SerializedName("level_1") boolean level1,
|
||||
@SerializedName("level_2") boolean level2,
|
||||
@SerializedName("level_3") boolean level3,
|
||||
@SerializedName("level_4") boolean level4,
|
||||
@SerializedName("level_5") boolean level5,
|
||||
@SerializedName("level_6") boolean level6,
|
||||
@SerializedName("level_7_special") boolean level7
|
||||
){}
|
||||
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
package lel.flummi.skilloverlay.api.records.dungeons;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lel.flummi.skilloverlay.api.records.PlayerProfiles;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public record Dungeons(
|
||||
Dungeon catacombs,
|
||||
@SerializedName("master_catacombs") Dungeon masterCatacombs,
|
||||
HashMap<String, Class> classes,
|
||||
@SerializedName("used_classes") boolean usedClasses,
|
||||
@SerializedName("selected_class") String selectedClass,
|
||||
@SerializedName("secrets_found") int secretsFound,
|
||||
HashMap<String, Integer> essence,
|
||||
@SerializedName("unlocked_collections") boolean unlockedCollections,
|
||||
@SerializedName("boss_collections") HashMap<String, Collection> bossCollections
|
||||
//Journals journals
|
||||
|
||||
){
|
||||
public record Dungeon(
|
||||
String id,
|
||||
boolean visited,
|
||||
PlayerProfiles.PlayerProfile.Data.Level level,
|
||||
@SerializedName("highest_floor") String highestFloor,
|
||||
HashMap<Integer, Floor> floors
|
||||
|
||||
){}
|
||||
public record Collection(
|
||||
String name,
|
||||
String texture,
|
||||
int tier,
|
||||
boolean maxed,
|
||||
int killed,
|
||||
HashMap<String, Integer> floors,
|
||||
int unclaimed,
|
||||
String[] claimed
|
||||
){}
|
||||
public record Class(PlayerProfiles.PlayerProfile.Data.Level experience, boolean current){}
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
package lel.flummi.skilloverlay.api.records.dungeons;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public record Floor(
|
||||
String name,
|
||||
Stats stats,
|
||||
@SerializedName("most_damage") MostDamage mostDamage,
|
||||
Bonuses bonuses
|
||||
|
||||
){
|
||||
public record Stats(
|
||||
@SerializedName("times_played") int timesPlayed,
|
||||
@SerializedName("best_score") int bestScore,
|
||||
@SerializedName("mobs_killed") int mobsKilled,
|
||||
@SerializedName("most_mobs_killed") int mostMobsKilled,
|
||||
@SerializedName("most_healing") double mostHealing,
|
||||
@SerializedName("tier_completions") int tierCompletions,
|
||||
@SerializedName("fastest_time") long fastestTime,
|
||||
@SerializedName("watcher_kills") int watcherKills,
|
||||
@SerializedName("best_runs") Run[] bestRuns
|
||||
){}
|
||||
public record MostDamage(
|
||||
@SerializedName("class") String classUsed,
|
||||
@SerializedName("value") double damage
|
||||
){}
|
||||
public record Run(
|
||||
long timestamp,
|
||||
@SerializedName("score_exploration") int scoreExploration,
|
||||
@SerializedName("score_speed") int scoreSpeed,
|
||||
@SerializedName("score_skill") int scoreSkill,
|
||||
@SerializedName("score_bonus") int scoreBonus,
|
||||
@SerializedName("dungeon_class") int dungeonClass,
|
||||
String[] teammates,
|
||||
@SerializedName("elapsed_time") long elapsedTime,
|
||||
@SerializedName("damaged_dealt") int damageDealt,
|
||||
int deaths,
|
||||
@SerializedName("mobs_killed") int mobsKilled,
|
||||
@SerializedName("secrets_found") int secretsFound,
|
||||
@SerializedName("damage_mitigated") double damageMitigated,
|
||||
@SerializedName("ally_healing") int allyHealing
|
||||
){}
|
||||
public record Bonuses(@SerializedName("item_boost") int itemBoost){}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package lel.flummi.skilloverlay.api.records.dungeons;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public record Journals(
|
||||
@SerializedName("pages_completed") int pagesCompleted,
|
||||
@SerializedName("journals_completed") int journalsCompleted,
|
||||
@SerializedName("total_pages") Integer totalPages,
|
||||
boolean maxed,
|
||||
@SerializedName("journal_entries") Entry[] journalEntries
|
||||
|
||||
){
|
||||
public record Entry(
|
||||
String name,
|
||||
@SerializedName("pages_collected") int pagesCollected,
|
||||
@SerializedName("total_pages") Integer totalPages
|
||||
){}
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
package lel.flummi.skilloverlay.api.records.mining;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lel.flummi.skilloverlay.api.records.PlayerProfiles;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public record Core(
|
||||
PlayerProfiles.PlayerProfile.Data.Level tier,
|
||||
Spent tokens,
|
||||
@SerializedName("selected_pickaxe_ability") String selectedMiningAbility,
|
||||
HashMap<String, Spent> powder,
|
||||
@SerializedName("crystal_nucleus") Nucleus crystalNucleus,
|
||||
@SerializedName("daily_ores") DailyOres dailyOres,
|
||||
@SerializedName("hotm_last_reset") long hotmLastReset,
|
||||
@SerializedName("crystal_hollows_last_access") long crystalHollowsLastAccess
|
||||
){
|
||||
public record Spent(int total, int spent, int available){}
|
||||
public record Nucleus(
|
||||
@SerializedName("times_completed") int timesCompleted,
|
||||
HashMap<String, Crystal> crystals,
|
||||
Goblin goblin
|
||||
){
|
||||
public record Crystal(
|
||||
String state,
|
||||
@SerializedName("total_placed") int totalPlaced,
|
||||
@SerializedName("total_found") int totalFound
|
||||
){}
|
||||
public record Goblin(
|
||||
@SerializedName("king_quest_active") boolean kingQuestActive,
|
||||
@SerializedName("king_quest_completed") boolean kingQuestCompleted
|
||||
){}
|
||||
}
|
||||
public record DailyOres(
|
||||
int mined,
|
||||
int day,
|
||||
@SerializedName("daily_ores") HashMap<String, Ore> dailyOres
|
||||
){
|
||||
public record Ore(int day, int count){}
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package lel.flummi.skilloverlay.api.records.mining;
|
||||
|
||||
public record Mining(
|
||||
Commissions commissions,
|
||||
Forge forge,
|
||||
Core core
|
||||
){
|
||||
public record Forge(Process[] processes){
|
||||
public record Process(
|
||||
String id,
|
||||
int slot,
|
||||
long timeFinished,
|
||||
String timeFinishedText,
|
||||
String name
|
||||
){}
|
||||
}
|
||||
public record Commissions(int milestone){}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package lel.flummi.skilloverlay.api.records.misc;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public record Burrows(
|
||||
@SerializedName("dug_next") Rarities dugNext,
|
||||
@SerializedName("dug_combat") Rarities dugCombat,
|
||||
@SerializedName("dug_treasure") Rarities dugTreasure,
|
||||
@SerializedName("chains_complete") Rarities chainsComplete
|
||||
){
|
||||
public record Rarities(
|
||||
int total,
|
||||
@SerializedName("null") int common,
|
||||
int uncommon,
|
||||
int rare,
|
||||
int epic,
|
||||
int legendary
|
||||
){}
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
package lel.flummi.skilloverlay.api.records.misc;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public record Misc(
|
||||
Milestones milestones,
|
||||
Gifts gifts,
|
||||
Winter winter,
|
||||
Dragons dragons,
|
||||
Protector protector,
|
||||
Damage damage,
|
||||
Burrows burrows,
|
||||
ProfileUpgrades profileUpgrades
|
||||
){
|
||||
public record Milestones(
|
||||
@SerializedName("ores_mined") int oresMined,
|
||||
@SerializedName("sea_creatures_killed") int seaCreaturesKilled
|
||||
){}
|
||||
public record Gifts(@SerializedName("gifts_given") int giftsGiven){}
|
||||
public record Winter(
|
||||
@SerializedName("most_winter_snowballs_hit") int mostWinterSnowballsHit,
|
||||
@SerializedName("most_winter_damage_dealt") int mostWinterDamageDealt,
|
||||
@SerializedName("most_winter_magma_damage_dealt") int mostWinterMagmaDamageDealt
|
||||
){}
|
||||
public record Dragons(
|
||||
@SerializedName("ender_crystals_destroyed") int enderCrystalsDestroyed,
|
||||
@SerializedName("last_hits") int lastHits,
|
||||
@SerializedName("deaths") int deaths
|
||||
){}
|
||||
public record Protector(
|
||||
@SerializedName("last_hits") int lastHits,
|
||||
int deaths
|
||||
){}
|
||||
public record Damage(@SerializedName("highest_critical_damage") double highestCriticalDamage){}
|
||||
public record ProfileUpgrades(
|
||||
@SerializedName("island_size") int islandSize,
|
||||
@SerializedName("minion_slots") int minionSlots,
|
||||
@SerializedName("guest_count") int guestCount,
|
||||
@SerializedName("coop_slots") int coopSlots,
|
||||
@SerializedName("coins_allowance") int coinsAllowance
|
||||
){}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package lel.flummi.skilloverlay.config;
|
||||
|
||||
import me.shedaniel.autoconfig.AutoConfig;
|
||||
import me.shedaniel.autoconfig.ConfigData;
|
||||
import me.shedaniel.autoconfig.annotation.Config;
|
||||
import me.shedaniel.autoconfig.annotation.ConfigEntry;
|
||||
import me.shedaniel.autoconfig.serializer.GsonConfigSerializer;
|
||||
|
||||
@Config(name = "skilloverlay")
|
||||
public class skilloverlayconfig implements ConfigData {
|
||||
@ConfigEntry.Category("general")
|
||||
@ConfigEntry.Gui.TransitiveObject
|
||||
public General general = new General();
|
||||
|
||||
public static class General {
|
||||
public String apiKey = "";
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
AutoConfig.register(skilloverlayconfig.class, GsonConfigSerializer::new);
|
||||
}
|
||||
|
||||
public static skilloverlayconfig get() {
|
||||
return AutoConfig.getConfigHolder(skilloverlayconfig.class).getConfig();
|
||||
}
|
||||
}
|
|
@ -8,7 +8,7 @@ import net.minecraft.util.Formatting;
|
|||
import net.minecraft.client.gui.DrawableHelper;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import lel.flummi.skilloverlay.skilloverlay;
|
||||
//import lel.flummi.skilloverlay.skilloverlay;
|
||||
import lel.flummi.skilloverlay.utils.LerpUtils;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
|
|
@ -1,73 +0,0 @@
|
|||
package lel.flummi.skilloverlay.overlays;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawableHelper;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class FarmingOverlay extends DrawableHelper {
|
||||
private MinecraftClient client;
|
||||
private MatrixStack matrixStack;
|
||||
|
||||
public FarmingOverlay() {}
|
||||
|
||||
public void render(MatrixStack matrixStack, MinecraftClient client) {
|
||||
this.matrixStack = matrixStack;
|
||||
this.client = MinecraftClient.getInstance();
|
||||
|
||||
RenderSystem.enableBlend();
|
||||
this.renderOverlay();
|
||||
|
||||
this.client.getProfiler().pop();
|
||||
}
|
||||
|
||||
public void renderOverlay() {
|
||||
ArrayList<String> overlayStringList = new ArrayList<>();
|
||||
|
||||
// Add all the lines to the array
|
||||
overlayStringList.add("Test");
|
||||
|
||||
//Remove empty lines from the array
|
||||
overlayStringList.removeIf(String::isEmpty);
|
||||
|
||||
// Draw HUD
|
||||
int Xcords = 10;
|
||||
int Ycords = 200;
|
||||
|
||||
// Get the longest string in the array
|
||||
int longestString = 0;
|
||||
int BoxWidth = 0;
|
||||
for (String s : overlayStringList) {
|
||||
if (s.length() > longestString) {
|
||||
longestString = s.length();
|
||||
BoxWidth = this.client.textRenderer.getWidth(s);
|
||||
}
|
||||
}
|
||||
|
||||
int lineHeight = this.client.textRenderer.fontHeight + 2;
|
||||
int yAxis = (((this.client.getWindow().getScaledHeight()) - ((lineHeight + 4) * overlayStringList.size())) + (lineHeight + 4)) * (Ycords) / 100;
|
||||
int xAxis = ((this.client.getWindow().getScaledWidth() - 4) - (BoxWidth)) * Xcords / 100;
|
||||
|
||||
// Add Padding to left of the screen
|
||||
if (xAxis <= 4) {
|
||||
xAxis = 4;
|
||||
}
|
||||
|
||||
for (String line : overlayStringList) {
|
||||
int offset = 0;
|
||||
if (Xcords >= 50) {
|
||||
int lineLength = this.client.textRenderer.getWidth(line);
|
||||
offset = (BoxWidth - lineLength);
|
||||
}
|
||||
|
||||
this.client.textRenderer.drawWithShadow(this.matrixStack, line, xAxis + offset, yAxis + 4, 0xFFFFFF);
|
||||
yAxis += lineHeight;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,8 +3,8 @@ package lel.flummi.skilloverlay;
|
|||
import net.fabricmc.api.ModInitializer;
|
||||
|
||||
import lel.flummi.skilloverlay.overlays.FarmingOverlay;
|
||||
|
||||
import lel.flummi.skilloverlay.api.PlayerProfile;
|
||||
import lel.flummi.skilloverlay.config.skilloverlayconfig;
|
||||
|
||||
public class skilloverlay implements ModInitializer {
|
||||
public static FarmingOverlay OVERLAY;
|
||||
|
@ -14,10 +14,9 @@ public class skilloverlay implements ModInitializer {
|
|||
public void onInitialize() {
|
||||
System.out.println("Skilloverlay started.");
|
||||
|
||||
skilloverlayconfig.init();
|
||||
OVERLAY = new FarmingOverlay();
|
||||
|
||||
PlayerProfile.init();
|
||||
|
||||
//System.out.println(profiles.profiles().get("b2255349-d395-4169-9980-3ec0a32b2cfb").data().skills().get("farming").xp());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user