Added code for making the heads that appear when the "heads" command is used have the skin of the UUID set in the configuration file.

This commit is contained in:
David Berdik 2019-08-03 22:55:07 -04:00
parent 978dd19fd4
commit 6591c03b10

View File

@ -3,10 +3,12 @@ package net.theprogrammersworld.herobrine.misc;
import java.util.Random;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.Skull;
import org.bukkit.block.data.Rotatable;
public class BlockChanger {
@ -92,6 +94,9 @@ public class BlockChanger {
Rotatable blockData = (Rotatable) b.getBlockData();
blockData.setRotation(bface);
b.setBlockData(blockData);
Skull skull = (Skull) b.getState();
skull.setOwningPlayer(Bukkit.getOfflinePlayer(uuid));
skull.update(true);
}
}