aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-26 23:59:20 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-26 23:59:20 +0200
commit370cf58f29a5d32040f83ca17465fd493cc88f61 (patch)
tree6594beafb7a903785bbcbcd1fd2c12897c5979ef /src/main/java
parenteef49c780202dc5c64c943269f00973e70010dec (diff)
downloadskyhanni-370cf58f29a5d32040f83ca17465fd493cc88f61.tar.gz
skyhanni-370cf58f29a5d32040f83ca17465fd493cc88f61.tar.bz2
skyhanni-370cf58f29a5d32040f83ca17465fd493cc88f61.zip
Added Horsezooka Hider
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java15
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt19
-rw-r--r--src/main/java/at/hannibal2/skyhanni/events/ItemInHandChangeEvent.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/ExpOrbsOnGroundHider.kt (renamed from src/main/java/at/hannibal2/skyhanni/features/misc/ExpBottleOnGroundHider.kt)2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftHorsezookaHider.kt22
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt3
7 files changed, 62 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
index 3be3c73db..9519e0146 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
@@ -182,7 +182,7 @@ class SkyHanniMod {
loadModule(HideNotClickableItems())
loadModule(ItemDisplayOverlayFeatures())
loadModule(CurrentPetDisplay())
- loadModule(ExpBottleOnGroundHider())
+ loadModule(ExpOrbsOnGroundHider())
loadModule(DamageIndicatorManager())
loadModule(ItemAbilityCooldown())
loadModule(DungeonHighlightClickedBlocks())
@@ -359,6 +359,7 @@ class SkyHanniMod {
loadModule(SlayerBossSpawnSoon())
loadModule(RiftBloodEffigies())
loadModule(RiftWiltedBerberisHelper())
+ loadModule(RiftHorsezookaHider())
//
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java
index 0a7caf5ce..f2b4434ce 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java
@@ -601,11 +601,6 @@ public class RiftConfig {
}
@Expose
- @ConfigOption(name = "Highlight Guide", desc = "Highlight things to do in the Rift Guide.")
- @ConfigEditorBoolean
- public boolean highlightGuide = true;
-
- @Expose
@ConfigOption(name = "Motes Sell Price", desc = "")
@Accordion
public Motes motes = new Motes();
@@ -662,4 +657,14 @@ public class RiftConfig {
public boolean hideParticles = false;
}
+
+ @Expose
+ @ConfigOption(name = "Highlight Guide", desc = "Highlight things to do in the Rift Guide.")
+ @ConfigEditorBoolean
+ public boolean highlightGuide = true;
+
+ @Expose
+ @ConfigOption(name = "Horsezooka Hider", desc = "Hide horses while holding the Horsezooka in the hand.")
+ @ConfigEditorBoolean
+ public boolean horsezookaHider = false;
}
diff --git a/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt b/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt
index c28db9a9d..b9e2b45dc 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt
@@ -1,6 +1,8 @@
package at.hannibal2.skyhanni.data
import at.hannibal2.skyhanni.events.*
+import at.hannibal2.skyhanni.utils.InventoryUtils
+import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzVec
import net.minecraft.client.Minecraft
@@ -64,4 +66,21 @@ class MinecraftData {
tick++
LorenzTickEvent(tick).postAndCatch()
}
+
+ @SubscribeEvent
+ fun onTick(event: LorenzTickEvent) {
+ if (!LorenzUtils.inSkyBlock) return
+ val hand = InventoryUtils.getItemInHand()
+ val newItem = hand?.getInternalName() ?: ""
+ if (newItem != InventoryUtils.itemInHandId) {
+ ItemInHandChangeEvent(newItem, hand).postAndCatch()
+ InventoryUtils.itemInHandId = newItem
+ InventoryUtils.latestItemInHand = hand
+ }
+ }
+
+ @SubscribeEvent
+ fun onWorldChange(event: LorenzWorldChangeEvent) {
+ InventoryUtils.itemInHandId = ""
+ }
} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/events/ItemInHandChangeEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/ItemInHandChangeEvent.kt
new file mode 100644
index 000000000..121e7d9cd
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/events/ItemInHandChangeEvent.kt
@@ -0,0 +1,5 @@
+package at.hannibal2.skyhanni.events
+
+import net.minecraft.item.ItemStack
+
+class ItemInHandChangeEvent(val internalName: String, val stack: ItemStack?) : LorenzEvent() \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ExpBottleOnGroundHider.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ExpOrbsOnGroundHider.kt
index b1f47f015..5d1b34564 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/ExpBottleOnGroundHider.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ExpOrbsOnGroundHider.kt
@@ -6,7 +6,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils
import net.minecraft.entity.item.EntityXPOrb
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
-class ExpBottleOnGroundHider {
+class ExpOrbsOnGroundHider {
@SubscribeEvent
fun onCheckRender(event: CheckRenderEntityEvent<*>) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftHorsezookaHider.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftHorsezookaHider.kt
new file mode 100644
index 000000000..cab024462
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftHorsezookaHider.kt
@@ -0,0 +1,22 @@
+package at.hannibal2.skyhanni.features.rift.everywhere
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.events.CheckRenderEntityEvent
+import at.hannibal2.skyhanni.utils.InventoryUtils
+import net.minecraft.entity.passive.EntityHorse
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+
+class RiftHorsezookaHider {
+
+ @SubscribeEvent
+ fun onCheckRender(event: CheckRenderEntityEvent<*>) {
+ if (!RiftAPI.inRift()) return
+ if (!SkyHanniMod.feature.rift.horsezookaHider) return
+
+ if (event.entity is EntityHorse) {
+ if (InventoryUtils.itemInHandId == "HORSEZOOKA") {
+ event.isCanceled = true
+ }
+ }
+ }
+}
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt
index 9e1ade646..54ea399bb 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt
@@ -7,6 +7,9 @@ import net.minecraft.item.ItemStack
object InventoryUtils {
+ var itemInHandId = ""
+ var latestItemInHand: ItemStack? = null
+
fun getItemsInOpenChest() = buildList {
val guiChest = Minecraft.getMinecraft().currentScreen as GuiChest
val inventorySlots = guiChest.inventorySlots.inventorySlots