1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-25 20:16:13 +01:00

Signs should work now in older versions

This commit is contained in:
montlikadani 2019-08-13 11:19:15 +02:00
parent 95dda60088
commit 0620cc6965

View File

@ -275,10 +275,8 @@ public class SignUtil {
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
@Override @Override
public void run() { public void run() {
Block b = loc.getBlock(); Block b = loc.getBlock();
final Material type = b.getType(); final Material type = b.getType();
final BlockData data = b.getBlockData();
b.setType(Material.AIR); b.setType(Material.AIR);
@ -288,10 +286,22 @@ public class SignUtil {
Block b = loc.getBlock(); Block b = loc.getBlock();
b.setType(type); b.setType(type);
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); b.setBlockData(data);
}
Skull skull = (Skull) b.getState(); Skull skull = (Skull) b.getState();
if (skull == null) if (skull == null)
return; return;
skull.setOwner(Playername); skull.setOwner(Playername);
skull.update(); skull.update();
return; return;