1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 05:55:27 +01:00

Fix for issue with heads updates

This commit is contained in:
Zrips 2019-08-16 14:21:27 +03:00
parent e7b5d6ceee
commit b1d457d2d6

View File

@ -23,6 +23,7 @@ import com.gamingmesh.jobs.CMILib.VersionChecker.Version;
import com.gamingmesh.jobs.config.CommentedYamlConfiguration;
import com.gamingmesh.jobs.container.Job;
import com.gamingmesh.jobs.container.TopList;
import com.gamingmesh.jobs.stuff.Debug;
public class SignUtil {
@ -376,6 +377,7 @@ public class SignUtil {
if (skull == null)
return false;
if (skull.getOwner() != null && skull.getOwner().equalsIgnoreCase(Playername))
return false;
@ -383,27 +385,8 @@ public class SignUtil {
@Override
public void run() {
Block b = loc.getBlock();
final Material type = b.getType();
b.setType(Material.AIR);
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
Block b = loc.getBlock();
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);
}
if (!(b.getState() instanceof Skull))
return;
Skull skull = (Skull) b.getState();
if (skull == null)
@ -413,9 +396,6 @@ public class SignUtil {
skull.update();
return;
}
}, 1L);
return;
}
}, timelapse * Jobs.getGCManager().InfoUpdateInterval * 20L);
} catch (Throwable e) {
e.printStackTrace();