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;
|
||||
|
||||
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() {
|
||||
}
|
||||
|
||||
@ -35,19 +38,12 @@ class AutoLoader_15 {
|
||||
}
|
||||
|
||||
static void updateBlock(Location location) {
|
||||
Location[] locations = new Location[] {
|
||||
location.clone().add(1, 0,0),
|
||||
location.clone().add(-1, 0,0),
|
||||
location.clone().add(0, 1,0),
|
||||
location.clone().add(0, -1,0),
|
||||
location.clone().add(0, 0,1),
|
||||
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);
|
||||
for (int[] offset : offsets) {
|
||||
location.add(offset[0], offset[1], offset[2]);
|
||||
if (!location.getBlock().getType().isOccluding()) continue;
|
||||
BlockData data = location.getBlock().getBlockData();
|
||||
location.getBlock().setType(Material.BARRIER, true);
|
||||
location.getBlock().setBlockData(data, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren