diff options
author | Empa <42304516+ItsEmpa@users.noreply.github.com> | 2024-06-01 11:23:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-01 11:23:19 +0200 |
commit | 7174c5eadbad4881c19f1ed5610285dc934741a1 (patch) | |
tree | d65dd6c75eca5ef75472c5ff5d4d4ab1345bcc51 /src | |
parent | 6e75bd6dc33b23507e952267015628ba542715b9 (diff) | |
download | skyhanni-7174c5eadbad4881c19f1ed5610285dc934741a1.tar.gz skyhanni-7174c5eadbad4881c19f1ed5610285dc934741a1.tar.bz2 skyhanni-7174c5eadbad4881c19f1ed5610285dc934741a1.zip |
Feature: Hide Useless Armorstands (#1962)
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java | 6 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/FixGhostEntities.kt | 12 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java index 1921d64b3..c390e7feb 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java @@ -119,6 +119,12 @@ public class MiscConfig { public boolean hideExpBottles = false; @Expose + @ConfigOption(name = "Armorstands", desc = "Hides Armorstands that are sometimes visible for a fraction of a second.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideTemporaryArmorstands = true; + + @Expose public Position collectionCounterPos = new Position(10, 10, false, true); @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/FixGhostEntities.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/FixGhostEntities.kt index 06720e8ea..d5246fc12 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/FixGhostEntities.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/FixGhostEntities.kt @@ -1,9 +1,12 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.CheckRenderEntityEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.events.PacketEvent import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.MobUtils.isDefaultValue +import net.minecraft.entity.item.EntityArmorStand import net.minecraft.network.play.server.S0CPacketSpawnPlayer import net.minecraft.network.play.server.S0FPacketSpawnMob import net.minecraft.network.play.server.S13PacketDestroyEntities @@ -55,5 +58,14 @@ object FixGhostEntities { } } + @SubscribeEvent + fun onCheckRender(event: CheckRenderEntityEvent<*>) { + if (!LorenzUtils.inSkyBlock || !config.hideTemporaryArmorstands) return + if (event.entity !is EntityArmorStand) return + with(event.entity) { + if (ticksExisted < 10 && isDefaultValue() && inventory.all { it == null }) event.cancel() + } + } + fun isEnabled() = LorenzUtils.inSkyBlock && config.fixGhostEntities } |