├── .github
└── workflows
│ └── gradle.yml
├── .gitignore
├── LICENSE
├── README.md
├── ThirdPartyProjects.md
├── build.gradle.kts
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── log4j2.xml
├── settings.gradle.kts
└── src
└── main
├── java
├── InstallerFrame.java
└── mrfast
│ └── sbf
│ ├── API
│ └── ItemAbilityAPI.java
│ ├── SkyblockFeatures.java
│ ├── commands
│ ├── ColorTestCommand.java
│ ├── ConfigCommand.java
│ ├── DebugCommand.java
│ ├── DungeonPlayerInfoCommand.java
│ ├── DungeonsCommand.java
│ ├── FakePlayerCommand.java
│ ├── FlipsCommand.java
│ ├── PingCommand.java
│ ├── RepartyCommand.java
│ ├── ShrugCommand.java
│ ├── SkyCommand.java
│ ├── TerminalCommand.java
│ └── pvCommand.java
│ ├── core
│ ├── AuctionUtil.java
│ ├── Config.java
│ ├── ConfigManager.java
│ ├── DataManager.java
│ ├── PricingData.java
│ ├── SkyblockInfo.java
│ ├── SkyblockMobDetector.java
│ └── VersionManager.java
│ ├── events
│ ├── BlockChangeEvent.java
│ ├── ChatEventListener.java
│ ├── CheckRenderEntityEvent.java
│ ├── DrawSignEvent.java
│ ├── GuiContainerEvent.java
│ ├── PacketEvent.java
│ ├── ProfileSwapEvent.java
│ ├── RenderEntityOutlineEvent.java
│ ├── SecondPassedEvent.java
│ ├── SkyblockMobEvent.java
│ ├── SlotClickedEvent.java
│ ├── SocketMessageEvent.java
│ └── UseItemAbilityEvent.java
│ ├── features
│ ├── dungeons
│ │ ├── ChestProfit.java
│ │ ├── DungeonMap.java
│ │ ├── DungeonsFeatures.java
│ │ ├── F2SpawnTimers.java
│ │ ├── FireFreezeHelper.java
│ │ ├── Nametags.java
│ │ ├── PartyFinderFeatures.java
│ │ ├── Reparty.java
│ │ ├── SalvageProtection.java
│ │ ├── ShadowAssasinFeatures.java
│ │ ├── TrashHighlighter.java
│ │ └── solvers
│ │ │ ├── BlazeSolver.java
│ │ │ ├── CreeperSolver.java
│ │ │ ├── LividFinder.java
│ │ │ ├── TeleportPadSolver.java
│ │ │ ├── ThreeWeirdosSolver.java
│ │ │ ├── WaterBoardSolver.java
│ │ │ └── terminals
│ │ │ ├── ClickInOrderSolver.java
│ │ │ ├── ColorPanesSolver.java
│ │ │ ├── CorrectPanes.java
│ │ │ └── StartsWithSolver.java
│ ├── events
│ │ ├── GiftTracker.java
│ │ ├── JerryTimer.java
│ │ ├── MayorJerry.java
│ │ └── MythologicalEvent.java
│ ├── items
│ │ ├── FireFreezeDisplay.java
│ │ ├── FireVeilTimer.java
│ │ ├── GloomlockProtection.java
│ │ ├── HideGlass.java
│ │ └── ItemFeatures.java
│ ├── mining
│ │ ├── CommisionsTracker.java
│ │ ├── CommissionHighlighter.kt
│ │ ├── HighlightCobblestone.java
│ │ ├── MetalDetectorSolver.java
│ │ └── MiningFeatures.java
│ ├── misc
│ │ ├── AuctionFeatures.java
│ │ ├── AutoAuctionFlip.java
│ │ ├── BestiaryHelper.java
│ │ ├── ChronomotronSolver.java
│ │ ├── CropCounter.java
│ │ ├── GlowingItems.java
│ │ ├── MiscFeatures.java
│ │ ├── PlayerDiguiser.java
│ │ ├── SpamHider.java
│ │ ├── TreecapCooldown.java
│ │ └── UltrasequencerSolver.java
│ ├── overlays
│ │ ├── DamageOverlays.java
│ │ ├── FairySoulWaypoints.java
│ │ ├── FinalDestinationOverlay.java
│ │ ├── GemstoneMiningOverlay.java
│ │ ├── GrandmaWolfTimer.java
│ │ ├── MiscOverlays.java
│ │ ├── QuiverOverlay.java
│ │ ├── RelicFinderWaypoints.java
│ │ ├── SlayerKillsDisplay.java
│ │ ├── ZealotSpawnLocations.java
│ │ ├── maps
│ │ │ ├── CrimsonMap.java
│ │ │ ├── CrystalHollowsMap.java
│ │ │ └── DwarvenMap.java
│ │ └── menuOverlay
│ │ │ ├── AuctionSellingOverlay.java
│ │ │ ├── CollectionOverlay.java
│ │ │ ├── GardenFeatures.java
│ │ │ ├── MinionOverlay.java
│ │ │ ├── MissingTalismans.java
│ │ │ └── TradingOverlay.java
│ ├── render
│ │ ├── DynamicFullbright.java
│ │ ├── HighlightCropArea.java
│ │ ├── RenderFeatures.java
│ │ ├── RiftFeatures.java
│ │ └── SlayerFeatures.java
│ ├── statDisplays
│ │ ├── ActionBarListener.kt
│ │ ├── CryptDisplay.kt
│ │ ├── DefenseDisplay.kt
│ │ ├── EffectiveHealthDisplay.kt
│ │ ├── HealthDisplay.kt
│ │ ├── ManaDisplay.kt
│ │ ├── OverflowManaDisplay.kt
│ │ ├── SecretDisplay.kt
│ │ ├── SpeedDisplay.kt
│ │ └── bars
│ │ │ ├── HealthBar.kt
│ │ │ └── ManaBar.kt
│ ├── termPractice
│ │ └── TerminalManager.kt
│ └── trackers
│ │ ├── AutomatonTracker.java
│ │ ├── EnderNodeTracker.java
│ │ ├── GhostTracker.java
│ │ ├── IceTreasureTracker.java
│ │ ├── PowderTracker.java
│ │ └── TrevorHelper.java
│ ├── gui
│ ├── ConfigGui.java
│ ├── EditLocationsGui.java
│ ├── GuiManager.java
│ ├── ProfileViewerGui.java
│ ├── ProfileViewerUtils.java
│ ├── SideMenu
│ │ ├── CustomButtonElement.java
│ │ ├── CustomElement.java
│ │ ├── CustomTextElement.java
│ │ ├── MenuOverlay.java
│ │ ├── MenuOverlayManager.java
│ │ └── TextInputElement.java
│ └── components
│ │ ├── InventoryComponent.java
│ │ ├── ItemStackComponent.java
│ │ ├── MoveableFeature.java
│ │ ├── Point.java
│ │ └── UIElement.java
│ ├── mixins
│ ├── init
│ │ └── MixinPlugin.java
│ └── transformers
│ │ ├── CustomRenderGlobal.java
│ │ ├── GuiContainerAccessor.java
│ │ ├── GuiEditSignAccessor.java
│ │ ├── MixinAbstractClientPlayer.java
│ │ ├── MixinBlockCrops.java
│ │ ├── MixinBlockNetherWart.java
│ │ ├── MixinChunk.java
│ │ ├── MixinEntityRenderer.java
│ │ ├── MixinGui.java
│ │ ├── MixinGuiContainer.java
│ │ ├── MixinGuiEditSign.java
│ │ ├── MixinGuiIngame.java
│ │ ├── MixinItemRenderer.java
│ │ ├── MixinLayerArmorBase.java
│ │ ├── MixinMinecraft.java
│ │ ├── MixinNetHandlerPlayClient.java
│ │ ├── MixinNetworkManager.java
│ │ ├── MixinRender.java
│ │ ├── MixinRenderGlobal.java
│ │ ├── MixinRenderItem.java
│ │ └── MixinRenderPlayer.java
│ └── utils
│ ├── CapeUtils.java
│ ├── EntityOutlineRenderer.java
│ ├── GuiUtils.java
│ ├── ItemRarity.java
│ ├── ItemUtils.java
│ ├── NetworkUtils.java
│ ├── RenderUtil.java
│ ├── ScoreboardUtil.java
│ ├── TabListUtils.java
│ └── Utils.java
└── resources
├── META-INF
└── mrfast_at.cfg
├── assets
└── skyblockfeatures
│ ├── font
│ └── ascii.png
│ ├── grayBox.png
│ ├── gui
│ ├── button.png
│ ├── default_button.png
│ ├── discord.png
│ ├── gear.png
│ ├── github.png
│ ├── largeOutline.png
│ ├── largeOutlineFurf.png
│ ├── outline.png
│ ├── outlineFurf.png
│ ├── reset.png
│ ├── reset.png.license
│ └── vignette.png
│ ├── logo.png
│ ├── map
│ ├── CrystalHollowsMap.png
│ ├── DungeonMap.png
│ ├── crimson.png
│ ├── dwarven.png
│ ├── locations
│ │ ├── bal.png
│ │ ├── city.png
│ │ ├── corleone.png
│ │ ├── divan.png
│ │ ├── king.png
│ │ ├── queen.png
│ │ └── temple.png
│ ├── mapIcon.png
│ └── mapIcon2.png
│ ├── monki.png
│ └── path_arrow.png
├── logo.png
├── mcmod.info
└── mixins.skyblockfeatures.json
/.github/workflows/gradle.yml:
--------------------------------------------------------------------------------
1 | name: Build SkyblockFeatures
2 |
3 | on:
4 | push:
5 | branches:
6 | - '*'
7 | pull_request:
8 | branches:
9 | - '*'
10 |
11 | jobs:
12 | build-gradle-project:
13 | runs-on: ubuntu-latest
14 |
15 | steps:
16 | - uses: actions/setup-java@v4.0.0
17 | with:
18 | distribution: zulu
19 | java-version: 17
20 |
21 | - name: Checkout repo
22 | uses: actions/checkout@v4.1.1
23 |
24 | - name: Make gradlew executable
25 | run: chmod +x ./gradlew
26 |
27 | - name: Setup Gradle and build jar
28 | uses: gradle/gradle-build-action@v2.11.1
29 | with:
30 | arguments: build
31 |
32 | - name: Upload SkyblockFeatures jar
33 | uses: actions/upload-artifact@v4.0.0
34 | with:
35 | name: SkyblockFeatures-Nightly
36 | path: build/libs/*.jar
37 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle/
2 |
3 | libs/
4 |
5 | bin/
6 |
7 | build/
8 |
9 | .idea/
10 |
11 | .vscode/
12 |
13 | *.bat
14 |
15 | run/
--------------------------------------------------------------------------------
/ThirdPartyProjects.md:
--------------------------------------------------------------------------------
1 | # Third Party Projects
2 | This section highlights various third-party projects that are utilized within Skyblock Features. These projects contribute to enhancing functionality, providing additional utilities, or extending the overall capabilities of the main software. Below is a list of such projects along with their respective licenses:
3 |
4 | | Software | License |
5 | |-------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
6 | | [Forge1.8.9Template](https://github.com/nea89o/Forge1.8.9Template) | [Unlicense](https://github.com/nea89o/Forge1.8.9Template/blob/master/LICENSE) |
7 | | [Danker's Skyblock Mod](https://github.com/bowser0000/SkyblockMod/) | [GPL 3.0](https://github.com/bowser0000/SkyblockMod/blob/master/COPYING) |
8 | | [Skytils 0.x](https://github.com/Skytils/SkytilsMod/blob/0.x/LICENSE) | [AGPL 3.0](https://github.com/Skytils/SkytilsMod/blob/0.x/LICENSE) |
9 | | [NotEnoughUpdates](https://github.com/Moulberry/NotEnoughUpdates/) | [LGPL 3.0](https://github.com/NotEnoughUpdates/NotEnoughUpdates/blob/master/COPYING) |
10 | | [Vigilance](https://github.com/EssentialGG/Vigilance) | [LGPL 3.0](https://github.com/EssentialGG/Vigilance/blob/master/LICENSE) |
11 | | [Elementa](https://github.com/EssentialGG/Elementa) | [LGPL 3.0](https://github.com/EssentialGG/Elementa/blob/master/LICENSE) |
12 | | [SkyHanni](https://github.com/hannibal002/SkyHanni) | [LGPL 2.1](https://github.com/hannibal002/SkyHanni/blob/master/LICENSE) |
13 | | [GSON](https://github.com/google/gson) | [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) |
14 | | [Skyblock Addons](https://github.com/BiscuitDevelopment/SkyblockAddons) | [MIT](https://github.com/BiscuitDevelopment/SkyblockAddons/blob/main/LICENSE) |
15 |
16 | Feel free to explore these projects and their licenses for more information on their usage and permissions.
17 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | loom.platform=forge
2 | org.gradle.jvmargs=-Xmx4g
3 | baseGroup = mrfast.sbf
4 | mcVersion = 1.8.9
5 | modid = skyblockfeatures
6 | version = 1.3.0-BETA3
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/settings.gradle.kts:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | mavenCentral()
4 | gradlePluginPortal()
5 | maven("https://oss.sonatype.org/content/repositories/snapshots")
6 | maven("https://maven.architectury.dev/")
7 | maven("https://maven.fabricmc.net")
8 | maven("https://maven.minecraftforge.net/")
9 | maven("https://repo.spongepowered.org/maven/")
10 | maven("https://repo.sk1er.club/repository/maven-releases/")
11 | }
12 | resolutionStrategy {
13 | eachPlugin {
14 | when (requested.id.id) {
15 | "gg.essential.loom" -> useModule("gg.essential:architectury-loom:${requested.version}")
16 | }
17 | }
18 | }
19 | }
20 |
21 | plugins {
22 | id("org.gradle.toolchains.foojay-resolver-convention") version("0.6.0")
23 | }
24 |
25 |
26 | rootProject.name = "skyblockfeatures"
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/commands/ColorTestCommand.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.commands;
2 |
3 | import mrfast.sbf.utils.Utils;
4 | import net.minecraft.client.Minecraft;
5 | import net.minecraft.command.CommandBase;
6 | import net.minecraft.command.CommandException;
7 | import net.minecraft.command.ICommandSender;
8 |
9 | public class ColorTestCommand extends CommandBase {
10 |
11 | @Override
12 | public String getCommandName() {
13 | return "colortest";
14 | }
15 |
16 | @Override
17 | public String getCommandUsage(ICommandSender sender) {
18 | return "/colortest [message]";
19 | }
20 |
21 | @Override
22 | public int getRequiredPermissionLevel() {
23 | return 0;
24 | }
25 |
26 | @Override
27 | public void processCommand(ICommandSender arg0, String[] args) throws CommandException {
28 | Utils.sendMessage(String.join(" ", args).replaceAll("&","§"));
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/commands/DungeonPlayerInfoCommand.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.commands;
2 |
3 | import mrfast.sbf.features.dungeons.PartyFinderFeatures;
4 | import net.minecraft.client.Minecraft;
5 | import net.minecraft.command.CommandBase;
6 | import net.minecraft.command.CommandException;
7 | import net.minecraft.command.ICommandSender;
8 |
9 |
10 | public class DungeonPlayerInfoCommand extends CommandBase{
11 | @Override
12 | public String getCommandName() {
13 | return "sfcata";
14 | }
15 |
16 | @Override
17 | public String getCommandUsage(ICommandSender arg0) {
18 | return "/" + getCommandName() + " [name]";
19 | }
20 |
21 | @Override
22 | public int getRequiredPermissionLevel() {
23 | return 0;
24 | }
25 |
26 |
27 | @Override
28 | public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException {
29 | PartyFinderFeatures instance = new PartyFinderFeatures();
30 | if(arg1.length == 0) instance.showDungeonPlayerInfo(Minecraft.getMinecraft().thePlayer.getName(),false);
31 | if(arg1.length ==1) instance.showDungeonPlayerInfo(arg1[0],false);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/commands/DungeonsCommand.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.commands;
2 |
3 | import net.minecraft.command.CommandBase;
4 | import net.minecraft.command.CommandException;
5 | import net.minecraft.command.ICommandSender;
6 |
7 | import java.util.HashMap;
8 | import java.util.Map;
9 |
10 | import com.mojang.realmsclient.gui.ChatFormatting;
11 |
12 | import mrfast.sbf.utils.Utils;
13 |
14 | public class DungeonsCommand extends CommandBase {
15 |
16 | private static final Map numberWords = new HashMap<>();
17 | static {
18 | numberWords.put(1, "ONE");
19 | numberWords.put(2, "TWO");
20 | numberWords.put(3, "THREE");
21 | numberWords.put(4, "FOUR");
22 | numberWords.put(5, "FIVE");
23 | numberWords.put(6, "SIX");
24 | numberWords.put(7, "SEVEN");
25 | // Add more numbers as needed
26 | }
27 |
28 | @Override
29 | public String getCommandName() {
30 | return "jd";
31 | }
32 |
33 | @Override
34 | public String getCommandUsage(ICommandSender arg0) {
35 | return "/" + getCommandName() + " [dungeon]";
36 | }
37 |
38 | @Override
39 | public int getRequiredPermissionLevel() {
40 | return 0;
41 | }
42 |
43 |
44 | @Override
45 | public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException {
46 | if(arg1.length!=1) {
47 | Utils.sendMessage(ChatFormatting.RED+"Invalid Command Usage! Example Usage /jd m4");
48 | return;
49 | }
50 | boolean masterMode = arg1[0].toLowerCase().contains("m");
51 | int floorInt = parseInt(arg1[0].replaceAll("[^0-9]", ""));
52 | String dungeonType = (masterMode?"MASTER_":"")+"CATACOMBS";
53 | String dungeonString = dungeonType+"_FLOOR_"+numberWords.get(floorInt);
54 |
55 | Utils.GetMC().thePlayer.sendChatMessage("/joindungeon "+dungeonString);
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/commands/FakePlayerCommand.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.commands;
2 |
3 | import java.util.UUID;
4 |
5 | import mrfast.sbf.utils.NetworkUtils;
6 |
7 | import com.mojang.authlib.GameProfile;
8 |
9 | import mrfast.sbf.utils.Utils;
10 | import net.minecraft.client.Minecraft;
11 | import net.minecraft.client.entity.EntityOtherPlayerMP;
12 | import net.minecraft.command.CommandBase;
13 | import net.minecraft.command.CommandException;
14 | import net.minecraft.command.ICommandSender;
15 |
16 | public class FakePlayerCommand extends CommandBase {
17 |
18 | @Override
19 | public String getCommandName() {
20 | return "fakeplayer";
21 | }
22 |
23 | @Override
24 | public String getCommandUsage(ICommandSender sender) {
25 | return "/fakeplayer [playerName]";
26 | }
27 |
28 | @Override
29 | public int getRequiredPermissionLevel() {
30 | return 0;
31 | }
32 |
33 | EntityOtherPlayerMP fakePlayer = null;
34 | static Minecraft mc = Utils.GetMC();
35 |
36 | @Override
37 | public void processCommand(ICommandSender arg0, String[] args) throws CommandException {
38 | if(fakePlayer != null) {
39 | mc.theWorld.removeEntity(fakePlayer);
40 | }
41 | UUID uuid = UUID.fromString(NetworkUtils.getUUID(args[0],true));
42 | GameProfile profile = new GameProfile(uuid, args[0]);
43 | Utils.GetMC().getSessionService().fillProfileProperties(profile, true);
44 |
45 | fakePlayer = new EntityOtherPlayerMP(mc.theWorld,profile);
46 | fakePlayer.copyLocationAndAnglesFrom(mc.thePlayer);
47 | fakePlayer.rotationYawHead = mc.thePlayer.rotationYawHead;
48 |
49 | mc.theWorld.addEntityToWorld(-1, fakePlayer);
50 | }
51 |
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/commands/FlipsCommand.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.commands;
2 |
3 | import java.awt.Desktop;
4 | import java.net.URI;
5 |
6 | import com.mojang.realmsclient.gui.ChatFormatting;
7 |
8 | import mrfast.sbf.utils.NetworkUtils;
9 | import mrfast.sbf.utils.Utils;
10 | import net.minecraft.command.CommandBase;
11 | import net.minecraft.command.CommandException;
12 | import net.minecraft.command.ICommandSender;
13 |
14 | public class FlipsCommand extends CommandBase {
15 |
16 | @Override
17 | public String getCommandName() {
18 | return "flips";
19 | }
20 |
21 | @Override
22 | public String getCommandUsage(ICommandSender sender) {
23 | return "/flips [username]";
24 | }
25 |
26 | @Override
27 | public int getRequiredPermissionLevel() {
28 | return 0;
29 | }
30 |
31 | @Override
32 | public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException {
33 | String username;
34 | if (arg1.length == 0) {
35 | username = Utils.GetMC().thePlayer.getName();
36 | } else {
37 | username = arg1[0];
38 | }
39 | String uuid = NetworkUtils.getUUID(username);
40 | try {
41 | Desktop.getDesktop().browse(new URI("https://sky.coflnet.com/player/"+uuid+"/flips"));
42 | } catch (Exception e) {
43 | e.printStackTrace();
44 | }
45 |
46 | Utils.sendMessage(ChatFormatting.LIGHT_PURPLE+"Opening "+username+"'s Flipper stats");
47 | }
48 | }
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/commands/PingCommand.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.commands;
2 |
3 | import mrfast.sbf.core.SkyblockInfo;
4 | import net.minecraft.command.CommandBase;
5 | import net.minecraft.command.CommandException;
6 | import net.minecraft.command.ICommandSender;
7 |
8 | public class PingCommand extends CommandBase {
9 |
10 | @Override
11 | public String getCommandName() {
12 | return "ping";
13 | }
14 |
15 | @Override
16 | public String getCommandUsage(ICommandSender sender) {
17 | return "/ping";
18 | }
19 |
20 | @Override
21 | public int getRequiredPermissionLevel() {
22 | return 0;
23 | }
24 |
25 | @Override
26 | public void processCommand(ICommandSender arg0, String[] args) throws CommandException {
27 | SkyblockInfo.getPing();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/commands/RepartyCommand.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.commands;
2 |
3 | import java.util.Collections;
4 | import java.util.List;
5 |
6 | import com.google.common.collect.Lists;
7 |
8 | import mrfast.sbf.features.dungeons.Reparty;
9 | import mrfast.sbf.utils.Utils;
10 | import net.minecraft.command.CommandBase;
11 | import net.minecraft.command.CommandException;
12 | import net.minecraft.command.ICommandSender;
13 | import net.minecraft.util.BlockPos;
14 |
15 | public class RepartyCommand extends CommandBase {
16 |
17 | @Override
18 | public String getCommandName() {
19 | return "reparty";
20 | }
21 |
22 | @Override
23 | public List getCommandAliases() {
24 | return Lists.newArrayList("sfrp","rp");
25 | }
26 |
27 | @Override
28 | public String getCommandUsage(ICommandSender arg0) {
29 | return "/" + getCommandName() + " [name]";
30 | }
31 |
32 | @Override
33 | public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) {
34 | return (args.length >= 1) ? getListOfStringsMatchingLastWord(args, Utils.getListOfPlayerUsernames()) : null;
35 | }
36 |
37 | @Override
38 | public int getRequiredPermissionLevel() {
39 | return 0;
40 | }
41 |
42 | @Override
43 | public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException {
44 | Reparty.doReparty();
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/commands/ShrugCommand.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.commands;
2 |
3 | import net.minecraft.client.Minecraft;
4 | import net.minecraft.command.CommandBase;
5 | import net.minecraft.command.CommandException;
6 | import net.minecraft.command.ICommandSender;
7 |
8 | public class ShrugCommand extends CommandBase {
9 |
10 | @Override
11 | public String getCommandName() {
12 | return "shrug";
13 | }
14 |
15 | @Override
16 | public String getCommandUsage(ICommandSender sender) {
17 | return "/shrug [message]";
18 | }
19 |
20 | @Override
21 | public int getRequiredPermissionLevel() {
22 | return 0;
23 | }
24 |
25 | @Override
26 | public void processCommand(ICommandSender arg0, String[] args) throws CommandException {
27 | String chatMsg = "¯\\_(ツ)_/¯";
28 | if (args.length > 0) chatMsg = String.join(" ", args) + " " + chatMsg;
29 | Minecraft.getMinecraft().thePlayer.sendChatMessage(chatMsg);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/commands/SkyCommand.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.commands;
2 |
3 | import java.awt.Desktop;
4 | import java.net.URI;
5 |
6 | import com.mojang.realmsclient.gui.ChatFormatting;
7 |
8 | import mrfast.sbf.utils.Utils;
9 | import net.minecraft.command.CommandBase;
10 | import net.minecraft.command.CommandException;
11 | import net.minecraft.command.ICommandSender;
12 |
13 | public class SkyCommand extends CommandBase {
14 |
15 | @Override
16 | public String getCommandName() {
17 | return "sky";
18 | }
19 |
20 | @Override
21 | public String getCommandUsage(ICommandSender sender) {
22 | return "/sky [username]";
23 | }
24 |
25 | @Override
26 | public int getRequiredPermissionLevel() {
27 | return 0;
28 | }
29 |
30 | @Override
31 | public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException {
32 | String username;
33 | if (arg1.length == 0) {
34 | username = Utils.GetMC().thePlayer.getName();
35 | } else {
36 | username = arg1[0];
37 | }
38 |
39 | try {
40 | Desktop.getDesktop().browse(new URI("https://sky.shiiyu.moe/stats/"+username));
41 | } catch (Exception e) {
42 | e.printStackTrace();
43 | }
44 |
45 | Utils.sendMessage(ChatFormatting.LIGHT_PURPLE+"Opening "+username+"'s Skycrypt stats");
46 | }
47 | }
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/commands/TerminalCommand.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.commands;
2 |
3 | import java.util.*;
4 |
5 | import com.mojang.realmsclient.gui.ChatFormatting;
6 | import mrfast.sbf.events.SlotClickedEvent;
7 | import mrfast.sbf.features.termPractice.TerminalManager;
8 | import mrfast.sbf.utils.GuiUtils;
9 | import mrfast.sbf.utils.Utils;
10 | import net.minecraft.block.BlockStainedGlassPane;
11 | import net.minecraft.client.gui.inventory.GuiChest;
12 | import net.minecraft.command.CommandBase;
13 | import net.minecraft.command.CommandException;
14 | import net.minecraft.command.ICommandSender;
15 | import net.minecraft.enchantment.Enchantment;
16 | import net.minecraft.init.Blocks;
17 | import net.minecraft.inventory.InventoryBasic;
18 | import net.minecraft.item.Item;
19 | import net.minecraft.item.ItemStack;
20 |
21 | public class TerminalCommand extends CommandBase {
22 |
23 | @Override
24 | public String getCommandName() {
25 | return "terminal";
26 | }
27 |
28 | @Override
29 | public String getCommandUsage(ICommandSender arg0) {
30 | return "/terminal";
31 | }
32 |
33 | @Override
34 | public int getRequiredPermissionLevel() {
35 | return 0;
36 | }
37 |
38 | @Override
39 | public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException {
40 | int termId = Utils.randomNumber(1, 4);
41 | if(arg1.length>0) {
42 | try {
43 | termId = Integer.parseInt(arg1[0].replaceAll("[^0-9]", ""));
44 | } catch (Exception ignored) {}
45 | }
46 | GuiChest terminal = TerminalManager.Companion.createTerminal(termId);
47 | if (terminal != null) {
48 | GuiUtils.openGui(terminal);
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/commands/pvCommand.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.commands;
2 |
3 | import java.util.List;
4 |
5 | import com.google.common.collect.Lists;
6 | import com.mojang.realmsclient.gui.ChatFormatting;
7 |
8 | import mrfast.sbf.gui.ProfileViewerGui;
9 | import mrfast.sbf.utils.NetworkUtils;
10 | import mrfast.sbf.utils.GuiUtils;
11 | import mrfast.sbf.utils.Utils;
12 | import net.minecraft.command.CommandBase;
13 | import net.minecraft.command.CommandException;
14 | import net.minecraft.command.ICommandSender;
15 | import net.minecraft.util.BlockPos;
16 |
17 | public class pvCommand extends CommandBase {
18 |
19 | @Override
20 | public String getCommandName() {
21 | return "sfpv";
22 | }
23 |
24 | @Override
25 | public List getCommandAliases() {
26 | return Lists.newArrayList("sfpv","pv");
27 | }
28 |
29 | @Override
30 | public String getCommandUsage(ICommandSender sender) {
31 | return "/" + getCommandName();
32 | }
33 |
34 | @Override
35 | public int getRequiredPermissionLevel() {
36 | return 0;
37 | }
38 |
39 | @Override
40 | public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) {
41 | return (args.length >= 1) ? getListOfStringsMatchingLastWord(args, Utils.getListOfPlayerUsernames()) : null;
42 | }
43 |
44 | @Override
45 | public void processCommand(ICommandSender sender, String[] args) throws CommandException {
46 | if (args.length == 0) {
47 | String username = Utils.GetMC().thePlayer.getName();
48 |
49 | Utils.sendMessage(ChatFormatting.YELLOW+"Opening "+username+"'s Profile "+ChatFormatting.GRAY+"(This may take a second)");
50 | GuiUtils.openGui(new ProfileViewerGui(true,username,"auto"));
51 | } else {
52 | String playerUuid = NetworkUtils.getUUID(args[0],true);
53 | if(playerUuid==null) {
54 | Utils.sendMessage(ChatFormatting.RED+"A player with that username doesn't exist");
55 | return;
56 | }
57 | Utils.sendMessage(ChatFormatting.YELLOW+"Opening "+args[0]+"'s Profile "+ChatFormatting.GRAY+"(This may take a second)");
58 | GuiUtils.openGui(new ProfileViewerGui(true,args[0],"auto"));
59 | }
60 | }
61 | }
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/events/BlockChangeEvent.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.events;
2 |
3 | import net.minecraft.block.state.IBlockState;
4 | import net.minecraft.util.BlockPos;
5 | import net.minecraftforge.fml.common.eventhandler.Event;
6 | /**
7 | * Modified from Skytils 0.x under GNU Affero General Public License v3.0
8 | * https://github.com/Skytils/SkytilsMod/tree/0.x
9 | *
10 | * @author Sychic
11 | */
12 | public class BlockChangeEvent extends Event {
13 |
14 | public BlockPos pos;
15 | public IBlockState oldBlockState;
16 | public IBlockState newBlockState;
17 |
18 | public BlockChangeEvent(BlockPos blockPos, IBlockState oldBlockState, IBlockState newBlockState) {
19 | this.pos = blockPos;
20 | this.oldBlockState = oldBlockState;
21 | this.newBlockState = newBlockState;
22 | }
23 |
24 | public IBlockState getOld() {
25 | return this.oldBlockState;
26 | }
27 |
28 | public IBlockState getNew() {
29 | return this.newBlockState;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/events/ChatEventListener.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.events;
2 |
3 | import mrfast.sbf.SkyblockFeatures;
4 | import mrfast.sbf.core.DataManager;
5 | import mrfast.sbf.utils.Utils;
6 | import net.minecraft.event.ClickEvent;
7 | import net.minecraft.event.HoverEvent;
8 | import net.minecraft.util.ChatComponentText;
9 | import net.minecraft.util.ChatStyle;
10 | import net.minecraft.util.EnumChatFormatting;
11 | import net.minecraft.util.IChatComponent;
12 | import net.minecraftforge.client.event.ClientChatReceivedEvent;
13 | import net.minecraftforge.fml.common.eventhandler.EventPriority;
14 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
15 |
16 | import java.util.Arrays;
17 | import java.util.List;
18 |
19 | public class ChatEventListener {
20 | boolean firstLaunch = true;
21 |
22 | @SubscribeEvent(receiveCanceled = true, priority = EventPriority.HIGHEST)
23 | public void onChat(ClientChatReceivedEvent event) {
24 | if (!Utils.isOnHypixel()) return;
25 | String unformatted = Utils.cleanColor(event.message.getUnformattedText());
26 |
27 | if (event.message.getFormattedText().contains(": ")) {
28 | if (SkyblockFeatures.config.DisguisePlayersAs == 8 && SkyblockFeatures.config.playerDiguiser && Utils.inSkyblock) {
29 | String name = event.message.getFormattedText().split(": ")[0];
30 | String message = event.message.getFormattedText().split(": ")[1];
31 | StringBuilder monkiMessage = new StringBuilder();
32 | for (String word : message.split(" ")) {
33 | List words = Arrays.asList("Ooh", "ooh", "ah", "Ee", "Hoo", "Grrr", "uuh");
34 | monkiMessage.append(words.get(Utils.randomNumber(0, 6))).append(" ");
35 | }
36 | event.setCanceled(true);
37 | Utils.GetMC().thePlayer.addChatMessage(new ChatComponentText(name + ": " + monkiMessage));
38 | }
39 | }
40 |
41 | if (unformatted.startsWith("You have joined ") && unformatted.contains("party!") && SkyblockFeatures.config.autoPartyChat) {
42 | Utils.GetMC().thePlayer.sendChatMessage("/chat p");
43 | Utils.setTimeout(() -> {
44 | Utils.sendMessage(EnumChatFormatting.YELLOW + "Auto Joined Party Chat.");
45 | }, 10);
46 | }
47 |
48 | // Welcome message
49 | if (DataManager.dataJson.has("firstLaunch") && firstLaunch) {
50 | firstLaunch = (boolean) DataManager.getData("firstLaunch");
51 | }
52 | if (firstLaunch && unformatted.equals("Welcome to Hypixel SkyBlock!")) {
53 | Utils.sendMessage("§bThank You for downloading Skyblock Features!§e Do /sbf for config!");
54 | DataManager.saveData("firstLaunch", false);
55 | }
56 |
57 |
58 | String pattern = "\\b\\w+\\b has sent you a trade request\\. Click here to accept!.*";
59 | if (unformatted.matches(pattern) && SkyblockFeatures.config.betterTrading && SkyblockFeatures.config.easierTrading) {
60 | String tradeRequest = unformatted.split(" ")[0];
61 |
62 | event.setCanceled(true);
63 | IChatComponent notificationText = new ChatComponentText(
64 | EnumChatFormatting.GREEN + tradeRequest + " has sent you a trade request." + EnumChatFormatting.AQUA +
65 | " Click here " + EnumChatFormatting.GREEN + "to accept!")
66 | .setChatStyle(new ChatStyle()
67 | .setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/trade " + tradeRequest))
68 | .setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(EnumChatFormatting.GREEN +
69 | "Click here to accept!"))));
70 | Utils.GetMC().thePlayer.addChatMessage(notificationText);
71 | }
72 |
73 | if (unformatted.startsWith("The /trade request from") && unformatted.endsWith("expired!") && SkyblockFeatures.config.betterTrading && SkyblockFeatures.config.hideExpired) {
74 | event.setCanceled(true);
75 | }
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/events/CheckRenderEntityEvent.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.events;
2 |
3 | import net.minecraft.client.renderer.culling.ICamera;
4 | import net.minecraft.entity.Entity;
5 | import net.minecraftforge.fml.common.eventhandler.Cancelable;
6 | import net.minecraftforge.fml.common.eventhandler.Event;
7 |
8 | /**
9 | * Taken from Skytils 0.x under GNU Affero General Public License v3.0
10 | * https://github.com/Skytils/SkytilsMod/tree/0.x
11 | *
12 | * @author Sychic
13 | */
14 | @Cancelable
15 | public class CheckRenderEntityEvent extends Event {
16 |
17 | public T entity;
18 | public ICamera camera;
19 | public double camX, camY, camZ;
20 |
21 | public CheckRenderEntityEvent(T entity, ICamera camera, double camX, double camY, double camZ) {
22 | this.entity = entity;
23 | this.camera = camera;
24 | this.camX = camX;
25 | this.camY = camY;
26 | this.camZ = camZ;
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/events/DrawSignEvent.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.events;
2 |
3 | import net.minecraftforge.fml.common.eventhandler.Event;
4 |
5 | public class DrawSignEvent extends Event {
6 |
7 | }
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/events/GuiContainerEvent.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.events;
2 |
3 | import net.minecraft.client.Minecraft;
4 | import net.minecraft.client.gui.inventory.GuiChest;
5 | import net.minecraft.client.gui.inventory.GuiContainer;
6 | import net.minecraft.inventory.Container;
7 | import net.minecraft.inventory.ContainerChest;
8 | import net.minecraft.inventory.IInventory;
9 | import net.minecraft.inventory.Slot;
10 | import net.minecraftforge.fml.common.eventhandler.Cancelable;
11 | import net.minecraftforge.fml.common.eventhandler.Event;
12 |
13 | /**
14 | * Modified from Skytils 0.x under GNU Affero General Public License v3.0
15 | * https://github.com/Skytils/SkytilsMod/tree/0.x
16 | *
17 | * @author Sychic
18 | */
19 | public abstract class GuiContainerEvent extends Event {
20 |
21 | public GuiContainer gui;
22 | public Container container;
23 |
24 | public GuiContainerEvent(GuiContainer gui, Container container) {
25 | this.gui = gui;
26 | this.container = container;
27 | }
28 |
29 | public static class TitleDrawnEvent extends GuiContainerEvent {
30 | public String displayName;
31 | public IInventory chestInventory;
32 |
33 | public TitleDrawnEvent(GuiContainer gui, Container container,String displayName) {
34 | super(gui, container);
35 | this.displayName = displayName;
36 | if(Minecraft.getMinecraft().currentScreen instanceof GuiChest) {
37 | GuiChest chest = (GuiChest) Minecraft.getMinecraft().currentScreen;
38 | chestInventory = ((ContainerChest) chest.inventorySlots).getLowerChestInventory();
39 | }
40 | }
41 | }
42 |
43 | public static class CloseWindowEvent extends GuiContainerEvent {
44 | public CloseWindowEvent(GuiContainer gui, Container container) {
45 | super(gui, container);
46 | }
47 | }
48 |
49 | public static class DrawSlotEvent extends GuiContainerEvent {
50 | public Slot slot;
51 | public String chestName = "";
52 |
53 | public DrawSlotEvent(GuiContainer gui, Container container, Slot slot) {
54 | super(gui, container);
55 |
56 | if(gui instanceof GuiChest) {
57 | if(gui.inventorySlots instanceof ContainerChest) {
58 | ContainerChest chest = (ContainerChest) gui.inventorySlots;
59 | IInventory inv = chest.getLowerChestInventory();
60 | this.chestName = inv.getDisplayName().getUnformattedText().trim();
61 | }
62 | }
63 |
64 | this.slot = slot;
65 | }
66 |
67 | @Cancelable
68 | public static class Pre extends DrawSlotEvent {
69 | public Pre(GuiContainer gui, Container container, Slot slot) {
70 | super(gui, container, slot);
71 | }
72 | }
73 |
74 | public static class Post extends DrawSlotEvent {
75 | public Post(GuiContainer gui, Container container, Slot slot) {
76 | super(gui, container, slot);
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/events/PacketEvent.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.events;
2 |
3 | import net.minecraft.network.Packet;
4 | import net.minecraftforge.fml.common.eventhandler.Cancelable;
5 | import net.minecraftforge.fml.common.eventhandler.Event;
6 |
7 |
8 | /**
9 | * Modified from Skytils 0.x under GNU Affero General Public License v3.0
10 | * https://github.com/Skytils/SkytilsMod/tree/0.x
11 | *
12 | * @author Sychic
13 | */
14 | @Cancelable
15 | public class PacketEvent extends Event {
16 | public Packet> packet;
17 |
18 | public PacketEvent(Packet> packet) {
19 | this.packet = packet;
20 | }
21 |
22 | public static class ReceiveEvent extends PacketEvent {
23 | public ReceiveEvent(Packet> packet) {
24 | super(packet);
25 | }
26 | }
27 |
28 | public static class SendEvent extends PacketEvent {
29 | public SendEvent(Packet> packet) {
30 | super(packet);
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/events/ProfileSwapEvent.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.events;
2 |
3 | import net.minecraftforge.fml.common.eventhandler.Event;
4 |
5 | public class ProfileSwapEvent extends Event {
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/events/SecondPassedEvent.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.events;
2 |
3 | import net.minecraftforge.fml.common.eventhandler.Event;
4 |
5 | public class SecondPassedEvent extends Event {
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/events/SkyblockMobEvent.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.events;
2 |
3 | import mrfast.sbf.core.SkyblockMobDetector.SkyblockMob;
4 | import net.minecraftforge.fml.common.eventhandler.Event;
5 |
6 | public class SkyblockMobEvent extends Event {
7 | SkyblockMob sbMob;
8 | public Float partialTicks;
9 | public SkyblockMobEvent(SkyblockMob sbMob,Float partialTicks) {
10 | this.sbMob=sbMob;
11 | this.partialTicks = partialTicks;
12 | }
13 |
14 | public SkyblockMob getSbMob() {
15 | return sbMob;
16 | }
17 |
18 | public static class Spawn extends SkyblockMobEvent {
19 | public Spawn(SkyblockMob sbMob) {
20 | super(sbMob,null);
21 | }
22 | @Override
23 | public boolean isCancelable() {
24 | return false;
25 | }
26 | }
27 |
28 | public static class Death extends SkyblockMobEvent {
29 | public Death(SkyblockMob sbMob) {
30 | super(sbMob,null);
31 | }
32 | @Override
33 | public boolean isCancelable() {
34 | return false;
35 | }
36 | }
37 |
38 |
39 | public static class Render extends SkyblockMobEvent {
40 | public Render(SkyblockMob sbMob,float partialTicks) {
41 | super(sbMob,partialTicks);
42 | }
43 |
44 | @Override
45 | public boolean isCancelable() {
46 | return false;
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/events/SlotClickedEvent.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.events;
2 |
3 | import mrfast.sbf.utils.Utils;
4 | import net.minecraft.client.Minecraft;
5 | import net.minecraft.client.gui.Gui;
6 | import net.minecraft.client.gui.inventory.GuiChest;
7 | import net.minecraft.client.gui.inventory.GuiContainer;
8 | import net.minecraft.inventory.ContainerChest;
9 | import net.minecraft.inventory.IInventory;
10 | import net.minecraft.inventory.Slot;
11 | import net.minecraft.item.ItemStack;
12 | import net.minecraftforge.fml.common.eventhandler.Cancelable;
13 | import net.minecraftforge.fml.common.eventhandler.Event;
14 |
15 | @Cancelable
16 | public class SlotClickedEvent extends Event {
17 | public GuiChest chest;
18 | public Gui gui;
19 | public IInventory inventory;
20 | public String chestName;
21 | public Slot slot;
22 | public int slotId;
23 | public ItemStack item;
24 |
25 | public SlotClickedEvent(GuiContainer container, Slot slot2) {
26 | if (!(Minecraft.getMinecraft().currentScreen instanceof GuiChest)) {
27 | this.chest = null;
28 | this.gui=Minecraft.getMinecraft().currentScreen;
29 | this.chestName = "";
30 | this.inventory = Utils.GetMC().thePlayer.inventory;
31 | } else {
32 | GuiChest chest = (GuiChest) Minecraft.getMinecraft().currentScreen;
33 | this.chest = chest;
34 | this.chestName = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getName();
35 | this.inventory = ((ContainerChest) container.inventorySlots).getLowerChestInventory();
36 | }
37 | if(slot2!=null) {
38 | this.slot = slot2;
39 | this.slotId = slot2.getSlotIndex();
40 | this.item = slot2.getStack();
41 | }
42 | }
43 |
44 | }
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/events/SocketMessageEvent.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.events;
2 |
3 | import io.socket.engineio.client.Socket;
4 | import net.minecraftforge.fml.common.eventhandler.Event;
5 |
6 | public class SocketMessageEvent extends Event {
7 | public Socket socket;
8 | public String message;
9 | public String type;
10 | public SocketMessageEvent(Socket socket, String message,String type) {
11 | this.socket = socket;
12 | this.message = message;
13 | this.type=type;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/events/UseItemAbilityEvent.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.events;
2 |
3 | import mrfast.sbf.API.ItemAbilityAPI;
4 | import net.minecraftforge.fml.common.eventhandler.Cancelable;
5 | import net.minecraftforge.fml.common.eventhandler.Event;
6 |
7 | @Cancelable
8 | public class UseItemAbilityEvent extends Event {
9 |
10 | public ItemAbilityAPI.ItemAbility ability;
11 |
12 | public UseItemAbilityEvent(ItemAbilityAPI.ItemAbility ability) {
13 | this.ability = ability;
14 | }
15 |
16 | @Override
17 | public boolean isCancelable() {
18 | return true;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/dungeons/F2SpawnTimers.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.dungeons;
2 |
3 | import com.mojang.realmsclient.gui.ChatFormatting;
4 | import mrfast.sbf.SkyblockFeatures;
5 | import mrfast.sbf.utils.RenderUtil;
6 | import mrfast.sbf.utils.Utils;
7 | import net.minecraft.util.BlockPos;
8 | import net.minecraftforge.client.event.ClientChatReceivedEvent;
9 | import net.minecraftforge.client.event.RenderWorldLastEvent;
10 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
11 | import net.minecraftforge.fml.common.gameevent.TickEvent;
12 |
13 | public class F2SpawnTimers {
14 | boolean startCounting = false;
15 | double time = 7.75;
16 | @SubscribeEvent
17 | public void onChat(ClientChatReceivedEvent event) {
18 | if(!SkyblockFeatures.config.floor2SpawnTimers) return;
19 | String clean = event.message.getUnformattedText();
20 | if(clean.equals("[BOSS] Scarf: If you can beat my Undeads, I'll personally grant you the privilege to replace them.")) {
21 | startCounting=true;
22 | }
23 | }
24 |
25 | @SubscribeEvent
26 | public void onTick(TickEvent.ClientTickEvent event) {
27 | if(!SkyblockFeatures.config.floor2SpawnTimers) return;
28 |
29 | if(event.phase != TickEvent.Phase.START) return;
30 |
31 | if(startCounting) {
32 | time -= 0.05;
33 | if (time<=-5) {
34 | startCounting = false;
35 | time = 7.75;
36 | }
37 | }
38 | }
39 |
40 | BlockPos priestPos = new BlockPos(-29,71,-4);
41 | BlockPos warriorPos = new BlockPos(13,71,-4);
42 | BlockPos magePos = new BlockPos(13,71,-23);
43 | BlockPos archPos = new BlockPos(-29,71,-23);
44 |
45 | @SubscribeEvent
46 | public void onRender3d(RenderWorldLastEvent event) {
47 | if(!SkyblockFeatures.config.floor2SpawnTimers) return;
48 |
49 | if(startCounting) {
50 | if(time+0.3>0) {
51 | RenderUtil.renderWaypointText(priestPos,"Priest "+ChatFormatting.YELLOW+Utils.round(time+0.3,1)+"s");
52 | }
53 | if(time+0.2>0) {
54 | RenderUtil.renderWaypointText(warriorPos,"Warrior "+ChatFormatting.YELLOW+Utils.round(time+0.2,1)+"s");
55 | }
56 | if(time+0.4>0) {
57 | RenderUtil.renderWaypointText(magePos,"Mage "+ChatFormatting.YELLOW+Utils.round(time+0.4,1)+"s");
58 | }
59 | if(time+0.5>0) {
60 | RenderUtil.renderWaypointText(archPos,"Archer "+ChatFormatting.YELLOW+Utils.round(time+0.5,1)+"s");
61 | }
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/dungeons/FireFreezeHelper.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.dungeons;
2 |
3 | import mrfast.sbf.SkyblockFeatures;
4 | import mrfast.sbf.core.SkyblockInfo;
5 | import mrfast.sbf.events.UseItemAbilityEvent;
6 | import mrfast.sbf.gui.components.Point;
7 | import mrfast.sbf.gui.components.UIElement;
8 | import mrfast.sbf.utils.GuiUtils;
9 | import mrfast.sbf.utils.Utils;
10 | import net.minecraft.client.renderer.GlStateManager;
11 | import net.minecraft.item.ItemStack;
12 | import net.minecraftforge.client.event.ClientChatReceivedEvent;
13 | import net.minecraftforge.event.world.WorldEvent;
14 | import net.minecraftforge.fml.common.eventhandler.EventPriority;
15 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
16 |
17 | public class FireFreezeHelper {
18 |
19 | String bossDialogue = "[BOSS] The Professor: Oh? You found my Guardians' one weakness?";
20 |
21 | static String display = "";
22 | @SubscribeEvent
23 | public void onPlayerInteract(UseItemAbilityEvent event) {
24 | if (!Utils.inDungeons || !SkyblockFeatures.config.fireFreezeHelper || !SkyblockFeatures.config.blockEarlyFireFreeze || !SkyblockInfo.localLocation.contains("3")) return;
25 |
26 | if(event.ability.itemId.equals("FIRE_FREEZE_STAFF")) {
27 | ItemStack held = Utils.GetMC().thePlayer.getHeldItem();
28 | if(!shouldFireFreeze && held != null && !DungeonsFeatures.dungeonStarted) {
29 | event.setCanceled(true);
30 | }
31 | }
32 | }
33 | static boolean shouldFireFreeze = false;
34 | @SubscribeEvent(priority = EventPriority.HIGHEST, receiveCanceled = true)
35 | public void onChatMessage(ClientChatReceivedEvent event) {
36 | if (!Utils.inDungeons || event.type == 2 || !SkyblockFeatures.config.fireFreezeHelper || !SkyblockFeatures.config.fireFreezeTimer || !SkyblockInfo.localLocation.contains("3")) return;
37 | String text = event.message.getUnformattedText();
38 | if(text.startsWith(bossDialogue)) {
39 | for(int i=1; i<=8;i++) {
40 | String count = i >= 6 ? "§aFire Freeze Now!" : "§cFire Freeze in " + (6 - i) + " seconds";
41 |
42 | int a = i;
43 | Utils.setTimeout(()->{
44 | display = count;
45 |
46 | if(a == 6) shouldFireFreeze = true;
47 | if(a == 8) display = "";
48 | },i*880);
49 | }
50 | }
51 | }
52 |
53 | @SubscribeEvent
54 | public void onLoad(WorldEvent.Load event) {
55 | display = "";
56 | shouldFireFreeze = false;
57 | }
58 |
59 | static {
60 | new FireFreezeGUI();
61 | }
62 |
63 | public static class FireFreezeGUI extends UIElement {
64 |
65 | public FireFreezeGUI() {
66 | super("Fire Freeze Timer", new Point(0.37552083f, 0.6f));
67 | SkyblockFeatures.GUIMANAGER.registerElement(this);
68 | }
69 |
70 | @Override
71 | public void drawElement() {
72 | float scale = 2f;
73 |
74 | GlStateManager.scale(scale, scale, 0);
75 | GuiUtils.drawText(display, 0, 0, GuiUtils.TextStyle.DROP_SHADOW);
76 | GlStateManager.scale(1 / scale, 1 / scale, 0);
77 | }
78 |
79 | @Override
80 | public void drawElementExample() {
81 | float scale = 2f;
82 |
83 | GlStateManager.scale(scale, scale, 0);
84 | GuiUtils.drawText("§cFire Freeze in 5 seconds!", 0, 0, GuiUtils.TextStyle.DROP_SHADOW);
85 | GlStateManager.scale(1/scale, 1/scale, 0);
86 | }
87 |
88 | @Override
89 | public boolean getToggled() {
90 | return SkyblockFeatures.config.fireFreezeTimer;
91 | }
92 |
93 | @Override
94 | public boolean getRequirement() {
95 | return Utils.inDungeons && Utils.inSkyblock;
96 | }
97 |
98 | @Override
99 | public int getHeight() {
100 | return Utils.GetMC().fontRendererObj.FONT_HEIGHT*2;
101 | }
102 |
103 | @Override
104 | public int getWidth() {
105 | return Utils.GetMC().fontRendererObj.getStringWidth("§6Fire Freeze in 5 seconds")*2;
106 | }
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/dungeons/SalvageProtection.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.dungeons;
2 |
3 | import com.mojang.realmsclient.gui.ChatFormatting;
4 | import mrfast.sbf.SkyblockFeatures;
5 | import mrfast.sbf.events.SlotClickedEvent;
6 | import mrfast.sbf.utils.ItemUtils;
7 | import mrfast.sbf.utils.Utils;
8 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
9 |
10 | public class SalvageProtection {
11 | @SubscribeEvent
12 | public void onSlotClick(SlotClickedEvent event) {
13 | if(event.chestName.startsWith("Salvage Items") && event.slot!=null && SkyblockFeatures.config.salvageProtection) {
14 | try {
15 | long itemWorth = ItemUtils.getEstimatedItemValue(event.item);
16 | if (itemWorth > SkyblockFeatures.config.salvageProtectionMinValue) {
17 | event.setCanceled(true);
18 | Utils.playSound("mob.villager.no", 0.1f);
19 | Utils.sendMessage(ChatFormatting.RED + "Blocked salvaging item with value greater than threshold");
20 | }
21 | } catch (Exception e) {
22 |
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/dungeons/ShadowAssasinFeatures.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.dungeons;
2 |
3 | import java.awt.Color;
4 | import java.util.ArrayList;
5 | import java.util.List;
6 |
7 | import com.mojang.realmsclient.gui.ChatFormatting;
8 |
9 | import mrfast.sbf.SkyblockFeatures;
10 | import mrfast.sbf.gui.GuiManager;
11 | import mrfast.sbf.utils.RenderUtil;
12 | import mrfast.sbf.utils.Utils;
13 | import net.minecraft.entity.player.EntityPlayer;
14 | import net.minecraftforge.client.event.RenderWorldLastEvent;
15 | import net.minecraftforge.event.world.WorldEvent;
16 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
17 |
18 | public class ShadowAssasinFeatures {
19 | List shadowAssassins = new ArrayList<>();
20 | @SubscribeEvent
21 | public void onRender(RenderWorldLastEvent event) {
22 | if(Utils.GetMC().theWorld==null || !(SkyblockFeatures.config.shadowAssassinNotify || SkyblockFeatures.config.boxShadowAssasins)) return;
23 | for(EntityPlayer entity:Utils.GetMC().theWorld.playerEntities) {
24 | if(entity.getName().equals("Shadow Assassin")) {
25 | boolean unspawned = entity.isInvisible();
26 |
27 | if(unspawned && SkyblockFeatures.config.boxShadowAssasins) {
28 | RenderUtil.drawOutlinedFilledBoundingBox(entity.getEntityBoundingBox(), new Color(0x8000FF), 0);
29 | }
30 | if(SkyblockFeatures.config.shadowAssassinNotify && unspawned && !shadowAssassins.contains(entity) && Utils.GetMC().thePlayer.getDistanceToEntity(entity)<16) {
31 | GuiManager.createTitle(ChatFormatting.LIGHT_PURPLE+"Shadow Assasin", 20);
32 | shadowAssassins.add(entity);
33 | }
34 | }
35 | }
36 | }
37 |
38 | @SubscribeEvent
39 | public void onLoad(WorldEvent.Load event) {
40 | shadowAssassins.clear();
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/dungeons/solvers/LividFinder.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.dungeons.solvers;
2 |
3 | import java.awt.Color;
4 |
5 | import mrfast.sbf.SkyblockFeatures;
6 | import mrfast.sbf.utils.RenderUtil;
7 | import mrfast.sbf.utils.Utils;
8 | import net.minecraft.block.BlockStainedGlass;
9 | import net.minecraft.block.state.IBlockState;
10 | import net.minecraft.entity.Entity;
11 | import net.minecraft.item.EnumDyeColor;
12 | import net.minecraft.util.AxisAlignedBB;
13 | import net.minecraft.util.BlockPos;
14 | import net.minecraftforge.client.event.RenderWorldLastEvent;
15 | import net.minecraftforge.event.world.WorldEvent;
16 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
17 | import net.minecraftforge.fml.common.gameevent.TickEvent;
18 |
19 | public class LividFinder {
20 | public static Entity livid = null;
21 | @SubscribeEvent
22 | public void onWorldChange(WorldEvent.Load event) {
23 | livid = null;
24 | }
25 |
26 | @SubscribeEvent
27 | public void onRender3D(RenderWorldLastEvent event) {
28 | if(livid != null && SkyblockFeatures.config.highlightCorrectLivid && Utils.inDungeons) {
29 | RenderUtil.drawOutlinedFilledBoundingBox(livid.getEntityBoundingBox(),SkyblockFeatures.config.correctLividColor,event.partialTicks);
30 | }
31 | }
32 |
33 | @SubscribeEvent
34 | public void onTick(TickEvent.ClientTickEvent event) {
35 | if(Utils.GetMC().theWorld == null || !SkyblockFeatures.config.highlightCorrectLivid || !Utils.inDungeons) return;
36 |
37 | IBlockState state = Utils.GetMC().theWorld.getBlockState(new BlockPos(6, 109, 43));
38 | try {
39 | EnumDyeColor color = state.getValue(BlockStainedGlass.COLOR);
40 | String lividName = null;
41 | switch (color) {
42 | case WHITE: lividName="Vendetta"; break;
43 | case MAGENTA:
44 | case PINK:
45 | lividName="Crossed"; break;
46 | case RED: lividName="Hockey"; break;
47 | case SILVER:
48 | case GRAY:
49 | lividName="Doctor"; break;
50 | case GREEN: lividName="Frog"; break;
51 | case LIME: lividName="Smile"; break;
52 | case BLUE: lividName="Scream"; break;
53 | case PURPLE: lividName="Purple"; break;
54 | case YELLOW: lividName="Arcade"; break;
55 | default:
56 | break;
57 | }
58 | for(Entity entity : Utils.GetMC().theWorld.loadedEntityList) {
59 | if (lividName != null && entity.getName().contains(lividName)) {
60 | livid = entity;
61 | }
62 | }
63 | } catch (Exception e) {
64 | // TODO: handle exception
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/dungeons/solvers/TeleportPadSolver.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.dungeons.solvers;
2 |
3 | import mrfast.sbf.features.dungeons.DungeonsFeatures;
4 | import net.minecraftforge.client.event.RenderWorldLastEvent;
5 | import net.minecraftforge.event.world.WorldEvent;
6 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
7 | import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
8 |
9 | import java.awt.Color;
10 | import java.util.ArrayList;
11 | import java.util.List;
12 |
13 | import mrfast.sbf.SkyblockFeatures;
14 | import mrfast.sbf.utils.RenderUtil;
15 | import mrfast.sbf.utils.Utils;
16 | import net.minecraft.block.Block;
17 | import net.minecraft.block.BlockEndPortalFrame;
18 | import net.minecraft.block.state.IBlockState;
19 | import net.minecraft.client.Minecraft;
20 | import net.minecraft.util.AxisAlignedBB;
21 | import net.minecraft.util.BlockPos;
22 |
23 | public class TeleportPadSolver {
24 | List endportalFrames = new ArrayList<>();
25 | @SubscribeEvent
26 | public void onWorldChange(WorldEvent.Load event) {
27 | endportalFrames.clear();
28 | }
29 |
30 | @SubscribeEvent
31 | public void onTick(ClientTickEvent event) {
32 | if(Utils.GetMC().theWorld == null || !Utils.inDungeons || !SkyblockFeatures.config.teleportPadSolver || DungeonsFeatures.getDungeonRoomId()!=-60) return;
33 | Minecraft mc = Utils.GetMC();
34 |
35 | int[][] directionOffsets = {
36 | {-1, 1}, // North-West
37 | {0, 1}, // North
38 | {1, 1}, // North-East
39 | {-1, 0}, // West
40 | {0, 0}, // No Move
41 | {1, 0}, // East
42 | {-1, -1}, // South-West
43 | {0, -1}, // South
44 | {1, -1} // South-East
45 | };
46 |
47 | BlockPos playerPos = new BlockPos(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ);
48 |
49 | for (int[] offset : directionOffsets) {
50 | int xOffset = offset[0];
51 | int zOffset = offset[1];
52 |
53 | BlockPos blockPos = playerPos.add(xOffset, 0, zOffset);
54 | Block block = Utils.GetMC().theWorld.getBlockState(blockPos).getBlock();
55 | if(block instanceof BlockEndPortalFrame && !endportalFrames.contains(playerPos.add(xOffset, 0, zOffset))) {
56 | endportalFrames.add(playerPos.add(xOffset, 0, zOffset));
57 | }
58 | }
59 |
60 | }
61 |
62 | @SubscribeEvent
63 | public void onRender(RenderWorldLastEvent event) {
64 | if(Utils.GetMC().theWorld == null || !Utils.inDungeons || !SkyblockFeatures.config.teleportPadSolver) return;
65 |
66 | for(BlockPos frame:endportalFrames) {
67 | AxisAlignedBB aabb = new AxisAlignedBB(frame, frame.add(1, 1, 1));
68 | RenderUtil.drawOutlinedFilledBoundingBox(aabb, SkyblockFeatures.config.teleportPadSolverColor, event.partialTicks);
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/dungeons/solvers/ThreeWeirdosSolver.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.dungeons.solvers;
2 |
3 | import java.awt.Color;
4 | import java.util.ArrayList;
5 | import java.util.List;
6 |
7 | import com.mojang.realmsclient.gui.ChatFormatting;
8 |
9 | import mrfast.sbf.SkyblockFeatures;
10 | import mrfast.sbf.utils.RenderUtil;
11 | import mrfast.sbf.utils.Utils;
12 | import net.minecraft.block.Block;
13 | import net.minecraft.block.BlockChest;
14 | import net.minecraft.entity.Entity;
15 | import net.minecraft.entity.item.EntityArmorStand;
16 | import net.minecraft.util.AxisAlignedBB;
17 | import net.minecraft.util.BlockPos;
18 | import net.minecraftforge.client.event.ClientChatReceivedEvent;
19 | import net.minecraftforge.client.event.RenderWorldLastEvent;
20 | import net.minecraftforge.event.world.WorldEvent;
21 | import net.minecraftforge.fml.common.eventhandler.EventPriority;
22 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
23 |
24 | public class ThreeWeirdosSolver {
25 | String[] riddleAnswers = {"The reward is not in my chest!",
26 | "At least one of them is lying, and the reward is not in",
27 | "My chest doesn't have the reward. We are all telling the truth",
28 | "My chest has the reward and I'm telling the truth",
29 | "The reward isn't in any of our chests",
30 | "Both of them are telling the truth."};
31 | BlockPos answerChest = null;
32 | List checking = new ArrayList<>();
33 |
34 | @SubscribeEvent
35 | public void onWorldChange(WorldEvent.Load event) {
36 | checking.clear();
37 | answerChest = null;
38 | }
39 |
40 | @SubscribeEvent(priority = EventPriority.HIGHEST, receiveCanceled = true)
41 | public void onChatMesaage(ClientChatReceivedEvent event) {
42 | if (!Utils.inDungeons || event.type == 2 || !SkyblockFeatures.config.ThreeWeirdosSolver) return;
43 | String message = Utils.cleanColor(event.message.getUnformattedText());
44 | // §e[NPC] §cLino§f: The reward is in my chest!
45 | for(String riddleAnswer:riddleAnswers) {
46 | if(!message.contains(riddleAnswer)) continue;
47 |
48 | String npcName = message.substring(6, message.indexOf(":"));
49 | Utils.sendMessage(ChatFormatting.RED+""+ChatFormatting.BOLD+npcName+ChatFormatting.YELLOW+ChatFormatting.BOLD+" has the reward!");
50 | for(Entity entity:Utils.GetMC().theWorld.loadedEntityList) {
51 | if(!(entity instanceof EntityArmorStand)) continue;
52 | if(!entity.getCustomNameTag().contains(npcName)) continue;
53 | int[][] directionOffsets = {
54 | {0, 1}, // North
55 | {-1, 0}, // West
56 | {1, 0}, // East
57 | {0, -1}, // South
58 | };
59 | for (int[] offset : directionOffsets) {
60 |
61 | int xOffset = offset[0];
62 | int zOffset = offset[1];
63 |
64 | BlockPos blockPos = entity.getPosition().add(xOffset, 0, zOffset);
65 |
66 | checking.add(blockPos);
67 | Block block = Utils.GetMC().theWorld.getBlockState(blockPos).getBlock();
68 |
69 | if(block instanceof BlockChest) {
70 | answerChest=blockPos;
71 | }
72 | }
73 | }
74 | }
75 | }
76 |
77 | @SubscribeEvent
78 | public void onRender(RenderWorldLastEvent event) {
79 | if (!Utils.inDungeons || answerChest==null || !SkyblockFeatures.config.ThreeWeirdosSolver) return;
80 | AxisAlignedBB aabb = new AxisAlignedBB(answerChest, answerChest.add(1, 1, 1));
81 | RenderUtil.drawOutlinedFilledBoundingBox(aabb,Color.CYAN,event.partialTicks);
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/dungeons/solvers/terminals/ClickInOrderSolver.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.dungeons.solvers.terminals;
2 |
3 | import mrfast.sbf.SkyblockFeatures;
4 | import mrfast.sbf.events.GuiContainerEvent;
5 | import mrfast.sbf.events.SlotClickedEvent;
6 | import mrfast.sbf.utils.GuiUtils;
7 | import net.minecraft.client.Minecraft;
8 | import net.minecraft.client.gui.Gui;
9 | import net.minecraft.client.gui.inventory.GuiChest;
10 | import net.minecraft.inventory.ContainerChest;
11 | import net.minecraft.inventory.Slot;
12 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
13 | import net.minecraftforge.event.world.WorldEvent;
14 | import java.awt.*;
15 | import java.util.HashMap;
16 |
17 | public class ClickInOrderSolver {
18 | static int currentNumber = 1;
19 | HashMap orderMap = new HashMap<>();
20 |
21 | @SubscribeEvent
22 | public void onSlotClick(SlotClickedEvent event) {
23 | if (!(Minecraft.getMinecraft().currentScreen instanceof GuiChest) || !SkyblockFeatures.config.clickInOrderSolver) return;
24 |
25 | if (event.chestName.contains("Click in order")) {
26 | if(event.slot.getStack()==null) return;
27 |
28 | if(event.slot.getStack().getMetadata()==14) {
29 | currentNumber++;
30 | }
31 | }
32 | }
33 |
34 | @SubscribeEvent
35 | public void onWindowClose(GuiContainerEvent.CloseWindowEvent event) {
36 | currentNumber = 1;
37 | orderMap.clear();
38 | }
39 | @SubscribeEvent
40 | public void onWorldChanges(WorldEvent.Load event) {
41 | currentNumber = 1;
42 | orderMap.clear();;
43 | }
44 |
45 | @SubscribeEvent
46 | public void onSlotDraw(GuiContainerEvent.DrawSlotEvent.Pre event) {
47 | if (!(Minecraft.getMinecraft().currentScreen instanceof GuiChest) || !SkyblockFeatures.config.clickInOrderSolver) return;
48 |
49 | if(event.chestName==null) return;
50 | if(event.chestName.contains("Click in order")) {
51 | if(!event.slot.getHasStack()) return;
52 | if(event.slot.getStack().getMetadata()==14) {
53 | orderMap.put(event.slot,event.slot.getStack().stackSize);
54 | event.setCanceled(true);
55 | }
56 | }
57 | }
58 |
59 | @SubscribeEvent
60 | public void onScreenDraw(GuiContainerEvent.TitleDrawnEvent event) {
61 | if (!(Minecraft.getMinecraft().currentScreen instanceof GuiChest) || !SkyblockFeatures.config.clickInOrderSolver) return;
62 |
63 | GuiChest chest = (GuiChest) Minecraft.getMinecraft().currentScreen;
64 | ContainerChest cont = (ContainerChest) chest.inventorySlots;
65 | String name = cont.getLowerChestInventory().getName();
66 |
67 | // Using contains rather than equals so it works for practice terminals aswell
68 | if (name.contains("Click in order") && SkyblockFeatures.config.clickInOrderSolver) {
69 | for (Slot slot : orderMap.keySet()) {
70 | if(slot.getStack()==null) continue;
71 | int order = orderMap.get(slot);
72 | int x = slot.xDisplayPosition;
73 | int y = slot.yDisplayPosition;
74 | Color color = null;
75 | if (order == currentNumber) {
76 | color = SkyblockFeatures.config.clickInOrderSolverCurrent;
77 | }
78 | if (order == currentNumber + 1) {
79 | color = SkyblockFeatures.config.clickInOrderSolverNext;
80 | }
81 | if (order == currentNumber + 2) {
82 | color = SkyblockFeatures.config.clickInOrderSolverNext2;
83 | }
84 |
85 | if (color != null) {
86 | Gui.drawRect(x, y, x + 16, y + 16, color.getRGB());
87 | }
88 | GuiUtils.drawText(order + "", x + 4, y + 4, GuiUtils.TextStyle.DROP_SHADOW);
89 | }
90 | }
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/dungeons/solvers/terminals/ColorPanesSolver.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.dungeons.solvers.terminals;
2 |
3 | public class ColorPanesSolver {
4 | }
5 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/dungeons/solvers/terminals/CorrectPanes.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.dungeons.solvers.terminals;
2 |
3 | public class CorrectPanes {
4 | }
5 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/dungeons/solvers/terminals/StartsWithSolver.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.dungeons.solvers.terminals;
2 |
3 | public class StartsWithSolver {
4 | }
5 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/events/JerryTimer.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.events;
2 |
3 | import com.google.gson.JsonObject;
4 | import mrfast.sbf.SkyblockFeatures;
5 | import mrfast.sbf.events.SecondPassedEvent;
6 | import mrfast.sbf.gui.components.Point;
7 | import mrfast.sbf.gui.components.UIElement;
8 | import mrfast.sbf.utils.NetworkUtils;
9 | import mrfast.sbf.utils.Utils;
10 | import net.minecraft.client.Minecraft;
11 | import net.minecraft.util.EnumChatFormatting;
12 | import net.minecraftforge.client.event.ClientChatReceivedEvent;
13 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
14 |
15 |
16 | public class JerryTimer {
17 | public static int seconds = 360;
18 | public static String display = EnumChatFormatting.LIGHT_PURPLE + "Jerry: " + "6:00";
19 | private static final Minecraft mc = Minecraft.getMinecraft();
20 | static boolean checkedMayor = false;
21 | static boolean isJerryMayor = false;
22 |
23 | @SubscribeEvent
24 | public void onSeconds(SecondPassedEvent event) {
25 | if (!SkyblockFeatures.config.jerryTimer || !Utils.inSkyblock) return;
26 |
27 | if(!checkedMayor) {
28 | checkedMayor = true;
29 | new Thread(()->{
30 | JsonObject mayorResponse = NetworkUtils.getJSONResponse("https://api.hypixel.net/resources/skyblock/election",new String[]{},true,false);
31 | String currentMayor = mayorResponse.get("mayor").getAsJsonObject().get("name").getAsString();
32 | if(currentMayor.equals("Jerry")) {
33 | isJerryMayor = true;
34 | }
35 | }).start();
36 | }
37 | if(!isJerryMayor) return;
38 |
39 | if (seconds < 361 && seconds > 0) {
40 | seconds--;
41 | }
42 | if (seconds == 0) {
43 | display = EnumChatFormatting.LIGHT_PURPLE + "Jerry: " + EnumChatFormatting.GREEN + "Ready!";
44 | return;
45 | }
46 | int secondsDisplay = seconds % 60;
47 | if (("" + seconds % 60).length() == 1) {
48 | display = EnumChatFormatting.LIGHT_PURPLE + "Jerry: " + EnumChatFormatting.RED + seconds / 60 + ":0" + secondsDisplay;
49 | } else {
50 | display = EnumChatFormatting.LIGHT_PURPLE + "Jerry: " + EnumChatFormatting.RED + seconds / 60 + ":" + secondsDisplay;
51 | }
52 | }
53 |
54 | @SubscribeEvent
55 | public void onChat(ClientChatReceivedEvent event) {
56 | if (!SkyblockFeatures.config.jerryTimer || !isJerryMayor) return;
57 |
58 | String unformatted = event.message.getUnformattedText();
59 | if (unformatted.contains("☺") && unformatted.contains("Jerry") && !unformatted.contains("Jerry Box")) {
60 | seconds = 359;
61 | }
62 | }
63 | static {
64 | new JerryTimerGUI();
65 | }
66 | public static class JerryTimerGUI extends UIElement {
67 | public JerryTimerGUI() {
68 | super("Jerry Timer", new Point(0.2f, 0.0f));
69 | SkyblockFeatures.GUIMANAGER.registerElement(this);
70 | }
71 |
72 | @Override
73 | public void drawElement() {
74 | if(mc.thePlayer == null || !Utils.inSkyblock) return;
75 | if (this.getToggled() && Minecraft.getMinecraft().thePlayer != null && mc.theWorld != null) {
76 | mc.fontRendererObj.drawString(display, 0, 0, 0xFFFFFF, true);
77 | }
78 | }
79 | @Override
80 | public void drawElementExample() {
81 | if(mc.thePlayer == null || !Utils.inSkyblock) return;
82 | mc.fontRendererObj.drawString(display, 0, 0, 0xFFFFFF, true);
83 | }
84 |
85 | @Override
86 | public boolean getToggled() {
87 | return SkyblockFeatures.config.jerryTimer;
88 | }
89 |
90 | @Override
91 | public boolean getRequirement() {
92 | return Utils.inSkyblock && isJerryMayor;
93 | }
94 |
95 | @Override
96 | public int getHeight() {
97 | return Utils.GetMC().fontRendererObj.FONT_HEIGHT;
98 | }
99 |
100 | @Override
101 | public int getWidth() {
102 | return 12 + Utils.GetMC().fontRendererObj.getStringWidth(display);
103 | }
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/events/MayorJerry.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.events;
2 |
3 | import net.minecraft.client.renderer.GlStateManager;
4 | import net.minecraft.entity.Entity;
5 | import net.minecraftforge.client.event.ClientChatReceivedEvent;
6 | import net.minecraftforge.client.event.RenderWorldLastEvent;
7 | import net.minecraftforge.fml.common.eventhandler.EventPriority;
8 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
9 |
10 | import java.util.regex.Matcher;
11 | import java.util.regex.Pattern;
12 |
13 | import com.mojang.realmsclient.gui.ChatFormatting;
14 |
15 | import mrfast.sbf.SkyblockFeatures;
16 | import mrfast.sbf.gui.GuiManager;
17 | import mrfast.sbf.utils.Utils;
18 |
19 | public class MayorJerry {
20 |
21 | private static final Pattern jerryType = Pattern.compile("(\\w+)(?=\\s+Jerry)");
22 |
23 | @SubscribeEvent(priority = EventPriority.HIGHEST, receiveCanceled = true)
24 | public void onChat(ClientChatReceivedEvent event) {
25 | if (!Utils.inSkyblock || !SkyblockFeatures.config.hiddenJerryAlert) return;
26 | String unformatted = Utils.cleanColor(event.message.getUnformattedText());
27 | if (unformatted.contains("☺") && unformatted.contains("Jerry") && !unformatted.contains("Jerry Box")) {
28 | Matcher matcher = jerryType.matcher(event.message.getFormattedText());
29 | if (matcher.find()) {
30 | String color = matcher.group(1);
31 | GuiManager.createTitle("§" + color.toUpperCase() + " JERRY!", 60);
32 | }
33 | }
34 | }
35 |
36 | @SubscribeEvent
37 | public void onRender3D(RenderWorldLastEvent event) {
38 | if(!SkyblockFeatures.config.hiddenJerryAlert) return;
39 |
40 | for(Entity player : Utils.GetMC().theWorld.loadedEntityList) {
41 | if(player.hasCustomName()) {
42 | if(player.getCustomNameTag().contains("Jerry")) {
43 | double x = interpolate(player.lastTickPosX, player.posX, event.partialTicks) - Utils.GetMC().getRenderManager().viewerPosX;
44 | double y = interpolate(player.lastTickPosY, player.posY, event.partialTicks) - Utils.GetMC().getRenderManager().viewerPosY;
45 | double z = interpolate(player.lastTickPosZ, player.posZ, event.partialTicks) - Utils.GetMC().getRenderManager().viewerPosZ;
46 | // renderNameTag(player, ChatFormatting.GREEN+player.getName(), x , y, z, event.partialTicks);
47 | renderNameTag(ChatFormatting.GREEN+"Jerry", x , y, z);
48 | }
49 | }
50 | }
51 | }
52 |
53 | public static double interpolate(double previous, double current, float delta) {
54 | return (previous + (current - previous) * delta);
55 | }
56 |
57 | private void renderNameTag(String a, double x, double y, double z) {
58 | int width = Utils.GetMC().fontRendererObj.getStringWidth(a) / 2;
59 |
60 | float f = 1.6F;
61 | float f1 = 0.016666668F * f;
62 |
63 | GlStateManager.pushMatrix();
64 | GlStateManager.translate(x, y+0.8, z);
65 | GlStateManager.rotate(-Utils.GetMC().getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F);
66 | GlStateManager.rotate(Utils.GetMC().getRenderManager().playerViewX, Utils.GetMC().gameSettings.thirdPersonView == 2 ? -1.0F : 1.0F, 0.0F, 0.0F);
67 | GlStateManager.scale(-f1, -f1, -f1);
68 | GlStateManager.disableLighting();
69 | GlStateManager.disableDepth();
70 |
71 | Utils.GetMC().fontRendererObj.drawStringWithShadow(a, -width, -(Utils.GetMC().fontRendererObj.FONT_HEIGHT - 1), 0x7FFF00);
72 |
73 | GlStateManager.enableDepth();
74 | GlStateManager.popMatrix();
75 | }
76 |
77 | }
78 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/items/FireFreezeDisplay.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.items;
2 |
3 | import com.mojang.realmsclient.gui.ChatFormatting;
4 | import mrfast.sbf.SkyblockFeatures;
5 | import mrfast.sbf.events.UseItemAbilityEvent;
6 | import mrfast.sbf.utils.RenderUtil;
7 | import mrfast.sbf.utils.Utils;
8 | import net.minecraft.util.Vec3;
9 | import net.minecraftforge.client.event.RenderWorldLastEvent;
10 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
11 |
12 | public class FireFreezeDisplay {
13 | Vec3 activatedPos;
14 | Long activatedAt;
15 | @SubscribeEvent
16 | public void onItemUse(UseItemAbilityEvent event) {
17 | if(SkyblockFeatures.config.fireFreezeStaffFreezeTimer && event.ability.itemId.equals("FIRE_FREEZE_STAFF")) {
18 | activatedAt = System.currentTimeMillis();
19 | activatedPos = Utils.GetMC().thePlayer.getPositionVector();
20 | }
21 | }
22 | @SubscribeEvent
23 | public void onRenderWorld(RenderWorldLastEvent event) {
24 | if(activatedPos!=null && SkyblockFeatures.config.fireFreezeStaffFreezeTimer) {
25 | String seconds = Utils.msToSeconds(5000-(System.currentTimeMillis()-activatedAt),1);
26 | RenderUtil.draw3DStringWithShadow(activatedPos.addVector(0,1,0), ChatFormatting.YELLOW+seconds,event.partialTicks);
27 |
28 | if(System.currentTimeMillis()-activatedAt>5000) {
29 | activatedAt = null;
30 | activatedPos = null;
31 | }
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/items/FireVeilTimer.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.items;
2 |
3 | import com.mojang.realmsclient.gui.ChatFormatting;
4 | import mrfast.sbf.SkyblockFeatures;
5 | import mrfast.sbf.events.UseItemAbilityEvent;
6 | import mrfast.sbf.gui.GuiManager;
7 | import mrfast.sbf.utils.Utils;
8 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
9 | import net.minecraftforge.fml.common.gameevent.TickEvent;
10 |
11 | public class FireVeilTimer {
12 | double time = 0;
13 | boolean startCounting = false;
14 | @SubscribeEvent
15 | public void onItemAbilityUse(UseItemAbilityEvent event) {
16 | if(!SkyblockFeatures.config.fireVeilTimer) return;
17 | if(event.ability.itemId.equals("FIRE_VEIL_WAND")) {
18 | startCounting = true;
19 | }
20 | }
21 |
22 | @SubscribeEvent
23 | public void onTick(TickEvent.ClientTickEvent event) {
24 | if(!SkyblockFeatures.config.fireVeilTimer || event.phase != TickEvent.Phase.START) return;
25 |
26 | if(startCounting) {
27 | time+=0.05;
28 | if (time<=5d) {
29 | GuiManager.createTitle(ChatFormatting.RED+Utils.round(5d-time,1)+"s",1,false);
30 | } else {
31 | startCounting = false;
32 | time = 0;
33 | }
34 | }
35 | }
36 |
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/items/GloomlockProtection.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.items;
2 |
3 | import com.mojang.realmsclient.gui.ChatFormatting;
4 | import mrfast.sbf.SkyblockFeatures;
5 | import mrfast.sbf.events.UseItemAbilityEvent;
6 | import mrfast.sbf.utils.Utils;
7 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
8 |
9 | public class GloomlockProtection {
10 | @SubscribeEvent
11 | public void onItemAbility(UseItemAbilityEvent event) {
12 | if(!SkyblockFeatures.config.gloomlockGrimoireProtection) return;
13 |
14 | if(event.ability.abilityName.equals("Life Tap") && event.ability.itemId.equals("GLOOMLOCK_GRIMOIRE")) {
15 | int currentHealth = Utils.health;
16 | int maxHealth = Utils.maxHealth;
17 | if(currentHealth<=Math.round((float) maxHealth *0.25)) {
18 | Utils.sendMessage(ChatFormatting.RED+"This ability was blocked due to < 25% health");
19 | event.setCanceled(true);
20 | }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/mining/CommissionHighlighter.kt:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.mining
2 |
3 | import mrfast.sbf.SkyblockFeatures
4 | import mrfast.sbf.events.GuiContainerEvent.DrawSlotEvent
5 | import mrfast.sbf.utils.ItemUtils
6 | import mrfast.sbf.utils.Utils
7 | import net.minecraft.client.gui.Gui
8 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
9 |
10 | class CommissionHighlighter {
11 | @SubscribeEvent
12 | fun onDrawSlot(event: DrawSlotEvent.Pre) {
13 | if (!SkyblockFeatures.config.highlightCompletedCommissions || event.slot.stack==null) return
14 |
15 | if (Utils.cleanColor(event.slot.stack.displayName).startsWith("Commission")) {
16 | for (line in ItemUtils.getItemLore(event.slot.stack)) {
17 | if (line.contains("COMPLETED")) {
18 | Gui.drawRect(event.slot.xDisplayPosition,
19 | event.slot.yDisplayPosition,
20 | event.slot.xDisplayPosition + 16,
21 | event.slot.yDisplayPosition + 16,
22 | SkyblockFeatures.config.highlightCompletedCommissionsColor.rgb)
23 | }
24 | }
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/mining/HighlightCobblestone.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.mining;
2 |
3 | import java.awt.Color;
4 | import java.util.ArrayList;
5 | import java.util.List;
6 |
7 | import mrfast.sbf.SkyblockFeatures;
8 | import mrfast.sbf.core.SkyblockInfo;
9 | import mrfast.sbf.events.BlockChangeEvent;
10 | import mrfast.sbf.features.overlays.maps.CrystalHollowsMap;
11 | import mrfast.sbf.utils.RenderUtil;
12 | import mrfast.sbf.utils.Utils;
13 | import net.minecraft.client.renderer.GlStateManager;
14 | import net.minecraft.init.Blocks;
15 | import net.minecraft.util.AxisAlignedBB;
16 | import net.minecraft.util.BlockPos;
17 | import net.minecraftforge.client.event.RenderWorldLastEvent;
18 | import net.minecraftforge.event.world.WorldEvent;
19 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
20 |
21 | public class HighlightCobblestone {
22 | List cobblestonePostitions = new ArrayList();
23 |
24 | @SubscribeEvent
25 | public void onBlockPlace(BlockChangeEvent event) {
26 | if(!SkyblockFeatures.config.highlightCobblestone || SkyblockInfo.getLocation() != null && !CrystalHollowsMap.inCrystalHollows) return;
27 | if(event.getNew().getBlock() == Blocks.cobblestone && !cobblestonePostitions.contains(event.pos) && Utils.GetMC().thePlayer.getDistance(event.pos.getX(), event.pos.getY(), event.pos.getZ())<10) {
28 | if(Utils.GetMC().thePlayer.getHeldItem()!=null) {
29 | if(Utils.GetMC().thePlayer.getHeldItem().getDisplayName().contains("Cobblestone")) {
30 | cobblestonePostitions.add(event.pos);
31 | }
32 | }
33 | }
34 | }
35 |
36 | @SubscribeEvent
37 | public void onWorldChange(WorldEvent.Load event) {
38 | if(!SkyblockFeatures.config.highlightCobblestone) return;
39 | cobblestonePostitions.clear();
40 | }
41 |
42 | @SubscribeEvent
43 | public void RenderWorldLastEvent(RenderWorldLastEvent event) {
44 | if(!SkyblockFeatures.config.highlightCobblestone) return;
45 |
46 | try {
47 | GlStateManager.disableDepth();
48 | for(BlockPos pos:cobblestonePostitions) {
49 | if(Utils.GetMC().theWorld.getBlockState(pos).getBlock() != Blocks.cobblestone) {
50 | cobblestonePostitions.remove(pos);
51 | }
52 | AxisAlignedBB box = new AxisAlignedBB(pos, pos.add(1, 1, 1));
53 | RenderUtil.drawOutlinedFilledBoundingBox(box, SkyblockFeatures.config.highlightCobblestoneColor, event.partialTicks);
54 | }
55 | GlStateManager.enableDepth();
56 | } catch (Exception e) {
57 | // TODO: handle exception
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/misc/ChronomotronSolver.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.misc;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import mrfast.sbf.SkyblockFeatures;
7 | import mrfast.sbf.events.SlotClickedEvent;
8 | import mrfast.sbf.events.GuiContainerEvent.TitleDrawnEvent;
9 | import mrfast.sbf.utils.ItemUtils;
10 | import mrfast.sbf.utils.Utils;
11 | import net.minecraft.init.Blocks;
12 | import net.minecraft.inventory.IInventory;
13 | import net.minecraft.inventory.Slot;
14 | import net.minecraft.item.Item;
15 | import net.minecraft.item.ItemStack;
16 | import net.minecraftforge.client.event.GuiOpenEvent;
17 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
18 |
19 | public class ChronomotronSolver {
20 | static int lastChronomatronRound = 0;
21 | static List chronomatronPattern = new ArrayList<>();
22 | static int chronomatronMouseClicks = 0;
23 |
24 | @SubscribeEvent
25 | public void onSlotClick(SlotClickedEvent event) {
26 | if(!SkyblockFeatures.config.enchantingSolvers) return;
27 | if (event.chestName.startsWith("Chronomatron (")) {
28 | IInventory inventory = event.inventory;
29 | ItemStack item = event.item;
30 | if (item == null) return;
31 | if (inventory.getStackInSlot(49).getDisplayName().startsWith("§7Timer: §a") && (item.getItem() == Item.getItemFromBlock(Blocks.stained_glass) || item.getItem() == Item.getItemFromBlock(Blocks.stained_hardened_clay))) {
32 | chronomatronMouseClicks++;
33 | }
34 | }
35 | }
36 |
37 | @SubscribeEvent
38 | public void onGuiBackground(TitleDrawnEvent event) {
39 | if(!SkyblockFeatures.config.enchantingSolvers) return;
40 |
41 | if(event.displayName.startsWith("Chronomatron (")) {
42 | List invSlots = event.container.inventorySlots;
43 | if (invSlots.size() > 48 && invSlots.get(49).getStack() != null) {
44 | if (invSlots.get(49).getStack().getDisplayName().startsWith("§7Timer: §a") && invSlots.get(4).getStack() != null) {
45 | int round = invSlots.get(4).getStack().stackSize;
46 | int timerSeconds = Integer.parseInt(Utils.cleanColor(invSlots.get(49).getStack().getDisplayName()).replaceAll("[^\\d]", ""));
47 | if (round != lastChronomatronRound && timerSeconds == round + 2) {
48 | lastChronomatronRound = round;
49 | for (int i = 10; i <= 43; i++) {
50 | ItemStack stack = invSlots.get(i).getStack();
51 | if (stack == null) continue;
52 | if (stack.getItem() == Item.getItemFromBlock(Blocks.stained_hardened_clay)) {
53 | chronomatronPattern.add(stack.getDisplayName());
54 | break;
55 | }
56 | }
57 | }
58 | if (chronomatronMouseClicks < chronomatronPattern.size()) {
59 | for (int i = 10; i <= 43; i++) {
60 | ItemStack glass = invSlots.get(i).getStack();
61 | if (glass == null) continue;
62 | if (!glass.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks))) {
63 | event.container.putStackInSlot(i, ItemUtils.menuGlass);
64 | }
65 | }
66 | }
67 | } else if (invSlots.get(49).getStack().getDisplayName().equals("§aRemember the pattern!")) {
68 | chronomatronMouseClicks = 0;
69 | }
70 | }
71 | }
72 | }
73 |
74 | @SubscribeEvent
75 | public void onGuiOpen(GuiOpenEvent event) {
76 | if(!SkyblockFeatures.config.enchantingSolvers) return;
77 | lastChronomatronRound = 0;
78 | chronomatronPattern.clear();
79 | chronomatronMouseClicks = 0;
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/misc/GlowingItems.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.misc;
2 |
3 | import mrfast.sbf.SkyblockFeatures;
4 | import mrfast.sbf.core.SkyblockInfo;
5 | import mrfast.sbf.events.RenderEntityOutlineEvent;
6 | import mrfast.sbf.utils.ItemRarity;
7 | import mrfast.sbf.utils.ItemUtils;
8 | import mrfast.sbf.utils.Utils;
9 | import net.minecraft.entity.Entity;
10 | import net.minecraft.entity.item.EntityItem;
11 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
12 |
13 | public class GlowingItems {
14 | @SubscribeEvent
15 | public void onRenderEntityOutlines(RenderEntityOutlineEvent event) {
16 | if(Utils.GetMC().theWorld == null || Utils.GetMC().thePlayer == null || SkyblockInfo.getLocation()==null || !SkyblockFeatures.config.glowingItems) return;
17 | if (event.type == RenderEntityOutlineEvent.Type.NO_XRAY) return;
18 |
19 | for (Entity entity : Utils.GetMC().theWorld.loadedEntityList) {
20 | if (entity instanceof EntityItem) {
21 | ItemRarity itemRarity = ItemUtils.getRarity(((EntityItem)entity).getEntityItem());
22 | event.queueEntityToOutline(entity,itemRarity.getColor());
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/misc/SpamHider.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.misc;
2 |
3 | import mrfast.sbf.SkyblockFeatures;
4 | import mrfast.sbf.events.PacketEvent;
5 | import mrfast.sbf.utils.Utils;
6 | import net.minecraft.network.play.server.S02PacketChat;
7 | import net.minecraftforge.client.event.ClientChatReceivedEvent;
8 | import net.minecraftforge.common.MinecraftForge;
9 | import net.minecraftforge.fml.common.eventhandler.EventPriority;
10 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
11 |
12 | public class SpamHider {
13 |
14 | private static void cancelChatPacket(PacketEvent.ReceiveEvent ReceivePacketEvent) {
15 | if (!(ReceivePacketEvent.packet instanceof S02PacketChat)) return;
16 | ReceivePacketEvent.setCanceled(true);
17 | S02PacketChat packet = ((S02PacketChat) ReceivePacketEvent.packet);
18 | MinecraftForge.EVENT_BUS.post(new ClientChatReceivedEvent(packet.getType(), packet.getChatComponent()));
19 | }
20 |
21 | @SubscribeEvent(priority = EventPriority.LOWEST, receiveCanceled = true)
22 | public void onChatPacket(PacketEvent.ReceiveEvent event) {
23 | if (!(event.packet instanceof S02PacketChat) || !Utils.inSkyblock) return;
24 | S02PacketChat packet = (S02PacketChat) event.packet;
25 | if (packet.getType() == 2) return;
26 | String unformatted = Utils.cleanColor(packet.getChatComponent().getUnformattedText());
27 |
28 | try {
29 | String u = unformatted.toLowerCase();
30 | if (SkyblockFeatures.config.hideAnitaArtifactNotification) {
31 | if (unformatted.startsWith("[NPC] Jacob: Your Anita's") || unformatted.equals("[NPC] Jacob: My contest has started!")) {
32 | cancelChatPacket(event);
33 | }
34 | }
35 | if (SkyblockFeatures.config.hideSlowdownCommandWarning) {
36 | if (unformatted.startsWith("You are sending commands too fast! Please slow down.")) {
37 | cancelChatPacket(event);
38 | }
39 | }
40 | if (SkyblockFeatures.config.hideAdvertisements) {
41 | if (unformatted.startsWith("[Auction]") ||
42 | unformatted.contains("collected an auction for") ||
43 | unformatted.startsWith("You claimed") ||
44 | unformatted.contains("Bid of") ||
45 | unformatted.contains("created a") ||
46 | unformatted.contains("Auction started") ||
47 | unformatted.startsWith("From") ||
48 | unformatted.startsWith("To") ||
49 | unformatted.startsWith("-----------------------------------------------------"))
50 | return;
51 |
52 | if (SkyblockFeatures.config.hideAdvertisementsLowball && (u.contains("percent") || (u.contains("low") || u.contains("ball")))) {
53 | cancelChatPacket(event);
54 | }
55 | if (SkyblockFeatures.config.hideAdvertisementsAll && (
56 | u.contains("/visit") ||
57 | u.contains("selling") ||
58 | u.contains("buying") ||
59 | u.contains("visit") ||
60 | u.contains(" ah") ||
61 | u.contains("auction") ||
62 | u.contains("guild") ||
63 | u.contains("can buy") ||
64 | u.contains("/p me") ||
65 | u.contains("free") ||
66 | u.contains("carry") ||
67 | u.contains("carries"))) {
68 | cancelChatPacket(event);
69 | }
70 | }
71 | } catch (Exception e) {
72 | e.printStackTrace();
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/misc/TreecapCooldown.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.misc;
2 |
3 | import java.awt.Color;
4 |
5 | import mrfast.sbf.SkyblockFeatures;
6 | import mrfast.sbf.events.BlockChangeEvent;
7 | import mrfast.sbf.utils.ItemUtils;
8 | import mrfast.sbf.utils.Utils;
9 | import net.minecraft.block.BlockAir;
10 | import net.minecraft.block.BlockLog;
11 | import net.minecraft.client.Minecraft;
12 | import net.minecraft.client.gui.ScaledResolution;
13 | import net.minecraft.item.ItemStack;
14 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
15 | import net.minecraftforge.fml.common.gameevent.TickEvent;
16 | import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent;
17 |
18 | public class TreecapCooldown {
19 | public static double seconds = 2.0;
20 | private static final Minecraft mc = Minecraft.getMinecraft();
21 |
22 | @SubscribeEvent
23 | public void onPlayerInteractEvent(BlockChangeEvent event) {
24 | if (!Utils.inSkyblock || mc.thePlayer.getHeldItem() == null || !SkyblockFeatures.config.treecapCooldown) return;
25 |
26 | if (mc.thePlayer.getHeldItem().getDisplayName().toLowerCase().contains("treecapitator") && event.getNew().getBlock() instanceof BlockAir && event.getOld().getBlock() instanceof BlockLog && Utils.GetMC().thePlayer.getDistanceSq(event.pos) < 20) {
27 | if (seconds <= 0) {
28 | seconds = 2;
29 | }
30 | }
31 | }
32 |
33 | @SubscribeEvent
34 | public void onTick(RenderTickEvent event) {
35 | if (!Utils.inSkyblock || !SkyblockFeatures.config.treecapCooldown || Minecraft.getMinecraft().currentScreen != null)
36 | return;
37 |
38 | boolean hasTreecap = false;
39 |
40 | if (SkyblockFeatures.config.treecapHeld) {
41 | ItemStack stack = Utils.GetMC().thePlayer.getHeldItem();
42 | if (stack == null || ItemUtils.getSkyBlockItemID(stack) == null) return;
43 |
44 | if (ItemUtils.getSkyBlockItemID(stack).equals("TREECAPITATOR_AXE")) {
45 | hasTreecap = true;
46 | }
47 | } else {
48 | for (int i = 0; i < 8; i++) {
49 | if (Utils.GetMC().thePlayer.inventory.mainInventory[i] == null) continue;
50 | ItemStack stack = Utils.GetMC().thePlayer.inventory.mainInventory[i];
51 | if (ItemUtils.getSkyBlockItemID(stack) == null) return;
52 | if (ItemUtils.getSkyBlockItemID(stack).equals("TREECAPITATOR_AXE")) {
53 | hasTreecap = true;
54 | }
55 | }
56 | }
57 |
58 |
59 | if (hasTreecap) {
60 | ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft());
61 | int guiLeft = (sr.getScaledWidth() - 176) / 2;
62 | int guiTop = (sr.getScaledHeight() - 222) / 2;
63 | if (seconds > 0) {
64 | float x = guiLeft + 85;
65 | int y = guiTop + 120;
66 | if (seconds <= 10) x = guiLeft + 82.5f;
67 |
68 | Minecraft.getMinecraft().fontRendererObj.drawString(Utils.round(seconds, 1), x, y, new Color(255, 85, 85).getRGB(), true);
69 | } else {
70 |
71 | int x = guiLeft + 85;
72 | int y = guiTop + 120;
73 |
74 | Minecraft.getMinecraft().fontRendererObj.drawString("✔", x, y, new Color(85, 255, 85).getRGB(), true);
75 | }
76 | }
77 | }
78 |
79 | @SubscribeEvent
80 | public void onSeconds(TickEvent.ClientTickEvent event) {
81 | if (event.phase != TickEvent.Phase.START || !Utils.inSkyblock) return;
82 | if (seconds > 0) {
83 | seconds -= 0.05;
84 | }
85 | }
86 |
87 | }
88 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/overlays/DamageOverlays.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.overlays;
2 |
3 | import mrfast.sbf.SkyblockFeatures;
4 | import mrfast.sbf.utils.Utils;
5 | import net.minecraft.client.gui.ScaledResolution;
6 | import net.minecraft.client.renderer.GlStateManager;
7 | import net.minecraft.client.renderer.Tessellator;
8 | import net.minecraft.client.renderer.WorldRenderer;
9 | import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
10 | import net.minecraft.util.ResourceLocation;
11 | import net.minecraftforge.client.event.RenderGameOverlayEvent;
12 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
13 |
14 | public class DamageOverlays {
15 | @SubscribeEvent
16 | public void onRenderHealth(RenderGameOverlayEvent.Post event) {
17 | if (event.type == RenderGameOverlayEvent.ElementType.HEALTH && Utils.inSkyblock && SkyblockFeatures.config.damagetint && Utils.GetMC().thePlayer!=null) {
18 | try {
19 | GlStateManager.pushMatrix();
20 | renderTint(Utils.health, new ScaledResolution(Utils.GetMC()));
21 | GlStateManager.popMatrix();
22 | } catch (Exception e) {
23 | // TODO: handle exception
24 | }
25 | }
26 | }
27 |
28 | private void renderTint(float currentHealth, ScaledResolution resolution) {
29 | float threshold = (float) Utils.maxHealth /2;
30 | if (currentHealth <= threshold) {
31 | float f = (threshold - currentHealth) / threshold + 1.0F / threshold * 2.0F;
32 | GlStateManager.pushMatrix();
33 | GlStateManager.enableBlend();
34 | GlStateManager.disableDepth();
35 | GlStateManager.depthMask(false);
36 | GlStateManager.tryBlendFuncSeparate(0, 769, 1, 0);
37 | GlStateManager.color(0.0F, f, f, 1.0F);
38 | Utils.GetMC().getTextureManager().bindTexture(tint);
39 | WorldRenderer worldRenderer = tessellator.getWorldRenderer();
40 | worldRenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
41 | worldRenderer.pos(0.0D, resolution.getScaledHeight(), -90.0D).tex(0.0D, 1.0D).endVertex();
42 | worldRenderer.pos(resolution.getScaledWidth(), resolution.getScaledHeight(), -90.0D).tex(1.0D, 1.0D).endVertex();
43 | worldRenderer.pos(resolution.getScaledWidth(), 0.0D, -90.0D).tex(1.0D, 0.0D).endVertex();
44 | worldRenderer.pos(0.0D, 0.0D, -90.0D).tex(0.0D, 0.0D).endVertex();
45 | tessellator.draw();
46 | GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
47 | GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
48 | GlStateManager.depthMask(true);
49 | GlStateManager.enableDepth();
50 | GlStateManager.disableBlend();
51 | GlStateManager.popMatrix();
52 | }
53 | }
54 |
55 | private static final Tessellator tessellator = Tessellator.getInstance();
56 | private static final ResourceLocation tint = new ResourceLocation("skyblockfeatures:gui/vignette.png");
57 | }
58 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/overlays/FinalDestinationOverlay.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.overlays;
2 |
3 | import com.mojang.realmsclient.gui.ChatFormatting;
4 | import mrfast.sbf.SkyblockFeatures;
5 | import mrfast.sbf.core.SkyblockInfo;
6 | import mrfast.sbf.gui.components.Point;
7 | import mrfast.sbf.gui.components.UIElement;
8 | import mrfast.sbf.utils.GuiUtils;
9 | import mrfast.sbf.utils.ItemUtils;
10 | import mrfast.sbf.utils.RenderUtil;
11 | import mrfast.sbf.utils.Utils;
12 | import net.minecraft.item.ItemStack;
13 |
14 | import java.util.regex.Matcher;
15 | import java.util.regex.Pattern;
16 |
17 | public class FinalDestinationOverlay {
18 | static {
19 | new FinalDestinationOverlayGui();
20 | }
21 | public static class FinalDestinationOverlayGui extends UIElement {
22 | public FinalDestinationOverlayGui() {
23 | super("Final Destination Armor Display", new Point(0.0f, 0.26018518f));
24 | SkyblockFeatures.GUIMANAGER.registerElement(this);
25 | }
26 | @Override
27 | public void drawElement() {
28 | drawArmor(false);
29 | }
30 |
31 | @Override
32 | public void drawElementExample() {
33 | drawArmor(true);
34 | }
35 |
36 | @Override
37 | public boolean getToggled() {
38 | return SkyblockFeatures.config.finalDestinationArmorDisplay;
39 | }
40 |
41 | @Override
42 | public boolean getRequirement() {
43 | return Utils.inSkyblock && SkyblockInfo.map.equals("The End");
44 | }
45 |
46 | @Override
47 | public int getHeight() {
48 | return 68;
49 | }
50 |
51 | @Override
52 | public int getWidth() {
53 | return Utils.GetMC().fontRendererObj.getStringWidth("Equip Final Destination Piece");
54 | }
55 | }
56 |
57 | public static void drawArmor(boolean example) {
58 | int drawnPieces = 0;
59 | for (int i = 0; i < 4; i++) {
60 | ItemStack stack = Utils.GetMC().thePlayer.getCurrentArmor(3-i);
61 |
62 | if(stack!=null && ItemUtils.getSkyBlockItemID(stack).startsWith("FINAL_DESTINATION")) {
63 | String currentBonus = "";
64 | int currentKills = 0;
65 | int nextUpgradeKills = 0;
66 | for (String line : ItemUtils.getItemLore(stack)) {
67 | line = Utils.cleanColor(line);
68 | if(line.startsWith("Next Upgrade: ")) {
69 | String regex = "\\((\\d{1,3}(?:,\\d{3})*?)/(\\d{1,3}(?:,\\d{3})*?)\\)";
70 | Pattern pattern = Pattern.compile(regex);
71 | Matcher matcher = pattern.matcher(line);
72 | if (matcher.find()) {
73 | currentKills = Integer.parseInt(matcher.group(1).replaceAll(",",""));
74 | nextUpgradeKills = Integer.parseInt(matcher.group(2).replaceAll(",",""));
75 | }
76 | }
77 | if(line.startsWith("Piece Bonus: ")) {
78 | String[] parts = line.split("\\+");
79 | if (parts.length > 1) {
80 | currentBonus = parts[1].trim();
81 | }
82 | }
83 | }
84 | RenderUtil.renderItemStackOnScreen(stack,0,i*16,16,16);
85 | String percentage = Utils.round(((double) currentKills / nextUpgradeKills)*100,2)+"%";
86 | if(SkyblockFeatures.config.finalDestinationArmorDisplayKills) {
87 | percentage = "§8(§a"+Utils.nf.format(currentKills)+"§7/§c"+Utils.nf.format(nextUpgradeKills)+"§8)";
88 | }
89 | String display = ChatFormatting.AQUA+" "+percentage+" "+ChatFormatting.GREEN+currentBonus;
90 | GuiUtils.drawText(display,18,(i*16)+4, GuiUtils.TextStyle.DROP_SHADOW);
91 | drawnPieces++;
92 | }
93 | }
94 | if(drawnPieces==0 && example) {
95 | GuiUtils.drawText(ChatFormatting.RED+"Equip Final Destination Piece!",0,0, GuiUtils.TextStyle.DROP_SHADOW);
96 | }
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/overlays/MiscOverlays.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.overlays;
2 |
3 | import java.text.SimpleDateFormat;
4 | import java.util.*;
5 |
6 | import com.mojang.realmsclient.gui.ChatFormatting;
7 |
8 | import mrfast.sbf.SkyblockFeatures;
9 | import mrfast.sbf.features.overlays.maps.CrystalHollowsMap;
10 | import mrfast.sbf.gui.components.Point;
11 | import mrfast.sbf.gui.components.UIElement;
12 | import mrfast.sbf.utils.GuiUtils;
13 | import mrfast.sbf.utils.Utils;
14 | import net.minecraft.client.Minecraft;
15 | import net.minecraftforge.client.event.RenderGameOverlayEvent;
16 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
17 |
18 | public class MiscOverlays {
19 | public static Minecraft mc = Utils.GetMC();
20 | static {
21 | new OnScreenClockGui();
22 | new DayTrackerGui();
23 | }
24 |
25 | @SubscribeEvent
26 | public void renderHealth(RenderGameOverlayEvent.Pre event) {
27 | if(Utils.inSkyblock) {
28 | if (event.type == RenderGameOverlayEvent.ElementType.FOOD && SkyblockFeatures.config.hideHungerBar) {
29 | event.setCanceled(true);
30 | }
31 | if (event.type == RenderGameOverlayEvent.ElementType.HEALTH && SkyblockFeatures.config.hideHealthHearts) {
32 | event.setCanceled(true);
33 | }
34 | if (event.type == RenderGameOverlayEvent.ElementType.ARMOR && SkyblockFeatures.config.hideArmorBar) {
35 | event.setCanceled(true);
36 | }
37 | }
38 | }
39 | public static String getTime() {
40 | return new SimpleDateFormat("hh:mm:ss").format(new Date());
41 | }
42 | public static class OnScreenClockGui extends UIElement {
43 | public OnScreenClockGui() {
44 | super("On-Screen Clock", new Point(0f,0f));
45 | SkyblockFeatures.GUIMANAGER.registerElement(this);
46 | }
47 |
48 | @Override
49 | public void drawElement() {
50 | GuiUtils.drawText("["+getTime()+"]",0,0, GuiUtils.TextStyle.BLACK_OUTLINE);
51 | }
52 |
53 | @Override
54 | public void drawElementExample() {
55 | GuiUtils.drawText("["+getTime()+"]",0,0, GuiUtils.TextStyle.BLACK_OUTLINE);
56 | }
57 |
58 | @Override
59 | public boolean getToggled() {
60 | return SkyblockFeatures.config.clock;
61 | }
62 |
63 | @Override
64 | public boolean getRequirement() {
65 | return Utils.inSkyblock;
66 | }
67 |
68 | @Override
69 | public int getHeight() {
70 | return Utils.GetMC().fontRendererObj.FONT_HEIGHT;
71 | }
72 |
73 | @Override
74 | public int getWidth() {
75 | return Utils.GetMC().fontRendererObj.getStringWidth("["+getTime()+"]");
76 | }
77 | }
78 |
79 | public static class DayTrackerGui extends UIElement {
80 | public DayTrackerGui() {
81 | super("Day Tracker", new Point(0.2f, 0.0f));
82 | SkyblockFeatures.GUIMANAGER.registerElement(this);
83 | }
84 |
85 | @Override
86 | public void drawElement() {
87 | long time = Utils.GetMC().theWorld.getWorldTime();
88 | double timeDouble = (double) time /20/60/20;
89 | double day = (Math.round(timeDouble*100.0))/100.0;
90 |
91 | GuiUtils.drawText(ChatFormatting.GREEN+"Day "+day,0,0, GuiUtils.TextStyle.BLACK_OUTLINE);
92 | }
93 |
94 | @Override
95 | public void drawElementExample() {
96 | GuiUtils.drawText(ChatFormatting.GREEN+"Day "+2,0,0, GuiUtils.TextStyle.BLACK_OUTLINE);
97 |
98 | }
99 |
100 | @Override
101 | public boolean getToggled() {
102 | return SkyblockFeatures.config.dayTracker;
103 | }
104 |
105 | @Override
106 | public boolean getRequirement() {
107 | return CrystalHollowsMap.inCrystalHollows && Utils.inSkyblock;
108 | }
109 |
110 | @Override
111 | public int getHeight() {
112 | return Utils.GetMC().fontRendererObj.FONT_HEIGHT;
113 | }
114 |
115 | @Override
116 | public int getWidth() {
117 | return Utils.GetMC().fontRendererObj.getStringWidth("["+getTime()+"]");
118 | }
119 | }
120 |
121 |
122 | }
123 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/overlays/RelicFinderWaypoints.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.overlays;
2 |
3 | import java.awt.Color;
4 | import java.util.HashSet;
5 | import java.util.Iterator;
6 |
7 | import mrfast.sbf.SkyblockFeatures;
8 | import mrfast.sbf.utils.RenderUtil;
9 | import net.minecraft.client.Minecraft;
10 | import net.minecraft.client.renderer.GlStateManager;
11 | import net.minecraft.item.ItemEgg;
12 | import net.minecraft.nbt.NBTTagCompound;
13 | import net.minecraft.tileentity.TileEntity;
14 | import net.minecraft.tileentity.TileEntitySkull;
15 | import net.minecraft.util.AxisAlignedBB;
16 | import net.minecraft.util.BlockPos;
17 | import net.minecraftforge.client.event.RenderWorldLastEvent;
18 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
19 |
20 | public class RelicFinderWaypoints {
21 | public static HashSet foundRelicLocations = new HashSet<>();
22 |
23 | @SubscribeEvent
24 | public void onRender(RenderWorldLastEvent event) {
25 | if(!SkyblockFeatures.config.spiderRelicHelper) return;
26 |
27 | Minecraft mc = Minecraft.getMinecraft();
28 |
29 | if (mc.theWorld != null) {
30 | Iterator var3 = mc.theWorld.loadedTileEntityList.iterator();
31 | BlockPos closestOne = null;
32 | while(var3.hasNext()) {
33 | TileEntity entity = var3.next();
34 | if (entity instanceof TileEntitySkull) {
35 | TileEntitySkull skull = (TileEntitySkull) entity;
36 | BlockPos pos = entity.getPos();
37 | NBTTagCompound entityData = new NBTTagCompound();
38 | skull.writeToNBT(entityData);
39 | if(!entityData.toString().contains("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNmYwY2YxM2NiYjM2OGFmOWNlZTEyMzI5NzlhMTRiODRlNmViZjIyYzEzYjE0MjdmOTMxNmQ5NzRiY2UifX19")) continue;
40 | if(foundRelicLocations.contains(pos)) continue;
41 | GlStateManager.disableDepth();
42 | if(closestOne==null) {
43 | closestOne = pos;
44 | } else {
45 | if(mc.thePlayer.getDistanceSqToCenter(pos) topCollectors = new HashMap<>();
20 |
21 | for (Slot slot : event.container.inventorySlots) {
22 | if(!slot.getHasStack()) continue;
23 | ItemStack itemStack = slot.getStack();
24 | if(itemStack==null) continue;
25 | boolean nextLine = false;
26 | for (String line : ItemUtils.getItemLore(itemStack)) {
27 | if(line.contains("Co-op Contributions")) {
28 | nextLine = true;
29 | continue;
30 | }
31 | if(nextLine) {
32 | nextLine = false;
33 | String player = line.split(":")[0];
34 | if(topCollectors.containsKey(player)) topCollectors.put(player, topCollectors.get(player)+1);
35 | else topCollectors.put(player, 1);
36 | }
37 | }
38 | }
39 |
40 | ArrayList lines = new ArrayList<>();
41 | GlStateManager.color(1, 1, 1, 1);
42 | GlStateManager.disableLighting();
43 |
44 | lines.add("§eTop Collectors");
45 | ArrayList sorted = new ArrayList<>();
46 |
47 | for (String name : topCollectors.keySet()) {
48 | sorted.add(name+":"+topCollectors.get(name));
49 | }
50 | sorted.sort((a,b)->{
51 | int aInt = Integer.parseInt(a.split(":")[1]);
52 | int bInt = Integer.parseInt(b.split(":")[1]);
53 | return bInt-aInt;
54 | });
55 | for (String entry : sorted) {
56 | String name = entry.split(":")[0];
57 | String value = entry.split(":")[1];
58 | String line = name+"§f: "+value;
59 | lines.add(line);
60 | }
61 |
62 | GuiUtils.drawSideMenu(lines, GuiUtils.TextStyle.DROP_SHADOW);
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/render/DynamicFullbright.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.render;
2 |
3 | import mrfast.sbf.SkyblockFeatures;
4 | import mrfast.sbf.core.SkyblockInfo;
5 | import mrfast.sbf.features.overlays.maps.CrystalHollowsMap;
6 | import mrfast.sbf.utils.Utils;
7 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
8 | import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
9 |
10 | public class DynamicFullbright {
11 | @SubscribeEvent
12 | public void onTick(ClientTickEvent event) {
13 | if(SkyblockFeatures.config.DynamicFullbright) {
14 | String loc = SkyblockInfo.getMap();
15 | try {
16 | if(loc.equals("Dynamic") || CrystalHollowsMap.inCrystalHollows|| Utils.inDungeons) {
17 | Utils.GetMC().gameSettings.gammaSetting=((float) SkyblockFeatures.config.DynamicFullbrightDisabled /10);
18 | } else {
19 | Utils.GetMC().gameSettings.gammaSetting= (float) SkyblockFeatures.config.DynamicFullbrightElsewhere /10;
20 | }
21 | } catch (Exception e) {
22 | // TODO: handle exception
23 | }
24 | }
25 | if(SkyblockFeatures.config.fullbright) {
26 | Utils.GetMC().gameSettings.gammaSetting=100;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/render/HighlightCropArea.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.render;
2 |
3 | import java.awt.Color;
4 | import java.util.ArrayList;
5 | import java.util.List;
6 |
7 | import mrfast.sbf.SkyblockFeatures;
8 | import mrfast.sbf.core.SkyblockInfo;
9 | import mrfast.sbf.events.BlockChangeEvent;
10 | import mrfast.sbf.events.SecondPassedEvent;
11 | import mrfast.sbf.utils.RenderUtil;
12 | import mrfast.sbf.utils.ScoreboardUtil;
13 | import mrfast.sbf.utils.Utils;
14 | import net.minecraft.block.Block;
15 | import net.minecraft.init.Blocks;
16 | import net.minecraft.util.AxisAlignedBB;
17 | import net.minecraft.util.BlockPos;
18 | import net.minecraftforge.client.event.RenderWorldLastEvent;
19 | import net.minecraftforge.event.world.WorldEvent;
20 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
21 |
22 | public class HighlightCropArea {
23 | List cropAreas = new ArrayList<>();
24 | List blocksToDestroy = new ArrayList<>();
25 | boolean update = true;
26 | int seconds = 0;
27 | @SubscribeEvent
28 | public void secondPassed(SecondPassedEvent event) {
29 | if(!SkyblockFeatures.config.GardenBlocksToRemove || Utils.GetMC().theWorld==null) return;
30 | try {if(!SkyblockInfo.map.equals("Garden")) return;} catch (Exception ignored) {}
31 |
32 | for(String line:ScoreboardUtil.getSidebarLines()) {
33 | if (line.contains("Cleanup") && blocksToDestroy.isEmpty()) {
34 | update = true;
35 | break;
36 | }
37 | }
38 | seconds++;
39 | if(seconds>10) {
40 | seconds=0;
41 | blocksToDestroy.clear();
42 | }
43 | }
44 |
45 | @SubscribeEvent
46 | public void worldChange(WorldEvent.Load event) {
47 | if(!SkyblockFeatures.config.GardenBlocksToRemove) return;
48 | update = false;
49 | cropAreas.clear();
50 | blocksToDestroy.clear();
51 | }
52 |
53 | @SubscribeEvent
54 | public void onRender(RenderWorldLastEvent event) {
55 | if(!SkyblockFeatures.config.GardenBlocksToRemove || Utils.GetMC().theWorld==null || !SkyblockInfo.map.equals("Garden")) return;
56 |
57 | if(cropAreas.isEmpty()) {
58 | for(int x=-192;x<192;x+=96) {
59 | for(int z=-192;z<192;z+=96) {
60 | AxisAlignedBB box = new AxisAlignedBB(x-48,65,z-48,x+48,116,z+48);
61 | cropAreas.add(box);
62 | }
63 | }
64 | }
65 | if(update) {
66 | update = false;
67 | blocksToDestroy.clear();
68 | for(AxisAlignedBB cropArea:cropAreas) {
69 | if(cropArea.isVecInside(Utils.GetMC().thePlayer.getPositionVector())) {
70 | for(double x=cropArea.minX;x200) continue;
88 | RenderUtil.drawBoundingBox(new AxisAlignedBB(pos, pos.add(1, 1, 1)), Color.red, event.partialTicks);
89 | }
90 |
91 | }
92 |
93 | @SubscribeEvent
94 | public void onBlockChange(BlockChangeEvent event) {
95 | if(!SkyblockFeatures.config.GardenBlocksToRemove || Utils.GetMC().theWorld==null) return;
96 | try {if(!SkyblockInfo.map.equals("Garden")) return;} catch (Exception ignored) {}
97 |
98 | blocksToDestroy.remove(event.pos);
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/render/RenderFeatures.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.render;
2 |
3 | import mrfast.sbf.SkyblockFeatures;
4 | import mrfast.sbf.utils.RenderUtil;
5 | import mrfast.sbf.utils.Utils;
6 | import net.minecraft.entity.Entity;
7 | import net.minecraft.entity.boss.EntityDragon;
8 | import net.minecraft.entity.boss.EntityDragonPart;
9 | import net.minecraft.util.AxisAlignedBB;
10 | import net.minecraftforge.client.event.RenderWorldLastEvent;
11 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
12 |
13 | public class RenderFeatures {
14 | @SubscribeEvent
15 | public void onRender3d(RenderWorldLastEvent event) {
16 | if (Utils.GetMC().theWorld == null) return;
17 |
18 | if (SkyblockFeatures.config.advancedDragonHitbox) {
19 | for (Entity entity : Utils.GetMC().theWorld.loadedEntityList) {
20 | if (entity instanceof EntityDragon) {
21 | EntityDragon dragon = (EntityDragon) entity;
22 | for (EntityDragonPart entityDragonPart : dragon.dragonPartArray) {
23 | AxisAlignedBB aabb = new AxisAlignedBB(entityDragonPart.posX, entityDragonPart.posY, entityDragonPart.posZ, entityDragonPart.posX + entityDragonPart.width, entityDragonPart.posY + entityDragonPart.height, entityDragonPart.posZ + entityDragonPart.width);
24 | RenderUtil.drawOutlinedFilledBoundingBox(aabb, SkyblockFeatures.config.advancedDragonHitboxColor, event.partialTicks);
25 | }
26 | }
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/statDisplays/ActionBarListener.kt:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.statDisplays
2 |
3 | import mrfast.sbf.SkyblockFeatures
4 | import mrfast.sbf.utils.Utils
5 | import net.minecraft.util.ChatComponentText
6 | import net.minecraftforge.client.event.ClientChatReceivedEvent
7 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
8 | import java.util.regex.Matcher
9 | import java.util.regex.Pattern
10 |
11 | class ActionBarListener {
12 | companion object {
13 | var maxSecrets: Int = 0
14 | var secrets: Int = -1
15 | private val PATTERN_SECRETS: Pattern = Pattern.compile("§7([0-9]+)/([0-9]+) Secrets")
16 | }
17 |
18 | private fun parseSecrets(message: String) {
19 | val matcher: Matcher = PATTERN_SECRETS.matcher(message)
20 | if (!matcher.find()) {
21 | secrets = -1
22 | return
23 | }
24 |
25 | secrets = Integer.parseInt(matcher.group(1))
26 | maxSecrets = Integer.parseInt(matcher.group(2))
27 | }
28 |
29 | @SubscribeEvent
30 | fun onEvent(event: ClientChatReceivedEvent) {
31 | if (event.type.toInt() == 2) {
32 | var actionBar: String = event.message.formattedText
33 | val actionBarSplit: List = actionBar.split(" ")
34 |
35 | for (piece in actionBarSplit) {
36 | val trimmed: String = piece.trim()
37 | val colorsStripped: String = Utils.cleanColor(trimmed).replace(",", "")
38 |
39 | if (trimmed.isEmpty()) continue
40 | val shortString: String = colorsStripped.substring(0, colorsStripped.length - 1).replace(",", "")
41 |
42 | when {
43 | colorsStripped.endsWith("❤") -> parseAndSetHealth(shortString)
44 | colorsStripped.endsWith("❈") -> parseAndSetDefense(shortString)
45 | colorsStripped.endsWith("✎") -> parseAndSetMana(shortString)
46 | colorsStripped.endsWith("ʬ") -> parseAndSetOverflow(shortString)
47 | }
48 |
49 | actionBar = actionBar.trim()
50 | event.message = ChatComponentText(actionBar)
51 | }
52 |
53 | parseSecrets(actionBar)
54 |
55 | if (SkyblockFeatures.config.cleanerActionBar) {
56 | val arr: List = actionBar.split(" ")
57 |
58 | for (s in arr) {
59 | when {
60 | s.contains("❤") && SkyblockFeatures.config.hideHealthFromBar -> actionBar = actionBar.replace(s, "")
61 | (s.contains("❈") || s.contains("Defense")) && SkyblockFeatures.config.hideDefenseFromBar -> actionBar = actionBar.replace(s, "")
62 | (s.contains("✎") || s.contains("Mana")) && SkyblockFeatures.config.hideManaFromBar -> actionBar = actionBar.replace(s, "")
63 | s.contains("ʬ") && SkyblockFeatures.config.hideOverflowManaFromBar -> actionBar = actionBar.replace(s, "")
64 | }
65 | }
66 |
67 | if (SkyblockFeatures.config.hideSecretsFromBar) {
68 | actionBar = actionBar.replace("$secrets/$maxSecrets Secrets", "")
69 | }
70 |
71 | event.message = ChatComponentText(actionBar.trim())
72 | }
73 | }
74 | }
75 |
76 | private fun parseAndSetHealth(actionBarSegment: String) {
77 | val split: List = actionBarSegment.split("/")
78 | val currentHealth: Int = split[0].toInt()
79 | val maxHealth: Int = split[1].toInt()
80 | Utils.health = currentHealth
81 | Utils.maxHealth = maxHealth
82 | }
83 |
84 | private fun parseAndSetDefense(actionBarSegment: String) {
85 | Utils.Defense = actionBarSegment.toInt()
86 | }
87 |
88 | private fun parseAndSetMana(actionBarSegment: String) {
89 | val split: List = actionBarSegment.split("/")
90 | val currentMana: Int = split[0].toInt()
91 | val maxMana: Int = split[1].toInt()
92 | Utils.mana = currentMana
93 | Utils.maxMana = maxMana
94 | }
95 |
96 | private fun parseAndSetOverflow(actionBarSegment: String) {
97 | Utils.overflowMana = actionBarSegment.toInt()
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/statDisplays/CryptDisplay.kt:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.statDisplays
2 |
3 | import mrfast.sbf.SkyblockFeatures
4 | import mrfast.sbf.gui.components.Point
5 | import mrfast.sbf.gui.components.UIElement
6 | import mrfast.sbf.utils.GuiUtils
7 | import mrfast.sbf.utils.TabListUtils
8 | import mrfast.sbf.utils.Utils
9 | import net.minecraft.client.Minecraft
10 | import net.minecraft.client.network.NetworkPlayerInfo
11 | import net.minecraft.client.renderer.GlStateManager
12 | import java.util.regex.Pattern
13 |
14 | class CryptDisplay {
15 | init {
16 | CryptDisplayGUI().register()
17 | }
18 |
19 | class CryptDisplayGUI : UIElement("Crypt Display", Point(0.0f, 0.24930556f)) {
20 | private val cryptsPattern = Pattern.compile("§r Crypts: §r§6(?\\d+)§r")
21 |
22 | override fun drawElement() {
23 | var crypts = 0
24 | for (pi: NetworkPlayerInfo in TabListUtils.getTabEntries()) {
25 | try {
26 | val name = Minecraft.getMinecraft().ingameGUI.tabList.getPlayerName(pi)
27 | if (name.contains("Crypts:")) {
28 | val matcher = cryptsPattern.matcher(name)
29 | if (matcher.find()) {
30 | crypts = matcher.group("crypts")?.toIntOrNull() ?: 0
31 | }
32 | }
33 | } catch (ignored: NumberFormatException) {
34 | }
35 | }
36 |
37 | val color = if (crypts >= 5) "§a" else "§c"
38 |
39 | val scale = 2f
40 | GlStateManager.scale(scale, scale, 0f)
41 | GuiUtils.drawText("$color Crypts: $crypts", 0f, 0f, GuiUtils.TextStyle.DROP_SHADOW)
42 | GlStateManager.scale(1 / scale, 1 / scale, 0f)
43 | }
44 |
45 | override fun drawElementExample() {
46 | val scale = 2f
47 | GlStateManager.scale(scale, scale, 0f)
48 | GuiUtils.drawText("§cCrypts: 3", 0f, 0f, GuiUtils.TextStyle.DROP_SHADOW)
49 | GlStateManager.scale(1 / scale, 1 / scale, 0f)
50 | }
51 |
52 | override fun getToggled(): Boolean = SkyblockFeatures.config.cryptCount
53 |
54 | override fun getRequirement(): Boolean = Utils.inDungeons && Utils.inSkyblock
55 |
56 | override fun getHeight(): Int = Utils.GetMC().fontRendererObj.FONT_HEIGHT * 2
57 |
58 | override fun getWidth(): Int = Utils.GetMC().fontRendererObj.getStringWidth("§6Estimated Secret C")
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/statDisplays/DefenseDisplay.kt:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.statDisplays
2 |
3 | import mrfast.sbf.SkyblockFeatures
4 | import mrfast.sbf.gui.components.Point
5 | import mrfast.sbf.gui.components.UIElement
6 | import mrfast.sbf.utils.GuiUtils
7 | import mrfast.sbf.utils.Utils
8 |
9 | class DefenseDisplay {
10 | var display: String = Utils.Defense.toString()
11 |
12 | init {
13 | DefenseDisplayGUI().register()
14 | updateDisplay()
15 | }
16 |
17 | private fun updateDisplay() {
18 | display = buildString {
19 | append("§a").append(Utils.nf.format(Utils.Defense.toLong()))
20 | }
21 | }
22 |
23 | inner class DefenseDisplayGUI : UIElement("Defense Display", Point(0.5651042f, 0.8037037f)) {
24 | override fun drawElement() {
25 | updateDisplay()
26 | GuiUtils.drawText(display, 0f, 0f, GuiUtils.TextStyle.BLACK_OUTLINE)
27 | }
28 |
29 | override fun drawElementExample() {
30 | drawElement()
31 | }
32 |
33 | override fun getToggled(): Boolean = SkyblockFeatures.config.DefenseDisplay
34 |
35 | override fun getRequirement(): Boolean = Utils.inSkyblock
36 |
37 | override fun getHeight(): Int = Utils.GetMC().fontRendererObj.FONT_HEIGHT
38 |
39 | override fun getWidth(): Int = Utils.GetMC().fontRendererObj.getStringWidth(display)
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/statDisplays/EffectiveHealthDisplay.kt:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.statDisplays
2 |
3 | import mrfast.sbf.SkyblockFeatures
4 | import mrfast.sbf.gui.components.Point
5 | import mrfast.sbf.gui.components.UIElement
6 | import mrfast.sbf.utils.GuiUtils
7 | import mrfast.sbf.utils.Utils
8 | import kotlin.math.roundToInt
9 |
10 | class EffectiveHealthDisplay {
11 | init {
12 | EffectiveHealthDisplayGUI().register()
13 | }
14 |
15 | private val effectiveHealth: Int
16 | get() = (Utils.health * (1f + Utils.Defense / 100f)).roundToInt()
17 |
18 | private inner class EffectiveHealthDisplayGUI : UIElement("Effective Health Display", Point(0.3703125f, 0.9539931f)) {
19 | override fun drawElement() {
20 | GuiUtils.drawText("§2${Utils.nf.format(effectiveHealth.toLong())}", 0f, 0f, GuiUtils.TextStyle.BLACK_OUTLINE)
21 | }
22 |
23 | override fun drawElementExample() {
24 | drawElement()
25 | }
26 |
27 | override fun getToggled(): Boolean = SkyblockFeatures.config.EffectiveHealthDisplay
28 |
29 | override fun getRequirement(): Boolean = Utils.inSkyblock
30 |
31 | override fun getHeight(): Int = Utils.GetMC().fontRendererObj.FONT_HEIGHT
32 |
33 | override fun getWidth(): Int = Utils.GetMC().fontRendererObj.getStringWidth(effectiveHealth.toString())
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/statDisplays/HealthDisplay.kt:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.statDisplays
2 |
3 | import mrfast.sbf.SkyblockFeatures
4 | import mrfast.sbf.gui.components.Point
5 | import mrfast.sbf.gui.components.UIElement
6 | import mrfast.sbf.utils.GuiUtils
7 | import mrfast.sbf.utils.Utils
8 |
9 | class HealthDisplay {
10 | var display: String = ""
11 |
12 | init {
13 | HealthDisplayGUI().register()
14 | }
15 |
16 | private fun updateDisplay() {
17 | display = buildString {
18 | append("§c").append(Utils.nf.format(Utils.health.toLong())).append("/").append(Utils.nf.format(Utils.maxHealth.toLong()))
19 | if (Utils.health > Utils.maxHealth) append("§6").append(Utils.nf.format(Utils.health.toLong())).append("§c/").append(Utils.nf.format(Utils.maxHealth.toLong()))
20 | }
21 | }
22 |
23 | inner class HealthDisplayGUI : UIElement("Health Display", Point(0.39878336f, 0.8029036f)) {
24 | override fun drawElement() {
25 | updateDisplay()
26 | GuiUtils.drawText(display, 0f, 0f, GuiUtils.TextStyle.BLACK_OUTLINE)
27 | }
28 |
29 | override fun drawElementExample() {
30 | drawElement();
31 | }
32 |
33 | override fun getToggled(): Boolean = SkyblockFeatures.config.HealthDisplay
34 |
35 | override fun getRequirement(): Boolean = Utils.inSkyblock
36 |
37 | override fun getHeight(): Int = Utils.GetMC().fontRendererObj.FONT_HEIGHT
38 |
39 | override fun getWidth(): Int = Utils.GetMC().fontRendererObj.getStringWidth(display)
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/statDisplays/ManaDisplay.kt:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.statDisplays
2 |
3 | import mrfast.sbf.SkyblockFeatures
4 | import mrfast.sbf.gui.components.Point
5 | import mrfast.sbf.gui.components.UIElement
6 | import mrfast.sbf.utils.GuiUtils
7 | import mrfast.sbf.utils.Utils
8 |
9 | class ManaDisplay {
10 | var display: String = Utils.mana.toString() + "/" + Utils.maxMana
11 |
12 | init {
13 | ManaDisplayGUI().register()
14 | updateDisplay()
15 | }
16 |
17 | private fun updateDisplay() {
18 | display = buildString {
19 | append("§9").append(Utils.nf.format(Utils.mana.toLong())).append("/").append(Utils.nf.format(Utils.maxMana.toLong()))
20 | }
21 | }
22 |
23 | inner class ManaDisplayGUI : UIElement("Mana Display", Point(0.47864583f, 0.80324066f)) {
24 | override fun drawElement() {
25 | updateDisplay();
26 | GuiUtils.drawText(display, 0f, 0f, GuiUtils.TextStyle.BLACK_OUTLINE)
27 | }
28 |
29 | override fun drawElementExample() {
30 | drawElement()
31 | }
32 |
33 | override fun getToggled(): Boolean = SkyblockFeatures.config.ManaDisplay
34 |
35 | override fun getRequirement(): Boolean = Utils.inSkyblock
36 |
37 | override fun getHeight(): Int = Utils.GetMC().fontRendererObj.FONT_HEIGHT
38 |
39 | override fun getWidth(): Int = Utils.GetMC().fontRendererObj.getStringWidth(display)
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/statDisplays/OverflowManaDisplay.kt:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.statDisplays
2 |
3 | import mrfast.sbf.SkyblockFeatures
4 | import mrfast.sbf.gui.components.Point
5 | import mrfast.sbf.gui.components.UIElement
6 | import mrfast.sbf.utils.GuiUtils
7 | import mrfast.sbf.utils.Utils
8 |
9 | class OverflowManaDisplay {
10 | var display: String = ""
11 |
12 | init {
13 | OverflowManaDisplayGUI().register()
14 | }
15 |
16 | private fun updateDisplay() {
17 | display = buildString {
18 | append("§3").append(Utils.nf.format(Utils.overflowMana)).append("ʬ")
19 | }
20 | }
21 |
22 | inner class OverflowManaDisplayGUI : UIElement("Overflow Mana Display", Point(0.6020833f, 0.96666664f)) {
23 | override fun drawElement() {
24 | updateDisplay()
25 | GuiUtils.drawText(display, 0f, 0f, GuiUtils.TextStyle.BLACK_OUTLINE)
26 | }
27 |
28 | override fun drawElementExample() {
29 | drawElement();
30 | }
31 |
32 | override fun getToggled(): Boolean = SkyblockFeatures.config.overFlowManaDisplay
33 |
34 | override fun getRequirement(): Boolean = Utils.inSkyblock
35 |
36 | override fun getHeight(): Int = Utils.GetMC().fontRendererObj.FONT_HEIGHT
37 |
38 | override fun getWidth(): Int = Utils.GetMC().fontRendererObj.getStringWidth(display)
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/statDisplays/SecretDisplay.kt:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.statDisplays
2 |
3 | import mrfast.sbf.SkyblockFeatures
4 | import mrfast.sbf.gui.components.Point
5 | import mrfast.sbf.gui.components.UIElement
6 | import mrfast.sbf.utils.GuiUtils
7 | import mrfast.sbf.utils.Utils
8 | import org.jetbrains.annotations.NotNull
9 |
10 | class SecretDisplay {
11 | init {
12 | SecretDisplayGui().register()
13 | }
14 |
15 | inner class SecretDisplayGui : UIElement("Dungeon Secret", Point(0.59876317f, 0.9574074f)) {
16 | override fun drawElement() {
17 | val secrets = ActionBarListener.secrets
18 | val maxSecrets = ActionBarListener.maxSecrets
19 |
20 | val text = getSecrets(secrets, maxSecrets)
21 |
22 | GuiUtils.drawCenteredText(this, text, GuiUtils.TextStyle.BLACK_OUTLINE)
23 | }
24 |
25 | override fun drawElementExample() {
26 | val text = arrayListOf()
27 |
28 | text.add("§7Secrets")
29 | text.add("§c1§7/§c9")
30 |
31 | GuiUtils.drawCenteredText(this, text, GuiUtils.TextStyle.BLACK_OUTLINE)
32 | }
33 |
34 | override fun getToggled(): Boolean {
35 | return SkyblockFeatures.config.SecretsDisplay
36 | }
37 |
38 | override fun getRequirement(): Boolean {
39 | return Utils.inDungeons && Utils.inSkyblock
40 | }
41 |
42 | override fun getHeight(): Int {
43 | return Utils.GetMC().fontRendererObj.FONT_HEIGHT * 2
44 | }
45 |
46 | override fun getWidth(): Int {
47 | return Utils.GetMC().fontRendererObj.getStringWidth("§7Secrets")
48 | }
49 | }
50 |
51 | @NotNull
52 | private fun getSecrets(secrets: Int, maxSecrets: Int): List {
53 | val text = ArrayList()
54 |
55 | val color: String = when {
56 | secrets == maxSecrets -> "§a"
57 | secrets > maxSecrets / 2 -> "§e"
58 | else -> "§c"
59 | }
60 |
61 | text.add("§7Secrets")
62 |
63 | if (secrets == -1) {
64 | text.add("§7None")
65 | } else {
66 | text.add("$color$secrets§7/$color$maxSecrets")
67 | }
68 | return text
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/statDisplays/SpeedDisplay.kt:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.statDisplays
2 |
3 | import mrfast.sbf.SkyblockFeatures
4 | import mrfast.sbf.gui.components.Point
5 | import mrfast.sbf.gui.components.UIElement
6 | import mrfast.sbf.utils.GuiUtils
7 | import mrfast.sbf.utils.Utils
8 | import net.minecraft.client.Minecraft
9 |
10 | class SpeedDisplay {
11 | var display: String = ""
12 |
13 | init {
14 | SpeedDisplayGUI().register()
15 | }
16 |
17 | private fun updateSpeed() {
18 | val walkSpeed = (Minecraft.getMinecraft().thePlayer?.capabilities?.walkSpeed ?: 0f) * 1000
19 | val text = walkSpeed.toString().substring(0, minOf(walkSpeed.toString().length, 3))
20 | display = if (text.endsWith(".")) text.substring(0, text.indexOf('.')) else "$text%"
21 | }
22 |
23 | inner class SpeedDisplayGUI : UIElement("Speed Display", Point(0.375f, 0.9777778f)) {
24 | override fun drawElement() {
25 | updateSpeed()
26 | GuiUtils.drawText(display, 0f, 0f, GuiUtils.TextStyle.BLACK_OUTLINE)
27 | }
28 |
29 | override fun drawElementExample() {
30 | drawElement()
31 | }
32 |
33 | override fun getToggled(): Boolean = SkyblockFeatures.config.SpeedDisplay
34 |
35 | override fun getRequirement(): Boolean = Utils.inSkyblock
36 |
37 | override fun getHeight(): Int = Utils.GetMC().fontRendererObj.FONT_HEIGHT
38 |
39 | override fun getWidth(): Int = Utils.GetMC().fontRendererObj.getStringWidth(display)
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/statDisplays/bars/HealthBar.kt:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.statDisplays.bars
2 |
3 | import mrfast.sbf.SkyblockFeatures
4 | import mrfast.sbf.gui.components.Point
5 | import mrfast.sbf.gui.components.UIElement
6 | import mrfast.sbf.utils.Utils
7 | import net.minecraft.client.gui.Gui
8 | import java.awt.Color
9 |
10 | class HealthBar {
11 | init {
12 | HealthBarGui().register()
13 | }
14 |
15 | class HealthBarGui : UIElement("Health Bar", Point(0.40605482f, 0.9166667f)) {
16 | override fun drawElement() {
17 | drawHealthBar()
18 | }
19 |
20 | override fun drawElementExample() {
21 | drawHealthBar()
22 | }
23 |
24 | private fun drawHealthBar() {
25 | val max = Utils.maxHealth
26 | var health = Utils.health
27 | var absorption = 0
28 | if (health > max) {
29 | absorption = health - max
30 | health = max
31 | }
32 | val total = max + absorption
33 | val healthFillPerc = health.toDouble() / total
34 | val absorbFillPerc = absorption.toDouble() / total
35 |
36 | val healthColor = Color.RED
37 | val absorbColor = Color(0xFFAA00)
38 |
39 | Gui.drawRect(0, 0, 80, 10, Color.BLACK.rgb)
40 |
41 | Gui.drawRect(2, 2, (78.0 * healthFillPerc).toInt(), 8, healthColor.rgb)
42 | if (absorption != 0) {
43 | val fillPixels = (78.0 * absorbFillPerc).toInt() + 3
44 | Gui.drawRect(
45 | minOf(76, maxOf(2, 2 + (78 - fillPixels))),
46 | 2, 78, 8, absorbColor.rgb
47 | )
48 | }
49 | }
50 |
51 | override fun getToggled(): Boolean = SkyblockFeatures.config.HealthBar
52 |
53 | override fun getRequirement(): Boolean = Utils.inSkyblock
54 |
55 | override fun getHeight(): Int = 11
56 |
57 | override fun getWidth(): Int = 81
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/features/statDisplays/bars/ManaBar.kt:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.features.statDisplays.bars
2 |
3 | import mrfast.sbf.SkyblockFeatures
4 | import mrfast.sbf.gui.components.Point
5 | import mrfast.sbf.gui.components.UIElement
6 | import mrfast.sbf.utils.Utils
7 | import net.minecraft.client.gui.Gui
8 | import java.awt.Color
9 |
10 | class ManaBar {
11 | init {
12 | ManaBarGui().register()
13 | }
14 |
15 | class ManaBarGui : UIElement("Mana Bar", Point(0.50865895f, 0.9157407f)) {
16 | override fun drawElement() {
17 | drawManaBar()
18 | }
19 |
20 | override fun drawElementExample() {
21 | drawManaBar()
22 | }
23 |
24 | private fun drawManaBar() {
25 | val max = Utils.maxMana
26 | var mana = Utils.mana
27 | val overflow = Utils.overflowMana
28 | val total = max + overflow
29 | val manaFillPerc = mana.toDouble() / total
30 | val overflowFillPerc = overflow.toDouble() / total
31 |
32 | val manaColor = Color(0x5555FF)
33 | val overflowColor = Color(0x55FFFF)
34 |
35 | Gui.drawRect(0, 0, 80, 10, Color.BLACK.rgb)
36 |
37 | Gui.drawRect(2, 2, (78.0 * manaFillPerc).toInt(), 8, manaColor.rgb)
38 | if (overflow != 0) {
39 | val fillPixels = (78.0 * overflowFillPerc).toInt() + 3
40 | Gui.drawRect(
41 | minOf(76, maxOf(2, 2 + (78 - fillPixels))),
42 | 2, 78, 8, overflowColor.rgb
43 | )
44 | }
45 | }
46 |
47 | override fun getToggled(): Boolean = SkyblockFeatures.config.ManaBar
48 |
49 | override fun getRequirement(): Boolean = Utils.inSkyblock
50 |
51 | override fun getHeight(): Int = 11
52 |
53 | override fun getWidth(): Int = 81
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/gui/SideMenu/CustomButtonElement.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.gui.SideMenu;
2 |
3 | import net.minecraft.client.Minecraft;
4 | import net.minecraft.client.gui.Gui;
5 | import net.minecraft.util.ResourceLocation;
6 | import org.lwjgl.opengl.GL11;
7 |
8 | import java.awt.*;
9 |
10 | public class CustomButtonElement extends CustomElement {
11 | private final ResourceLocation buttonTexture = new ResourceLocation("skyblockfeatures","gui/default_button.png");
12 | private String text;
13 | private int width,height = 0;
14 | public CustomButtonElement(int x, int y,String text, int width, int height, String hoverText, Runnable onClickAction) {
15 | super(x, y, width, height, hoverText, onClickAction);
16 | this.text = text;
17 | this.width=width;
18 | this.height=height;
19 | }
20 |
21 | @Override
22 | public void render() {
23 | GL11.glColor4f(1f,1f,1f,1f);
24 |
25 | // Draw button background (customize as needed)
26 | Minecraft.getMinecraft().getTextureManager().bindTexture(buttonTexture);
27 |
28 | int buttonWidth = width; // Get button width
29 | int buttonHeight = height; // Get button height
30 |
31 | // Draw the button background
32 | Gui.drawModalRectWithCustomSizedTexture(this.x, this.y, 0, 0, buttonWidth, buttonHeight, buttonWidth, buttonHeight);
33 |
34 | // Calculate text position to center it in the button
35 | int textX = this.x + (buttonWidth - Minecraft.getMinecraft().fontRendererObj.getStringWidth(text)) / 2;
36 | int textY = this.y + (buttonHeight - Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT) / 2;
37 |
38 | // Draw the text in the middle of the button
39 | Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(text, textX, textY, Color.WHITE.getRGB());
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/gui/SideMenu/CustomElement.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.gui.SideMenu;
2 |
3 | import mrfast.sbf.mixins.transformers.GuiContainerAccessor;
4 | import mrfast.sbf.utils.Utils;
5 | import net.minecraft.client.gui.GuiScreen;
6 | import net.minecraft.client.renderer.GlStateManager;
7 | import net.minecraftforge.fml.client.config.GuiUtils;
8 | import org.lwjgl.input.Mouse;
9 |
10 | import java.util.Arrays;
11 |
12 | public abstract class CustomElement {
13 | protected int x, y, width, height, orginX, orginY;
14 | public static CustomElement focusedElement;
15 |
16 | public boolean isFocused() {
17 | return this.equals(focusedElement);
18 | }
19 |
20 | private final String hoverText;
21 | private final Runnable onClickAction;
22 | MenuOverlay parent;
23 |
24 |
25 | // Constructor for button element
26 | public CustomElement(int x, int y, int width, int height, String hoverText, Runnable onClickAction) {
27 | this.x = x;
28 | this.y = y;
29 | this.orginX = x;
30 | this.orginY = y;
31 | this.width = width;
32 | this.height = height;
33 | this.hoverText = hoverText;
34 | this.onClickAction = onClickAction;
35 | }
36 |
37 | public void render() {
38 |
39 | }
40 |
41 | public void onKeyTyped(char character, int key) {
42 |
43 | }
44 |
45 | public static boolean lastMouseState = false;
46 |
47 | public boolean doHoverRender(int mouseX, int mouseY, GuiScreen gui) {
48 | this.x = (this.orginX + parent.x);
49 | this.y = (this.orginY + parent.y);
50 |
51 | // Check if the mouse is over the element
52 | boolean isHovered = isHovered(mouseX, mouseY);
53 | // Handle hover and click events
54 | if (isHovered) {
55 | onHover(mouseX, mouseY);
56 | if (lastMouseState && !Mouse.isButtonDown(0) && gui.equals(MenuOverlayManager.mouseWentDownOn)) {
57 | focusedElement = this;
58 | onClick(mouseX, mouseY, 0);
59 | }
60 | } else {
61 | if (Mouse.isButtonDown(0)) {
62 | if (this instanceof TextInputElement) {
63 | ((TextInputElement) this).textField.setFocused(false);
64 | }
65 | }
66 | }
67 | return isHovered;
68 | }
69 |
70 | private void onHover(int mouseX, int mouseY) {
71 | // Display hover text or perform additional hover logic
72 | if (hoverText != null) {
73 | GlStateManager.translate(0, 0, 350f);
74 | GuiUtils.drawHoveringText(Arrays.asList(hoverText.split("\n")), mouseX, mouseY, Utils.GetMC().displayWidth, Utils.GetMC().displayHeight, -1, Utils.GetMC().fontRendererObj);
75 | GlStateManager.translate(0, 0, -350f);
76 | }
77 | }
78 |
79 | public void onClick(int mouseX, int mouseY, int mouseButton) {
80 | // Perform click action
81 | if (onClickAction != null) {
82 | onClickAction.run();
83 | }
84 | }
85 |
86 | private boolean isHovered(int mouseX, int mouseY) {
87 | return mouseX >= x && mouseX <= x + width && mouseY >= y && mouseY <= y + height;
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/gui/SideMenu/CustomTextElement.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.gui.SideMenu;
2 |
3 | import mrfast.sbf.utils.Utils;
4 |
5 | public class CustomTextElement extends CustomElement {
6 | private String text;
7 | private boolean shadow = false;
8 |
9 | public CustomTextElement(int x, int y, String text, String hoverText, Runnable onClickAction,boolean shadow) {
10 | super(x, y, Utils.GetMC().fontRendererObj.getStringWidth(text), Utils.GetMC().fontRendererObj.FONT_HEIGHT, hoverText, onClickAction);
11 | this.text = text;
12 | this.shadow=shadow;
13 | }
14 |
15 | @Override
16 | public void render() {
17 | // Render the text
18 | Utils.GetMC().fontRendererObj.drawString(text, this.x + 2, this.y + 2, 0xFFFFFF,shadow);
19 | }
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/gui/SideMenu/MenuOverlay.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.gui.SideMenu;
2 |
3 | import mrfast.sbf.mixins.transformers.GuiContainerAccessor;
4 | import mrfast.sbf.utils.GuiUtils;
5 | import net.minecraft.client.gui.GuiScreen;
6 | import net.minecraft.client.renderer.GlStateManager;
7 | import org.lwjgl.opengl.GL11;
8 |
9 | import java.util.HashMap;
10 | import java.util.Map;
11 |
12 | public class MenuOverlay {
13 |
14 | private Map elements;
15 | int x,y = 0;
16 |
17 | public Map getElements() {
18 | return elements;
19 | }
20 | public boolean handleMouseMovement(int mouseX, int mouseY, GuiScreen gui) {
21 | for (CustomElement element : this.getElements().values()) {
22 | boolean result = element.doHoverRender(mouseX, mouseY, gui);
23 | if (result) {
24 | return true;
25 | }
26 | }
27 | return false;
28 | }
29 | public boolean handleKeyInput(char character, int key) {
30 | for (CustomElement element : this.getElements().values()) {
31 | if (element.isFocused()) {
32 | element.onKeyTyped(character, key);
33 | }
34 | }
35 | return false;
36 | }
37 |
38 | public MenuOverlay() {
39 | this.elements = new HashMap<>();
40 | }
41 |
42 | public void addOrUpdateElement(String name,CustomElement element) {
43 | element.parent = this;
44 | elements.put(name,element);
45 | }
46 |
47 | public void render(int x, int y, boolean drawSquare, int height, GuiContainerAccessor gui) {
48 | this.x=x;
49 | this.y=y;
50 |
51 | GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
52 | int maxWidth = 0;
53 | for (CustomElement element : elements.values()) {
54 | if(element.width>maxWidth) maxWidth=element.width;
55 | }
56 |
57 | GlStateManager.translate(x,y,340f);
58 | if(drawSquare) GuiUtils.drawGraySquareWithBorder(0,0,maxWidth+8,height);
59 | for (CustomElement element : elements.values()) {
60 | element.render();
61 | }
62 | GlStateManager.translate(-x,-y,-340f);
63 | }
64 | }
65 |
66 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/gui/SideMenu/MenuOverlayManager.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.gui.SideMenu;
2 |
3 | import mrfast.sbf.events.SlotClickedEvent;
4 | import net.minecraft.client.gui.GuiScreen;
5 | import net.minecraft.client.gui.inventory.GuiContainer;
6 | import net.minecraftforge.client.event.GuiScreenEvent;
7 | import net.minecraftforge.event.entity.player.ItemTooltipEvent;
8 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
9 | import org.lwjgl.input.Keyboard;
10 | import org.lwjgl.input.Mouse;
11 |
12 | import java.util.HashMap;
13 | import java.util.Map;
14 |
15 | public class MenuOverlayManager {
16 |
17 | private static Map overlayRegistry = new HashMap<>();
18 |
19 | public static class Overlay {
20 | public MenuOverlay content;
21 | public String name;
22 | public GuiScreen associatedGui;
23 |
24 | public Overlay(String overlayName, MenuOverlay overlayContent, GuiScreen associatedGui) {
25 | this.associatedGui = associatedGui;
26 | this.name = overlayName;
27 | this.content = overlayContent;
28 | }
29 | }
30 |
31 | public static Map getOverlays() {
32 | return overlayRegistry;
33 | }
34 |
35 | public static Overlay getOrCreateMenuOverlay(String overlayName, GuiScreen gui) {
36 | return overlayRegistry.computeIfAbsent(overlayName, name ->
37 | new Overlay(name, new MenuOverlay(), gui)
38 | );
39 | }
40 |
41 |
42 | @SubscribeEvent
43 | public void onTooltip(ItemTooltipEvent event) {
44 | if (buttonHovered) {
45 | event.toolTip.clear();
46 | }
47 | }
48 |
49 | @SubscribeEvent
50 | public void onSlotClick(SlotClickedEvent event) {
51 | if (buttonHovered) {
52 | event.setCanceled(true);
53 | }
54 | }
55 |
56 | boolean buttonHovered = false;
57 | static GuiScreen mouseWentDownOn;
58 | @SubscribeEvent
59 | public void onGuiScreenDrawn(GuiScreenEvent.DrawScreenEvent.Post event) {
60 | if (event.gui instanceof GuiContainer) {
61 | buttonHovered = false;
62 | for (Overlay overlay : MenuOverlayManager.getOverlays().values()) {
63 | buttonHovered = overlay.content.handleMouseMovement(event.mouseX, event.mouseY, event.gui);
64 | }
65 | }
66 | if (Mouse.isButtonDown(0)) {
67 | if (mouseWentDownOn == null) {
68 | mouseWentDownOn = event.gui;
69 | }
70 | } else {
71 | mouseWentDownOn = null;
72 | }
73 |
74 | CustomElement.lastMouseState = Mouse.isButtonDown(0);
75 | }
76 | @SubscribeEvent
77 | public void onMenuOpen(GuiScreenEvent.InitGuiEvent event) {
78 | overlayRegistry.clear();
79 | }
80 |
81 | @SubscribeEvent
82 | public void onKeyTyped(GuiScreenEvent.KeyboardInputEvent.Pre event) {
83 | if (event.gui instanceof GuiContainer) {
84 | for (Overlay overlay : MenuOverlayManager.getOverlays().values()) {
85 | int key = Keyboard.getEventKey();
86 | char character = Keyboard.getEventCharacter();
87 | if (!Keyboard.isKeyDown(key)) return;
88 |
89 | overlay.content.handleKeyInput(character, key);
90 | }
91 | }
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/gui/SideMenu/TextInputElement.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.gui.SideMenu;
2 |
3 | import mrfast.sbf.utils.Utils;
4 | import net.minecraft.client.gui.GuiTextField;
5 | import net.minecraft.client.renderer.GlStateManager;
6 | import org.lwjgl.opengl.GL11;
7 |
8 | public class TextInputElement extends CustomElement {
9 | public GuiTextField textField;
10 | public TextInputElement(int x, int y,String text, int width, int height) {
11 | super(x, y, width, height, null, null);
12 | this.textField = new GuiTextField(-1, Utils.GetMC().fontRendererObj,x,y,width,height);
13 |
14 | if(text!=null) {
15 | textField.setText(text);
16 | textField.setCursorPosition(0);
17 | }
18 | }
19 |
20 | @Override
21 | public void onClick(int mouseX, int mouseY, int mouseButton) {
22 | textField.setFocused(true);
23 | textField.mouseClicked(mouseX, mouseY, mouseButton);
24 | }
25 |
26 | @Override
27 | public void onKeyTyped(char character,int key) {
28 | textField.textboxKeyTyped(character, key);
29 | }
30 | int updateCheck = 0;
31 | @Override
32 | public void render() {
33 | GL11.glColor4f(1f,1f,1f,1f);
34 | textField.xPosition = this.x;
35 | textField.yPosition = this.y;
36 |
37 | // Handle this differently because it wont draw at 0,0 for some reason
38 | GlStateManager.translate(-this.parent.x,-this.parent.y,0);
39 | textField.drawTextBox();
40 | GlStateManager.translate(this.parent.x,this.parent.y,0);
41 |
42 | updateCheck++;
43 | if(updateCheck%15==0) {
44 | textField.updateCursorCounter();
45 | updateCheck = 0;
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/gui/components/InventoryComponent.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.gui.components;
2 |
3 | import java.awt.Color;
4 |
5 | import com.mojang.realmsclient.gui.ChatFormatting;
6 |
7 | import gg.essential.elementa.UIComponent;
8 | import gg.essential.elementa.components.UIRoundedRectangle;
9 | import gg.essential.elementa.components.UIText;
10 | import gg.essential.elementa.constraints.CenterConstraint;
11 | import gg.essential.elementa.constraints.PixelConstraint;
12 | import gg.essential.elementa.state.BasicState;
13 | import gg.essential.elementa.state.State;
14 | import gg.essential.universal.UMatrixStack;
15 | import mrfast.sbf.utils.Utils;
16 | import net.minecraft.inventory.InventoryBasic;
17 | import net.minecraft.item.ItemStack;
18 |
19 | public class InventoryComponent extends UIComponent {
20 | public InventoryComponent(InventoryBasic stack,String inventoryName) {
21 | this(new BasicState<>(stack),new BasicState<>(inventoryName));
22 | }
23 |
24 | public InventoryComponent(State state, State invName) {
25 | InventoryBasic inventory = state.get();
26 | int verticalSlots = (int) (double) (inventory.getSizeInventory() / 9);
27 | int horizontalSlots = 9;
28 | int screenHeight = Utils.GetMC().currentScreen.height;
29 | double fontScale = screenHeight / 540d;
30 | if(getWidth()==0) setWidth(new PixelConstraint((float) (horizontalSlots*17f*fontScale)));
31 | if(getHeight()==0) setHeight(new PixelConstraint((float) (verticalSlots*17f*fontScale)+8f));
32 |
33 | new UIText(ChatFormatting.YELLOW+invName.get()).setX(new CenterConstraint()).setChildOf(this);
34 | boolean stopped = false;
35 | for(int y=0;y state;
23 |
24 | public ItemStackComponent(ItemStack stack) {
25 | this(new BasicState<>(stack));
26 | }
27 |
28 | public ItemStackComponent(State state) {
29 | this.state = state;
30 | }
31 |
32 | @Override
33 | public void draw(UMatrixStack matrixStack) {
34 | ItemStack item = this.state.get();
35 | if (item == null) return;
36 |
37 | beforeDraw(matrixStack);
38 | super.draw(matrixStack);
39 | int screenHeight = Utils.GetMC().currentScreen.height;
40 | float fontScale = (float) (screenHeight / 540d);
41 | if (getWidth() == 0) setWidth(new PixelConstraint(16f*fontScale));
42 | if (getHeight() == 0) setHeight(new PixelConstraint(16f*fontScale));
43 |
44 | matrixStack.push();
45 |
46 | matrixStack.translate(getLeft(), getTop(), 100f);
47 | matrixStack.scale(getWidth() / (16f*fontScale), getHeight() / (16f*fontScale), 1f);
48 | UGraphics.color4f(1f, 1f, 1f, 1f);
49 | matrixStack.runWithGlobalState(() -> {
50 | RenderUtil.renderItemStackOnScreen(item, 0, 0, (16f*fontScale), (16f*fontScale));
51 | });
52 | matrixStack.pop();
53 | UGraphics.disableLighting();
54 |
55 |
56 | if (!item.hasDisplayName()) return;
57 | if (item.getDisplayName().trim().isEmpty()) return;
58 |
59 | if (this.isHovered()) {
60 | ProfileViewerGui.renderTooltip = item.getTooltip(Utils.GetMC().thePlayer, false);
61 | }
62 | }
63 |
64 |
65 | }
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/gui/components/MoveableFeature.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.gui.components;
2 |
3 | import mrfast.sbf.gui.GuiManager;
4 | import mrfast.sbf.utils.GuiUtils;
5 | import net.minecraft.client.Minecraft;
6 | import net.minecraft.client.gui.GuiButton;
7 | import net.minecraft.client.gui.ScaledResolution;
8 | import net.minecraft.client.renderer.GlStateManager;
9 |
10 | public class MoveableFeature extends GuiButton {
11 |
12 | public UIElement element;
13 | public float relativeX;
14 | public float relativeY;
15 | public float actualX;
16 | public float actualY;
17 | public boolean hovered = false;
18 |
19 | public MoveableFeature(UIElement element) {
20 | super(-1, 0, 0, null);
21 | this.element = element;
22 | updateLocations();
23 | }
24 |
25 | private void updateLocations() {
26 | relativeX = element.getX();
27 | relativeY = element.getY();
28 | }
29 |
30 | @Override
31 | public void drawButton(Minecraft mc, int mouseX, int mouseY) {
32 | updateLocations();
33 | ScaledResolution sr = new ScaledResolution(mc);
34 | ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
35 | float guiScaleFactor = (1f / scaledResolution.getScaleFactor()) * 2;
36 | int screenWidth = sr.getScaledWidth();
37 | int screenHeight = sr.getScaledHeight();
38 | float actualX = (screenWidth * relativeX) - 2;
39 | float actualY = (screenHeight * relativeY) - 2;
40 | float elementWidth = element.getWidth() * guiScaleFactor;
41 | float elementHeight = element.getHeight() * guiScaleFactor;
42 | if (!element.getRequirement() && !GuiManager.showAllEnabledElements) return;
43 | this.actualX = actualX;
44 | this.actualY = actualY;
45 |
46 | float xWidth = actualX + elementWidth + 4;
47 | float yHeight = actualY + elementHeight + 4;
48 |
49 | hovered = mouseX >= actualX && mouseY >= actualY && mouseX < xWidth && mouseY < yHeight;
50 |
51 | GuiUtils.drawGraySquare(-2, -2, (int) ((elementWidth + 4) / 2) * scaledResolution.getScaleFactor(), (int) ((elementHeight + 4) / 2) * scaledResolution.getScaleFactor(), hovered);
52 |
53 | GlStateManager.pushMatrix();
54 | element.drawElementExample();
55 | GlStateManager.popMatrix();
56 | }
57 |
58 | @Override
59 | public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) {
60 | return enabled && visible && hovered;
61 | }
62 |
63 | public UIElement getElement() {
64 | return element;
65 | }
66 | }
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/gui/components/Point.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.gui.components;
2 |
3 | import net.minecraft.client.Minecraft;
4 | import net.minecraft.client.gui.ScaledResolution;
5 |
6 | public class Point {
7 |
8 | public float x;
9 | public float y;
10 |
11 | public Point(float x, float y) {
12 | this.x = x;
13 | this.y = y;
14 | }
15 |
16 | public float getX() {
17 | return x;
18 | }
19 |
20 | public float getY() {
21 | return y;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/gui/components/UIElement.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.gui.components;
2 |
3 | import mrfast.sbf.SkyblockFeatures;
4 | import mrfast.sbf.gui.GuiManager;
5 |
6 | /**
7 | * Modified from Skytils 0.x under GNU Affero General Public License v3.0
8 | * https://github.com/Skytils/SkytilsMod/tree/0.x
9 | *
10 | * @author Sychic
11 | */
12 | public abstract class UIElement {
13 | String name;
14 | Point pos;
15 |
16 | public UIElement(String name, Point fp) {
17 | this.name = name;
18 | this.pos = GuiManager.GuiPositions.getOrDefault(name, fp);
19 | }
20 |
21 | public abstract void drawElement();
22 |
23 | public abstract void drawElementExample();
24 |
25 | public abstract boolean getToggled();
26 |
27 | public abstract boolean getRequirement();
28 |
29 | public Point getPos() {
30 | return this.pos;
31 | }
32 |
33 | public void setPos(float x, float y) {
34 | this.pos = new Point(x, y);
35 | }
36 |
37 | public String getName() {
38 | return this.name;
39 | }
40 |
41 | public float getX() {
42 | return getPos().getX();
43 | }
44 |
45 | public float getY() {
46 | return getPos().getY();
47 | }
48 |
49 | public abstract int getHeight();
50 |
51 | public abstract int getWidth();
52 |
53 | public void register() {
54 | SkyblockFeatures.GUIMANAGER.registerElement(this);
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/mixins/transformers/CustomRenderGlobal.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.mixins.transformers;
2 |
3 | import net.minecraft.client.renderer.RenderGlobal;
4 | import net.minecraft.client.shader.Framebuffer;
5 | import net.minecraft.client.shader.ShaderGroup;
6 | import org.spongepowered.asm.mixin.Mixin;
7 | import org.spongepowered.asm.mixin.gen.Accessor;
8 |
9 | /**
10 | * Adapted from Skyhanni under GNU LGPL v2.1 license
11 | * @link https://github.com/hannibal002/SkyHanni/blob/beta/LICENSE
12 | */
13 | @Mixin(RenderGlobal.class)
14 | public interface CustomRenderGlobal {
15 | @Accessor("entityOutlineFramebuffer")
16 | Framebuffer sbf$entityOutlineFramebuffer();
17 |
18 | @Accessor("entityOutlineShader")
19 | ShaderGroup sbf$entityOutlineShader();
20 | }
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/mixins/transformers/GuiContainerAccessor.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.mixins.transformers;
2 |
3 | import net.minecraft.client.gui.inventory.GuiContainer;
4 | import org.spongepowered.asm.mixin.Mixin;
5 | import org.spongepowered.asm.mixin.gen.Accessor;
6 |
7 | @Mixin(GuiContainer.class)
8 | public interface GuiContainerAccessor {
9 | @Accessor("guiLeft")
10 | int getGuiLeft();
11 |
12 | @Accessor("guiTop")
13 | int getGuiTop();
14 |
15 | @Accessor("xSize")
16 | int getWidth();
17 | @Accessor("ySize")
18 | int getHeight();
19 | }
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/mixins/transformers/GuiEditSignAccessor.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.mixins.transformers;
2 |
3 | import net.minecraft.client.gui.inventory.GuiEditSign;
4 | import net.minecraft.tileentity.TileEntitySign;
5 | import org.spongepowered.asm.mixin.Mixin;
6 | import org.spongepowered.asm.mixin.gen.Accessor;
7 |
8 | @Mixin(GuiEditSign.class)
9 | public interface GuiEditSignAccessor {
10 | @Accessor("tileSign")
11 | TileEntitySign getTileSign();
12 | }
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/mixins/transformers/MixinAbstractClientPlayer.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.mixins.transformers;
2 |
3 | import javax.annotation.Nullable;
4 |
5 | import org.spongepowered.asm.mixin.Mixin;
6 | import org.spongepowered.asm.mixin.Shadow;
7 | import org.spongepowered.asm.mixin.injection.At;
8 | import org.spongepowered.asm.mixin.injection.Inject;
9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
10 |
11 | import mrfast.sbf.SkyblockFeatures;
12 | import mrfast.sbf.utils.CapeUtils;
13 | import mrfast.sbf.utils.Utils;
14 | import net.minecraft.client.entity.AbstractClientPlayer;
15 | import net.minecraft.client.network.NetworkPlayerInfo;
16 | import net.minecraft.util.ResourceLocation;
17 |
18 | @Mixin(AbstractClientPlayer.class)
19 | public abstract class MixinAbstractClientPlayer {
20 | @Shadow
21 | @Nullable
22 | protected abstract NetworkPlayerInfo getPlayerInfo();
23 |
24 | @Inject(method={"getLocationCape"}, at={@At(value="HEAD")}, cancellable=true)
25 | public void getLocationCape(CallbackInfoReturnable callbackInfoReturnable) {
26 | NetworkPlayerInfo info = this.getPlayerInfo();
27 | if(info != null) {
28 | if (CapeUtils.is_name_valid(info.getGameProfile().getName())) {
29 | callbackInfoReturnable.setReturnValue(CapeUtils.getCape(info.getGameProfile().getName()));
30 | }
31 | }
32 | }
33 | }
34 |
35 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/mixins/transformers/MixinBlockCrops.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.mixins.transformers;
2 |
3 | import net.minecraft.block.Block;
4 | import net.minecraft.block.BlockBush;
5 | import net.minecraft.block.BlockCrops;
6 | import net.minecraft.block.state.IBlockState;
7 | import net.minecraft.util.AxisAlignedBB;
8 | import net.minecraft.util.BlockPos;
9 | import net.minecraft.util.MovingObjectPosition;
10 | import net.minecraft.util.Vec3;
11 | import net.minecraft.world.World;
12 |
13 | import org.spongepowered.asm.mixin.Mixin;
14 |
15 | import mrfast.sbf.SkyblockFeatures;
16 | import mrfast.sbf.utils.Utils;
17 | /**
18 | * Modified from Patcher under Creative Commons Attribution-NonCommercial-ShareAlike 4.0
19 | * https://github.com/Sk1erLLC/Patcher/blob/master/LICENSE.md
20 | *
21 | * @author Sk1erLLC
22 | */
23 | @Mixin(BlockCrops.class)
24 | public abstract class MixinBlockCrops extends BlockBush {
25 |
26 | @Override
27 | public AxisAlignedBB getSelectedBoundingBox(World worldIn, BlockPos pos) {
28 | updateCropsMaxY(worldIn, pos, worldIn.getBlockState(pos).getBlock());
29 | return super.getSelectedBoundingBox(worldIn, pos);
30 | }
31 |
32 | @Override
33 | public MovingObjectPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end) {
34 | updateCropsMaxY(worldIn, pos, worldIn.getBlockState(pos).getBlock());
35 | return super.collisionRayTrace(worldIn, pos, start, end);
36 | }
37 |
38 | private void updateCropsMaxY(World world, BlockPos pos, Block block) {
39 | if(!SkyblockFeatures.config.cropBox) return;
40 | final IBlockState blockState = world.getBlockState(pos);
41 |
42 | if (Utils.GetMC().theWorld != null) {
43 | if(blockState.getValue(BlockCrops.AGE) == 7) {
44 | block.maxY = 1F;
45 | return;
46 | }
47 | }
48 |
49 | block.maxY = 0.25F;
50 | }
51 | }
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/mixins/transformers/MixinBlockNetherWart.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.mixins.transformers;
2 |
3 | import net.minecraft.block.Block;
4 | import net.minecraft.block.BlockBush;
5 | import net.minecraft.block.BlockNetherWart;
6 | import net.minecraft.util.AxisAlignedBB;
7 | import net.minecraft.util.BlockPos;
8 | import net.minecraft.util.MovingObjectPosition;
9 | import net.minecraft.util.Vec3;
10 | import net.minecraft.world.World;
11 |
12 | import org.spongepowered.asm.mixin.Mixin;
13 |
14 | import mrfast.sbf.utils.Utils;
15 | /**
16 | * Taken from Patcher under Creative Commons Attribution-NonCommercial-ShareAlike 4.0
17 | * https://github.com/Sk1erLLC/Patcher/blob/master/LICENSE.md
18 | *
19 | * @author Sk1erLLC
20 | */
21 | @Mixin(BlockNetherWart.class)
22 | public abstract class MixinBlockNetherWart extends BlockBush {
23 |
24 | @Override
25 | public AxisAlignedBB getSelectedBoundingBox(World worldIn, BlockPos pos) {
26 | updateWartMaxY(worldIn, pos, worldIn.getBlockState(pos).getBlock());
27 | return super.getSelectedBoundingBox(worldIn, pos);
28 | }
29 |
30 | @Override
31 | public MovingObjectPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end) {
32 | updateWartMaxY(worldIn, pos, worldIn.getBlockState(pos).getBlock());
33 | return super.collisionRayTrace(worldIn, pos, start, end);
34 | }
35 |
36 | private void updateWartMaxY(World world, BlockPos pos, Block block) {
37 | if (Utils.GetMC().theWorld != null) {
38 | if(world.getBlockState(pos).getValue(BlockNetherWart.AGE) == 3) {
39 | block.maxY = 1F;
40 | return;
41 | }
42 | }
43 | block.maxY = 0.25F;
44 | }
45 |
46 | }
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/mixins/transformers/MixinChunk.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.mixins.transformers;
2 |
3 | import net.minecraft.block.state.IBlockState;
4 | import net.minecraft.client.Minecraft;
5 | import net.minecraft.util.BlockPos;
6 | import net.minecraft.util.ChatComponentText;
7 | import net.minecraft.world.World;
8 | import net.minecraft.world.chunk.Chunk;
9 | import net.minecraftforge.common.MinecraftForge;
10 | import org.spongepowered.asm.mixin.Mixin;
11 | import org.spongepowered.asm.mixin.Shadow;
12 | import org.spongepowered.asm.mixin.injection.At;
13 | import org.spongepowered.asm.mixin.injection.Inject;
14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
15 |
16 | import mrfast.sbf.events.BlockChangeEvent;
17 |
18 | @Mixin(Chunk.class)
19 | public abstract class MixinChunk {
20 | @Shadow
21 | public abstract IBlockState getBlockState(final BlockPos pos);
22 |
23 | @Inject(method = "setBlockState", at = @At("HEAD"))
24 | private void onBlockChange(BlockPos pos, IBlockState state, CallbackInfoReturnable cir) {
25 | IBlockState old = this.getBlockState(pos);
26 | if (old != state) {
27 | try {
28 | MinecraftForge.EVENT_BUS.post(new BlockChangeEvent(pos, old, state));
29 | } catch (Throwable e) {
30 | e.printStackTrace();
31 | }
32 | }
33 | }
34 |
35 | }
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/mixins/transformers/MixinEntityRenderer.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.mixins.transformers;
2 |
3 | import org.spongepowered.asm.mixin.Mixin;
4 | import org.spongepowered.asm.mixin.Shadow;
5 | import org.spongepowered.asm.mixin.injection.At;
6 | import org.spongepowered.asm.mixin.injection.Inject;
7 | import org.spongepowered.asm.mixin.injection.ModifyVariable;
8 | import org.spongepowered.asm.mixin.injection.Redirect;
9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
10 |
11 | import mrfast.sbf.SkyblockFeatures;
12 | import mrfast.sbf.utils.Utils;
13 | import net.minecraft.client.Minecraft;
14 | import net.minecraft.client.renderer.EntityRenderer;
15 | import net.minecraft.entity.EntityLivingBase;
16 | import net.minecraft.item.ItemStack;
17 | import net.minecraft.potion.Potion;
18 | import net.minecraft.util.MovingObjectPosition;
19 | import net.minecraft.world.World;
20 |
21 | @Mixin(EntityRenderer.class)
22 | public class MixinEntityRenderer {
23 | @Inject(method = "hurtCameraEffect", at = @At("HEAD"), cancellable = true)
24 | private void onHurtcam(float partialTicks, CallbackInfo ci) {
25 | if (Utils.inSkyblock && SkyblockFeatures.config.noHurtcam) ci.cancel();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/mixins/transformers/MixinGui.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.mixins.transformers;
2 |
3 | import org.spongepowered.asm.mixin.Mixin;
4 | import org.spongepowered.asm.mixin.injection.At;
5 | import org.spongepowered.asm.mixin.injection.Inject;
6 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
7 |
8 | import mrfast.sbf.SkyblockFeatures;
9 | import mrfast.sbf.utils.Utils;
10 | import net.minecraft.client.gui.Gui;
11 | import net.minecraft.client.gui.inventory.GuiChest;
12 |
13 | @Mixin(Gui.class)
14 | public abstract class MixinGui {
15 | @Inject(method = "drawGradientRect", at = @At(value = "HEAD"), cancellable = true)
16 | private void connect(int left, int top, int right, int bottom, int startColor, int endColor, CallbackInfo ci) {
17 | if(SkyblockFeatures.config.hideWhiteSquare && Utils.GetMC().theWorld != null && startColor==-2130706433) {
18 | ci.cancel();
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/mixins/transformers/MixinGuiContainer.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.mixins.transformers;
2 |
3 | import net.minecraft.client.Minecraft;
4 | import net.minecraft.client.gui.GuiScreen;
5 | import net.minecraft.client.gui.inventory.GuiChest;
6 | import net.minecraft.client.gui.inventory.GuiContainer;
7 | import net.minecraft.inventory.Container;
8 | import net.minecraft.inventory.ContainerChest;
9 | import net.minecraft.inventory.Slot;
10 | import net.minecraftforge.common.MinecraftForge;
11 | import org.spongepowered.asm.mixin.Mixin;
12 | import org.spongepowered.asm.mixin.Shadow;
13 | import org.spongepowered.asm.mixin.injection.At;
14 | import org.spongepowered.asm.mixin.injection.Inject;
15 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
16 |
17 | import mrfast.sbf.events.GuiContainerEvent;
18 | import mrfast.sbf.events.SlotClickedEvent;
19 |
20 | /**
21 | * Original code was taken from Skytils under GNU Affero General Public License v3.0 and modified by MrFast
22 | *
23 | * @author Skytils Team
24 | * @link https://github.com/Skytils/SkytilsMod/blob/1.x/LICENSE.md
25 | */
26 | @Mixin(GuiContainer.class)
27 | public abstract class MixinGuiContainer extends GuiScreen {
28 |
29 | @Shadow
30 | public Container inventorySlots;
31 |
32 | private final GuiContainer that = (GuiContainer) (Object) this;
33 |
34 | @Inject(method = "drawScreen", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/inventory/GuiContainer;drawGuiContainerForegroundLayer(II)V", ordinal = 0, shift = At.Shift.AFTER))
35 | private void onGuiContainerDrawn(int mouseX, int mouseY, float partialTicks, CallbackInfo ci) {
36 | try {
37 | if (!(Minecraft.getMinecraft().currentScreen instanceof GuiChest)) {
38 | return;
39 | }
40 |
41 | GuiChest chest = (GuiChest) Minecraft.getMinecraft().currentScreen;
42 | ContainerChest container = (ContainerChest) chest.inventorySlots;
43 |
44 | if (container == null || container.getLowerChestInventory() == null) {
45 | return;
46 | }
47 |
48 | String name = container.getLowerChestInventory().getName();
49 |
50 | if (name == null) {
51 | return;
52 | }
53 |
54 | MinecraftForge.EVENT_BUS.post(new GuiContainerEvent.TitleDrawnEvent(that, chest.inventorySlots, name));
55 | } catch (Throwable e) {
56 | e.printStackTrace();
57 | }
58 | }
59 |
60 | @Inject(method = "drawSlot", at = @At("HEAD"), cancellable = true)
61 | private void onDrawSlot(Slot slot, CallbackInfo ci) {
62 | try {
63 | if (MinecraftForge.EVENT_BUS.post(new GuiContainerEvent.DrawSlotEvent.Pre(that, inventorySlots, slot)))
64 | ci.cancel();
65 | } catch (Throwable e) {
66 | e.printStackTrace();
67 | }
68 | }
69 |
70 | @Inject(
71 | method = "handleMouseClick",
72 | at = @At("HEAD"),
73 | cancellable = true
74 | )
75 | private void onSlotClick(Slot slotIn, int slotId, int clickedButton, int clickType, CallbackInfo ci) {
76 | GuiContainer container = (GuiContainer) (Object) this;
77 | Slot slot = slotId < 0 ? null : container.inventorySlots.getSlot(slotId);
78 | SlotClickedEvent event = new SlotClickedEvent(container, slot);
79 | MinecraftForge.EVENT_BUS.post(event);
80 | if (event.isCanceled()) {
81 | ci.cancel();
82 | }
83 | }
84 |
85 | @Inject(method = "drawSlot", at = @At("RETURN"))
86 | private void onDrawSlotPost(Slot slot, CallbackInfo ci) {
87 | try {
88 | MinecraftForge.EVENT_BUS.post(new GuiContainerEvent.DrawSlotEvent.Post(that, inventorySlots, slot));
89 | } catch (Throwable e) {
90 | e.printStackTrace();
91 | }
92 | }
93 | }
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/mixins/transformers/MixinGuiEditSign.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.mixins.transformers;
2 |
3 | import org.spongepowered.asm.mixin.Mixin;
4 | import org.spongepowered.asm.mixin.injection.At;
5 | import org.spongepowered.asm.mixin.injection.Inject;
6 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
7 |
8 | import mrfast.sbf.events.DrawSignEvent;
9 | import mrfast.sbf.utils.Utils;
10 | import net.minecraft.client.gui.GuiScreen;
11 | import net.minecraft.client.gui.inventory.GuiEditSign;
12 | import net.minecraftforge.common.MinecraftForge;
13 |
14 | @Mixin(GuiEditSign.class)
15 | public class MixinGuiEditSign extends GuiScreen {
16 | @Inject(method = "drawScreen", at = @At("RETURN"))
17 | private void onDrawScreen(int mouseX, int mouseY, float partialTicks, CallbackInfo ci) {
18 | try {
19 | MinecraftForge.EVENT_BUS.post(new DrawSignEvent());
20 | } catch (Throwable e) {
21 | e.printStackTrace();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/mixins/transformers/MixinItemRenderer.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.mixins.transformers;
2 |
3 | import org.spongepowered.asm.mixin.Final;
4 | import org.spongepowered.asm.mixin.Mixin;
5 | import org.spongepowered.asm.mixin.Shadow;
6 | import org.spongepowered.asm.mixin.injection.At;
7 | import org.spongepowered.asm.mixin.injection.Inject;
8 | import org.spongepowered.asm.mixin.injection.ModifyArg;
9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
10 | import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
11 |
12 | import mrfast.sbf.SkyblockFeatures;
13 | import mrfast.sbf.utils.Utils;
14 | import net.minecraft.client.Minecraft;
15 | import net.minecraft.client.entity.AbstractClientPlayer;
16 | import net.minecraft.client.renderer.GlStateManager;
17 | import net.minecraft.client.renderer.ItemRenderer;
18 | import net.minecraft.item.Item;
19 |
20 | @Mixin(ItemRenderer.class)
21 | public class MixinItemRenderer {
22 |
23 | @Inject(method = "renderItemInFirstPerson(F)V",at = @At(value = "INVOKE",shift = At.Shift.AFTER, target = "Lnet/minecraft/client/renderer/GlStateManager;pushMatrix()V"))
24 | public void transformFirstPersonItem(CallbackInfo ci) {
25 | if(!SkyblockFeatures.config.smallItems) return;
26 |
27 | if(Utils.GetMC().thePlayer.getHeldItem() != null) {
28 | GlStateManager.translate(30*0.01, -5*0.01, -60*0.01);
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/mixins/transformers/MixinLayerArmorBase.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.mixins.transformers;
2 |
3 | import net.minecraft.client.model.ModelBase;
4 | import net.minecraft.client.renderer.GlStateManager;
5 | import net.minecraft.client.renderer.entity.RenderLiving;
6 | import net.minecraft.client.renderer.entity.layers.LayerArmorBase;
7 | import net.minecraft.client.renderer.entity.layers.LayerRenderer;
8 | import net.minecraft.entity.EntityLivingBase;
9 | import net.minecraft.entity.monster.EntityZombie;
10 | import net.minecraft.entity.player.EntityPlayer;
11 |
12 | import org.lwjgl.opengl.GL11;
13 | import org.spongepowered.asm.mixin.Mixin;
14 | import org.spongepowered.asm.mixin.injection.At;
15 | import org.spongepowered.asm.mixin.injection.Inject;
16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
17 |
18 | import mrfast.sbf.SkyblockFeatures;
19 | import mrfast.sbf.utils.Utils;
20 |
21 | @Mixin(LayerArmorBase.class)
22 | public abstract class MixinLayerArmorBase implements LayerRenderer {
23 |
24 | @Inject(method = "doRenderLayer", at = @At("HEAD"), cancellable = true)
25 | private void onRenderAllArmor(EntityLivingBase entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale, CallbackInfo ci) {
26 | if (entitylivingbaseIn instanceof EntityPlayer && SkyblockFeatures.config.DisguisePlayersAs == 8 && SkyblockFeatures.config.playerDiguiser && !Utils.isNPC(entitylivingbaseIn) && Utils.inSkyblock) {
27 | ci.cancel();
28 | }
29 | }
30 |
31 | }
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/mixins/transformers/MixinMinecraft.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.mixins.transformers;
2 |
3 | import org.spongepowered.asm.mixin.Mixin;
4 | import org.spongepowered.asm.mixin.Shadow;
5 | import org.spongepowered.asm.mixin.injection.At;
6 | import org.spongepowered.asm.mixin.injection.Inject;
7 | import org.spongepowered.asm.mixin.injection.Redirect;
8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
9 |
10 | import mrfast.sbf.SkyblockFeatures;
11 | import mrfast.sbf.utils.Utils;
12 | import net.minecraft.client.Minecraft;
13 | import net.minecraft.client.entity.EntityPlayerSP;
14 | import net.minecraft.client.gui.FontRenderer;
15 | import net.minecraft.util.ResourceLocation;
16 |
17 | @Mixin(Minecraft.class)
18 | public class MixinMinecraft {
19 |
20 | @Redirect(method = "startGame", at = @At(value = "FIELD", target = "Lnet/minecraft/client/Minecraft;fontRendererObj:Lnet/minecraft/client/gui/FontRenderer;"))
21 | public void startFontRenderer(Minecraft instance, FontRenderer value) {
22 | if(SkyblockFeatures.config.customFont) {
23 | Utils.GetMC().fontRendererObj = new FontRenderer(Utils.GetMC().gameSettings, new ResourceLocation("skyblockfeatures","font/ascii.png"), Utils.GetMC().renderEngine, false);
24 | } else {
25 | Utils.GetMC().fontRendererObj = new FontRenderer(Utils.GetMC().gameSettings, new ResourceLocation("textures/font/ascii.png"), Utils.GetMC().renderEngine, false);
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/mixins/transformers/MixinNetHandlerPlayClient.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.mixins.transformers;
2 |
3 | import net.minecraft.client.Minecraft;
4 | import net.minecraft.client.network.NetHandlerPlayClient;
5 | import net.minecraft.network.Packet;
6 | import net.minecraft.util.ChatComponentText;
7 | import net.minecraftforge.common.MinecraftForge;
8 | import org.spongepowered.asm.mixin.Mixin;
9 | import org.spongepowered.asm.mixin.injection.At;
10 | import org.spongepowered.asm.mixin.injection.Inject;
11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
12 |
13 | import mrfast.sbf.events.PacketEvent;
14 |
15 | @Mixin(NetHandlerPlayClient.class)
16 | public class MixinNetHandlerPlayClient {
17 | @Inject(method = "addToSendQueue", at = @At("HEAD"), cancellable = true)
18 | private void onSendPacket(Packet> packet, CallbackInfo ci) {
19 | try {
20 | if (MinecraftForge.EVENT_BUS.post(new PacketEvent.SendEvent(packet))) ci.cancel();
21 | } catch (Throwable e) {
22 | e.printStackTrace();
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/mixins/transformers/MixinNetworkManager.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.mixins.transformers;
2 |
3 | import io.netty.channel.ChannelHandlerContext;
4 | import mrfast.sbf.events.PacketEvent;
5 | import net.minecraft.client.Minecraft;
6 | import net.minecraft.network.NetworkManager;
7 | import net.minecraft.network.Packet;
8 | import net.minecraft.util.ChatComponentText;
9 | import net.minecraftforge.common.MinecraftForge;
10 | import org.spongepowered.asm.mixin.Mixin;
11 | import org.spongepowered.asm.mixin.injection.At;
12 | import org.spongepowered.asm.mixin.injection.Inject;
13 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
14 |
15 | @Mixin(NetworkManager.class)
16 | public class MixinNetworkManager {
17 | @Inject(method = "channelRead0", at = @At("HEAD"), cancellable = true)
18 | private void onReceivePacket(ChannelHandlerContext context, Packet> packet, CallbackInfo ci) {
19 | try {
20 | if (MinecraftForge.EVENT_BUS.post(new PacketEvent.ReceiveEvent(packet))) ci.cancel();
21 | } catch (Throwable e) {
22 | e.printStackTrace();
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/mixins/transformers/MixinRender.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.mixins.transformers;
2 |
3 | import org.lwjgl.opengl.GL11;
4 | import org.spongepowered.asm.mixin.Mixin;
5 | import org.spongepowered.asm.mixin.injection.At;
6 | import org.spongepowered.asm.mixin.injection.Inject;
7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
9 |
10 | import mrfast.sbf.SkyblockFeatures;
11 | import mrfast.sbf.events.CheckRenderEntityEvent;
12 | import mrfast.sbf.utils.Utils;
13 | import net.minecraft.client.renderer.culling.ICamera;
14 | import net.minecraft.client.renderer.entity.Render;
15 | import net.minecraft.entity.Entity;
16 | import net.minecraft.entity.passive.EntityBat;
17 | import net.minecraft.entity.player.EntityPlayer;
18 | import net.minecraft.util.ResourceLocation;
19 | import net.minecraftforge.common.MinecraftForge;
20 |
21 | @Mixin(Render.class)
22 | public abstract class MixinRender {
23 | @Inject(method = "shouldRender", at = @At("HEAD"), cancellable = true)
24 | private void shouldRender(T livingEntity, ICamera camera, double camX, double camY, double camZ, CallbackInfoReturnable cir) {
25 | if(!Utils.isNPC(livingEntity) && livingEntity.getDistanceToEntity(Utils.GetMC().thePlayer) > 49 && Utils.inSkyblock && SkyblockFeatures.config.HideFarEntity && !Utils.inDungeons) {
26 | cir.setReturnValue(false);
27 | }
28 |
29 | try {
30 | if (MinecraftForge.EVENT_BUS.post(new CheckRenderEntityEvent<>(livingEntity, camera, camX, camY, camZ))) cir.setReturnValue(false);
31 | } catch (Throwable e) {
32 | e.printStackTrace();
33 | }
34 | }
35 |
36 | @Inject(method="renderLivingLabel",at=@At("HEAD"), cancellable = true)
37 | public void renderLivingLabel(T entityIn, String str, double x, double y, double z, int maxDistance, CallbackInfo ci) {
38 | if(!Utils.isNPC(entityIn) && entityIn instanceof EntityPlayer && SkyblockFeatures.config.hidePlayerNametags) {
39 | ci.cancel();
40 | }
41 | else if(SkyblockFeatures.config.hideAllNametags) {
42 | ci.cancel();
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/mixins/transformers/MixinRenderGlobal.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.mixins.transformers;
2 |
3 | import mrfast.sbf.utils.EntityOutlineRenderer;
4 | import net.minecraft.client.entity.EntityPlayerSP;
5 | import net.minecraft.client.renderer.RenderGlobal;
6 | import net.minecraft.client.renderer.culling.ICamera;
7 | import net.minecraft.client.settings.KeyBinding;
8 | import net.minecraft.client.shader.Framebuffer;
9 | import net.minecraft.client.shader.ShaderGroup;
10 | import net.minecraft.entity.Entity;
11 | import org.spongepowered.asm.mixin.Mixin;
12 | import org.spongepowered.asm.mixin.Shadow;
13 | import org.spongepowered.asm.mixin.injection.At;
14 | import org.spongepowered.asm.mixin.injection.Inject;
15 | import org.spongepowered.asm.mixin.injection.Redirect;
16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
17 | import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
18 |
19 | import java.util.List;
20 |
21 | /**
22 | * Adapted from Skyhanni under GNU LGPL v2.1 license
23 | * @link https://github.com/hannibal002/SkyHanni/blob/beta/LICENSE
24 | */
25 | @Mixin(RenderGlobal.class)
26 | public abstract class MixinRenderGlobal {
27 | @Shadow protected abstract boolean isRenderEntityOutlines();
28 |
29 | @Redirect(method = "renderEntities", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/RenderGlobal;isRenderEntityOutlines()Z", ordinal = 0))
30 | private boolean onRenderEntities(RenderGlobal renderGlobal) {
31 | return false;
32 | }
33 |
34 | // Remove condition by always returning true
35 | @Redirect(method = "isRenderEntityOutlines", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/entity/EntityPlayerSP;isSpectator()Z", ordinal = 0))
36 | private boolean isSpectatorDisableCheck(EntityPlayerSP entityPlayerSP) {
37 | return true;
38 | }
39 |
40 | @Redirect(method = "isRenderEntityOutlines", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/settings/KeyBinding;isKeyDown()Z", ordinal = 0))
41 | private boolean isKeyDownDisableCheck(KeyBinding keyBinding) {
42 | return EntityOutlineRenderer.shouldRenderEntityOutlines();
43 | }
44 |
45 | @Inject(method = "renderEntities", at = @At(value = "INVOKE_STRING", target = "Lnet/minecraft/profiler/Profiler;endStartSection(Ljava/lang/String;)V", shift = At.Shift.BEFORE, ordinal = 2, args = {"ldc=entities"}), locals = LocalCapture.CAPTURE_FAILSOFT) // Non-optifine version
46 | private void renderEntities(Entity renderViewEntity, ICamera camera, float partialTicks, CallbackInfo ci, int pass, double d0, double d1, double d2) {
47 | displayOutlines(d0, d1, d2, camera, partialTicks);
48 | }
49 |
50 | private void displayOutlines(double x, double y, double z, ICamera camera, float partialTicks) {
51 | if (isRenderEntityOutlines()) {
52 | EntityOutlineRenderer.renderEntityOutlines(camera,partialTicks,x,y,z);
53 | }
54 | }
55 | }
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/mixins/transformers/MixinRenderPlayer.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.mixins.transformers;
2 |
3 | import org.spongepowered.asm.mixin.Mixin;
4 | import org.spongepowered.asm.mixin.Overwrite;
5 | import org.spongepowered.asm.mixin.Shadow;
6 | import org.spongepowered.asm.mixin.injection.At;
7 | import org.spongepowered.asm.mixin.injection.Inject;
8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
10 |
11 | import mrfast.sbf.SkyblockFeatures;
12 | import mrfast.sbf.utils.Utils;
13 | import net.minecraft.client.entity.AbstractClientPlayer;
14 | import net.minecraft.client.entity.EntityOtherPlayerMP;
15 | import net.minecraft.client.renderer.GlStateManager;
16 | import net.minecraft.client.renderer.entity.RenderPlayer;
17 | import net.minecraft.client.renderer.entity.layers.LayerArmorBase;
18 | import net.minecraft.entity.Entity;
19 | import net.minecraft.entity.player.EntityPlayer;
20 | import net.minecraft.init.Items;
21 | import net.minecraft.item.ItemStack;
22 | import net.minecraft.util.ResourceLocation;
23 |
24 | @Mixin(RenderPlayer.class)
25 | public abstract class MixinRenderPlayer {
26 | @Inject(method = { "preRenderCallback(Lnet/minecraft/client/entity/AbstractClientPlayer;F)V" }, at = { @At("HEAD") })
27 | public void beforeRender(AbstractClientPlayer entitylivingbaseIn, float partialTickTime, CallbackInfo ci) {
28 | if (SkyblockFeatures.config.DisguisePlayersAs == 7 && SkyblockFeatures.config.playerDiguiser && !Utils.isNPC(entitylivingbaseIn) && Utils.inSkyblock) {
29 | GlStateManager.scale(0.5, 0.5, 0.5);
30 | }
31 | if (SkyblockFeatures.config.DisguisePlayersAs == 8 && SkyblockFeatures.config.playerDiguiser && !Utils.isNPC(entitylivingbaseIn) && Utils.inSkyblock) {
32 | GlStateManager.scale(1, 0.75, 1);
33 | }
34 | }
35 |
36 | @Inject(method = "getEntityTexture", at = @At("HEAD"), cancellable = true)
37 | private void onGetEntityTexture(AbstractClientPlayer entity, CallbackInfoReturnable info) {
38 | if (SkyblockFeatures.config.DisguisePlayersAs == 8 && SkyblockFeatures.config.playerDiguiser && !Utils.isNPC(entity) && Utils.inSkyblock) {
39 | ResourceLocation customSkin = new ResourceLocation("skyblockfeatures", "monki.png");
40 | info.setReturnValue(customSkin);
41 | if(entity instanceof EntityOtherPlayerMP) {
42 | entity.setCurrentItemOrArmor(0, new ItemStack(Items.stick));
43 | entity.setCurrentItemOrArmor(4, null);
44 | }
45 | }
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/utils/CapeUtils.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.utils;
2 |
3 | import java.awt.image.BufferedImage;
4 | import java.io.BufferedReader;
5 | import java.io.IOException;
6 | import java.io.InputStream;
7 | import java.io.InputStreamReader;
8 | import java.net.URL;
9 | import java.util.ArrayList;
10 | import java.util.HashMap;
11 | import java.util.List;
12 |
13 | import javax.imageio.ImageIO;
14 |
15 | import mrfast.sbf.SkyblockFeatures;
16 | import net.minecraft.client.Minecraft;
17 | import net.minecraft.client.renderer.texture.DynamicTexture;
18 | import net.minecraft.util.ResourceLocation;
19 | import net.minecraftforge.event.world.WorldEvent;
20 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
21 |
22 | public class CapeUtils {
23 | public static HashMap final_name_list = get_names();
24 |
25 | @SubscribeEvent
26 | public void worldLoadEvent(WorldEvent.Load event) {
27 | reloadCapes();
28 | }
29 |
30 | public static void reloadCapes() {
31 | final_name_list = get_names();
32 | }
33 |
34 | public static HashMap get_names() {
35 | try {
36 | URL url = new URL("https://raw.githubusercontent.com/MrFast-js/skyblockFeatures-Capes/main/capes.txt");
37 | BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
38 | final HashMap name_list = new HashMap<>();
39 | String s;
40 |
41 | while ((s = reader.readLine()) != null) {
42 | String name = s.toLowerCase().split(" ")[0];
43 | String capeName = s.split(" ")[1];
44 | name_list.put(name, capeName);
45 | }
46 | if(!SkyblockFeatures.config.playerCapeURL.isEmpty()) {
47 | if(convertImageToResourceLocation(SkyblockFeatures.config.playerCapeURL)!=null) {
48 | name_list.put(Utils.GetMC().thePlayer.getName().toLowerCase(), SkyblockFeatures.config.playerCapeURL);
49 | }
50 | }
51 | return name_list;
52 | } catch (Exception ignored){
53 | return null;
54 | }
55 | }
56 |
57 | static HashMap capes = new HashMap<>();
58 | static List capesFetching = new ArrayList<>();
59 | public static ResourceLocation convertImageToResourceLocation(String imageUrl) {
60 | if(imageUrl==null) return null;
61 | if(capes.containsKey(imageUrl)) {
62 | return capes.get(imageUrl);
63 | }
64 | try {
65 | URL url = new URL(imageUrl);
66 | InputStream inputStream = url.openStream();
67 | BufferedImage image = ImageIO.read(inputStream);
68 | DynamicTexture dynamicTexture = new DynamicTexture(image);
69 | ResourceLocation resourceLocation = Minecraft.getMinecraft().getTextureManager().getDynamicTextureLocation("image_" + imageUrl.hashCode(), dynamicTexture);
70 | capes.put(imageUrl,resourceLocation);
71 | capesFetching.remove(imageUrl);
72 | return resourceLocation;
73 | } catch (IOException e) {
74 | // e.printStackTrace();
75 | }
76 | return null;
77 | }
78 |
79 | public static ResourceLocation getCape(String name) {
80 | name = name.toLowerCase();
81 |
82 | return convertImageToResourceLocation(final_name_list.get(name));
83 | }
84 |
85 | public static boolean is_name_valid(String name) {
86 | if(final_name_list==null) return false;
87 | if(name==null) return false;
88 | for (String u : final_name_list.keySet()) {
89 | if (u.contains(name.toLowerCase())) {
90 | return true;
91 | }
92 | }
93 | return false;
94 | }
95 |
96 | }
97 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/utils/ItemRarity.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.utils;
2 |
3 | import net.minecraft.util.EnumChatFormatting;
4 |
5 | import java.awt.*;
6 | import java.util.Arrays;
7 | import java.util.Comparator;
8 |
9 | /**
10 | * Taken from Skyblockcatia under MIT License
11 | * Modified
12 | * https://github.com/SteveKunG/SkyBlockcatia/blob/1.8.9/LICENSE.md
13 | * @author SteveKunG
14 | */
15 | public enum ItemRarity {
16 | COMMON("COMMON", EnumChatFormatting.WHITE, new Color(255,255,255)),
17 | UNCOMMON("UNCOMMON", EnumChatFormatting.GREEN, new Color(85,255,85)),
18 | RARE("RARE", EnumChatFormatting.BLUE, new Color(85,85,255)),
19 | EPIC("EPIC", EnumChatFormatting.DARK_PURPLE, new Color(190,0,190)),
20 | LEGENDARY("LEGENDARY", EnumChatFormatting.GOLD, new Color(255,170,0)),
21 | MYTHIC("MYTHIC", EnumChatFormatting.LIGHT_PURPLE, new Color(255,85,255)),
22 | SUPREME("SUPREME", EnumChatFormatting.DARK_RED, new Color(170,0,0)),
23 |
24 | SPECIAL("SPECIAL", EnumChatFormatting.RED, new Color(255,85,85)),
25 | VERY_SPECIAL("VERY SPECIAL", EnumChatFormatting.RED, new Color(170,0,0));
26 |
27 | private static final ItemRarity[] VALUES = Arrays.stream(values()).sorted(Comparator.comparingInt(ItemRarity::ordinal)).toArray(size -> new ItemRarity[size]);
28 | private final String name;
29 | private final EnumChatFormatting baseColor;
30 | private final Color color;
31 |
32 | static {
33 | for (ItemRarity rarity : values())
34 | {
35 | VALUES[rarity.ordinal()] = rarity;
36 | }
37 | }
38 |
39 | ItemRarity(String name, EnumChatFormatting baseColor, Color color) {
40 | this.name = name;
41 | this.baseColor = baseColor;
42 | this.color = color;
43 | }
44 |
45 | public String getName() {
46 | return this.name;
47 | }
48 |
49 | public EnumChatFormatting getBaseColor() {
50 | return this.baseColor;
51 | }
52 |
53 | public Color getColor() {
54 | return this.color;
55 | }
56 |
57 | public static ItemRarity getRarityFromName(String name) {
58 | for (ItemRarity rarity : values())
59 | {
60 | if (rarity.name.equals(name))
61 | {
62 | return rarity;
63 | }
64 | }
65 | return ItemRarity.COMMON;
66 | }
67 |
68 | public static int getPetRarity(String tier) {
69 | int rarity = 0;
70 | if (tier.equals("COMMON")) rarity = 1;
71 | if (tier.equals("UNCOMMON")) rarity = 2;
72 | if (tier.equals("RARE")) rarity = 3;
73 | if (tier.equals("EPIC")) rarity = 4;
74 | if (tier.equals("LEGENDARY")) rarity = 5;
75 | if (tier.equals("MYTHIC")) rarity = 6;
76 | return rarity;
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/utils/ScoreboardUtil.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.utils;
2 |
3 | import com.google.common.collect.Iterables;
4 | import com.google.common.collect.Lists;
5 | import net.minecraft.client.Minecraft;
6 | import net.minecraft.scoreboard.Score;
7 | import net.minecraft.scoreboard.ScoreObjective;
8 | import net.minecraft.scoreboard.ScorePlayerTeam;
9 | import net.minecraft.scoreboard.Scoreboard;
10 |
11 | import java.util.*;
12 | import java.util.stream.Collectors;
13 |
14 | public class ScoreboardUtil {
15 |
16 | /**
17 | * Data from Skyhanni
18 | * Source: https://github.com/hannibal002/SkyHanni
19 | * @author CalMWolfs
20 | */
21 | private static final List hypixelsWeirdIcons = Arrays.asList(
22 | "\uD83C\uDF6B", "\uD83D\uDCA3", "\uD83D\uDC7D", "\uD83D\uDD2E", "\uD83D\uDC0D",
23 | "\uD83D\uDC7E", "\uD83C\uDF20", "\uD83C\uDF6D", "⚽", "\uD83C\uDFC0", "\uD83D\uDC79",
24 | "\uD83C\uDF81", "\uD83C\uDF89", "\uD83C\uDF82", "\uD83D\uDD2B"
25 | );
26 | public static String fixFormatting(String input,Boolean cleanColor) {
27 | for (String weirdIcon : hypixelsWeirdIcons) {
28 | if (input.contains(weirdIcon)) {
29 | String[] parts = input.split(weirdIcon, 2);
30 | input = parts[0] + (parts.length > 1 ? parts[1].length()>2?parts[1].substring(2):"" : "");
31 | }
32 | }
33 | if(cleanColor) input = Utils.cleanColor(input);
34 | return input;
35 | }
36 |
37 | /**
38 | * Taken from Danker's Skyblock Mod and modified under GPL 3.0 license
39 | * https://github.com/bowser0000/SkyblockMod/blob/master/LICENSE
40 | * @author bowser0000
41 | */
42 | public static List getSidebarLines() {
43 | return getSidebarLines(true);
44 | }
45 | public static List getSidebarLines(boolean clean) {
46 | List lines = new ArrayList<>();
47 | if (Minecraft.getMinecraft().theWorld == null) return lines;
48 | Scoreboard scoreboard = Minecraft.getMinecraft().theWorld.getScoreboard();
49 | if (scoreboard == null) return lines;
50 |
51 | ScoreObjective objective = scoreboard.getObjectiveInDisplaySlot(1);
52 |
53 | if (objective == null) return lines;
54 |
55 | Collection scores = scoreboard.getSortedScores(objective);
56 | List list = scores.stream()
57 | .filter(input -> input != null && input.getPlayerName() != null && !input.getPlayerName()
58 | .startsWith("#"))
59 | .collect(Collectors.toList());
60 |
61 | if (list.size() > 15) {
62 | scores = Lists.newArrayList(Iterables.skip(list, scores.size() - 15));
63 | } else {
64 | scores = list;
65 | }
66 |
67 | for (Score score : scores) {
68 | ScorePlayerTeam team = scoreboard.getPlayersTeam(score.getPlayerName());
69 | lines.add(fixFormatting(ScorePlayerTeam.formatPlayerName(team, score.getPlayerName()),clean));
70 | }
71 | // Reverse it so its from top to bottom
72 | lines.add(objective.getDisplayName());
73 | Collections.reverse(lines);
74 | return lines;
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/src/main/java/mrfast/sbf/utils/TabListUtils.java:
--------------------------------------------------------------------------------
1 | package mrfast.sbf.utils;
2 |
3 | import com.google.common.collect.ComparisonChain;
4 | import com.google.common.collect.Ordering;
5 | import net.minecraft.client.Minecraft;
6 | import net.minecraft.client.network.NetworkPlayerInfo;
7 | import net.minecraft.scoreboard.ScorePlayerTeam;
8 | import net.minecraft.world.WorldSettings;
9 |
10 | import java.util.Collections;
11 | import java.util.List;
12 |
13 | /**
14 | * Modified from Skytils 0.x under GNU Affero General Public License v3.0
15 | * https://github.com/Skytils/SkytilsMod/tree/0.x
16 | *
17 | * @author Sychic
18 | */
19 | public class TabListUtils {
20 |
21 | public static final Ordering playerInfoOrdering = new Ordering() {
22 | @Override
23 | public int compare(NetworkPlayerInfo p_compare_1_, NetworkPlayerInfo p_compare_2_) {
24 | ScorePlayerTeam scoreplayerteam = p_compare_1_.getPlayerTeam();
25 | ScorePlayerTeam scoreplayerteam1 = p_compare_2_.getPlayerTeam();
26 | return ComparisonChain.start().compareTrueFirst(p_compare_1_.getGameType() != WorldSettings.GameType.SPECTATOR, p_compare_2_.getGameType() != WorldSettings.GameType.SPECTATOR).compare(scoreplayerteam != null ? scoreplayerteam.getRegisteredName() : "", scoreplayerteam1 != null ? scoreplayerteam1.getRegisteredName() : "").compare(p_compare_1_.getGameProfile().getName(), p_compare_2_.getGameProfile().getName()).result();
27 | }
28 | };
29 |
30 | public static List getTabEntries() {
31 | if (Minecraft.getMinecraft().thePlayer == null) return Collections.emptyList();
32 | return playerInfoOrdering.sortedCopy(Minecraft.getMinecraft().thePlayer.sendQueue.getPlayerInfoMap());
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/resources/META-INF/mrfast_at.cfg:
--------------------------------------------------------------------------------
1 | public net.minecraft.block.Block field_149756_F # maxY
2 | public net.minecraft.client.gui.GuiPlayerTabOverlay field_175255_h # footer
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/font/ascii.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/font/ascii.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/grayBox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/grayBox.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/gui/button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/gui/button.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/gui/default_button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/gui/default_button.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/gui/discord.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/gui/discord.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/gui/gear.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/gui/gear.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/gui/github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/gui/github.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/gui/largeOutline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/gui/largeOutline.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/gui/largeOutlineFurf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/gui/largeOutlineFurf.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/gui/outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/gui/outline.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/gui/outlineFurf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/gui/outlineFurf.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/gui/reset.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/gui/reset.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/gui/reset.png.license:
--------------------------------------------------------------------------------
1 | LGPL-3.0 + notenoughupdates
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/gui/vignette.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/gui/vignette.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/logo.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/map/CrystalHollowsMap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/map/CrystalHollowsMap.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/map/DungeonMap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/map/DungeonMap.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/map/crimson.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/map/crimson.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/map/dwarven.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/map/dwarven.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/map/locations/bal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/map/locations/bal.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/map/locations/city.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/map/locations/city.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/map/locations/corleone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/map/locations/corleone.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/map/locations/divan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/map/locations/divan.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/map/locations/king.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/map/locations/king.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/map/locations/queen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/map/locations/queen.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/map/locations/temple.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/map/locations/temple.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/map/mapIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/map/mapIcon.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/map/mapIcon2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/map/mapIcon2.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/monki.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/monki.png
--------------------------------------------------------------------------------
/src/main/resources/assets/skyblockfeatures/path_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/assets/skyblockfeatures/path_arrow.png
--------------------------------------------------------------------------------
/src/main/resources/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrFast-js/SkyblockFeatures/47a269af83e82112fecc866706ee95abe1dfc195/src/main/resources/logo.png
--------------------------------------------------------------------------------
/src/main/resources/mcmod.info:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "modid": "skyblockfeatures",
4 | "name": "Skyblock Features",
5 | "description": "A Hypixel Skyblock mod that adds unique features that other mods dont have. '/sf' for help",
6 | "version": "${version}",
7 | "mcversion": "${mcversion}",
8 | "url": "https://github.com/MrFast-js/SkyblockFeatures",
9 | "updateUrl": "https://github.com/MrFast-js/SkyblockFeatures/releases/latest",
10 | "authorList": ["MrFast"],
11 | "credits": "",
12 | "logoFile": "logo.png",
13 | "screenshots": [],
14 | "dependencies": []
15 | }
16 | ]
17 |
--------------------------------------------------------------------------------
/src/main/resources/mixins.skyblockfeatures.json:
--------------------------------------------------------------------------------
1 | {
2 | "compatibilityLevel": "JAVA_8",
3 | "package": "mrfast.sbf.mixins.transformers",
4 | "refmap": "mixins.skyblockfeatures.refmap.json",
5 | "plugin": "mrfast.sbf.mixins.init.MixinPlugin",
6 | "verbose": true,
7 | "injectors": {
8 | "maxShiftBy": 2
9 | }
10 | }
--------------------------------------------------------------------------------