mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-26 04:25:15 +01:00
Fixing bp command issue with newer server versions
This commit is contained in:
parent
15ae2988e0
commit
751b57095f
@ -10,6 +10,7 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.CMILib.CMIMaterial;
|
||||
import com.gamingmesh.jobs.CMILib.Version;
|
||||
import com.gamingmesh.jobs.commands.Cmd;
|
||||
import com.gamingmesh.jobs.commands.JobCommand;
|
||||
import com.gamingmesh.jobs.container.BlockProtection;
|
||||
@ -67,12 +68,18 @@ public class bp implements Cmd {
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.bp.output.notFound"));
|
||||
else
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.bp.output.found", "%amount%", changedBlocks.size()));
|
||||
|
||||
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (Block one : changedBlocks) {
|
||||
player.sendBlockChange(one.getLocation(), one.getType(), one.getData());
|
||||
}
|
||||
if (Version.isCurrentEqualOrHigher(Version.v1_15_R1))
|
||||
for (Block one : changedBlocks) {
|
||||
player.sendBlockChange(one.getLocation(), one.getBlockData());
|
||||
}
|
||||
else
|
||||
for (Block one : changedBlocks) {
|
||||
player.sendBlockChange(one.getLocation(), one.getType(), one.getData());
|
||||
}
|
||||
}
|
||||
}, 120L);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user