public void loadSign(int a) { try { Walls.debug("walls-system.lobby.signs." + a + ".world"); World w = Bukkit.getWorld(s.getString("walls-system.lobby.signs." + a + ".world")); int x1 = s.getInt("walls-system.lobby.signs." + a + ".x1"); int y1 = s.getInt("walls-system.lobby.signs." + a + ".y1"); int z1 = s.getInt("walls-system.lobby.signs." + a + ".z1"); int x2 = s.getInt("walls-system.lobby.signs." + a + ".x2"); // int y2 = s.getInt("walls-system.lobby.signs." + a + ".y2"); int z2 = s.getInt("walls-system.lobby.signs." + a + ".z2"); int gameid = s.getInt("walls-system.lobby.signs." + a + ".id"); LobbyWall ls = new LobbyWall(gameid); if (ls.loadSign(w, x1, x2, z1, z2, y1)) { ArrayList<LobbyWall> t = signs.get(gameid); if (t == null) { t = new ArrayList<LobbyWall>(); signs.put(gameid, t); } t.add(ls); ls.update(); // TODO } else { /*s.set("walls-system.lobby.signs." + a, null); SettingsManager.getInstance().saveSystemConfig();*/ } } catch (Exception e) { s.set("walls-system.lobby.signs." + a, null); s.set("walls-system.lobby.signno", s.getInt("walls-system.lobby.signno") - 1); } }
// https://blog.udemy.com/dql-queries/ private void displayWalls(Graphics g) { // Method for displaying the wall objects. g.setColor(Color.BLACK); // If it looks familiar it's because it's code was heavily // influenced from the displayKibble method that Clara wrote. int x = wall1.getWallX() * SnakeGame.squareSize; int y = wall1.getWallY() * SnakeGame.squareSize; int x2 = wall2.getWallX() * SnakeGame.squareSize; int y2 = wall2.getWallY() * SnakeGame.squareSize; int x3 = wall3.getWallX() * SnakeGame.squareSize; int y3 = wall3.getWallY() * SnakeGame.squareSize; int x4 = wall4.getWallX() * SnakeGame.squareSize; int y4 = wall4.getWallY() * SnakeGame.squareSize; int x5 = wall5.getWallX() * SnakeGame.squareSize; int y5 = wall5.getWallY() * SnakeGame.squareSize; g.fillRect(x, y, SnakeGame.squareSize, SnakeGame.squareSize); g.fillRect(x2, y2, SnakeGame.squareSize, SnakeGame.squareSize); g.fillRect(x3, y3, SnakeGame.squareSize, SnakeGame.squareSize); g.fillRect(x4, y4, SnakeGame.squareSize, SnakeGame.squareSize); g.fillRect(x5, y5, SnakeGame.squareSize, SnakeGame.squareSize); }