SkriptLang / Skript

Skript is a Spigot plugin which allows server admins to customize their server easily, but without the hassle of programming a plugin or asking/paying someone to program a plugin for them.
https://docs.skriptlang.org
GNU General Public License v3.0
1.07k stars 369 forks source link

GUI button not working #7090

Closed hiimnobody496 closed 1 month ago

hiimnobody496 commented 1 month ago

Skript/Server Version

Server version: 1.21-130-b1b5d4c
Skript version 2.9.2 (skriptlang-github)
installed skript addons: none
installed depencencies: none

Bug Description

So basicly i'm making the tardis in minecraft with skript, going great, everything working, i added a whitelist system, no problems, and now suddenly the whitelist button in my control gui of the tardis does nothing expect producing the error (In errors or screenshots)

Expected Behavior

image When i click the paper, a new gui should open up showing all players in {Whitelisted::*}

Steps to Reproduce

Well this is quite complex to explain, i just right click the control panel wich opens the control gui, then click the paper in the gui ( image ) and then it just doesn't do anything and the error in errors or screenshots in console only

Errors or Screenshots

15:05:59 ERROR: #!#! [Skript] Severe Error:

15:05:59 ERROR: #!#! Something went horribly wrong with Skript. 15:05:59 ERROR: #!#! This issue is NOT your fault! You probably can't fix it yourself, either. 15:05:59 ERROR: #!#! You should report it at https://github.com/SkriptLang/Skript/issues. Please copy paste this report there (or use paste service). 15:05:59 ERROR: #!#! This ensures that your issue is noticed and will be fixed as soon as possible.

15:05:59 ERROR: #!#! Stack trace: 15:05:59 ERROR: #!#! java.lang.NullPointerException: Profile name must not be null 15:05:59 ERROR: #!#! at java.base/java.util.Objects.requireNonNull(Objects.java:259) 15:05:59 ERROR: #!#! at com.mojang.authlib.GameProfile.(GameProfile.java:31) 15:05:59 ERROR: #!#! at org.bukkit.craftbukkit.inventory.CraftMetaSkull.setOwningPlayer(CraftMetaSkull.java:212) 15:05:59 ERROR: #!#! at Skript-2.9.2 (2).jar//ch.njol.skript.expressions.ExprSkull.convert(ExprSkull.java:69) 15:05:59 ERROR: #!#! at Skript-2.9.2 (2).jar//ch.njol.skript.expressions.ExprSkull.convert(ExprSkull.java:41) 15:05:59 ERROR: #!#! at Skript-2.9.2 (2).jar//org.skriptlang.skript.lang.converter.Converters.convert(Converters.java:501) 15:05:59 ERROR: #!#! at Skript-2.9.2 (2).jar//org.skriptlang.skript.lang.converter.Converters.convertUnsafe(Converters.java:565) 15:05:59 ERROR: #!#! at Skript-2.9.2 (2).jar//ch.njol.skript.registrations.Converters.convertUnsafe(Converters.java:203) 15:05:59 ERROR: #!#! at Skript-2.9.2 (2).jar//ch.njol.skript.expressions.base.PropertyExpression.get(PropertyExpression.java:119) 15:05:59 ERROR: #!#! at Skript-2.9.2 (2).jar//ch.njol.skript.expressions.base.SimplePropertyExpression.get(SimplePropertyExpression.java:56) 15:05:59 ERROR: #!#! at Skript-2.9.2 (2).jar//ch.njol.skript.expressions.base.PropertyExpression.get(PropertyExpression.java:88) 15:05:59 ERROR: #!#! at Skript-2.9.2 (2).jar//ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:97) 15:05:59 ERROR: #!#! at Skript-2.9.2 (2).jar//ch.njol.skript.expressions.base.PropertyExpression.get(PropertyExpression.java:88) 15:05:59 ERROR: #!#! at Skript-2.9.2 (2).jar//ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:97) 15:05:59 ERROR: #!#! at Skript-2.9.2 (2).jar//ch.njol.skript.effects.EffChange.execute(EffChange.java:284) 15:05:59 ERROR: #!#! at Skript-2.9.2 (2).jar//ch.njol.skript.lang.Effect.run(Effect.java:49) 15:05:59 ERROR: #!#! at Skript-2.9.2 (2).jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61) 15:05:59 ERROR: #!#! at Skript-2.9.2 (2).jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:88) 15:05:59 ERROR: #!#! at Skript-2.9.2 (2).jar//ch.njol.skript.lang.Trigger.execute(Trigger.java:52) 15:05:59 ERROR: #!#! at Skript-2.9.2 (2).jar//ch.njol.skript.SkriptEventHandler.lambda$execute$2(SkriptEventHandler.java:183) 15:05:59 ERROR: #!#! at Skript-2.9.2 (2).jar//ch.njol.skript.SkriptEventHandler.lambda$execute$3(SkriptEventHandler.java:194) 15:05:59 ERROR: #!#! at Skript-2.9.2 (2).jar//ch.njol.skript.util.Task.callSync(Task.java:164) 15:05:59 ERROR: #!#! at Skript-2.9.2 (2).jar//ch.njol.skript.util.Task.callSync(Task.java:148) 15:05:59 ERROR: #!#! at Skript-2.9.2 (2).jar//ch.njol.skript.SkriptEventHandler.execute(SkriptEventHandler.java:192) 15:05:59 ERROR: #!#! at Skript-2.9.2 (2).jar//ch.njol.skript.SkriptEventHandler.check(SkriptEventHandler.java:138) 15:05:59 ERROR: #!#! at Skript-2.9.2 (2).jar//ch.njol.skript.SkriptEventHandler$PriorityListener.lambda$new$0(SkriptEventHandler.java:64) 15:05:59 ERROR: #!#! at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) 15:05:59 ERROR: #!#! at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) 15:05:59 ERROR: #!#! at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) 15:05:59 ERROR: #!#! at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131) 15:05:59 ERROR: #!#! at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) 15:05:59 ERROR: #!#! at net.minecraft.server.network.ServerGamePacketListenerImpl.handleContainerClick(ServerGamePacketListenerImpl.java:3122) 15:05:59 ERROR: #!#! at net.minecraft.network.protocol.game.ServerboundContainerClickPacket.handle(ServerboundContainerClickPacket.java:69) 15:05:59 ERROR: #!#! at net.minecraft.network.protocol.game.ServerboundContainerClickPacket.handle(ServerboundContainerClickPacket.java:33) 15:05:59 ERROR: #!#! at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:56) 15:05:59 ERROR: #!#! at net.minecraft.server.TickTask.run(TickTask.java:18) 15:05:59 ERROR: #!#! at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:151) 15:05:59 ERROR: #!#! at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) 15:05:59 ERROR: #!#! at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1537) 15:05:59 ERROR: #!#! at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:201) 15:05:59 ERROR: #!#! at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:125) 15:05:59 ERROR: #!#! at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1514) 15:05:59 ERROR: #!#! at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1507) 15:05:59 ERROR: #!#! at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:135) 15:05:59 ERROR: #!#! at net.minecraft.server.MinecraftServer.managedBlock(MinecraftServer.java:1466) 15:05:59 ERROR: #!#! at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1473) 15:05:59 ERROR: #!#! at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1318) 15:05:59 ERROR: #!#! at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:330) 15:05:59 ERROR: #!#! at java.base/java.lang.Thread.run(Thread.java:1583)

15:05:59 ERROR: #!#! Version Information: 15:05:59 ERROR: #!#! Skript: 2.9.2 (latest) 15:05:59 ERROR: #!#! Flavor: skriptlang-github 15:05:59 ERROR: #!#! Date: 14:35:57.106583600 15:05:59 ERROR: #!#! Bukkit: 1.21-R0.1-SNAPSHOT 15:05:59 ERROR: #!#! Minecraft: 1.21 15:05:59 ERROR: #!#! Java: 21.0.3 (OpenJDK 64-Bit Server VM 21.0.3+9-LTS) 15:05:59 ERROR: #!#! OS: Linux amd64 6.8.0-39-generic

15:05:59 ERROR: #!#! Server platform: Paper

15:05:59 ERROR: #!#! Current node: null 15:05:59 ERROR: #!#! Current item: set slots {_I} (as java.lang.Number) of {_GUI} (as org.bukkit.inventory.Inventory) to skull of (loop-value >> ch.njol.skript.expressions.ExprLoopValue$1@5362fa8e: ConverterInfo{from=class java.lang.Object,to=interface org.bukkit.OfflinePlayer,converter=ch.njol.skript.expressions.ExprLoopValue$1@5362fa8e,flags=0}) named "§r%loop-value%" 15:05:59 ERROR: #!#! Current trigger: inventory click (dispense/spawn/drop/craft/pickup/consume/break/despawn/merge/move/stonecutting) (tardis.sk, line 389)

15:05:59 ERROR: #!#! Thread: Server thread

15:05:59 ERROR: #!#! Language: english 15:05:59 ERROR: #!#! Link parse mode: DISABLED

15:05:59 ERROR: #!#! End of Error.

Other

No response

Agreement

hiimnobody496 commented 1 month ago

PS the skript has requirements of specific worlds etc so i can't really give it out like that

Pesekjak commented 1 month ago

It seems like there's an oversight in the Bukkit API. An OfflinePlayer can have no username, which causes OfflinePlayer#getName to return null. However, SkullMeta#setOwningPlayer(OfflinePlayer) does not check if the username is present and still creates a new GameProfile, even when it's missing, resulting in NPE.

hiimnobody496 commented 1 month ago

I've just fixed it by not using the player heads