Add more show methods to ArenaRegion.
This commit is contained in:
@@ -586,27 +586,34 @@ public class ArenaRegion
|
|||||||
arena.getPlugin().saveConfig();
|
arena.getPlugin().saveConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showRegion(final Player p) {
|
public void showRegion(Player p) {
|
||||||
if (!isDefined()) {
|
if (!isDefined()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
showBlocks(p, getFramePoints(p1, p2));
|
showBlocks(p, getFramePoints(p1, p2));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showLobbyRegion(final Player p) {
|
public void showLobbyRegion(Player p) {
|
||||||
if (!isLobbyDefined()) {
|
if (!isLobbyDefined()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
showBlocks(p, getFramePoints(l1, l2));
|
showBlocks(p, getFramePoints(l1, l2));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showSpawns(final Player p) {
|
public void showSpawns(Player p) {
|
||||||
if (spawnpoints.isEmpty()) {
|
if (spawnpoints.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
showBlocks(p, spawnpoints.values());
|
showBlocks(p, spawnpoints.values());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void showChests(Player p) {
|
||||||
|
if (containers.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
showBlocks(p, containers.values());
|
||||||
|
}
|
||||||
|
|
||||||
public void checkSpawns(Player p) {
|
public void checkSpawns(Player p) {
|
||||||
if (spawnpoints.isEmpty()) {
|
if (spawnpoints.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
@@ -637,6 +644,19 @@ public class ArenaRegion
|
|||||||
showBlocks(p, map.values());
|
showBlocks(p, map.values());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void showBlock(final Player p, final Location loc, int id, byte data) {
|
||||||
|
p.sendBlockChange(loc, id, data);
|
||||||
|
arena.scheduleTask(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (!p.isOnline()) return;
|
||||||
|
|
||||||
|
Block b = loc.getBlock();
|
||||||
|
p.sendBlockChange(loc, b.getTypeId(), b.getData());
|
||||||
|
}
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
|
||||||
private void showBlocks(final Player p, Collection<Location> points) {
|
private void showBlocks(final Player p, Collection<Location> points) {
|
||||||
// Grab all the blocks, and send block change events.
|
// Grab all the blocks, and send block change events.
|
||||||
final Map<Location,BlockState> blocks = new HashMap<Location,BlockState>();
|
final Map<Location,BlockState> blocks = new HashMap<Location,BlockState>();
|
||||||
|
|||||||
Reference in New Issue
Block a user