#1002: Add Player Profile API
Slight changes may occur as this API is stabilized. This PR is based on work previously done by DerFrZocker in #938. By: blablubbabc <lukas@wirsindwir.de>
This commit is contained in:
@@ -14,6 +14,8 @@ import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Directional;
|
||||
import org.bukkit.block.data.Rotatable;
|
||||
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.profile.CraftPlayerProfile;
|
||||
import org.bukkit.profile.PlayerProfile;
|
||||
|
||||
public class CraftSkull extends CraftBlockEntityState<TileEntitySkull> implements Skull {
|
||||
|
||||
@@ -100,6 +102,24 @@ public class CraftSkull extends CraftBlockEntityState<TileEntitySkull> implement
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayerProfile getOwnerProfile() {
|
||||
if (!hasOwner()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new CraftPlayerProfile(profile);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOwnerProfile(PlayerProfile profile) {
|
||||
if (profile == null) {
|
||||
this.profile = null;
|
||||
} else {
|
||||
this.profile = CraftPlayerProfile.validateSkullProfile(((CraftPlayerProfile) profile).buildGameProfile());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockFace getRotation() {
|
||||
BlockData blockData = getBlockData();
|
||||
|
||||
Reference in New Issue
Block a user