Closed Maxlego08 closed 1 year ago
This was already reported: https://github.com/PluginBugs/Issues-ItemsAdder/issues/2454#issuecomment-1496391406 And this is the answer of your team member:
Okay my bad seems that i did something wrong, so I did reinstall the plugins and refreshing once again the pack its fixed for hud display
Please test if this plugin works: https://www.spigotmc.org/resources/plugin-servermonitor-for-itemsadder.78112/
It loads just fine for me.
I just tried again using your example code, something really simple. Still with the same HUD file configuration, you have an example video and the code used. However, with the command /iaplayerstats
everything works perfectly. I don’t understand or maybe my mistake with the API.
Video: https://github.com/PluginBugs/Issues-ItemsAdder/assets/32517160/00c19672-fd22-4934-bce9-e337fa27ac37
Code:
package fr.wyntale.wynhub.hud
import dev.lone.itemsadder.api.FontImages.PlayerHudsHolderWrapper
import dev.lone.itemsadder.api.FontImages.PlayerQuantityHudWrapper
import fr.wyntale.core.command.CommandModule
import fr.wyntale.core.command.PlayerCommand
import fr.wyntale.core.listener.WynPlayerJoinEvent
import fr.wyntale.core.listener.WynPlayerQuitEvent
import fr.wyntale.core.module.ModuleManager
import fr.wyntale.core.player.WynPlayer
import org.bukkit.command.Command
import org.bukkit.entity.Player
import org.bukkit.event.EventHandler
import org.bukkit.event.EventPriority
import org.bukkit.event.Listener
import java.util.*
object HudManagerV2 : Listener {
private var lastId = 1.0f
private val users = mutableMapOf<UUID, PlayerDataHolder>()
init {
ModuleManager.getModule(CommandModule::class.java).registerCommand("testhud", CommandTestClass())
}
@EventHandler(priority = EventPriority.HIGHEST)
fun onJoin(event: WynPlayerJoinEvent) {
val player = event.wynPlayer.getBukkitPlayer()
users[player.uniqueId] = PlayerDataHolder(player)
}
class CommandTestClass : PlayerCommand() {
override suspend fun onPlayerCommand(
wynPlayer: WynPlayer,
command: Command,
label: String,
args: Array<out String>
) {
val holder = users[wynPlayer.getUniqueId()] ?: return
holder.teamHud.isVisible = true
println("Je vais mettre l'id: '$lastId'")
holder.teamHud.floatValue = lastId
lastId += 1f
}
override suspend fun onPlayerTabComplete(
wynPlayer: WynPlayer,
command: Command,
alias: String,
args: Array<out String>
): List<String> = emptyList()
}
class PlayerDataHolder(player: Player) {
val holder: PlayerHudsHolderWrapper
val teamHud: PlayerQuantityHudWrapper
init {
holder = PlayerHudsHolderWrapper(player)
teamHud = PlayerQuantityHudWrapper(holder, "w_icons:team_hud")
println("Start: $holder -> $teamHud")
}
}
}
Please first check if my plugin works on your server as I asked.
The plugin does not work at all.
did you actually read the installation guide?
How to install?
- extract the content of this .zip file inside
plugins/ItemsAdder
folder- use the command /iazip
You probably didn't download the assets.
News? Please check if my plugin works on your server as I asked.
Hey, yes your plugin works ok thé server
I went through a custom HUD and I will put the image directly. Everything works very well now. But there is clearly a problem with quantity HUDs.
Sorry I don't understand what you want me to do and what is the issue, nor how you fixed the problem.
Sorry I don't understand what you want me to do and what is the issue, nor how you fixed the problem.
I just passed the HUD in custom and not in quantity and I have no more problems, its good
Terms
Discord tag (optional)
maxlego08
What happened?
When using a quantity HUD with the API, nothing works - it's not displayed. However, using the API we can display a custom HUD (to display numbers). However, using the
/iaplayerstat write Maxlego08 team 11
the image will be displayed correctly.Desired result:
Obtained result:
Steps to reproduce the issue
We were in 1.18.2 and ItemAdder 3.4.1-R5 there was no problem, since we switched to 1.19.4 with ItemAdder 3.5.0c the API that will handle the quantity HUD type does not work. The code has not been changed, the custom huds work perfectly.
Server version
ItemsAdder Version
ProtocolLib Version
LoneLibs Version
FULL server log
latest.log
Error (optional)
No response
Problematic items yml configuration file (optional)
Other files, you can drag and drop them here to upload. (optional)
Example of using custom HUD with code present in the document:
Using the API with code based on HUD RPG sources:
Screenshots/Videos (you can drag and drop files or paste links)
No response