This repository has been archived by the owner on May 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
549 additions
and
530 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
group=com.mineinabyss | ||
version=0.24 | ||
idofrontVersion=0.21.12 | ||
idofrontVersion=0.22.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[versions] | ||
gearyPaper = "0.29-SNAPSHOT" | ||
gearyPaper = "0.29.12-dev.1" | ||
|
||
[libraries] | ||
geary-papermc = { module = "com.mineinabyss:geary-papermc", version.ref = "gearyPaper" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 14 additions & 13 deletions
27
...features/src/main/kotlin/com/mineinabyss/mobzy/features/initializers/SetAlwaysShowName.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
package com.mineinabyss.mobzy.features.initializers | ||
|
||
import com.mineinabyss.geary.autoscan.AutoScan | ||
import com.mineinabyss.geary.systems.GearyListener | ||
import com.mineinabyss.geary.systems.accessors.Pointers | ||
import com.mineinabyss.geary.datatypes.ComponentDefinition | ||
import com.mineinabyss.geary.modules.GearyModule | ||
import com.mineinabyss.geary.papermc.bridge.events.EventHelpers | ||
import com.mineinabyss.geary.papermc.bridge.events.entities.OnSpawn | ||
import com.mineinabyss.geary.systems.builders.listener | ||
import com.mineinabyss.geary.systems.query.ListenerQuery | ||
import com.mineinabyss.idofront.typealiases.BukkitEntity | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
import org.bukkit.entity.AbstractSkeleton | ||
import org.bukkit.entity.Phantom | ||
import org.bukkit.entity.Zombie | ||
|
||
@JvmInline | ||
@Serializable | ||
@SerialName("mobzy:set.always_show_name") | ||
value class SetAlwaysShowName(val value: Boolean = true) | ||
value class SetAlwaysShowName(val value: Boolean = true) { | ||
companion object : ComponentDefinition by EventHelpers.defaultTo<OnSpawn>() | ||
} | ||
|
||
@AutoScan | ||
class SetAlwaysShowNameSystem : GearyListener() { | ||
private val Pointers.visibility by get<SetAlwaysShowName>().whenSetOnTarget() | ||
private val Pointers.bukkit by get<BukkitEntity>().whenSetOnTarget() | ||
|
||
override fun Pointers.handle() { | ||
bukkit.isCustomNameVisible = visibility.value | ||
} | ||
fun GearyModule.customNameVisibleSetter() = listener(object : ListenerQuery() { | ||
val bukkit by get<BukkitEntity>() | ||
val visibility by source.get<SetAlwaysShowName>() | ||
}).exec { | ||
bukkit.isCustomNameVisible = visibility.value | ||
} |
Oops, something went wrong.