PlaceholderAPI / WorldGuard-Expansion

Placeholder expansion for WorldGuard
GNU General Public License v3.0
1 stars 11 forks source link

An error occurs when entering a Poly2d region #16

Closed book000 closed 4 years ago

book000 commented 4 years ago

Issue

What is the issue? Describe it like you would tell a friend.

Hello. Using % worldguard_region_name_capitalized% and getting an error when entering a Poly2d region.
The environment is as follows:

Expected behaviour

What should PlaceholderAPI do?

When using % worldguard_region_name_capitalized%, the region name should be displayed correctly even within the Poly2d region.

Actual behaviour

What does PlaceholderAPI actually do?

No such line is output, and instead the following error is displayed on the console:

[Server thread/WARN]: [ScoreboardPlus] Task #44 for ScoreboardPlus v10 generated an exception
java.lang.ClassCastException: org.codemc.worldguardwrapper.implementation.v6.region.WrappedRegion$1 cannot be cast to org.codemc.worldguardwrapper.selection.ICuboidSelection
    at com.extendedclip.papi.expansion.worldguard.WorldGuardExpansion.onRequest(WorldGuardExpansion.java:135) ~[?:?]
    at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:234) ~[?:?]
    at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:374) ~[?:?]
    at me.kaaseigenaar.scoreboard.ScoreboardBuilder.buildScoreboard(ScoreboardBuilder.java:107) ~[?:?]
    at me.kaaseigenaar.scoreboard.events.worlds.run(worlds.java:60) ~[?:?]
    at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftTask.run(CraftTask.java:76) ~[spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
    at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:361) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
    at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:739) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
    at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
    at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
    at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577) [spigot-1.12.2.jar:git-Spigot-79a30d7-acbc348]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]

How to reproduce

What steps did you made, to get this bug?

  1. Use ScoreboardPlus to change the settings to display the result of % worldguard_region_name_capitalized% on the scoreboard.
  2. Create a Poly2d region using WorldGuard and WorldEdit.
  3. Enter the region created by the player.
  4. The above error occurs.

I think that this error occurs because casts to ICuboidSelection without checking the region type in WorldGuardExpansion.java line 135.

I am sorry that my English is so bad. Thank you for developing this plugin.

aBooDyy commented 4 years ago

Can you please try the expansion from this pull request #14? That issue should be fixed in this pull request

How to try it:

book000 commented 4 years ago

@aBooDyy Thank you for your comment. This expansion worked fine.

I solved it but it was not reflected in the project. I don't know much about Issue system on GitHub, do I need to close an issue right now?