Maxqia / PoreRT

[Abandoned] Run Bukkit plugins on Sponge natively! (Batteries now included)
Other
32 stars 23 forks source link

Scoreboard #17

Closed Firemonkey08 closed 7 years ago

Firemonkey08 commented 7 years ago

I tried to load my 1.11 Bukkit plugins. If I want to register a new Scoreboardobjective, the error comes: Dispalyname cannot be null. But how to set the displayname, if I can´t register the objective?

Bukkit code: Scoreboard board = manager.getNewScoreboard(); board.registerNewObjective("kills", "dummy"); //error message

Error:

[11:17:24] [Server thread/ERROR] [pore/]: Could not pass event Secondary to pvp v0.1 org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[JavaPluginLoader$1.class:1.0.0-SNAPSHOT] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[RegisteredListener.class:1.0.0-SNAPSHOT] at blue.lapis.pore.event.SpongeEventHandler.call(SpongeEventHandler.java:110) [SpongeEventHandler.class:1.0.0-SNAPSHOT] at blue.lapis.pore.event.SpongeEventHandler.handle(SpongeEventHandler.java:98) [SpongeEventHandler.class:1.0.0-SNAPSHOT] at org.spongepowered.common.event.RegisteredListener.handle(RegisteredListener.java:95) [RegisteredListener.class:1.11-2195-6.0.0-BETA-2004] at org.spongepowered.mod.event.SpongeModEventManager.post(SpongeModEventManager.java:301) [SpongeModEventManager.class:1.11-2195-6.0.0-BETA-2004] at org.spongepowered.mod.event.SpongeModEventManager.post(SpongeModEventManager.java:285) [SpongeModEventManager.class:1.11-2195-6.0.0-BETA-2004] at org.spongepowered.mod.event.SpongeModEventManager.post(SpongeModEventManager.java:326) [SpongeModEventManager.class:1.11-2195-6.0.0-BETA-2004] at org.spongepowered.mod.event.SpongeModEventManager.post(SpongeModEventManager.java:314) [SpongeModEventManager.class:1.11-2195-6.0.0-BETA-2004] at org.spongepowered.common.SpongeImpl.postEvent(SpongeImpl.java:144) [SpongeImpl.class:1.11-2195-6.0.0-BETA-2004] at org.spongepowered.common.event.SpongeCommonEventFactory.callInteractBlockEventSecondary(SpongeCommonEventFactory.java:408) [SpongeCommonEventFactory.class:1.11-2195-6.0.0-BETA-2004] at org.spongepowered.common.event.SpongeCommonEventFactory.callInteractBlockEventSecondary(SpongeCommonEventFactory.java:398) [SpongeCommonEventFactory.class:1.11-2195-6.0.0-BETA-2004] at net.minecraft.server.management.PlayerInteractionManager.func_187251_a(PlayerInteractionManager.java:123) [lz.class:?] at net.minecraft.network.NetHandlerPlayServer.redirect$onProcessRightClickBlock$zgo000(NetHandlerPlayServer.java:519) [mi.class:?] at net.minecraft.network.NetHandlerPlayServer.func_184337_a(NetHandlerPlayServer.java:674) [mi.class:?] at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.func_148833_a(SourceFile:55) [jm.class:?] at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.func_148833_a(SourceFile:11) [jm.class:?] at org.spongepowered.common.network.PacketUtil.onProcessPacket(PacketUtil.java:136) [PacketUtil.class:1.11-2195-6.0.0-BETA-2004] at net.minecraft.network.PacketThreadUtil$1.redirect$onProcessPacket$zjb000(SourceFile:39) [fo$1.class:?] at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13) [fo$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_111] at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_111] at net.minecraft.util.Util.func_181617_a(SourceFile:46) [h.class:?] at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:679) [MinecraftServer.class:?] at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:384) [lh.class:?] at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:624) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_111] Caused by: java.lang.IllegalStateException: DisplayName cannot be null at com.google.common.base.Preconditions.checkState(Preconditions.java:176) ~[minecraft_server.1.11.jar:?] at org.spongepowered.common.scoreboard.builder.SpongeObjectiveBuilder.build(SpongeObjectiveBuilder.java:97) ~[SpongeObjectiveBuilder.class:1.11-2195-6.0.0-BETA-2004] at blue.lapis.pore.impl.scoreboard.PoreScoreboard.registerNewObjective(PoreScoreboard.java:77) ~[PoreScoreboard.class:1.0.0-SNAPSHOT] at me.luc.pvp.Methoden.pvpVorbereiten(Methoden.java:84) ~[?:?] at me.luc.pvp.ClickSign.onPlayerInteract(ClickSign.java:66) ~[?:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_111] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_111] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[JavaPluginLoader$1.class:1.0.0-SNAPSHOT]

Greetings Firemonkey

Maxqia commented 7 years ago

Do you have a plugin that I can use to test this? (I think it's a Sponge Issue, btw)

Firemonkey08 commented 7 years ago

I´ve never used Github to share my Plugins. Dont know how to do that. Can I send my Plugin to you or can I upload it on a file-uploader?

Firemonkey08 commented 7 years ago

I did upload my Plugin here: https://github.com/Firemonkey08/PvP - it´s build with eclipse. The finished jar is here: http://en.file-upload.net/download-12227612/pvp.jar.html

To get the error: Place a sign with first line: "PvP" and second line: "Vorbereitungen". Then right click. You can use the command "/pvp" also. Thanks for your help.

Maxqia commented 7 years ago

Should be now fixed with 969fdf5ea84e076c83e85fd1227ea90f159464ec, couldn't test it with your plugin because it requests a custom world "arenabau" and throws a NullPointerException.

Firemonkey08 commented 7 years ago

Thanks, this works now. Good job :) Sorry, for the mistake with the world, I have fixed it now.

I get the next error when I try to register the Teams of this Scoreboard. I set the displayname to "Rot" and get the error: "Display name must not be longer than 32 characters". But this name isn´t so long...

Bukkit Code: Team rot = board.getTeam("rot"); if (rot == null) { rot = board.registerNewTeam("rot"); rot.setDisplayName("Rot"); rot.setAllowFriendlyFire(false); rot.setPrefix(ChatColor.RED.toString()); }

Error: [21:15:28] [Server thread/ERROR] [pore/]: Could not pass event Secondary to pvp v0.1 org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[JavaPluginLoader$1.class:1.0.0-SNAPSHOT] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[RegisteredListener.class:1.0.0-SNAPSHOT] at blue.lapis.pore.event.SpongeEventHandler.call(SpongeEventHandler.java:110) [SpongeEventHandler.class:1.0.0-SNAPSHOT] at blue.lapis.pore.event.SpongeEventHandler.handle(SpongeEventHandler.java:98) [SpongeEventHandler.class:1.0.0-SNAPSHOT] at org.spongepowered.common.event.RegisteredListener.handle(RegisteredListener.java:95) [RegisteredListener.class:1.11-2195-6.0.0-BETA-2004] at org.spongepowered.mod.event.SpongeModEventManager.post(SpongeModEventManager.java:301) [SpongeModEventManager.class:1.11-2195-6.0.0-BETA-2004] at org.spongepowered.mod.event.SpongeModEventManager.post(SpongeModEventManager.java:285) [SpongeModEventManager.class:1.11-2195-6.0.0-BETA-2004] at org.spongepowered.mod.event.SpongeModEventManager.post(SpongeModEventManager.java:326) [SpongeModEventManager.class:1.11-2195-6.0.0-BETA-2004] at org.spongepowered.mod.event.SpongeModEventManager.post(SpongeModEventManager.java:314) [SpongeModEventManager.class:1.11-2195-6.0.0-BETA-2004] at org.spongepowered.common.SpongeImpl.postEvent(SpongeImpl.java:144) [SpongeImpl.class:1.11-2195-6.0.0-BETA-2004] at org.spongepowered.common.event.SpongeCommonEventFactory.callInteractBlockEventSecondary(SpongeCommonEventFactory.java:408) [SpongeCommonEventFactory.class:1.11-2195-6.0.0-BETA-2004] at org.spongepowered.common.event.SpongeCommonEventFactory.callInteractBlockEventSecondary(SpongeCommonEventFactory.java:398) [SpongeCommonEventFactory.class:1.11-2195-6.0.0-BETA-2004] at net.minecraft.server.management.PlayerInteractionManager.func_187251_a(PlayerInteractionManager.java:123) [lz.class:?] at net.minecraft.network.NetHandlerPlayServer.redirect$onProcessRightClickBlock$zgo000(NetHandlerPlayServer.java:519) [mi.class:?] at net.minecraft.network.NetHandlerPlayServer.func_184337_a(NetHandlerPlayServer.java:674) [mi.class:?] at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.func_148833_a(SourceFile:55) [jm.class:?] at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.func_148833_a(SourceFile:11) [jm.class:?] at org.spongepowered.common.network.PacketUtil.onProcessPacket(PacketUtil.java:136) [PacketUtil.class:1.11-2195-6.0.0-BETA-2004] at net.minecraft.network.PacketThreadUtil$1.redirect$onProcessPacket$zjb000(SourceFile:39) [fo$1.class:?] at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13) [fo$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_111] at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_111] at net.minecraft.util.Util.func_181617_a(SourceFile:46) [h.class:?] at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:679) [MinecraftServer.class:?] at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:384) [lh.class:?] at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:624) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_111] Caused by: java.lang.IllegalArgumentException: Display name must not be longer than 32 characters at com.google.common.base.Preconditions.checkArgument(Preconditions.java:125) ~[minecraft_server.1.11.jar:?] at blue.lapis.pore.impl.scoreboard.PoreTeam.setDisplayName(PoreTeam.java:78) ~[PoreTeam.class:1.0.0-SNAPSHOT] at me.luc.pvp.Methoden.TeamzuweisungRot(Methoden.java:165) ~[?:?] at me.luc.pvp.ClickSign.onPlayerInteract(ClickSign.java:70) ~[?:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_111] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_111] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[JavaPluginLoader$1.class:1.0.0-SNAPSHOT]

Maxqia commented 7 years ago

Should be fixed by 4353b81941bc805200d0855377386c55ed9a5f48 (haven't tested)

Firemonkey08 commented 7 years ago

Thanks, I will try it, when you upload the new build.

Firemonkey08 commented 7 years ago

Works 👍