Skip to content

Commit

Permalink
reduce to one call
Browse files Browse the repository at this point in the history
  • Loading branch information
EpicPlayerA10 committed Jun 1, 2024
1 parent 4f9f7cb commit 68cb6ac
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.mojang.authlib.properties.Property;
import org.bukkit.Bukkit;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.block.Skull;

import javax.annotation.ParametersAreNonnullByDefault;
Expand All @@ -15,9 +16,10 @@ public class PlayerHeadAdapterPaper implements PlayerHeadAdapter {
@Override
@ParametersAreNonnullByDefault
public void setGameProfile(Block block, GameProfile profile, boolean sendBlockUpdate) {
if (!(block.getState() instanceof Skull)) return;
BlockState state = block.getState();
if (!(state instanceof Skull)) return;

Skull skull = (Skull) block.getState();
Skull skull = (Skull) state;

Property property = profile.getProperties().get("textures").iterator().next();

Expand Down

0 comments on commit 68cb6ac

Please sign in to comment.