aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-02-13 20:43:38 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-02-13 20:43:38 +0100
commit848e9e6ca15b5e70dc0a282d7adb8c2f299be2c4 (patch)
treef9f1b78ebfc1e6f0cb897e65ac8e832d819732b1 /src/main/java/at/hannibal2
parenta35b093c39c9dce7697d1daacecab199a44c9f40 (diff)
downloadskyhanni-848e9e6ca15b5e70dc0a282d7adb8c2f299be2c4.tar.gz
skyhanni-848e9e6ca15b5e70dc0a282d7adb8c2f299be2c4.tar.bz2
skyhanni-848e9e6ca15b5e70dc0a282d7adb8c2f299be2c4.zip
Added enderman teleportation, explosion and fire overlay hider.
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Misc.java10
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Mobs.java5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt47
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt20
5 files changed, 63 insertions, 20 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
index 73b54a661..5395f1bea 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
@@ -192,6 +192,7 @@ public class SkyHanniMod {
loadModule(new HideDeadEntities());
loadModule(new TpsCounter());
loadModule(new ParticleHider());
+ loadModule(new MiscFeatures());
Commands.INSTANCE.init();
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java
index 994b5c9ac..c84460492 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java
@@ -228,6 +228,16 @@ public class Misc {
public boolean hideScoreboardNumbers = false;
@Expose
+ @ConfigOption(name = "Explosions Hider", desc = "Hide explosions.")
+ @ConfigEditorBoolean
+ public boolean hideExplosions = false;
+
+ @Expose
+ @ConfigOption(name = "Fire Overlay Hider", desc = "Hide the fire overlay (Like in Skytils)")
+ @ConfigEditorBoolean
+ public boolean hideFireOverlay = false;
+
+ @Expose
@ConfigOption(name = "Config Button", desc = "Add a button to the pause menu to configure SkyHanni.")
@ConfigEditorBoolean
public boolean configButtonOnPause = true;
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Mobs.java b/src/main/java/at/hannibal2/skyhanni/config/features/Mobs.java
index d135427e0..97d69532d 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/Mobs.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/Mobs.java
@@ -66,4 +66,9 @@ public class Mobs {
@ConfigEditorBoolean
@ConfigAccordionId(id = 1)
public boolean areaBossRespawnTimer = false;
+
+ @Expose
+ @ConfigOption(name = "Enderman Teleportation Hider", desc = "Stops the Enderman Teleportation animation (Like in SBA)")
+ @ConfigEditorBoolean
+ public boolean endermanTeleportationHider = false;
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt
new file mode 100644
index 000000000..ab4d22df1
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt
@@ -0,0 +1,47 @@
+package at.hannibal2.skyhanni.features.misc
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.events.ReceiveParticleEvent
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import net.minecraft.util.EnumParticleTypes
+import net.minecraftforge.client.event.RenderBlockOverlayEvent
+import net.minecraftforge.event.entity.living.EnderTeleportEvent
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+
+/**
+ * I need these features in my dev env
+ */
+class MiscFeatures {
+
+ @SubscribeEvent
+ fun onEnderTeleport(event: EnderTeleportEvent) {
+ if (!LorenzUtils.inSkyBlock) return
+ if (!SkyHanniMod.feature.mobs.endermanTeleportationHider) return
+
+ event.isCanceled = true
+ }
+
+ @SubscribeEvent
+ fun onHypExplosions(event: ReceiveParticleEvent) {
+ if (!LorenzUtils.inSkyBlock) return
+ if (!SkyHanniMod.feature.misc.hideExplosions) return
+
+ when (event.type) {
+ EnumParticleTypes.EXPLOSION_LARGE,
+ EnumParticleTypes.EXPLOSION_HUGE,
+ EnumParticleTypes.EXPLOSION_NORMAL,
+ -> event.isCanceled = true
+ else -> {}
+ }
+ }
+
+ @SubscribeEvent
+ fun onRenderBlockOverlay(event: RenderBlockOverlayEvent) {
+ if (!LorenzUtils.inSkyBlock) return
+ if (!SkyHanniMod.feature.misc.hideFireOverlay) return
+
+ if (event.overlayType == RenderBlockOverlayEvent.OverlayType.FIRE) {
+ event.isCanceled = true
+ }
+ }
+} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt
index 0002e0db8..49c1b899b 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt
@@ -9,10 +9,8 @@ import at.hannibal2.skyhanni.utils.*
import at.hannibal2.skyhanni.utils.LorenzUtils.round
import at.hannibal2.skyhanni.utils.RenderUtils.renderString
import net.minecraft.nbt.NBTTagCompound
-import net.minecraft.util.EnumParticleTypes
import net.minecraftforge.client.event.RenderGameOverlayEvent
import net.minecraftforge.common.MinecraftForge
-import net.minecraftforge.event.entity.living.EnderTeleportEvent
import net.minecraftforge.event.entity.player.ItemTooltipEvent
import net.minecraftforge.fml.common.eventhandler.EventPriority
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -147,24 +145,6 @@ class LorenzTest {
}
@SubscribeEvent
- fun onHypExplosions(event: ReceiveParticleEvent) {
- if (!LorenzUtils.inSkyBlock) return
- when (event.type) {
- EnumParticleTypes.EXPLOSION_LARGE,
- EnumParticleTypes.EXPLOSION_HUGE,
- EnumParticleTypes.EXPLOSION_NORMAL,
- -> event.isCanceled = true
- else -> {}
- }
- }
-
- @SubscribeEvent
- fun onEnderTeleport(event: EnderTeleportEvent) {
- if (!LorenzUtils.inSkyBlock) return
- event.isCanceled = true
- }
-
- @SubscribeEvent
fun onSendPacket(event: PacketEvent.SendEvent) {
if (!shouldLogPackets) return