title: Pieces not being removed when taken
body: <p>I am creating a Chess Game and I just finished the basic Ai, but whenever a piece is taken it disappears and comes back a few turns later. The piece shouldn't even be in the list that renders the pieces. 
  This is the class that render/adds/sets the new pieces</p>
  
  <p><code>setPieceLoc()</code> sets the old piece at its new location and removes both the <code>original</code> and the <code>newLoc</code> from all lists.
  Does anyone see why this is happening? There is no other class that adds new information to the lists, so as far as I can tell it must be an error here.</p>
  
  <pre><code>package me.xthegamerplayz.FirstGame.board;
  
  import java.awt.Color;
  import java.awt.Graphics;
  import java.awt.Point;
  
  import me.xthegamerplayz.FirstGame.board.tiles.ChessImages;
  import me.xthegamerplayz.FirstGame.rules.LegalMoves;
  
  public class Board {
  
      public static void addPiece(int x, int y, int piece) {
  
          Point point = new Point();
          point.setLocation(x, y);
  
          if(piece &gt; 16)
              ChessBoard.black.put(point, piece);
          else
              ChessBoard.white.put(point, piece);
      }
  
      public static void setPieceLoc(Point original, Point newLoc) {
          int piece = 8;
          if(ChessBoard.white.containsKey(original))
              piece = ChessBoard.white.get(original);
          else if(ChessBoard.black.containsKey(original))
              piece = ChessBoard.black.get(original);
  
          //Remove piece at newLoc
          if(ChessBoard.white.containsKey(newLoc))
              ChessBoard.white.remove(newLoc);
          else if(ChessBoard.black.containsKey(newLoc))
              ChessBoard.black.remove(newLoc);
  
          //Remove piece from previous location
          if(ChessBoard.white.containsKey(original))
              ChessBoard.white.remove(original);
          else if(ChessBoard.black.containsKey(original))
              ChessBoard.black.remove(original);
  
          if(piece &gt; 16)
              ChessBoard.black.put(newLoc, piece);
          else
              ChessBoard.white.put(newLoc, piece);
      }
  
      public void registerPieces() {
          //Pawns
          for(int x = 0; x &lt; 8; x++) {
              addPiece(x, 1, 8);
              addPiece(x, 6, 24);
          }
          //White
          addPiece(0, 0, 9);
          addPiece(1, 0, 10);
          addPiece(2, 0, 11);
          addPiece(5, 0, 11);
          addPiece(6, 0, 10);
          addPiece(7, 0, 9);
  
          addPiece(4, 0, 12);
          addPiece(3, 0, 13);
  
          //Black
          addPiece(0, 7, 25);
          addPiece(1, 7, 26);
          addPiece(2, 7, 27);
          addPiece(5, 7, 27);
          addPiece(6, 7, 26);
          addPiece(7, 7, 25);
  
          addPiece(3, 7, 28);
          addPiece(4, 7, 29);
  
      }
  
      public void render(Graphics g) {
  
          for(Point point : ChessBoard.white.keySet()) {
  
              int piece = ChessBoard.white.get(new Point(point));
              int x = (int) (point.getX()*64) + 20;
              int y = (int) (point.getY()*64) + 20;
  
              boolean showTiles = false;
              if(showTiles) {
                  if(piece == 24) {
                      LegalMoves lm = new LegalMoves(point);
  
                      for(Point p : lm.moves()) {
  
                          int bx = (int) (p.getX()*64) + 20;
                          int by = (int) (p.getY()*64) + 20;
                          g.setColor(Color.green);
                          g.fillRect(bx, by, 64, 64);
                      }
                  }
              }
  
              g.drawImage(ChessImages.getPieceImage(piece), x, y, null);
          }
  
          for(Point point : ChessBoard.black.keySet()) {
  
              int piece = ChessBoard.black.get(new Point(point));
              int x = (int) (point.getX()*64) + 20;
              int y = (int) (point.getY()*64) + 20;
  
              boolean showTiles = false;
              if(showTiles) {
                  if(piece == 24) {
                      LegalMoves lm = new LegalMoves(point);
  
                      for(Point p : lm.moves()) {
  
                          int bx = (int) (p.getX()*64) + 20;
                          int by = (int) (p.getY()*64) + 20;
                          g.setColor(Color.green);
                          g.fillRect(bx, by, 64, 64);
                      }
                  }
              }
  
              g.drawImage(ChessImages.getPieceImage(piece), x, y, null);
          }
  
      }
  
  }
  </code></pre>