Improved Location Selection
Dieser Commit ist enthalten in:
Ursprung
88a495f4ae
Commit
bb814a2103
@ -9,6 +9,9 @@ import org.bukkit.event.block.Action;
|
|||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
|
||||||
class AutoLoader_15 {
|
class AutoLoader_15 {
|
||||||
|
|
||||||
|
private static int[][] offsets = new int[][]{{1, 0, 0}, {-2, 0, 0}, {1, 1, 0}, {0, -2, 0}, {0, 1, 1}, {0, 0, -2}, {0, 0, 1}};
|
||||||
|
|
||||||
private AutoLoader_15() {
|
private AutoLoader_15() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,19 +38,12 @@ class AutoLoader_15 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void updateBlock(Location location) {
|
static void updateBlock(Location location) {
|
||||||
Location[] locations = new Location[] {
|
for (int[] offset : offsets) {
|
||||||
location.clone().add(1, 0,0),
|
location.add(offset[0], offset[1], offset[2]);
|
||||||
location.clone().add(-1, 0,0),
|
if (!location.getBlock().getType().isOccluding()) continue;
|
||||||
location.clone().add(0, 1,0),
|
BlockData data = location.getBlock().getBlockData();
|
||||||
location.clone().add(0, -1,0),
|
location.getBlock().setType(Material.BARRIER, true);
|
||||||
location.clone().add(0, 0,1),
|
location.getBlock().setBlockData(data, true);
|
||||||
location.clone().add(0, 0,-1)
|
|
||||||
};
|
|
||||||
for (Location value : locations) {
|
|
||||||
if (!value.getBlock().getType().isOccluding()) continue;
|
|
||||||
BlockData data = value.getBlock().getBlockData();
|
|
||||||
value.getBlock().setType(Material.BARRIER, true);
|
|
||||||
value.getBlock().setBlockData(data, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren