mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-25 12:05:16 +01:00
Signs should work now in older versions
This commit is contained in:
parent
95dda60088
commit
0620cc6965
@ -275,10 +275,8 @@ public class SignUtil {
|
||||
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
Block b = loc.getBlock();
|
||||
final Material type = b.getType();
|
||||
final BlockData data = b.getBlockData();
|
||||
|
||||
b.setType(Material.AIR);
|
||||
|
||||
@ -288,10 +286,22 @@ public class SignUtil {
|
||||
Block b = loc.getBlock();
|
||||
|
||||
b.setType(type);
|
||||
b.setBlockData(data);
|
||||
if (Version.isCurrentEqualOrLower(Version.v1_13_R2)) {
|
||||
byte data = b.getData();
|
||||
try {
|
||||
Block.class.getMethod("setData", byte.class).invoke(b, data);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
BlockData data = b.getBlockData();
|
||||
b.setBlockData(data);
|
||||
}
|
||||
|
||||
Skull skull = (Skull) b.getState();
|
||||
if (skull == null)
|
||||
return;
|
||||
|
||||
skull.setOwner(Playername);
|
||||
skull.update();
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user