@Override public void onPlace(int x, int y, HUD hud) { if (hud.getAmountOfResources() < cost || (!(hud.getWorld().getTile(x, y) instanceof DirtTile) && !(hud.getWorld().getTile(x, y) instanceof GrassTile) && !(hud.getWorld().getTile(x, y) instanceof StoneTile))) return; if (!checkPlacement(x, y, hud.getWorld().getEntityManager())) return; hud.incResources(-cost); hud.addFoodTaker(); Assets.playSound("place"); hud.getWorld().setTile(x, y, new GeneratorTile()); }