Merge pull request #2584 from tiagoad/v3.0

Fix for disappearing sign-markers on 1.14 (Issue #2533)
This commit is contained in:
mikeprimm 2019-12-15 00:44:27 -06:00 committed by GitHub
commit 33b4fb7042
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 127 additions and 9 deletions

View file

@ -28,6 +28,7 @@ import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState;
import org.bukkit.block.Sign;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@ -212,6 +213,22 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
}
return -1;
}
@Override
public int isSignAt(String wname, int x, int y, int z) {
World w = getServer().getWorld(wname);
if((w != null) && w.isChunkLoaded(x >> 4, z >> 4)) {
Block b = w.getBlockAt(x, y, z);
BlockState s = b.getState();
if (s instanceof Sign) {
return 1;
} else {
return 0;
}
}
return -1;
}
@Override
public void scheduleServerTask(Runnable run, long delay) {