tanguygab / playerlist-placeholderapi-expansion Goto Github PK
View Code? Open in Web Editor NEWPlayerList expansion for PlaceholderAPI
License: GNU General Public License v3.0
PlayerList expansion for PlaceholderAPI
License: GNU General Public License v3.0
Sometimes, you'd like to list players who have certain permission, but aren't conneted at the moment.
That's what my suggestion is. World and Nearby is understandable for it to not work, but perm plugins save permissions of players in an accessible way that may allow to list offline players with certain permission.
Thank you in advance.
I want to list players that are in X server and also have X permission
Hello! I've been recently getting these errors:
[23:58:04 ERROR]: Could not pass event StandardPaperServerListPingEventImpl to AdvancedServerList v4.11.1
java.lang.NullPointerException: Cannot invoke "org.bukkit.OfflinePlayer.getPlayer()" because "viewer" is null
at io.github.tanguygab.playerlistexpansion.filters.CanSee.filter(CanSee.java:11) ~[?:?]
at io.github.tanguygab.playerlistexpansion.PlayerList.lambda$null$0(PlayerList.java:63) ~[?:?]
at java.util.ArrayList.removeIf(ArrayList.java:1755) ~[?:?]
at java.util.ArrayList.removeIf(ArrayList.java:1743) ~[?:?]
at io.github.tanguygab.playerlistexpansion.PlayerList.lambda$getList$1(PlayerList.java:63) ~[?:?]
at java.util.ArrayList.forEach(ArrayList.java:1596) ~[?:?]
at io.github.tanguygab.playerlistexpansion.PlayerList.getList(PlayerList.java:63) ~[?:?]
at io.github.tanguygab.playerlistexpansion.PlayerList.getText(PlayerList.java:30) ~[?:?]
at io.github.tanguygab.playerlistexpansion.PlayerListExpansion.onRequest(PlayerListExpansion.java:105) ~[?:?]
at me.clip.placeholderapi.replacer.CharsReplacer.apply(CharsReplacer.java:119) ~[PlaceholderAPI-2.11.6.jar:?]
at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:71) ~[PlaceholderAPI-2.11.6.jar:?]
at ch.andre601.advancedserverlist.paper.listeners.PaperEventWrapper.lambda$setPlayers$1(PaperEventWrapper.java:101) ~[AdvancedServerList-Paper-4.11.1.jar:?]
at ch.andre601.advancedserverlist.core.parsing.ComponentParser.modifyText(ComponentParser.java:60) ~[AdvancedServerList-Paper-4.11.1.jar:?]
at ch.andre601.advancedserverlist.paper.listeners.PaperEventWrapper.setPlayers(PaperEventWrapper.java:99) ~[AdvancedServerList-Paper-4.11.1.jar:?]
at ch.andre601.advancedserverlist.paper.listeners.PaperEventWrapper.setPlayers(PaperEventWrapper.java:52) ~[AdvancedServerList-Paper-4.11.1.jar:?]
at ch.andre601.advancedserverlist.core.events.PingEventHandler.handleEvent(PingEventHandler.java:145) ~[AdvancedServerList-Paper-4.11.1.jar:?]
at ch.andre601.advancedserverlist.paper.listeners.PingEvent.onPaperServerListPing(PingEvent.java:48) ~[AdvancedServerList-Paper-4.11.1.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor353.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[purpur-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[purpur-api-1.20.4-R0.1-SNAPSHOT.jar:git-Purpur-2176]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[purpur-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[purpur-1.20.4.jar:git-Purpur-2176]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[purpur-1.20.4.jar:git-Purpur-2176]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:617) ~[purpur-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at com.destroystokyo.paper.network.StandardPaperServerListPingEventImpl.processRequest(StandardPaperServerListPingEventImpl.java:79) ~[purpur-1.20.4.jar:?]
at net.minecraft.server.network.ServerStatusPacketListenerImpl.handleStatusRequest(ServerStatusPacketListenerImpl.java:157) ~[?:?]
at net.minecraft.network.protocol.status.ServerboundStatusRequestPacket.handle(ServerboundStatusRequestPacket.java:19) ~[?:?]
at net.minecraft.network.protocol.status.ServerboundStatusRequestPacket.handle(ServerboundStatusRequestPacket.java:8) ~[?:?]
at net.minecraft.network.Connection.genericsFtw(Connection.java:313) ~[?:?]
at net.minecraft.network.Connection.channelRead0(Connection.java:294) ~[?:?]
at net.minecraft.network.Connection.channelRead0(Connection.java:61) ~[?:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.handler.flow.FlowControlHandler.dequeue(FlowControlHandler.java:202) ~[netty-handler-4.1.97.Final.jar:4.1.97.Final]
at io.netty.handler.flow.FlowControlHandler.channelRead(FlowControlHandler.java:164) ~[netty-handler-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at com.comphenix.protocol.injector.netty.channel.InboundPacketInterceptor.channelRead(InboundPacketInterceptor.java:28) ~[ProtocolLib.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at com.moulberry.axiom.packet.AxiomBigPayloadHandler.decode(AxiomBigPayloadHandler.java:47) ~[AxiomPaper-1.5.11.jar:?]
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:529) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:468) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at net.minecraft.server.network.LegacyQueryHandler.channelRead(LegacyQueryHandler.java:114) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) ~[netty-handler-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.handler.flush.FlushConsolidationHandler.channelRead(FlushConsolidationHandler.java:152) ~[netty-handler-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800) ~[netty-transport-classes-epoll-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:509) ~[netty-transport-classes-epoll-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:407) ~[netty-transport-classes-epoll-4.1.97.Final.jar:4.1.97.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
at java.lang.Thread.run(Thread.java:1583) ~[?:?]
I am using AdvancedServerList to display placeholders in the online players hover list. Here is the relevant config section:
playerCount:
hover:
- "<gold>✦</gold> <bold><gray>Cobbleton</gray> <gold>Forever</gold></bold> <gold>✦</gold>"
- ""
- "● cobbleton.com"
- "● map.cobbleton.com"
- "● wiki.cobbleton.com"
- "● discord.cobbleton.com"
- ""
- "<gold><underlined>Online Staff</underlined><gold>"
- "%playerlist_staff_list%"
- ""
- "<aqua><underlined>Online Players</underlined></aqua>"
- "%conditionaltext_online-players_0%"
- "%conditionaltext_online-players_1%"
- "%conditionaltext_online-players_2%"
- "%conditionaltext_online-players_3%"
- "%conditionaltext_online-players_4%"
- "%conditionaltext_online-players_5%"
- "%conditionaltext_online-players_6%"
- "%conditionaltext_online-players_7%"
- "%conditionaltext_online-players_8%"
- "%conditionaltext_online-players_9%"
- "%conditionaltext_online-players_10%"
- "<dark_gray>... and </dark_gray><gray>%math_0_MAX({playerlist_online_amount}-10, 0)%</gray><dark_gray> more ...</dark_gray>"
- ""
- "<dark_gray>Guests Online: %playerlist_guest_amount%"
Here is my PlayerList settings config:
playerlist:
offline-text: Offline
argument-separator: ','
lists:
staff:
type: ONLINE
included: true
filters:
- PERMISSION:tab.staff
- CANSEE
online:
type: ONLINE
included: true
filters:
- "!PERMISSION:tab.staff"
- "!PLACEHOLDER:%luckperms_primary_group_name%=Guest"
guest:
type: ONLINE
included: true
filters:
- PLACEHOLDER:%luckperms_primary_group_name%=Guest
and here is my ConditionalText config:
online-players:
placeholder: "%playerlist_online_$0%"
rules:
- "=Offline;<dark_gray><italic>-</italic></dark_gray>"
- "%playerlist_online_$0%"
I am running Purpur v1.20.4-2176
, AdvancedServerList v4.11.1
, ConditionalTextPlaceholders v1.5.0
.
Any ideas on how to fix this?
Hello. I've been trying to figure out what I'm writing wrong for quite some time now. I tried writing the placeholder in {}, and in %%, and even in [], but nothing works. Also, I tried to mix them, but it still doesn't help. What am I doing wrong?
as I expect "CANSEE" gonna to exclude player who vanish from game for example:
playerlist:
offline-text: Offline
argument-separator: '||'
lists:
all:
type: ONLINE
included: true
filters:
- CANSEE
I use offline and authorized, but can not display offline, only online, such as%playerlist_offline,perm,yes,list,jc% he does not display offline players with jc permissions, directly returns an empty string, but I have the jc permission for offline players, and I give it when the player is online
you can use vault to get permissions from an offline player
Hook into Vault API and use the .playerHas(String world, OfflinePlayer player, String perm) method.
[22:13:49 WARN]: Exception in thread "DiscordSRV - Presence Updater" java.lang.NullPointerException: Cannot invoke "org.bukkit.OfflinePlayer.getName()" because "player" is null
[22:13:49 WARN]: at io.github.tanguygab.playerlistexpansion.subtype.Permission.getText(Permission.java:21)
[22:13:49 WARN]: at io.github.tanguygab.playerlistexpansion.playerlist.OnlinePlayerList.getText(OnlinePlayerList.java:21)
[22:13:49 WARN]: at io.github.tanguygab.playerlistexpansion.PlayerListExpansion.onRequest(PlayerListExpansion.java:52)
[22:13:49 WARN]: at PlaceholderAPI-2.11.3-DEV-160.jar//me.clip.placeholderapi.replacer.CharsReplacer.apply(CharsReplacer.java:119)
[22:13:49 WARN]: at PlaceholderAPI-2.11.3-DEV-160.jar//me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:71)
[22:13:49 WARN]: at DiscordSRV-Build-1.26.0-SNAPSHOT-525b004.jar//github.scarsz.discordsrv.util.PlaceholderUtil.replacePlaceholders(PlaceholderUtil.java:48)
[22:13:49 WARN]: at DiscordSRV-Build-1.26.0-SNAPSHOT-525b004.jar//github.scarsz.discordsrv.util.PlaceholderUtil.replacePlaceholders(PlaceholderUtil.java:41)
[22:13:49 WARN]: at DiscordSRV-Build-1.26.0-SNAPSHOT-525b004.jar//github.scarsz.discordsrv.objects.threads.PresenceUpdater.run(PresenceUpdater.java:80)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.