Skip to content

Commit

Permalink
Moved io.github.skyblockcore.dungeons.DungeonUtils to io.github.skybl…
Browse files Browse the repository at this point in the history
…ockcore.Dungeons, as per Unex's suggestion.
  • Loading branch information
BuildTools committed Oct 5, 2023
1 parent e729f0b commit 13787e4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package io.github.skyblockcore.dungeons;
package io.github.skyblockcore;

import java.util.HashMap;
import java.util.Map;

public class DungeonUtils {
public class Dungeons {
public enum DUNGEON_FLOORS { UNDEFINED("UNDEFINED"), E("E"), F1("F1"), F2("F2"), F3("F3"), F4("F4"), F5("F5"), F6("F6"), F7("F7"), M1("M1"), M2("M2"), M3("M3"), M4("M4"), M5("M5"), M6("M6"), M7("M7");
private static final Map<String, DUNGEON_FLOORS> map = new HashMap<>();
private final String text;
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/io/github/skyblockcore/SkyBlockCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import com.mojang.brigadier.CommandDispatcher;
import io.github.skyblockcore.command.SkyBlockCoreCommand;
import io.github.skyblockcore.dungeons.DungeonUtils;
import io.github.skyblockcore.event.*;
import io.github.skyblockcore.event.dungeons.*;
import net.fabricmc.api.ClientModInitializer;
Expand Down Expand Up @@ -52,7 +51,7 @@ public static String getLocation() {
private static boolean IN_DUNGEON = false;
private static boolean DUNGEON_ACTIVE = false;
public static boolean ENTERED_BOSSFIGHT = false;
public static DungeonUtils.DUNGEON_CLASSES DUNGEON_CLASS = DungeonUtils.DUNGEON_CLASSES.HEALER;
public static Dungeons.DUNGEON_CLASSES DUNGEON_CLASS = Dungeons.DUNGEON_CLASSES.HEALER;

public static boolean isOnSkyblock() {
return ON_SKYBLOCK;
Expand Down Expand Up @@ -137,7 +136,7 @@ public void onInitializeClient() {
IN_DUNGEON = false;
DUNGEON_ACTIVE = false;
ENTERED_BOSSFIGHT = false;
DungeonUtils.setDungeonBoss(null);
Dungeons.setDungeonBoss(null);
return ActionResult.PASS;
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.skyblockcore.event.dungeons;

import io.github.skyblockcore.dungeons.DungeonUtils;
import io.github.skyblockcore.Dungeons;
import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;
import net.minecraft.util.ActionResult;
Expand All @@ -16,5 +16,5 @@ public interface DungeonStartedCallback {
return ActionResult.PASS;
});

ActionResult interact(DungeonUtils.DUNGEON_CLASSES dungeonClass);
ActionResult interact(Dungeons.DUNGEON_CLASSES dungeonClass);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.skyblockcore.event.dungeons;

import io.github.skyblockcore.dungeons.DungeonUtils;
import io.github.skyblockcore.Dungeons;
import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;
import net.minecraft.util.ActionResult;
Expand All @@ -16,5 +16,5 @@ public interface EnteredBossfightCallback {
return ActionResult.PASS;
});

ActionResult interact(DungeonUtils.DUNGEON_BOSSES boss);
ActionResult interact(Dungeons.DUNGEON_BOSSES boss);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.skyblockcore.mixin;

import io.github.skyblockcore.dungeons.DungeonUtils;
import io.github.skyblockcore.Dungeons;
import io.github.skyblockcore.event.dungeons.*;
import io.github.skyblockcore.util.TextUtils;
import net.minecraft.client.network.message.MessageHandler;
Expand All @@ -24,23 +24,23 @@ void onGameMessage(Text messageText, boolean overlay, CallbackInfo ci) {
// Dungeons
if(isInDungeon()) {
if(message.contains("[Healer] Ghost Healing Aura Healing")) {
DUNGEON_CLASS = DungeonUtils.DUNGEON_CLASSES.HEALER;
DUNGEON_CLASS = Dungeons.DUNGEON_CLASSES.HEALER;
LOGGER.info(TITLE + " Dungeon Started! Class: " + DUNGEON_CLASS);
DungeonStartedCallback.EVENT.invoker().interact(DUNGEON_CLASS);
} else if(message.contains("[Mage] Intelligence")) {
DUNGEON_CLASS = DungeonUtils.DUNGEON_CLASSES.MAGE;
DUNGEON_CLASS = Dungeons.DUNGEON_CLASSES.MAGE;
LOGGER.info(TITLE + " Dungeon Started! Class: " + DUNGEON_CLASS);
DungeonStartedCallback.EVENT.invoker().interact(DUNGEON_CLASS);
} else if(message.contains("[Berserk] Lust For Blood Damage Increase Per Hit")) {
DUNGEON_CLASS = DungeonUtils.DUNGEON_CLASSES.BERSERK;
DUNGEON_CLASS = Dungeons.DUNGEON_CLASSES.BERSERK;
LOGGER.info(TITLE + " Dungeon Started! Class: " + DUNGEON_CLASS);
DungeonStartedCallback.EVENT.invoker().interact(DUNGEON_CLASS);
} else if(message.contains("[Archer] Extra Arrow Chance")) {
DUNGEON_CLASS = DungeonUtils.DUNGEON_CLASSES.ARCHER;
DUNGEON_CLASS = Dungeons.DUNGEON_CLASSES.ARCHER;
LOGGER.info(TITLE + " Dungeon Started! Class: " + DUNGEON_CLASS);
DungeonStartedCallback.EVENT.invoker().interact(DUNGEON_CLASS);
} else if(message.contains("[Tank] Absorption Shield Health Required")) {
DUNGEON_CLASS = DungeonUtils.DUNGEON_CLASSES.TANK;
DUNGEON_CLASS = Dungeons.DUNGEON_CLASSES.TANK;
LOGGER.info(TITLE + " Dungeon Started! Class: " + DUNGEON_CLASS);
DungeonStartedCallback.EVENT.invoker().interact(DUNGEON_CLASS);
}
Expand Down Expand Up @@ -97,7 +97,7 @@ void onGameMessage(Text messageText, boolean overlay, CallbackInfo ci) {
}

if (message.contains("[BOSS] ") && !message.contains("[BOSS] The Watcher:")) {
DungeonUtils.DUNGEON_BOSSES boss = DungeonUtils.getDungeonFloor().getBoss();
Dungeons.DUNGEON_BOSSES boss = Dungeons.getDungeonFloor().getBoss();
if(!ENTERED_BOSSFIGHT) {
EnteredBossfightCallback.EVENT.invoker().interact(boss);
LOGGER.info(TITLE + " Entered Boss Fight! Boss: " + boss);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import io.github.skyblockcore.event.LeaveSkyblockCallback;
import io.github.skyblockcore.event.LocationChangedCallback;
import io.github.skyblockcore.event.dungeons.*;
import io.github.skyblockcore.dungeons.DungeonUtils;
import io.github.skyblockcore.Dungeons;
import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.network.packet.s2c.play.ScoreboardDisplayS2CPacket;
import net.minecraft.network.packet.s2c.play.TeamS2CPacket;
Expand Down Expand Up @@ -57,7 +57,7 @@ void onTeam(TeamS2CPacket packet, CallbackInfo ci) {
if(matcher.find()) {
floor = matcher.group(1);
}
DungeonUtils.setDungeonFloor(DungeonUtils.DUNGEON_FLOORS.fromString(floor));
Dungeons.setDungeonFloor(Dungeons.DUNGEON_FLOORS.fromString(floor));
EnterDungeonCallback.EVENT.invoker().interact();
LOGGER.info(TITLE + " Joined Dungeon (" + floor + ")");
}
Expand Down

0 comments on commit 13787e4

Please sign in to comment.