Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dungeon Editing breaks for players with max health other than 20 #137

Closed
UberPilot opened this issue Aug 18, 2016 · 6 comments
Closed

Dungeon Editing breaks for players with max health other than 20 #137

UberPilot opened this issue Aug 18, 2016 · 6 comments
Assignees
Labels
Milestone

Comments

@UberPilot
Copy link

I use RPGme on my server, which means that players have a variety of different max health values. If anyone has anything other than 20 max health/10 max hearts, the server outputs this to console repeatedly:

[17:47:30] [Server thread/WARN]: [DungeonsXL] Task #1576 for DungeonsXL v0.14.4 generated an exception
java.lang.IllegalArgumentException: Health must be between 0 and 16.0
    at org.bukkit.craftbukkit.v1_9_R1.entity.CraftLivingEntity.setHealth(CraftLivingEntity.java:95) ~[server.jar:git-Spigot-e000104-4cb3258]
    at io.github.dre2n.dungeonsxl.player.DInstancePlayer.clearPlayerData(DInstancePlayer.java:111) ~[?:?]
    at io.github.dre2n.dungeonsxl.player.DEditPlayer.<init>(DEditPlayer.java:48) ~[?:?]
    at io.github.dre2n.dungeonsxl.task.CreateDInstancePlayerTask.run(CreateDInstancePlayerTask.java:71) ~[?:?]
    at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftTask.run(CraftTask.java:71) ~[server.jar:git-Spigot-e000104-4cb3258]
    at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350) [server.jar:git-Spigot-e000104-4cb3258]
    at net.minecraft.server.v1_9_R1.MinecraftServer.D(MinecraftServer.java:729) [server.jar:git-Spigot-e000104-4cb3258]
    at net.minecraft.server.v1_9_R1.DedicatedServer.D(DedicatedServer.java:400) [server.jar:git-Spigot-e000104-4cb3258]
    at net.minecraft.server.v1_9_R1.MinecraftServer.C(MinecraftServer.java:660) [server.jar:git-Spigot-e000104-4cb3258]
    at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java:559) [server.jar:git-Spigot-e000104-4cb3258]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_102]

This error is for me, where I have the default 8 hearts that RPGme gives. It was fixed by giving myself 2 additional health, but I can't set/reset players easily for when the decide to go into a dungeon.

@Sataniel98 Sataniel98 added the BUG label Aug 19, 2016
@Sataniel98 Sataniel98 added this to the Beta 0.15 milestone Aug 19, 2016
@Sataniel98 Sataniel98 self-assigned this Aug 19, 2016
@Sataniel98
Copy link
Member

Thank you very much for the report. I am currently not able to test it, but I'm pretty sure about the reason for the error and attempted to fix it. Would you mind trying it yourself?

Compiled jar:

http://feuerstern.bplaced.net/repo/io/github/dre2n/dungeonsxl/archives/dungeonsxl-0.15-SNAPSHOT-10.jar

Note: This is a build of the 0.15 branch, it might cause inconsistencies and errors with an unmodified 0.14.x or lower setup, so you might need to let it regenerate the main config and the language file.

@snapopotamos
Copy link

I'm on an RPG server and have over 20 health (10 hearts,) and I haven't had a problem, so this bug is either just on that server or only when a player has under 20 health.

@Sataniel98
Copy link
Member

@snapopotamos Interesting. This explains why I thought it was fixed.

@snapopotamos
Copy link

I think the plugin sets the players health to 20 whenever they enter/exit, so if you have a higher max health you start not fully healed, but if you have a lower max health it can't set it to ten, which causes the error.

@Sataniel98
Copy link
Member

In the fixed build I posted above, the health scale is also saved and replaced with the default 20.0 scale, so it should work now.

@UberPilot
Copy link
Author

It's fixed. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants