Skip to content

Commit

Permalink
Hide Players in Hub Spawn
Browse files Browse the repository at this point in the history
See #350

Original feature credit:

Co-authored-by: RobotHanzo <nathanlee302@outlook.com>
  • Loading branch information
My-Name-Is-Jeff and RobotHanzo committed Mar 21, 2023
1 parent b68acb0 commit 854bd0c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/kotlin/gg/skytils/skytilsmod/core/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1893,6 +1893,13 @@ object Config : Vigilant(
)
var hidePetHealth = false

@Property(
type = PropertyType.SWITCH, name = "Hide Players in Spawn",
description = "Hides players in the spawn area at the Hub.",
category = "Miscellaneous", subcategory = "Quality of Life"
)
var hidePlayersInSpawn = false

@Property(
type = PropertyType.SWITCH, name = "Hide Potion Effects in Inventory",
description = "Prevents the game from rendering the potion effects in inventories while in Skyblock.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ object MiscFeatures {
"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTM4MDcxNzIxY2M1YjRjZDQwNmNlNDMxYTEzZjg2MDgzYTg5NzNlMTA2NGQyZjg4OTc4Njk5MzBlZTZlNTIzNyJ9fX0=",
"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZGZhMDg3ZWI3NmU3Njg3YTgxZTRlZjgxYTdlNjc3MjY0OTk5MGY2MTY3Y2ViMGY3NTBhNGM1ZGViNmM0ZmJhZCJ9fX0="
)
private val hubSpawnPoint = BlockPos(-2, 70, -69)

init {
GolemSpawnTimerElement()
Expand Down Expand Up @@ -246,6 +247,10 @@ object MiscFeatures {
if (Skytils.config.hideLightning) {
event.isCanceled = true
}
} else if (event.entity is EntityOtherPlayerMP) {
if (Skytils.config.hidePlayersInSpawn && event.entity.position == hubSpawnPoint && SBInfo.mode == SkyblockIsland.Hub.mode) {
event.isCanceled = true
}
} else if (Skytils.deobfEnvironment && DevTools.getToggle("invis")) {
event.entity.isInvisible = false
}
Expand Down

0 comments on commit 854bd0c

Please sign in to comment.