Don't set a skull owner if empty

Closes #781

Another bug due to Mojang's new stupid username changing "feature".
Setting the owner requires a web lookup or cache hit for the name in
order to target the correct player. It apparently doesn't like looking
up a blank name.
This commit is contained in:
cmastudios 2014-06-12 21:09:58 -05:00
parent df1e5a56df
commit 9281ad5c4d
1 changed files with 3 additions and 1 deletions

View File

@ -184,7 +184,9 @@ public class ZoneVolumeMapper {
// Skulls
if (modify instanceof Skull) {
String[] opts = query.getString("metadata").split("\n");
((Skull) modify).setOwner(opts[0]);
if (!opts[0].isEmpty()) {
((Skull) modify).setOwner(opts[0]);
}
((Skull) modify).setSkullType(SkullType.valueOf(opts[1]));
((Skull) modify).setRotation(BlockFace.valueOf(opts[2]));
modify.update(true, false);