diff options
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 } |