Skip to content

Commit

Permalink
1.21.4 project and misc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterCheezeCake committed Dec 10, 2024
1 parent c8bfb91 commit 01b35d3
Show file tree
Hide file tree
Showing 26 changed files with 313 additions and 126 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("fabric-loom") version "1.8-SNAPSHOT"
id("fabric-loom") version "1.9-SNAPSHOT"
id("maven-publish")
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ stonecutter {
centralScript = "build.gradle.kts"

create(rootProject) {
versions("1.21.1", "1.21.3")
versions("1.21.1", "1.21.3", "1.21.4")
vcsVersion = "1.21.3"
}
}
9 changes: 6 additions & 3 deletions src/main/java/wtf/cheeze/sbt/command/CommandUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.text.Text;
import wtf.cheeze.sbt.utils.enums.Crops;
import wtf.cheeze.sbt.utils.enums.Rarity;
import wtf.cheeze.sbt.utils.enums.Slayers;
import wtf.cheeze.sbt.utils.skyblock.SkyblockConstants;

import java.util.function.Supplier;
Expand All @@ -48,7 +51,7 @@ public static SuggestionProvider<FabricClientCommandSource> getArrayAsSuggestion
};
}

static int[] getCalcPetTable(SkyblockConstants.Rarity rarity) {
static int[] getCalcPetTable(Rarity rarity) {
return switch (rarity) {
case COMMON -> SkyblockConstants.PET_LEVELS_COMMON;
case UNCOMMON -> SkyblockConstants.PET_LEVELS_UNCOMMON;
Expand All @@ -59,7 +62,7 @@ static int[] getCalcPetTable(SkyblockConstants.Rarity rarity) {
};
}

static int[] getCalcSlayerTable(SkyblockConstants.Slayers slayer) {
static int[] getCalcSlayerTable(Slayers slayer) {
return switch (slayer) {
case ZOMBIE -> SkyblockConstants.SLAYER_LEVELS_ZOMBIE;
case SPIDER -> SkyblockConstants.SLAYER_LEVELS_SPIDER;
Expand All @@ -68,7 +71,7 @@ static int[] getCalcSlayerTable(SkyblockConstants.Slayers slayer) {
};
}

static int[] getCalcCropTable(SkyblockConstants.Crops crop) {
static int[] getCalcCropTable(Crops crop) {
return switch (crop) {
case WHEAT, PUMPKIN, MUSHROOM -> SkyblockConstants.CROP_LEVELS_WPMS;
case CARROT, POTATO -> SkyblockConstants.CROP_LEVELS_CP;
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/wtf/cheeze/sbt/command/SBTCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
import wtf.cheeze.sbt.features.CalcPowder;
import wtf.cheeze.sbt.features.chat.PartyFeatures;
import wtf.cheeze.sbt.utils.NumberUtils;
import wtf.cheeze.sbt.utils.enums.Rarity;
import wtf.cheeze.sbt.utils.enums.Slayers;
import wtf.cheeze.sbt.utils.skyblock.SkyblockConstants;
import wtf.cheeze.sbt.utils.skyblock.SkyblockUtils;
import wtf.cheeze.sbt.hud.HudScreen;
Expand Down Expand Up @@ -84,7 +86,7 @@ public class SBTCommand {
}
var levelStart = IntegerArgumentType.getInteger(context, "level-start");
var levelEnd = IntegerArgumentType.getInteger(context, "level-end");
var cap = slayer == SkyblockConstants.Slayers.VAMPIRE ? 5 : 9;
var cap = slayer == Slayers.VAMPIRE ? 5 : 9;

if (levelStart > levelEnd || levelEnd < 0 || levelStart < 0 || levelStart > cap || levelEnd > cap) {
context.getSource().sendFeedback(Text.of(PREFIX + " §cInvalid arguments"));
Expand Down Expand Up @@ -140,7 +142,7 @@ public class SBTCommand {
var levelStart = IntegerArgumentType.getInteger(context, "level-start");
var levelEnd = IntegerArgumentType.getInteger(context, "level-end");

var cap = (rarity == SkyblockConstants.Rarity.LEGENDARY || rarity == SkyblockConstants.Rarity.MYTHIC) ? 200 : 100;
var cap = (rarity == Rarity.LEGENDARY || rarity == Rarity.MYTHIC) ? 200 : 100;


if (levelStart < 0 || levelEnd < 0 || levelStart > cap || levelEnd > cap || levelStart >= levelEnd) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/wtf/cheeze/sbt/config/SBTConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import java.nio.file.Path;


public class SBTConfig {
public class SBTConfig {

public static final Path PATH = FabricLoader.getInstance().getConfigDir().resolve("skyblocktweaks-config.json");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
*/
package wtf.cheeze.sbt.config.persistent;

import wtf.cheeze.sbt.utils.skyblock.SkyblockConstants;
import wtf.cheeze.sbt.utils.enums.Skills;

import java.util.EnumMap;

public class ProfileData {
public EnumMap<SkyblockConstants.Skills, Integer> skillLevels = new EnumMap<>(SkyblockConstants.Skills.class);
public EnumMap<Skills, Integer> skillLevels = new EnumMap<>(Skills.class);
}
2 changes: 1 addition & 1 deletion src/main/java/wtf/cheeze/sbt/features/CalcPowder.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import java.util.Map;

import static wtf.cheeze.sbt.utils.skyblock.SkyblockConstants.Powder;
import wtf.cheeze.sbt.utils.enums.Powder;

/**
* This lives in its own class instead of SkyblockConstants because it has its own complex logic
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/wtf/cheeze/sbt/features/huds/QuiverHUD.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Copyright (C) 2024 MisterCheezeCake
*
* This file is part of SkyblockTweaks.
*
* SkyblockTweaks is free software: you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* SkyblockTweaks is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with SkyblockTweaks. If not, see <https://www.gnu.org/licenses/>.
*/
package wtf.cheeze.sbt.features.huds;

import dev.isxander.yacl3.api.Option;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import wtf.cheeze.sbt.hud.utils.HudInformation;
import wtf.cheeze.sbt.hud.components.SingleHudLine;
import wtf.cheeze.sbt.hud.bases.TextHUD;
import wtf.cheeze.sbt.utils.enums.Skills;
import wtf.cheeze.sbt.utils.render.Colors;
import wtf.cheeze.sbt.utils.skyblock.IconDict;
import wtf.cheeze.sbt.utils.skyblock.SkyblockConstants;
Expand Down Expand Up @@ -65,7 +66,7 @@ private SkillHUDManager() {
private static final int PERSIST_TICKS = 60;

private int timeLeft = 0;
private SkyblockConstants.Skills currentSkill = SkyblockConstants.Skills.UNKNOWN;
private Skills currentSkill = Skills.UNKNOWN;
private float gained = 0;
private float total = 0;
private float progress = 0;
Expand Down Expand Up @@ -171,13 +172,13 @@ public SkillHUD() {
);
}

private static int tryAndGetSkillLevel(SkyblockConstants.Skills skill) {
private static int tryAndGetSkillLevel(Skills skill) {
var profile = SkyblockTweaks.PD.profiles.get(SkyblockTweaks.DATA.getCurrentProfileUnique());
if (profile == null) return -1;
return profile.skillLevels.getOrDefault(skill, -1);
}

private static int[] getSkillTable(SkyblockConstants.Skills skill) {
private static int[] getSkillTable(Skills skill) {
return switch (skill) {
case FARMING, FISHING, FORAGING, MINING, COMBAT, ENCHANTING, ALCHEMY, TAMING, CARPENTRY, UNKNOWN ->
SkyblockConstants.SKILL_LEVELS;
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/wtf/cheeze/sbt/hud/utils/DrawMode.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
import wtf.cheeze.sbt.utils.TextUtils;

public enum DrawMode implements NameableEnum {
PURE, SHADOW, OUTLINE;
PURE,
SHADOW,
OUTLINE;

@Override
public Text getDisplayName() {
Expand Down
32 changes: 32 additions & 0 deletions src/main/java/wtf/cheeze/sbt/utils/enums/Crops.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (C) 2024 MisterCheezeCake
*
* This file is part of SkyblockTweaks.
*
* SkyblockTweaks is free software: you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* SkyblockTweaks is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with SkyblockTweaks. If not, see <https://www.gnu.org/licenses/>.
*/
package wtf.cheeze.sbt.utils.enums;

public enum Crops {
WHEAT,
CARROT,
POTATO,
MELON,
PUMPKIN,
SUGAR_CANE,
COCOA_BEANS,
CACTUS,
MUSHROOM,
NETHER_WART
}
60 changes: 60 additions & 0 deletions src/main/java/wtf/cheeze/sbt/utils/enums/Location.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Copyright (C) 2024 MisterCheezeCake
*
* This file is part of SkyblockTweaks.
*
* SkyblockTweaks is free software: you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* SkyblockTweaks is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with SkyblockTweaks. If not, see <https://www.gnu.org/licenses/>.
*/
package wtf.cheeze.sbt.utils.enums;

// Inspired by Skyblocker's Location enum
public enum Location {
PRIVATE_ISLAND("dynamic", "Private Location"),
GARDEN("garden", "The Garden"),
HUB("hub", "The Hub"),
FARMING("farming_1", "The Barn"),
PARK("foraging_1", "The Park"),
SPIDERS_DEN("combat_1", "The Spider's Den"),
END("combat_3", "The End"),
CRIMSON_ISLE("crimson_isle", "The Crimson Isle"),
GOLD_MINE("mining_1", "The Gold Mine"),
DEEP_CAVERNS("mining_2", "The Deep Caverns"),
DWARVEN_MINES("mining_3", "The Dwarven Mines"),
CRYSTAL_HOLLOWS("crystal_hollows", "The Crystal Hollows"),
GLACITE_MINESHAFT("mineshaft", "Glacite Mineshaft"),
DUNGEON_HUB("dungeon_hub", "The Dungeon Hub"),
JERRYS_WORKSHOP("winter", "Jerry's Workshop"),
RIFT("rift", "The Rift"),
DARK_AUCTION("dark_auction", "The Dark Auction"),
DUNGEON("dungeon", "Dungeons"),
KUUDRA("kuudra", "Kuudra"),
UNKNOWN("unknown", "Unknown Location");

Location(String mode, String name) {
this.mode = mode;
this.name = name;
}

;
private final String mode;
private final String name;

public String getMode() {
return mode;
}

public String getName() {
return name;
}
}
29 changes: 29 additions & 0 deletions src/main/java/wtf/cheeze/sbt/utils/enums/Powder.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (C) 2024 MisterCheezeCake
*
* This file is part of SkyblockTweaks.
*
* SkyblockTweaks is free software: you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* SkyblockTweaks is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with SkyblockTweaks. If not, see <https://www.gnu.org/licenses/>.
*/
package wtf.cheeze.sbt.utils.enums;

public enum Powder {
MITHRIL,
GEMSTONE,
GLACITE;

public String getDisplayName() {
return name().substring(0, 1).toUpperCase() + name().substring(1).toLowerCase();
}
}
32 changes: 32 additions & 0 deletions src/main/java/wtf/cheeze/sbt/utils/enums/Rarity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (C) 2024 MisterCheezeCake
*
* This file is part of SkyblockTweaks.
*
* SkyblockTweaks is free software: you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* SkyblockTweaks is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with SkyblockTweaks. If not, see <https://www.gnu.org/licenses/>.
*/
package wtf.cheeze.sbt.utils.enums;

public enum Rarity {
COMMON,
UNCOMMON,
RARE,
EPIC,
LEGENDARY,
MYTHIC,
DIVINE,
SPECIAL,
VERY_SPECIAL,
ULTIMATE
}
38 changes: 38 additions & 0 deletions src/main/java/wtf/cheeze/sbt/utils/enums/Skills.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright (C) 2024 MisterCheezeCake
*
* This file is part of SkyblockTweaks.
*
* SkyblockTweaks is free software: you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* SkyblockTweaks is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with SkyblockTweaks. If not, see <https://www.gnu.org/licenses/>.
*/
package wtf.cheeze.sbt.utils.enums;

/**
* Skills
* Unknown is used rather than null when no skill is known to prevent NPEs
*/
public enum Skills {
COMBAT,
MINING,
FARMING,
FORAGING,
FISHING,
ENCHANTING,
ALCHEMY,
TAMING,
CARPENTRY,
RUNECRAFTING,
SOCIAL,
UNKNOWN
}
Loading

0 comments on commit 01b35d3

Please sign in to comment.